]> granicus.if.org Git - curl/commitdiff
winbuild: fix the nghttp2 build
authorAnatol Belski <ab@php.net>
Fri, 10 Mar 2017 11:59:36 +0000 (12:59 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 24 May 2017 06:27:12 +0000 (08:27 +0200)
Closes #1321

winbuild/Makefile.vc
winbuild/MakefileBuild.vc

index f78da434363a3cfb85247158017afcd4af64a171..9ef7c14576511b36541d78e970faef89c81b931c 100644 (file)
@@ -21,8 +21,7 @@ CFGSET=true
 !MESSAGE                                  Libraries can be fetched at http://pecl2.php.net/downloads/php-windows-builds/
 !MESSAGE                                  Uncompress them into the deps folder.
 !MESSAGE   WITH_SSL=<dll or static>     - Enable OpenSSL support, DLL or static
-!MESSAGE   ENABLE_NGHTTP2=<yes or no>   - Enable HTTP/2 support, defaults to no
-!MESSAGE                                  Requires OpenSSL
+!MESSAGE   WITH_NGHTTP2=<dll or static> - Enable HTTP/2 support, DLL or static
 !MESSAGE   WITH_CARES=<dll or static>   - Enable c-ares support, DLL or static
 !MESSAGE   WITH_ZLIB=<dll or static>    - Enable zlib support, DLL or static
 !MESSAGE   WITH_SSH2=<dll or static>    - Enable libSSH2 support, DLL or static
@@ -114,10 +113,17 @@ USE_SSL = true
 SSL     = static
 !ENDIF
 
-!IF "$(USE_SSL)"=="true"
 !IF "$(ENABLE_NGHTTP2)"=="yes"
+# compatibility bit, WITH_NGHTTP2 is the correct flag
+WITH_NGHTTP2 = dll
+USE_NGHTTP2  = true
+NGHTTP2      = dll
+!ELSEIF "$(WITH_NGHTTP2)"=="dll"
 USE_NGHTTP2 = true
-!ENDIF
+NGHTTP2     = dll
+!ELSEIF "$(WITH_NGHTTP2)"=="static"
+USE_NGHTTP2 = true
+NGHTTP2     = static
 !ENDIF
 
 !IFNDEF USE_NGHTTP2
@@ -205,6 +211,10 @@ CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi
 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-winssl
 !ENDIF
 
+!IF "$(USE_NGHTTP2)"=="true"
+CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-nghttp2-$(NGHTTP2)
+!ENDIF
+
 !MESSAGE configuration name: $(CONFIG_NAME_LIB)
 
 BUILD_DIR=../builds/$(CONFIG_NAME_LIB)
@@ -233,6 +243,9 @@ $(MODE):
        @SET USE_IPV6=$(USE_IPV6)
        @SET USE_SSPI=$(USE_SSPI)
        @SET USE_WINSSL=$(USE_WINSSL)
+# compatibility bit
+       @SET WITH_NGHTTP2=$(WITH_NGHTTP2)
+
        @$(MAKE) /NOLOGO /F MakefileBuild.vc
 
 copy_from_lib:
index f8296718b86ab042a98ac02f3c171369a0df1b22..83f92374e36b118a4ee4b4c1aebacede0297584f 100644 (file)
@@ -131,22 +131,16 @@ USE_SSL      = true
 SSL          = static\r
 !ENDIF\r
 \r
-!IFNDEF USE_NGHTTP2\r
-USE_NGHTTP2  = false\r
-!ENDIF\r
-\r
 !IFDEF USE_SSL\r
 SSL_CFLAGS   = /DUSE_OPENSSL /I"$(DEVEL_INCLUDE)/openssl"\r
-\r
-!IF "$(USE_NGHTTP2)"=="yes"\r
-USE_NGHTTP2  = true\r
-!ENDIF\r
-\r
-!IF "$(USE_NGHTTP2)"=="true"\r
-SSL_CFLAGS   = $(SSL_CFLAGS) /DUSE_NGHTTP2\r
-SSL_LIBS     = $(SSL_LIBS) nghttp2.lib\r
 !ENDIF\r
 \r
+!IF "$(WITH_NGHTTP2)"=="dll"\r
+NGHTTP2_CFLAGS   = /DUSE_NGHTTP2\r
+NGHTTP2_LIBS     = nghttp2.lib\r
+!ELSEIF "$(WITH_NGHTTP2)"=="static"\r
+NGHTTP2_CFLAGS   = /DUSE_NGHTTP2 /DNGHTTP2_STATICLIB\r
+NGHTTP2_LIBS     = nghttp2_static.lib\r
 !ENDIF\r
 \r
 !IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static"\r
@@ -381,6 +375,11 @@ CFLAGS = $(CFLAGS) $(IPV6_CFLAGS)
 CFLAGS = $(CFLAGS) $(SSPI_CFLAGS)\r
 !ENDIF\r
 \r
+!IF "$(USE_NGHTTP2)"=="true"\r
+CFLAGS = $(CFLAGS) $(NGHTTP2_CFLAGS)\r
+LFLAGS = $(LFLAGS) $(NGHTTP2_LFLAGS) $(NGHTTP2_LIBS)\r
+!ENDIF\r
+\r
 !IF "$(GEN_PDB)"=="true"\r
 CFLAGS = $(CFLAGS) $(CFLAGS_PDB) /Fd"$(LIB_DIROBJ)\$(PDB)"\r
 LFLAGS = $(LFLAGS) $(LFLAGS_PDB)\r