From f3ba774660c1d421ac2de0fd1e4a89345817c69e Mon Sep 17 00:00:00 2001 From: kdekker Date: Mon, 9 Apr 2018 11:19:51 +0200 Subject: [PATCH 1/3] Allow to provide own locations for zlib, openssl etc Allow to provide own locations for zlib, openssl, libssh2, cares. The link.exe /lib failed, because it added (Microsoft) dependencies. As create a static lib is just aggregating objects into an archive, use lib.exe instead. As lib.exe does not perform optimizations nor linking, the optimizations and dependent windows libraries should not be provided as flags to the archiver. --- winbuild/MakefileBuild.vc | 121 ++++++++++++++++++++++++-------------- 1 file changed, 78 insertions(+), 43 deletions(-) diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc index 9e6810340cadec..45a3f0d43e23ad 100644 --- a/winbuild/MakefileBuild.vc +++ b/winbuild/MakefileBuild.vc @@ -70,7 +70,12 @@ CFLAGS = /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /FD / LFLAGS = /nologo /machine:$(MACHINE) LNKDLL = link.exe /DLL -LNKLIB = link.exe /lib +# Use lib.exe instead of link.exe as link.exe /lib has the following bad habits: +# - optimizing options like /opt:ref raises warnings (at least in Visual Studio 2015) +# - all (including Windows) dependencies are aggregated (as static parts) +# - link.exe /lib is not documented (anymore) at MSDN +# Instead of id: just create an archive, that contains all objects +LNKLIB = lib.exe CFLAGS_PDB = /Zi LFLAGS_PDB = /incremental:no /opt:ref,icf /DEBUG @@ -97,9 +102,9 @@ PDB_NAME_DLL = $(BASE_NAME).pdb PDB_NAME_DLL_DEBUG = $(BASE_NAME_DEBUG).pdb # CURL Command section -PROGRAM_NAME = curl.exe -CURL_CFLAGS = /I../lib /I../include /nologo /W4 /EHsc /DWIN32 /FD /c -CURL_LFLAGS = /nologo /out:$(DIRDIST)\bin\$(PROGRAM_NAME) /subsystem:console /machine:$(MACHINE) +PROGRAM_NAME = curl.exe +CURL_CFLAGS = /I../lib /I../include /nologo /W4 /EHsc /DWIN32 /FD /c +CURL_LFLAGS = /out:$(DIRDIST)\bin\$(PROGRAM_NAME) /subsystem:console $(LFLAGS) CURL_RESFLAGS = /i../include ############################################################# @@ -108,37 +113,43 @@ LIBCURL_SRC_DIR = ..\lib CURL_SRC_DIR = ..\src !IFNDEF WITH_DEVEL -WITH_DEVEL = ../../deps +WITH_DEVEL = ../../deps !ENDIF -DEVEL_INCLUDE = $(WITH_DEVEL)/include -DEVEL_LIB = $(WITH_DEVEL)/lib -DEVEL_BIN = $(WITH_DEVEL)/bin +DEVEL_INCLUDE= $(WITH_DEVEL)/include +DEVEL_LIB = $(WITH_DEVEL)/lib -CFLAGS = $(CFLAGS) /I"$(DEVEL_INCLUDE)" -LFLAGS = $(LFLAGS) "/LIBPATH:$(DEVEL_LIB)" +!IF EXISTS("$(DEVEL_INCLUDE)") +CFLAGS = $(CFLAGS) /I"$(DEVEL_INCLUDE)" +!ENDIF +!IF EXISTS("$(DEVEL_LIB)") +LFLAGS = $(LFLAGS) "/LIBPATH:$(DEVEL_LIB)" +!ENDIF +!IFDEF SSL_PATH +SSL_INC_DIR = $(SSL_PATH)\include +SSL_LIB_DIR = $(SSL_PATH)\lib +SSL_LFLAGS = $(SSL_LFLAGS) "/LIBPATH:$(SSL_LIB_DIR)" +!ELSE +SSL_INC_DIR=$(DEVEL_INCLUDE)\openssl +SSL_LIB_DIR=$(DEVEL_LIB) +!ENDIF -!IF "$(WITH_SSL)"=="dll" -!IF EXISTS("$(DEVEL_LIB)\libssl.lib") +!IF "$(WITH_SSL)"=="dll" || "$(WITH_SSL)"=="static" +!IF EXISTS("$(SSL_LIB_DIR)\libssl.lib") SSL_LIBS = libssl.lib libcrypto.lib !ELSE SSL_LIBS = libeay32.lib ssleay32.lib !ENDIF USE_SSL = true -SSL = dll -!ELSEIF "$(WITH_SSL)"=="static" -!IF EXISTS("$(DEVEL_LIB)\libssl.lib") -SSL_LIBS = libssl.lib libcrypto.lib gdi32.lib user32.lib crypt32.lib -!ELSE -SSL_LIBS = libeay32.lib ssleay32.lib gdi32.lib user32.lib crypt32.lib +SSL = $(WITH_SSL) +!IF "$(WITH_SSL)"=="static" +WIN_LIBS = $(WIN_LIBS) gdi32.lib user32.lib crypt32.lib !ENDIF -USE_SSL = true -SSL = static !ENDIF !IFDEF USE_SSL -SSL_CFLAGS = /DUSE_OPENSSL /I"$(DEVEL_INCLUDE)/openssl" -!IF EXISTS("$(DEVEL_INCLUDE)\openssl\is_boringssl.h") +SSL_CFLAGS = /DUSE_OPENSSL /I"$(SSL_INC_DIR)" +!IF EXISTS("$(SSL_INC_DIR)\is_boringssl.h") SSL_CFLAGS = $(SSL_CFLAGS) /DHAVE_BORINGSSL !ENDIF !ENDIF @@ -159,6 +170,15 @@ MBEDTLS_LIBS = mbedtls.lib mbedcrypto.lib mbedx509.lib !ENDIF +!IFDEF CARES_PATH +CARES_INC_DIR = $(CARES_PATH)\include +CARES_LIB_DIR = $(CARES_PATH)\lib +CARES_LFLAGS = $(CARES_LFLAGS) "/LIBPATH:$(CARES_LIB_DIR)" +!ELSE +CARES_INC_DIR = $(DEVEL_INCLUDE)/cares +CARES_LIB_DIR = $(DEVEL_LIB) +!ENDIF + !IF "$(WITH_CARES)"=="dll" !IF "$(DEBUG)"=="yes" CARES_LIBS = caresd.lib @@ -178,15 +198,25 @@ CARES = static !ENDIF !IFDEF USE_CARES -CARES_CFLAGS = /DUSE_ARES /I"$(DEVEL_INCLUDE)/cares" +CARES_CFLAGS = /DUSE_ARES /I"$(CARES_INC_DIR)" +!ENDIF + + +!IFDEF ZLIB_PATH +ZLIB_INC_DIR = $(ZLIB_PATH)\include +ZLIB_LIB_DIR = $(ZLIB_PATH)\lib +ZLIB_LFLAGS = $(ZLIB_LFLAGS) "/LIBPATH:$(ZLIB_LIB_DIR)" +!ELSE +ZLIB_INC_DIR = $(DEVEL_INCLUDE) +ZLIB_LIB_DIR = $(DEVEL_LIB) !ENDIF # Depending on how zlib is built the libraries have different names, we # try to handle them all. !IF "$(WITH_ZLIB)"=="dll" -!IF EXISTS("$(DEVEL_LIB)\zlibwapi.lib") +!IF EXISTS("$(ZLIB_LIB_DIR)\zlibwapi.lib") ZLIB_LIBS = zlibwapi.lib -!ELSEIF EXISTS("$(DEVEL_LIB)\zdll.lib") +!ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zdll.lib") ZLIB_LIBS = zdll.lib !ELSE ZLIB_LIBS = zlib.lib @@ -194,9 +224,9 @@ ZLIB_LIBS = zlib.lib USE_ZLIB = true ZLIB = dll !ELSEIF "$(WITH_ZLIB)"=="static" -!IF EXISTS("$(DEVEL_LIB)\zlibstat.lib") +!IF EXISTS("$(ZLIB_LIB_DIR)\zlibstat.lib") ZLIB_LIBS = zlibstat.lib -!ELSEIF EXISTS("$(DEVEL_LIB)\zlib.lib") +!ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlib.lib") ZLIB_LIBS = zlib.lib !ELSE ZLIB_LIBS = zlib_a.lib @@ -206,23 +236,38 @@ ZLIB = static !ENDIF !IFDEF USE_ZLIB -ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ +ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I"$(ZLIB_INC_DIR)" !ENDIF +!IFDEF SSH2_PATH +SSH2_INC_DIR= $(SSH2_PATH)\include +SSH2_LIB_DIR= $(SSH2_PATH)\lib +SSH2_LFLAGS = $(SSH2_LFLAGS) "/LIBPATH:$(SSH2_LIB_DIR)" +!ELSE +SSH2_LIB_DIR= $(DEVEL_LIB) +SSH2_INC_DIR= $(DEVEL_INCLUDE)/libssh2 +!ENDIF + !IF "$(WITH_SSH2)"=="dll" SSH2_LIBS = libssh2.lib USE_SSH2 = true SSH2 = dll !ELSEIF "$(WITH_SSH2)"=="static" -SSH2_LIBS = libssh2_a.lib user32.lib +# libssh2 NMakefile on Windows at default creates a static library without _a suffix +!IF EXISTS("$(SSH2_LIB_DIR)\libssh2.lib") +SSH2_LIBS = libssh2.lib +!ELSE +SSH2_LIBS = libssh2_a.lib +!ENDIF +WIN_LIBS = $(WIN_LIBS) user32.lib USE_SSH2 = true SSH2 = static !ENDIF !IFDEF USE_SSH2 SSH2_CFLAGS = /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H /DLIBSSH2_WIN32 /DLIBSSH2_LIBRARY /DUSE_LIBSSH2 -SSH2_CFLAGS = $(SSH2_CFLAGS) /I$(WITH_DEVEL)/include/libssh2 +SSH2_CFLAGS = $(SSH2_CFLAGS) /I$(SSH2_INC_DIR) !ENDIF @@ -330,7 +375,7 @@ CURL_RC_FLAGS = /i../include /dDEBUGBUILD=0 /Fo $@ $(CURL_SRC_DIR)\curl.rc !IF "$(AS_DLL)" == "true" -LNK = $(LNKDLL) $(WIN_LIBS) /out:$(LIB_DIROBJ)\$(TARGET) +LNK = $(LNKDLL) $(LFLAGS) $(WIN_LIBS) /out:$(LIB_DIROBJ)\$(TARGET) !IF "$(DEBUG)"=="yes" TARGET = $(LIB_NAME_DLL_DEBUG) LNK = $(LNK) /DEBUG /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) @@ -354,7 +399,7 @@ PDB = $(PDB_NAME_STATIC_DEBUG) TARGET = $(LIB_NAME_STATIC) PDB = $(PDB_NAME_STATIC) !ENDIF -LNK = $(LNKLIB) $(WIN_LIBS) /out:$(LIB_DIROBJ)\$(TARGET) +LNK = $(LNKLIB) /out:$(LIB_DIROBJ)\$(TARGET) CURL_CC = $(CURL_CC) $(CFLAGS_LIBCURL_STATIC) # AS_DLL @@ -416,16 +461,6 @@ DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\ # CURL_LINK = link.exe /incremental:no /libpath:"$(DIRDIST)\lib" -#!IF "$(CFG)" == "release-ssh2-ssl-dll-zlib" -#TARGET = $(LIB_NAME_STATIC) -#LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBS) $(SSH2LIBS) $(SSL_LFLAGS) $(ZLIB_LFLAGS) $(LFLAGSSSH) /out:$(LIB_DIROBJ)\$(TARGET) -#CC = $(CCNODBG) $(RTLIB) $(SSL_CFLAGS) $(ZLIB_CFLAGS) $(CFLAGSLIB) $(SSH2_CFLAGS) -#CFGSET = TRUE -#!ENDIF - -####################### -# Only the clean target can be used if a config was not provided. -# !IF "$(CFGSET)" != "FALSE" # A mode was provided, so the library can be built. # @@ -462,7 +497,7 @@ $(TARGET): $(LIB_OBJS) $(LIB_DIROBJ) $(DISTDIR) @echo GenPDB: $(GEN_PDB) @echo Debug: $(DEBUG) @echo Machine: $(MACHINE) - $(LNK) $(LFLAGS) $(LIB_OBJS) + $(LNK) $(LIB_OBJS) @echo Copying libs... @if exist $(LIB_DIROBJ)\$(LIB_NAME_DLL) copy $(LIB_DIROBJ)\$(LIB_NAME_DLL) $(DIRDIST)\bin\ /y >nul 2<&1 @if exist $(LIB_DIROBJ)\$(LIB_NAME_STATIC) copy $(LIB_DIROBJ)\$(LIB_NAME_STATIC) $(DIRDIST)\lib\ /y >nul 2<&1 From d4382e9a62b08ed9dc014dbd2c39c1317d5d0700 Mon Sep 17 00:00:00 2001 From: kdekker Date: Wed, 11 Apr 2018 09:53:08 +0200 Subject: [PATCH 2/3] Documented xxx_PATH variables Some new variables have been introduced to tell locations of dependencies, e.g. for OpenSSL. Also removed a dangling URL that no longer worked. I was not able to find the IDN download at MSDN/microsoft.com, so it seems to be removed... --- winbuild/BUILD.WINDOWS.txt | 16 ++++++++++++++-- winbuild/Makefile.vc | 15 +++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/winbuild/BUILD.WINDOWS.txt b/winbuild/BUILD.WINDOWS.txt index 76887dcda8d26f..3953a83282dec7 100644 --- a/winbuild/BUILD.WINDOWS.txt +++ b/winbuild/BUILD.WINDOWS.txt @@ -89,12 +89,24 @@ where is one or many of: ENABLE_SSPI= - Enable SSPI support, defaults to yes ENABLE_IPV6= - Enable IPv6, defaults to yes ENABLE_IDN= - Enable use of Windows IDN APIs, defaults to yes - Requires Windows Vista or later, or installation from: - https://www.microsoft.com/downloads/details.aspx?FamilyID=AD6158D7-DDBA-416A-9109-07607425A815 + Requires Windows Vista or later ENABLE_WINSSL= - Enable native Windows SSL support, defaults to yes GEN_PDB= - Generate Program Database (debug symbols for release build) DEBUG= - Debug builds MACHINE= - Target architecture (default is x86) + CARES_PATH= - Alternative to the WITH_DEVEL option. + Provided path should point to c-ares include + and lib sub directories. + SSH2_PATH= - Alternative to the WITH_DEVEL option. + Provided path should point to libSSH2 include + and lib sub directories. + SSL_PATH= - Alternative to the WITH_DEVEL option. + Provided path should point to OpenSSL include + and lib sub directories. + ZLIB_PATH= - Alternative to the WITH_DEVEL option. + Provided path should point to zlib include + and lib sub directories. + Static linking of Microsoft's C RunTime (CRT): ============================================== diff --git a/winbuild/Makefile.vc b/winbuild/Makefile.vc index b3d0e46070c7bb..1179173e6ca8ab 100644 --- a/winbuild/Makefile.vc +++ b/winbuild/Makefile.vc @@ -49,14 +49,25 @@ CFGSET=true !MESSAGE WITH_SSH2= - Enable libSSH2 support, DLL or static !MESSAGE WITH_MBEDTLS= - Enable mbedTLS support, DLL or static !MESSAGE ENABLE_IDN= - Enable use of Windows IDN APIs, defaults to yes -!MESSAGE Requires Windows Vista or later, or installation from: -!MESSAGE https://www.microsoft.com/en-us/download/details.aspx?id=734 +!MESSAGE Requires Windows Vista or later !MESSAGE ENABLE_IPV6= - Enable IPv6, defaults to yes !MESSAGE ENABLE_SSPI= - Enable SSPI support, defaults to yes !MESSAGE ENABLE_WINSSL= - Enable native Windows SSL support, defaults to yes !MESSAGE GEN_PDB= - Generate Program Database (debug symbols for release build) !MESSAGE DEBUG= - Debug builds !MESSAGE MACHINE= - Target architecture (default x64 on AMD64, x86 on others) +!MESSAGE CARES_PATH= - Alternative to the WITH_DEVEL option. +!MESSAGE Provided path should point to c-ares include +!MESSAGE and lib sub directories. +!MESSAGE SSH2_PATH= - Alternative to the WITH_DEVEL option. +!MESSAGE Provided path should point to libSSH2 include +!MESSAGE and lib sub directories. +!MESSAGE SSL_PATH= - Alternative to the WITH_DEVEL option. +!MESSAGE Provided path should point to OpenSSL include +!MESSAGE and lib sub directories. +!MESSAGE ZLIB_PATH= - Alternative to the WITH_DEVEL option. +!MESSAGE Provided path should point to zlib include +!MESSAGE and lib sub directories. !ERROR please choose a valid mode !ENDIF From 7a1bf738620ef5f27c2ca7d2e02d5edec655fd20 Mon Sep 17 00:00:00 2001 From: kdekker Date: Mon, 16 Apr 2018 09:22:44 +0200 Subject: [PATCH 3/3] Allow to provide custom path to NGHTTP2 and/or MBEDTLS As requested by Jay Satiro: added similar possibility for remaining 2 left-overs (NGHTTP/2 and mbedTLS) similar to was done before for zlib, openssl, libssb2, cares. Also applied proposed change to the documentation (including the 2 new xxx_PATH possibilities). --- winbuild/BUILD.WINDOWS.txt | 56 +++++++++++++++++--------------------- winbuild/Makefile.vc | 56 +++++++++++++++++--------------------- winbuild/MakefileBuild.vc | 26 ++++++++++++++++-- 3 files changed, 73 insertions(+), 65 deletions(-) diff --git a/winbuild/BUILD.WINDOWS.txt b/winbuild/BUILD.WINDOWS.txt index 3953a83282dec7..874fc9c6968ca3 100644 --- a/winbuild/BUILD.WINDOWS.txt +++ b/winbuild/BUILD.WINDOWS.txt @@ -75,37 +75,31 @@ a directory named using the options given to the nmake call. nmake /f Makefile.vc mode= where is one or many of: - VC=<6,7,8,9,10,11,12,14,15> - VC versions - WITH_DEVEL= - Paths for the development files (SSL, zlib, etc.) - Defaults to sibbling directory deps: ../deps - Libraries can be fetched at http://windows.php.net/downloads/php-sdk/deps/ - Uncompress them into the deps folder. - WITH_SSL= - Enable OpenSSL support, DLL or static - WITH_NGHTTP2= - Enable HTTP/2 support, DLL or static - WITH_MBEDTLS= - Enable mbedTLS support, DLL or static - WITH_CARES= - Enable c-ares support, DLL or static - WITH_ZLIB= - Enable zlib support, DLL or static - WITH_SSH2= - Enable libSSH2 support, DLL or static - ENABLE_SSPI= - Enable SSPI support, defaults to yes - ENABLE_IPV6= - Enable IPv6, defaults to yes - ENABLE_IDN= - Enable use of Windows IDN APIs, defaults to yes - Requires Windows Vista or later - ENABLE_WINSSL= - Enable native Windows SSL support, defaults to yes - GEN_PDB= - Generate Program Database (debug symbols for release build) - DEBUG= - Debug builds - MACHINE= - Target architecture (default is x86) - CARES_PATH= - Alternative to the WITH_DEVEL option. - Provided path should point to c-ares include - and lib sub directories. - SSH2_PATH= - Alternative to the WITH_DEVEL option. - Provided path should point to libSSH2 include - and lib sub directories. - SSL_PATH= - Alternative to the WITH_DEVEL option. - Provided path should point to OpenSSL include - and lib sub directories. - ZLIB_PATH= - Alternative to the WITH_DEVEL option. - Provided path should point to zlib include - and lib sub directories. + VC=<6,7,8,9,10,11,12,14,15> - VC versions + WITH_DEVEL= - Paths for the development files (SSL, zlib, etc.) + Defaults to sibbling directory deps: ../deps + Libraries can be fetched at http://windows.php.net/downloads/php-sdk/deps/ + Uncompress them into the deps folder. + WITH_SSL= - Enable OpenSSL support, DLL or static + WITH_NGHTTP2= - Enable HTTP/2 support, DLL or static + WITH_MBEDTLS= - Enable mbedTLS support, DLL or static + WITH_CARES= - Enable c-ares support, DLL or static + WITH_ZLIB= - Enable zlib support, DLL or static + WITH_SSH2= - Enable libSSH2 support, DLL or static + ENABLE_SSPI= - Enable SSPI support, defaults to yes + ENABLE_IPV6= - Enable IPv6, defaults to yes + ENABLE_IDN= - Enable use of Windows IDN APIs, defaults to yes + Requires Windows Vista or later + ENABLE_WINSSL= - Enable native Windows SSL support, defaults to yes + GEN_PDB= - Generate Program Database (debug symbols for release build) + DEBUG= - Debug builds + MACHINE= - Target architecture (default is x86) + CARES_PATH= - Custom path for c-ares. + MBEDTLS_PATH= - Custom path for mbedTLS + NGHHTP2_PATH= - Custom path for HTTP/2 + SSH2_PATH= - Custom path for libSSH2. + SSL_PATH= - Custom path for OpenSSL. + ZLIB_PATH= - Custom path for zlib. Static linking of Microsoft's C RunTime (CRT): diff --git a/winbuild/Makefile.vc b/winbuild/Makefile.vc index 1179173e6ca8ab..d1a70f9eb2aea1 100644 --- a/winbuild/Makefile.vc +++ b/winbuild/Makefile.vc @@ -37,37 +37,31 @@ CFGSET=true !MESSAGE Usage: nmake /f Makefile.vc mode= !MESSAGE where is one or many of: -!MESSAGE VC=<6,7,8,9,10,11,12,14,15> - VC versions -!MESSAGE WITH_DEVEL= - Paths for the development files (SSL, zlib, etc.) -!MESSAGE Defaults to sibbling directory deps: ../deps -!MESSAGE Libraries can be fetched at http://pecl2.php.net/downloads/php-windows-builds/ -!MESSAGE Uncompress them into the deps folder. -!MESSAGE WITH_SSL= - Enable OpenSSL support, DLL or static -!MESSAGE WITH_NGHTTP2= - Enable HTTP/2 support, DLL or static -!MESSAGE WITH_CARES= - Enable c-ares support, DLL or static -!MESSAGE WITH_ZLIB= - Enable zlib support, DLL or static -!MESSAGE WITH_SSH2= - Enable libSSH2 support, DLL or static -!MESSAGE WITH_MBEDTLS= - Enable mbedTLS support, DLL or static -!MESSAGE ENABLE_IDN= - Enable use of Windows IDN APIs, defaults to yes -!MESSAGE Requires Windows Vista or later -!MESSAGE ENABLE_IPV6= - Enable IPv6, defaults to yes -!MESSAGE ENABLE_SSPI= - Enable SSPI support, defaults to yes -!MESSAGE ENABLE_WINSSL= - Enable native Windows SSL support, defaults to yes -!MESSAGE GEN_PDB= - Generate Program Database (debug symbols for release build) -!MESSAGE DEBUG= - Debug builds -!MESSAGE MACHINE= - Target architecture (default x64 on AMD64, x86 on others) -!MESSAGE CARES_PATH= - Alternative to the WITH_DEVEL option. -!MESSAGE Provided path should point to c-ares include -!MESSAGE and lib sub directories. -!MESSAGE SSH2_PATH= - Alternative to the WITH_DEVEL option. -!MESSAGE Provided path should point to libSSH2 include -!MESSAGE and lib sub directories. -!MESSAGE SSL_PATH= - Alternative to the WITH_DEVEL option. -!MESSAGE Provided path should point to OpenSSL include -!MESSAGE and lib sub directories. -!MESSAGE ZLIB_PATH= - Alternative to the WITH_DEVEL option. -!MESSAGE Provided path should point to zlib include -!MESSAGE and lib sub directories. +!MESSAGE VC=<6,7,8,9,10,11,12,14,15> - VC versions +!MESSAGE WITH_DEVEL= - Paths for the development files (SSL, zlib, etc.) +!MESSAGE Defaults to sibbling directory deps: ../deps +!MESSAGE Libraries can be fetched at http://pecl2.php.net/downloads/php-windows-builds/ +!MESSAGE Uncompress them into the deps folder. +!MESSAGE WITH_SSL= - Enable OpenSSL support, DLL or static +!MESSAGE WITH_NGHTTP2= - Enable HTTP/2 support, DLL or static +!MESSAGE WITH_CARES= - Enable c-ares support, DLL or static +!MESSAGE WITH_ZLIB= - Enable zlib support, DLL or static +!MESSAGE WITH_SSH2= - Enable libSSH2 support, DLL or static +!MESSAGE WITH_MBEDTLS= - Enable mbedTLS support, DLL or static +!MESSAGE ENABLE_IDN= - Enable use of Windows IDN APIs, defaults to yes +!MESSAGE Requires Windows Vista or later +!MESSAGE ENABLE_IPV6= - Enable IPv6, defaults to yes +!MESSAGE ENABLE_SSPI= - Enable SSPI support, defaults to yes +!MESSAGE ENABLE_WINSSL= - Enable native Windows SSL support, defaults to yes +!MESSAGE GEN_PDB= - Generate Program Database (debug symbols for release build) +!MESSAGE DEBUG= - Debug builds +!MESSAGE MACHINE= - Target architecture (default x64 on AMD64, x86 on others) +!MESSAGE CARES_PATH= - Custom path for c-ares. +!MESSAGE MBEDTLS_PATH= - Custom path for mbedTLS +!MESSAGE NGHHTP2_PATH= - Custom path for HTTP/2 +!MESSAGE SSH2_PATH= - Custom path for libSSH2. +!MESSAGE SSL_PATH= - Custom path for OpenSSL. +!MESSAGE ZLIB_PATH= - Custom path for zlib. !ERROR please choose a valid mode !ENDIF diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc index 45a3f0d43e23ad..5f994cb30353c4 100644 --- a/winbuild/MakefileBuild.vc +++ b/winbuild/MakefileBuild.vc @@ -154,18 +154,38 @@ SSL_CFLAGS = $(SSL_CFLAGS) /DHAVE_BORINGSSL !ENDIF !ENDIF + +!IFDEF NGHTTP2_PATH +NGHTTP2_INC_DIR = $(NGHTTP2_PATH)\include +NGHTTP2_LIB_DIR = $(NGHTTP2_PATH)\lib +NGHTTP2_LFLAGS = $(NGHTTP2_LFLAGS) "/LIBPATH:$(NGHTTP2_LIB_DIR)" +!ELSE +NGHTTP2_INC_DIR = $(DEVEL_INCLUDE) +NGHTTP2_LIB_DIR = $(DEVEL_LIB) +!ENDIF + !IF "$(WITH_NGHTTP2)"=="dll" -NGHTTP2_CFLAGS = /DUSE_NGHTTP2 +NGHTTP2_CFLAGS = /DUSE_NGHTTP2 /I"$(NGHTTP2_INC_DIR)" NGHTTP2_LIBS = nghttp2.lib !ELSEIF "$(WITH_NGHTTP2)"=="static" -NGHTTP2_CFLAGS = /DUSE_NGHTTP2 /DNGHTTP2_STATICLIB +NGHTTP2_CFLAGS = /DUSE_NGHTTP2 /DNGHTTP2_STATICLIB /I"$(NGHTTP2_INC_DIR)" NGHTTP2_LIBS = nghttp2_static.lib !ENDIF + +!IFDEF MBEDTLS_PATH +MBEDTLS_INC_DIR = $(MBEDTLS_PATH)\include +MBEDTLS_LIB_DIR = $(MBEDTLS_PATH)\lib +MBEDTLS_LFLAGS = $(MBEDTLS_LFLAGS) "/LIBPATH:$(MBEDTLS_LIB_DIR)" +!ELSE +MBEDTLS_INC_DIR = $(DEVEL_INCLUDE) +MBEDTLS_LIB_DIR = $(DEVEL_LIB) +!ENDIF + !IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static" USE_MBEDTLS = true MBEDTLS = $(WITH_MBEDTLS) -MBEDTLS_CFLAGS = /DUSE_MBEDTLS +MBEDTLS_CFLAGS = /DUSE_MBEDTLS /I"$(MBEDTLS_INC_DIR)" MBEDTLS_LIBS = mbedtls.lib mbedcrypto.lib mbedx509.lib !ENDIF