Fossil SCM
Get the smtp_mx_host() routine working on Windows in addition to Linux.
Commit
9a6c6c2cdacf4d8dc84377f62d0ccd884ae1341f5db65deb434f9d2340f16713
Parent
efbc319c32a38fa…
6 files changed
+7
-3
+40
-10
+1
-1
+1
-1
+4
-1
+1
-1
+7
-3
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -939,10 +939,14 @@ | ||
| 939 | 939 | LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32 |
| 940 | 940 | endif |
| 941 | 941 | else |
| 942 | 942 | LIB += -lkernel32 -lws2_32 |
| 943 | 943 | endif |
| 944 | + | |
| 945 | +#### Library required for DNS lookups. | |
| 946 | +# | |
| 947 | +LIB += ldnsapi | |
| 944 | 948 | |
| 945 | 949 | #### Tcl shell for use in running the fossil test suite. This is only |
| 946 | 950 | # used for testing. |
| 947 | 951 | # |
| 948 | 952 | TCLSH = tclsh |
| @@ -1313,11 +1317,11 @@ | ||
| 1313 | 1317 | SSL = |
| 1314 | 1318 | |
| 1315 | 1319 | CFLAGS = -o |
| 1316 | 1320 | BCC = $(DMDIR)\bin\dmc $(CFLAGS) |
| 1317 | 1321 | TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL) |
| 1318 | -LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 | |
| 1322 | +LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi | |
| 1319 | 1323 | } |
| 1320 | 1324 | writeln "SQLITE_OPTIONS = [join $SQLITE_OPTIONS { }]\n" |
| 1321 | 1325 | writeln "SHELL_OPTIONS = [join $SHELL_WIN32_OPTIONS { }]\n" |
| 1322 | 1326 | writeln -nonewline "SRC =" |
| 1323 | 1327 | foreach s [lsort $src] { |
| @@ -1705,11 +1709,11 @@ | ||
| 1705 | 1709 | |
| 1706 | 1710 | BCC = $(CC) $(CFLAGS) |
| 1707 | 1711 | TCC = $(CC) /c $(CFLAGS) $(MSCDEF) $(INCL) |
| 1708 | 1712 | RCC = $(RC) /D_WIN32 /D_MSC_VER $(MSCDEF) $(INCL) |
| 1709 | 1713 | MTC = mt |
| 1710 | -LIBS = ws2_32.lib advapi32.lib | |
| 1714 | +LIBS = ws2_32.lib advapi32.lib dnsapi.lib | |
| 1711 | 1715 | LIBDIR = |
| 1712 | 1716 | |
| 1713 | 1717 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1714 | 1718 | TCC = $(TCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| 1715 | 1719 | RCC = $(RCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| @@ -2098,11 +2102,11 @@ | ||
| 2098 | 2102 | WINDIR=$(B)/win/ |
| 2099 | 2103 | ZLIBSRCDIR=../../zlib/ |
| 2100 | 2104 | |
| 2101 | 2105 | # define linker command and options |
| 2102 | 2106 | LINK=$(PellesCDir)/bin/polink.exe |
| 2103 | -LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib Crtmt$(TARGETEXTEND).lib | |
| 2107 | +LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib dnsapi.lib Crtmt$(TARGETEXTEND).lib | |
| 2104 | 2108 | |
| 2105 | 2109 | # define standard C-compiler and flags, used to compile |
| 2106 | 2110 | # the fossil binary. Some special definitions follow for |
| 2107 | 2111 | # special files follow |
| 2108 | 2112 | CC=$(PellesCDir)\bin\pocc.exe |
| 2109 | 2113 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -939,10 +939,14 @@ | |
| 939 | LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32 |
| 940 | endif |
| 941 | else |
| 942 | LIB += -lkernel32 -lws2_32 |
| 943 | endif |
| 944 | |
| 945 | #### Tcl shell for use in running the fossil test suite. This is only |
| 946 | # used for testing. |
| 947 | # |
| 948 | TCLSH = tclsh |
| @@ -1313,11 +1317,11 @@ | |
| 1313 | SSL = |
| 1314 | |
| 1315 | CFLAGS = -o |
| 1316 | BCC = $(DMDIR)\bin\dmc $(CFLAGS) |
| 1317 | TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL) |
| 1318 | LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 |
| 1319 | } |
| 1320 | writeln "SQLITE_OPTIONS = [join $SQLITE_OPTIONS { }]\n" |
| 1321 | writeln "SHELL_OPTIONS = [join $SHELL_WIN32_OPTIONS { }]\n" |
| 1322 | writeln -nonewline "SRC =" |
| 1323 | foreach s [lsort $src] { |
| @@ -1705,11 +1709,11 @@ | |
| 1705 | |
| 1706 | BCC = $(CC) $(CFLAGS) |
| 1707 | TCC = $(CC) /c $(CFLAGS) $(MSCDEF) $(INCL) |
| 1708 | RCC = $(RC) /D_WIN32 /D_MSC_VER $(MSCDEF) $(INCL) |
| 1709 | MTC = mt |
| 1710 | LIBS = ws2_32.lib advapi32.lib |
| 1711 | LIBDIR = |
| 1712 | |
| 1713 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1714 | TCC = $(TCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| 1715 | RCC = $(RCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| @@ -2098,11 +2102,11 @@ | |
| 2098 | WINDIR=$(B)/win/ |
| 2099 | ZLIBSRCDIR=../../zlib/ |
| 2100 | |
| 2101 | # define linker command and options |
| 2102 | LINK=$(PellesCDir)/bin/polink.exe |
| 2103 | LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib Crtmt$(TARGETEXTEND).lib |
| 2104 | |
| 2105 | # define standard C-compiler and flags, used to compile |
| 2106 | # the fossil binary. Some special definitions follow for |
| 2107 | # special files follow |
| 2108 | CC=$(PellesCDir)\bin\pocc.exe |
| 2109 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -939,10 +939,14 @@ | |
| 939 | LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32 |
| 940 | endif |
| 941 | else |
| 942 | LIB += -lkernel32 -lws2_32 |
| 943 | endif |
| 944 | |
| 945 | #### Library required for DNS lookups. |
| 946 | # |
| 947 | LIB += ldnsapi |
| 948 | |
| 949 | #### Tcl shell for use in running the fossil test suite. This is only |
| 950 | # used for testing. |
| 951 | # |
| 952 | TCLSH = tclsh |
| @@ -1313,11 +1317,11 @@ | |
| 1317 | SSL = |
| 1318 | |
| 1319 | CFLAGS = -o |
| 1320 | BCC = $(DMDIR)\bin\dmc $(CFLAGS) |
| 1321 | TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL) |
| 1322 | LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi |
| 1323 | } |
| 1324 | writeln "SQLITE_OPTIONS = [join $SQLITE_OPTIONS { }]\n" |
| 1325 | writeln "SHELL_OPTIONS = [join $SHELL_WIN32_OPTIONS { }]\n" |
| 1326 | writeln -nonewline "SRC =" |
| 1327 | foreach s [lsort $src] { |
| @@ -1705,11 +1709,11 @@ | |
| 1709 | |
| 1710 | BCC = $(CC) $(CFLAGS) |
| 1711 | TCC = $(CC) /c $(CFLAGS) $(MSCDEF) $(INCL) |
| 1712 | RCC = $(RC) /D_WIN32 /D_MSC_VER $(MSCDEF) $(INCL) |
| 1713 | MTC = mt |
| 1714 | LIBS = ws2_32.lib advapi32.lib dnsapi.lib |
| 1715 | LIBDIR = |
| 1716 | |
| 1717 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1718 | TCC = $(TCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| 1719 | RCC = $(RCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| @@ -2098,11 +2102,11 @@ | |
| 2102 | WINDIR=$(B)/win/ |
| 2103 | ZLIBSRCDIR=../../zlib/ |
| 2104 | |
| 2105 | # define linker command and options |
| 2106 | LINK=$(PellesCDir)/bin/polink.exe |
| 2107 | LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib dnsapi.lib Crtmt$(TARGETEXTEND).lib |
| 2108 | |
| 2109 | # define standard C-compiler and flags, used to compile |
| 2110 | # the fossil binary. Some special definitions follow for |
| 2111 | # special files follow |
| 2112 | CC=$(PellesCDir)\bin\pocc.exe |
| 2113 |
+40
-10
| --- src/smtp.c | ||
| +++ src/smtp.c | ||
| @@ -19,21 +19,22 @@ | ||
| 19 | 19 | ** to RFC 5321. |
| 20 | 20 | */ |
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include "smtp.h" |
| 23 | 23 | #include <assert.h> |
| 24 | - | |
| 25 | -#ifdef __linux__ | |
| 26 | -# define FOSSIL_ENABLE_DNS_LOOKUP | |
| 27 | -#endif | |
| 28 | - | |
| 29 | -#if defined(FOSSIL_ENABLE_DNS_LOOKUP) | |
| 24 | +#if defined(__linux__) | |
| 30 | 25 | # include <sys/types.h> |
| 31 | 26 | # include <netinet/in.h> |
| 32 | 27 | # include <arpa/nameser.h> |
| 33 | 28 | # include <resolv.h> |
| 34 | -#endif /* defined(FOSSIL_ENABLE_DNS_LOOKUP) */ | |
| 29 | +# define FOSSIL_UNIX_STYLE_DNS 1 | |
| 30 | +#endif | |
| 31 | +#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__) | |
| 32 | +# include <windows.h> | |
| 33 | +# include <windns.h> | |
| 34 | +# define FOSSIL_WINDOWS_STYLE_DNS 1 | |
| 35 | +#endif | |
| 35 | 36 | |
| 36 | 37 | |
| 37 | 38 | /* |
| 38 | 39 | ** Find the hostname for receiving email for the domain given |
| 39 | 40 | ** in zDomain. Return NULL if not found or not implemented. |
| @@ -42,11 +43,11 @@ | ||
| 42 | 43 | ** |
| 43 | 44 | ** The returned string is obtained from fossil_malloc() |
| 44 | 45 | ** and should be released using fossil_free(). |
| 45 | 46 | */ |
| 46 | 47 | char *smtp_mx_host(const char *zDomain){ |
| 47 | -#if defined(FOSSIL_ENABLE_DNS_LOOKUP) | |
| 48 | +#if defined(FOSSIL_UNIX_STYLE_DNS) | |
| 48 | 49 | int nDns; /* Length of the DNS reply */ |
| 49 | 50 | int rc; /* Return code from various APIs */ |
| 50 | 51 | int i; /* Loop counter */ |
| 51 | 52 | int iBestPriority = 9999999; /* Best priority */ |
| 52 | 53 | int nRec; /* Number of answers */ |
| @@ -80,12 +81,41 @@ | ||
| 80 | 81 | if( pBest ){ |
| 81 | 82 | ns_name_uncompress(aDns, aDns+nDns, pBest+2, |
| 82 | 83 | zHostname, sizeof(zHostname)); |
| 83 | 84 | return fossil_strdup(zHostname); |
| 84 | 85 | } |
| 85 | -#endif /* defined(FOSSIL_ENABLE_DNS_LOOKUP) */ | |
| 86 | + return 0; | |
| 87 | +#elif defined(FOSSIL_WINDOWS_STYLE_DNS) | |
| 88 | + DNS_STATUS status; /* Return status */ | |
| 89 | + PDNS_RECORDA pDnsRecord, p; /* Pointer to DNS_RECORD structure */ | |
| 90 | + int iBestPriority = 9999999; /* Best priority */ | |
| 91 | + char *pBest = 0; /* RDATA for the best answer */ | |
| 92 | + | |
| 93 | + status = DnsQuery_UTF8(zDomain, /* Domain name */ | |
| 94 | + DNS_TYPE_MX, /* DNS record type */ | |
| 95 | + DNS_QUERY_STANDARD, /* Query options */ | |
| 96 | + NULL, /* List of DNS servers */ | |
| 97 | + &pDnsRecord, /* Query results */ | |
| 98 | + NULL); /* Reserved */ | |
| 99 | + if( status ) return NULL; | |
| 100 | + | |
| 101 | + p = pDnsRecord; | |
| 102 | + while( p ){ | |
| 103 | + if( p->Data.MX.wPreference<iBestPriority ){ | |
| 104 | + iBestPriority = p->Data.MX.wPreference; | |
| 105 | + pBest = p->Data.MX.pNameExchange; | |
| 106 | + } | |
| 107 | + p = p->pNext; | |
| 108 | + } | |
| 109 | + if( pBest ){ | |
| 110 | + pBest = fossil_strdup(pBest); | |
| 111 | + } | |
| 112 | + DnsRecordListFree(pDnsRecord, DnsFreeRecordListDeep); | |
| 113 | + return pBest; | |
| 114 | +#else | |
| 86 | 115 | return 0; |
| 116 | +#endif /* defined(FOSSIL_WINDOWS_STYLE_DNS) */ | |
| 87 | 117 | } |
| 88 | 118 | |
| 89 | 119 | /* |
| 90 | 120 | ** COMMAND: test-find-mx |
| 91 | 121 | ** |
| @@ -94,11 +124,11 @@ | ||
| 94 | 124 | ** Do a DNS MX lookup to find the hostname for sending email for |
| 95 | 125 | ** DOMAIN. |
| 96 | 126 | */ |
| 97 | 127 | void test_find_mx(void){ |
| 98 | 128 | int i; |
| 99 | - if( g.argc<2 ){ | |
| 129 | + if( g.argc<=2 ){ | |
| 100 | 130 | usage("DOMAIN ..."); |
| 101 | 131 | } |
| 102 | 132 | for(i=2; i<g.argc; i++){ |
| 103 | 133 | char *z = smtp_mx_host(g.argv[i]); |
| 104 | 134 | fossil_print("%s: %s\n", g.argv[i], z); |
| 105 | 135 |
| --- src/smtp.c | |
| +++ src/smtp.c | |
| @@ -19,21 +19,22 @@ | |
| 19 | ** to RFC 5321. |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "smtp.h" |
| 23 | #include <assert.h> |
| 24 | |
| 25 | #ifdef __linux__ |
| 26 | # define FOSSIL_ENABLE_DNS_LOOKUP |
| 27 | #endif |
| 28 | |
| 29 | #if defined(FOSSIL_ENABLE_DNS_LOOKUP) |
| 30 | # include <sys/types.h> |
| 31 | # include <netinet/in.h> |
| 32 | # include <arpa/nameser.h> |
| 33 | # include <resolv.h> |
| 34 | #endif /* defined(FOSSIL_ENABLE_DNS_LOOKUP) */ |
| 35 | |
| 36 | |
| 37 | /* |
| 38 | ** Find the hostname for receiving email for the domain given |
| 39 | ** in zDomain. Return NULL if not found or not implemented. |
| @@ -42,11 +43,11 @@ | |
| 42 | ** |
| 43 | ** The returned string is obtained from fossil_malloc() |
| 44 | ** and should be released using fossil_free(). |
| 45 | */ |
| 46 | char *smtp_mx_host(const char *zDomain){ |
| 47 | #if defined(FOSSIL_ENABLE_DNS_LOOKUP) |
| 48 | int nDns; /* Length of the DNS reply */ |
| 49 | int rc; /* Return code from various APIs */ |
| 50 | int i; /* Loop counter */ |
| 51 | int iBestPriority = 9999999; /* Best priority */ |
| 52 | int nRec; /* Number of answers */ |
| @@ -80,12 +81,41 @@ | |
| 80 | if( pBest ){ |
| 81 | ns_name_uncompress(aDns, aDns+nDns, pBest+2, |
| 82 | zHostname, sizeof(zHostname)); |
| 83 | return fossil_strdup(zHostname); |
| 84 | } |
| 85 | #endif /* defined(FOSSIL_ENABLE_DNS_LOOKUP) */ |
| 86 | return 0; |
| 87 | } |
| 88 | |
| 89 | /* |
| 90 | ** COMMAND: test-find-mx |
| 91 | ** |
| @@ -94,11 +124,11 @@ | |
| 94 | ** Do a DNS MX lookup to find the hostname for sending email for |
| 95 | ** DOMAIN. |
| 96 | */ |
| 97 | void test_find_mx(void){ |
| 98 | int i; |
| 99 | if( g.argc<2 ){ |
| 100 | usage("DOMAIN ..."); |
| 101 | } |
| 102 | for(i=2; i<g.argc; i++){ |
| 103 | char *z = smtp_mx_host(g.argv[i]); |
| 104 | fossil_print("%s: %s\n", g.argv[i], z); |
| 105 |
| --- src/smtp.c | |
| +++ src/smtp.c | |
| @@ -19,21 +19,22 @@ | |
| 19 | ** to RFC 5321. |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "smtp.h" |
| 23 | #include <assert.h> |
| 24 | #if defined(__linux__) |
| 25 | # include <sys/types.h> |
| 26 | # include <netinet/in.h> |
| 27 | # include <arpa/nameser.h> |
| 28 | # include <resolv.h> |
| 29 | # define FOSSIL_UNIX_STYLE_DNS 1 |
| 30 | #endif |
| 31 | #if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__) |
| 32 | # include <windows.h> |
| 33 | # include <windns.h> |
| 34 | # define FOSSIL_WINDOWS_STYLE_DNS 1 |
| 35 | #endif |
| 36 | |
| 37 | |
| 38 | /* |
| 39 | ** Find the hostname for receiving email for the domain given |
| 40 | ** in zDomain. Return NULL if not found or not implemented. |
| @@ -42,11 +43,11 @@ | |
| 43 | ** |
| 44 | ** The returned string is obtained from fossil_malloc() |
| 45 | ** and should be released using fossil_free(). |
| 46 | */ |
| 47 | char *smtp_mx_host(const char *zDomain){ |
| 48 | #if defined(FOSSIL_UNIX_STYLE_DNS) |
| 49 | int nDns; /* Length of the DNS reply */ |
| 50 | int rc; /* Return code from various APIs */ |
| 51 | int i; /* Loop counter */ |
| 52 | int iBestPriority = 9999999; /* Best priority */ |
| 53 | int nRec; /* Number of answers */ |
| @@ -80,12 +81,41 @@ | |
| 81 | if( pBest ){ |
| 82 | ns_name_uncompress(aDns, aDns+nDns, pBest+2, |
| 83 | zHostname, sizeof(zHostname)); |
| 84 | return fossil_strdup(zHostname); |
| 85 | } |
| 86 | return 0; |
| 87 | #elif defined(FOSSIL_WINDOWS_STYLE_DNS) |
| 88 | DNS_STATUS status; /* Return status */ |
| 89 | PDNS_RECORDA pDnsRecord, p; /* Pointer to DNS_RECORD structure */ |
| 90 | int iBestPriority = 9999999; /* Best priority */ |
| 91 | char *pBest = 0; /* RDATA for the best answer */ |
| 92 | |
| 93 | status = DnsQuery_UTF8(zDomain, /* Domain name */ |
| 94 | DNS_TYPE_MX, /* DNS record type */ |
| 95 | DNS_QUERY_STANDARD, /* Query options */ |
| 96 | NULL, /* List of DNS servers */ |
| 97 | &pDnsRecord, /* Query results */ |
| 98 | NULL); /* Reserved */ |
| 99 | if( status ) return NULL; |
| 100 | |
| 101 | p = pDnsRecord; |
| 102 | while( p ){ |
| 103 | if( p->Data.MX.wPreference<iBestPriority ){ |
| 104 | iBestPriority = p->Data.MX.wPreference; |
| 105 | pBest = p->Data.MX.pNameExchange; |
| 106 | } |
| 107 | p = p->pNext; |
| 108 | } |
| 109 | if( pBest ){ |
| 110 | pBest = fossil_strdup(pBest); |
| 111 | } |
| 112 | DnsRecordListFree(pDnsRecord, DnsFreeRecordListDeep); |
| 113 | return pBest; |
| 114 | #else |
| 115 | return 0; |
| 116 | #endif /* defined(FOSSIL_WINDOWS_STYLE_DNS) */ |
| 117 | } |
| 118 | |
| 119 | /* |
| 120 | ** COMMAND: test-find-mx |
| 121 | ** |
| @@ -94,11 +124,11 @@ | |
| 124 | ** Do a DNS MX lookup to find the hostname for sending email for |
| 125 | ** DOMAIN. |
| 126 | */ |
| 127 | void test_find_mx(void){ |
| 128 | int i; |
| 129 | if( g.argc<=2 ){ |
| 130 | usage("DOMAIN ..."); |
| 131 | } |
| 132 | for(i=2; i<g.argc; i++){ |
| 133 | char *z = smtp_mx_host(g.argv[i]); |
| 134 | fossil_print("%s: %s\n", g.argv[i], z); |
| 135 |
+1
-1
| --- win/Makefile.PellesCGMake | ||
| +++ win/Makefile.PellesCGMake | ||
| @@ -58,11 +58,11 @@ | ||
| 58 | 58 | WINDIR=$(B)/win/ |
| 59 | 59 | ZLIBSRCDIR=../../zlib/ |
| 60 | 60 | |
| 61 | 61 | # define linker command and options |
| 62 | 62 | LINK=$(PellesCDir)/bin/polink.exe |
| 63 | -LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib Crtmt$(TARGETEXTEND).lib | |
| 63 | +LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib dnsapi.lib Crtmt$(TARGETEXTEND).lib | |
| 64 | 64 | |
| 65 | 65 | # define standard C-compiler and flags, used to compile |
| 66 | 66 | # the fossil binary. Some special definitions follow for |
| 67 | 67 | # special files follow |
| 68 | 68 | CC=$(PellesCDir)\bin\pocc.exe |
| 69 | 69 |
| --- win/Makefile.PellesCGMake | |
| +++ win/Makefile.PellesCGMake | |
| @@ -58,11 +58,11 @@ | |
| 58 | WINDIR=$(B)/win/ |
| 59 | ZLIBSRCDIR=../../zlib/ |
| 60 | |
| 61 | # define linker command and options |
| 62 | LINK=$(PellesCDir)/bin/polink.exe |
| 63 | LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib Crtmt$(TARGETEXTEND).lib |
| 64 | |
| 65 | # define standard C-compiler and flags, used to compile |
| 66 | # the fossil binary. Some special definitions follow for |
| 67 | # special files follow |
| 68 | CC=$(PellesCDir)\bin\pocc.exe |
| 69 |
| --- win/Makefile.PellesCGMake | |
| +++ win/Makefile.PellesCGMake | |
| @@ -58,11 +58,11 @@ | |
| 58 | WINDIR=$(B)/win/ |
| 59 | ZLIBSRCDIR=../../zlib/ |
| 60 | |
| 61 | # define linker command and options |
| 62 | LINK=$(PellesCDir)/bin/polink.exe |
| 63 | LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib dnsapi.lib Crtmt$(TARGETEXTEND).lib |
| 64 | |
| 65 | # define standard C-compiler and flags, used to compile |
| 66 | # the fossil binary. Some special definitions follow for |
| 67 | # special files follow |
| 68 | CC=$(PellesCDir)\bin\pocc.exe |
| 69 |
+1
-1
| --- win/Makefile.dmc | ||
| +++ win/Makefile.dmc | ||
| @@ -22,11 +22,11 @@ | ||
| 22 | 22 | SSL = |
| 23 | 23 | |
| 24 | 24 | CFLAGS = -o |
| 25 | 25 | BCC = $(DMDIR)\bin\dmc $(CFLAGS) |
| 26 | 26 | TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL) |
| 27 | -LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 | |
| 27 | +LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi | |
| 28 | 28 | |
| 29 | 29 | SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB |
| 30 | 30 | |
| 31 | 31 | SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen |
| 32 | 32 | |
| 33 | 33 |
| --- win/Makefile.dmc | |
| +++ win/Makefile.dmc | |
| @@ -22,11 +22,11 @@ | |
| 22 | SSL = |
| 23 | |
| 24 | CFLAGS = -o |
| 25 | BCC = $(DMDIR)\bin\dmc $(CFLAGS) |
| 26 | TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL) |
| 27 | LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 |
| 28 | |
| 29 | SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB |
| 30 | |
| 31 | SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen |
| 32 | |
| 33 |
| --- win/Makefile.dmc | |
| +++ win/Makefile.dmc | |
| @@ -22,11 +22,11 @@ | |
| 22 | SSL = |
| 23 | |
| 24 | CFLAGS = -o |
| 25 | BCC = $(DMDIR)\bin\dmc $(CFLAGS) |
| 26 | TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL) |
| 27 | LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi |
| 28 | |
| 29 | SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB |
| 30 | |
| 31 | SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen |
| 32 | |
| 33 |
+4
-1
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -407,10 +407,14 @@ | ||
| 407 | 407 | LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32 |
| 408 | 408 | endif |
| 409 | 409 | else |
| 410 | 410 | LIB += -lkernel32 -lws2_32 |
| 411 | 411 | endif |
| 412 | + | |
| 413 | +#### Library required for DNS lookups. | |
| 414 | +# | |
| 415 | +LIB += -ldnsapi | |
| 412 | 416 | |
| 413 | 417 | #### Tcl shell for use in running the fossil test suite. This is only |
| 414 | 418 | # used for testing. |
| 415 | 419 | # |
| 416 | 420 | TCLSH = tclsh |
| @@ -2416,6 +2420,5 @@ | ||
| 2416 | 2420 | $(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c |
| 2417 | 2421 | $(XTCC) -c $(SRCDIR)/th_tcl.c -o $@ |
| 2418 | 2422 | |
| 2419 | 2423 | $(OBJDIR)/miniz.o: $(SRCDIR)/miniz.c |
| 2420 | 2424 | $(XTCC) $(MINIZ_OPTIONS) -c $(SRCDIR)/miniz.c -o $@ |
| 2421 | - | |
| 2422 | 2425 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -407,10 +407,14 @@ | |
| 407 | LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32 |
| 408 | endif |
| 409 | else |
| 410 | LIB += -lkernel32 -lws2_32 |
| 411 | endif |
| 412 | |
| 413 | #### Tcl shell for use in running the fossil test suite. This is only |
| 414 | # used for testing. |
| 415 | # |
| 416 | TCLSH = tclsh |
| @@ -2416,6 +2420,5 @@ | |
| 2416 | $(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c |
| 2417 | $(XTCC) -c $(SRCDIR)/th_tcl.c -o $@ |
| 2418 | |
| 2419 | $(OBJDIR)/miniz.o: $(SRCDIR)/miniz.c |
| 2420 | $(XTCC) $(MINIZ_OPTIONS) -c $(SRCDIR)/miniz.c -o $@ |
| 2421 | |
| 2422 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -407,10 +407,14 @@ | |
| 407 | LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32 |
| 408 | endif |
| 409 | else |
| 410 | LIB += -lkernel32 -lws2_32 |
| 411 | endif |
| 412 | |
| 413 | #### Library required for DNS lookups. |
| 414 | # |
| 415 | LIB += -ldnsapi |
| 416 | |
| 417 | #### Tcl shell for use in running the fossil test suite. This is only |
| 418 | # used for testing. |
| 419 | # |
| 420 | TCLSH = tclsh |
| @@ -2416,6 +2420,5 @@ | |
| 2420 | $(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c |
| 2421 | $(XTCC) -c $(SRCDIR)/th_tcl.c -o $@ |
| 2422 | |
| 2423 | $(OBJDIR)/miniz.o: $(SRCDIR)/miniz.c |
| 2424 | $(XTCC) $(MINIZ_OPTIONS) -c $(SRCDIR)/miniz.c -o $@ |
| 2425 |
+1
-1
| --- win/Makefile.msc | ||
| +++ win/Makefile.msc | ||
| @@ -245,11 +245,11 @@ | ||
| 245 | 245 | |
| 246 | 246 | BCC = $(CC) $(CFLAGS) |
| 247 | 247 | TCC = $(CC) /c $(CFLAGS) $(MSCDEF) $(INCL) |
| 248 | 248 | RCC = $(RC) /D_WIN32 /D_MSC_VER $(MSCDEF) $(INCL) |
| 249 | 249 | MTC = mt |
| 250 | -LIBS = ws2_32.lib advapi32.lib | |
| 250 | +LIBS = ws2_32.lib advapi32.lib dnsapi.lib | |
| 251 | 251 | LIBDIR = |
| 252 | 252 | |
| 253 | 253 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 254 | 254 | TCC = $(TCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| 255 | 255 | RCC = $(RCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| 256 | 256 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -245,11 +245,11 @@ | |
| 245 | |
| 246 | BCC = $(CC) $(CFLAGS) |
| 247 | TCC = $(CC) /c $(CFLAGS) $(MSCDEF) $(INCL) |
| 248 | RCC = $(RC) /D_WIN32 /D_MSC_VER $(MSCDEF) $(INCL) |
| 249 | MTC = mt |
| 250 | LIBS = ws2_32.lib advapi32.lib |
| 251 | LIBDIR = |
| 252 | |
| 253 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 254 | TCC = $(TCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| 255 | RCC = $(RCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| 256 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -245,11 +245,11 @@ | |
| 245 | |
| 246 | BCC = $(CC) $(CFLAGS) |
| 247 | TCC = $(CC) /c $(CFLAGS) $(MSCDEF) $(INCL) |
| 248 | RCC = $(RC) /D_WIN32 /D_MSC_VER $(MSCDEF) $(INCL) |
| 249 | MTC = mt |
| 250 | LIBS = ws2_32.lib advapi32.lib dnsapi.lib |
| 251 | LIBDIR = |
| 252 | |
| 253 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 254 | TCC = $(TCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| 255 | RCC = $(RCC) /DFOSSIL_DYNAMIC_BUILD=1 |
| 256 |