]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
winbuild: Added option to build with c-ares
authorSam Schanken <windexlight@gmail.com>
Mon, 29 Dec 2014 18:57:21 +0000 (10:57 -0800)
committerSteve Holme <steve_holme@hotmail.com>
Thu, 8 Jan 2015 21:12:43 +0000 (21:12 +0000)
Added support for a WITH_CARES option to be used when invoking nmake
via Makefile.vc. This option enables linking against both the DLL and
static versions of the c-ares libraries, as well as the debug and
release varients, depending on the value of DEBUG. The USE_ARES
preprocessor symbol is also defined.

winbuild/BUILD.WINDOWS.txt
winbuild/Makefile.vc
winbuild/MakefileBuild.vc

index 757c41f571bdbbe5010a509ed6e1aa5593577124..7d6b364e24d88e3bf394234ab34485b6b9cc5137 100644 (file)
@@ -19,7 +19,7 @@ Building with Visual C++, prerequises
 \r
     http://www.microsoft.com/en-us/download/details.aspx?id=12261\r
 \r
-   If you wish to support zlib, openssl, ssh2, you will have to download\r
+   If you wish to support zlib, openssl, c-ares, ssh2, you will have to download\r
    them separately and copy them to the deps directory as shown below:\r
    \r
    somedirectory\\r
@@ -64,6 +64,7 @@ where <options> is one or many of:
                                  Libraries can be fetched at http://windows.php.net/downloads/php-sdk/deps/\r
                                  Uncompress them into the deps folder.\r
   WITH_SSL=<dll or static>     - Enable OpenSSL support, DLL or static\r
+  WITH_CARES=<dll or static>   - Enable c-ares support, DLL or static\r
   WITH_ZLIB=<dll or static>    - Enable zlib support, DLL or static\r
   WITH_SSH2=<dll or static>    - Enable libSSH2 support, DLL or static\r
   ENABLE_SSPI=<yes or no>      - Enable SSPI support, defaults to yes\r
index 6dc58c4ef5f483480b7396715a735e4dfbfd9e07..21e1614aecb8c9f6880a197f3ecc862edc15752a 100644 (file)
@@ -21,6 +21,7 @@ CFGSET=true
 !MESSAGE                                  Libraries can be fetched at http://pecl2.php.net/downloads/php-windows-builds/\r
 !MESSAGE                                  Uncompress them into the deps folder.\r
 !MESSAGE   WITH_SSL=<dll or static>     - Enable OpenSSL support, DLL or static\r
+!MESSAGE   WITH_CARES=<dll or static>   - Enable c-ares support, DLL or static\r
 !MESSAGE   WITH_ZLIB=<dll or static>    - Enable zlib support, DLL or static\r
 !MESSAGE   WITH_SSH2=<dll or static>    - Enable libSSH2 support, DLL or static\r
 !MESSAGE   ENABLE_IDN=<yes or no>       - Enable use of Windows IDN APIs, defaults to yes\r
@@ -107,6 +108,14 @@ USE_SSL = true
 SSL     = static\r
 !ENDIF\r
 \r
+!IF "$(WITH_CARES)"=="dll"\r
+USE_CARES = true\r
+CARES     = dll\r
+!ELSEIF "$(WITH_CARES)"=="static"\r
+USE_CARES = true\r
+CARES     = static\r
+!ENDIF\r
+\r
 !IF "$(WITH_ZLIB)"=="dll"\r
 USE_ZLIB = true\r
 ZLIB     = dll\r
@@ -141,6 +150,10 @@ CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-static
 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL)\r
 !ENDIF\r
 \r
+!IF "$(USE_CARES)"=="true"\r
+CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-cares-$(CARES)\r
+!ENDIF\r
+\r
 !IF "$(USE_ZLIB)"=="true"\r
 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-zlib-$(ZLIB)\r
 !ENDIF\r
index b9e150c4346310e574bcbee47591d8c39b1fc4b1..985c1bcc2927fe1eb4ea28e7f42708572e0a42b6 100644 (file)
@@ -121,6 +121,27 @@ SSL          = static
 SSL_CFLAGS   = /DUSE_SSLEAY /I"$(DEVEL_INCLUDE)/openssl"\r
 !ENDIF\r
 \r
+!IF "$(WITH_CARES)"=="dll"\r
+!IF "$(DEBUG)"=="yes"\r
+CARES_LIBS     = caresd.lib\r
+!ELSE\r
+CARES_LIBS     = cares.lib\r
+!ENDIF\r
+USE_CARES      = true\r
+CARES          = dll\r
+!ELSEIF "$(WITH_CARES)"=="static"\r
+!IF "$(DEBUG)"=="yes"\r
+CARES_LIBS     = libcaresd.lib\r
+!ELSE\r
+CARES_LIBS     = libcares.lib\r
+!ENDIF\r
+USE_CARES      = true\r
+CARES          = static\r
+!ENDIF\r
+\r
+!IFDEF USE_CARES\r
+CARES_CFLAGS   = /DUSE_ARES /I"$(DEVEL_INCLUDE)/cares"\r
+!ENDIF\r
 \r
 !IF "$(WITH_ZLIB)"=="dll"\r
 ZLIB_LIBS   = zlib.lib\r
@@ -297,6 +318,11 @@ CFLAGS = $(CFLAGS) $(SSL_CFLAGS)
 LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(SSL_LIBS)\r
 !ENDIF\r
 \r
+!IF "$(USE_CARES)"=="true"\r
+CFLAGS = $(CFLAGS) $(CARES_CFLAGS)\r
+LFLAGS = $(LFLAGS) $(CARES_LFLAGS) $(CARES_LIBS)\r
+!ENDIF\r
+\r
 !IF "$(USE_ZLIB)"=="true"\r
 CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS)\r
 LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) $(ZLIB_LIBS)\r
@@ -376,6 +402,7 @@ package: $(TARGET)
 \r
 $(TARGET): $(LIB_OBJS) $(LIB_DIROBJ) $(DISTDIR)\r
        @echo Using SSL: $(USE_SSL)\r
+       @echo Using c-ares: $(USE_CARES)\r
        @echo Using SSH2: $(USE_SSH2)\r
        @echo Using ZLIB: $(USE_ZLIB)\r
        @echo Using IDN:  $(USE_IDN)\r