diff --git a/toolchain-mipsel/build_toolchain_O3 b/toolchain-mipsel/build_toolchain_O3 old mode 100644 new mode 100755 index a9d74613..ac6e1831 --- a/toolchain-mipsel/build_toolchain_O3 +++ b/toolchain-mipsel/build_toolchain_O3 @@ -114,7 +114,7 @@ if [ "$DO_UNPACK" = "YES" ]; then [ -f ${i} ] && patch -p1 < ${i} done cd .. - pypy /media/Storage/workspace/router/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 + pypy /media/Storage/workspace/router/TMRAF/tools/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 fi if [ "$DO_HEADERS" = "YES" ]; then @@ -123,7 +123,7 @@ if [ "$DO_HEADERS" = "YES" ]; then rm -rf "$PREFIX/usr/include" cp -rf "$TARGET_DIR/include" "$PREFIX/include" cp -fv ${ID_UCLIBC}.config $ID_UCLIBC/.config - pypy /media/Storage/workspace/router/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 + pypy /media/Storage/workspace/router/TMRAF/tools/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 make -C $ID_UCLIBC install_headers mkdir -p "$PREFIX/usr" ln -sf ../include "$PREFIX/usr/include" @@ -135,7 +135,7 @@ if [ "$DO_BINUTILS" = "YES" ]; then (../$ID_BINUTILS/configure --target=$TARGET --prefix="$PREFIX" \ --with-sysroot="$PREFIX" --with-build-sysroot="$PREFIX" \ --disable-nls --disable-werror --disable-multilib && - pypy /media/Storage/workspace/router/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 + pypy /media/Storage/workspace/router/TMRAF/tools/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 make -j${HOST_NCPU} && \ make install) || exit 1 cd .. @@ -152,7 +152,7 @@ if [ "$DO_GCC" = "YES" ]; then --disable-libgomp --disable-nls \ --with-sysroot="$PREFIX" \ --enable-languages=c && \ - pypy /media/Storage/workspace/router/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 + pypy /media/Storage/workspace/router/TMRAF/tools/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 make -j${HOST_NCPU} && \ make install) || exit 1 cd .. @@ -161,7 +161,7 @@ fi if [ "$DO_UCLIBC" = "YES" ]; then echo "=====================BUILD-UCLIBC=======================" cp -fv ${ID_UCLIBC}.config $ID_UCLIBC/.config - pypy /media/Storage/workspace/router/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 + pypy /media/Storage/workspace/router/TMRAF/tools/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 cd $ID_UCLIBC (make -j${HOST_NCPU} && \ make install) || exit 1 @@ -179,12 +179,14 @@ if [ "$DO_GCCCPP" = "YES" ]; then --disable-libgomp --disable-nls \ --with-sysroot="$PREFIX" \ --enable-languages=c++ && \ - pypy /media/Storage/workspace/router/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 + pypy /media/Storage/workspace/router/TMRAF/tools/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 make -j${HOST_NCPU} all-host all-target-libgcc all-target-libstdc++-v3 && \ make install-host install-target-libgcc install-target-libstdc++-v3) || exit 1 cd .. fi +pypy /media/Storage/workspace/router/TMRAF/tools/redirectOptimize.py /media/Storage/workspace/router/rt-n56u/toolchain-mipsel/ O2 O3 + # sanity if [ "$GCCMJ" = "4.4" ] ; then cp -rf "$PREFIX/man" "$PREFIX/share" && rm -rf "$PREFIX/man" diff --git a/trunk/libs/libcurl/curl-7.62.x/docs/examples/Makefile.m32 b/trunk/libs/libcurl/curl-7.62.x/docs/examples/Makefile.m32 index 160afb62..2f42b056 100644 --- a/trunk/libs/libcurl/curl-7.62.x/docs/examples/Makefile.m32 +++ b/trunk/libs/libcurl/curl-7.62.x/docs/examples/Makefile.m32 @@ -101,7 +101,7 @@ CURL_AR := $(CROSSPREFIX)ar endif CC = $(CURL_CC) -CFLAGS = $(CURL_CFLAG_EXTRAS) -g -O2 -Wall -W +CFLAGS = $(CURL_CFLAG_EXTRAS) -g -O3 -Wall -W CFLAGS += -fno-strict-aliasing # comment LDFLAGS below to keep debug info LDFLAGS = $(CURL_LDFLAG_EXTRAS) $(CURL_LDFLAG_EXTRAS_EXE) -s diff --git a/trunk/libs/libcurl/curl-7.62.x/docs/examples/Makefile.netware b/trunk/libs/libcurl/curl-7.62.x/docs/examples/Makefile.netware index 9b6c69b8..f6bf6ea8 100644 --- a/trunk/libs/libcurl/curl-7.62.x/docs/examples/Makefile.netware +++ b/trunk/libs/libcurl/curl-7.62.x/docs/examples/Makefile.netware @@ -81,7 +81,7 @@ DB = NDEBUG endif # Optimization: -O or debugging: -g ifeq ($(DB),NDEBUG) - OPT = -O2 + OPT = -O3 OBJDIR = release else OPT = -g diff --git a/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.m32 b/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.m32 index ae88f4dc..871d5954 100644 --- a/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.m32 +++ b/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.m32 @@ -92,7 +92,7 @@ CURL_RANLIB := $(CROSSPREFIX)ranlib endif CC = $(CURL_CC) -CFLAGS = $(CURL_CFLAG_EXTRAS) -g -O2 -Wall -W +CFLAGS = $(CURL_CFLAG_EXTRAS) -g -O3 -Wall -W CFLAGS += -fno-strict-aliasing # comment LDFLAGS below to keep debug info LDFLAGS = $(CURL_LDFLAG_EXTRAS) $(CURL_LDFLAG_EXTRAS_DLL) -s diff --git a/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.netware b/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.netware index fa6beec0..96796c11 100644 --- a/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.netware +++ b/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.netware @@ -108,7 +108,7 @@ DB = NDEBUG endif # Optimization: -O or debugging: -g ifeq ($(DB),NDEBUG) - OPT = -O2 + OPT = -O3 OBJDIR = release else OPT = -g diff --git a/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.vxworks b/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.vxworks index 7ff197f0..bbcd7e54 100644 --- a/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.vxworks +++ b/trunk/libs/libcurl/curl-7.62.x/lib/Makefile.vxworks @@ -52,7 +52,7 @@ CFLAGS := -D__GNUC__ -D__ppc__ -msoft-float -fno-builtin -mcpu=604 -mlongcall -D LDFLAGS := -nostdlib -Wl,-i -Wl,-X INCLUDE_FLAG := -I C_DEBUGFLAG := -g -C_OPTFLAG := -O2 +C_OPTFLAG := -O3 COMPILE_ONLY_FLAG := -c OBJ_EXTENSION := .o CC_OBJ_OUTPUT = -o $@ diff --git a/trunk/libs/libcurl/curl-7.62.x/lib/makefile.amiga b/trunk/libs/libcurl/curl-7.62.x/lib/makefile.amiga index 673b147c..4bb07fa5 100644 --- a/trunk/libs/libcurl/curl-7.62.x/lib/makefile.amiga +++ b/trunk/libs/libcurl/curl-7.62.x/lib/makefile.amiga @@ -8,7 +8,7 @@ ATCPSDKI= /GG/netinclude CC = m68k-amigaos-gcc -CFLAGS = -I$(ATCPSDKI) -m68020-60 -O2 -msoft-float -noixemul -g -I. -I../include -W -Wall +CFLAGS = -I$(ATCPSDKI) -m68020-60 -O3 -msoft-float -noixemul -g -I. -I../include -W -Wall include Makefile.inc OBJS = $(CSOURCES:.c=.o) diff --git a/trunk/libs/libcurl/curl-7.62.x/src/Makefile.m32 b/trunk/libs/libcurl/curl-7.62.x/src/Makefile.m32 index e13db04b..ecbaa4e9 100644 --- a/trunk/libs/libcurl/curl-7.62.x/src/Makefile.m32 +++ b/trunk/libs/libcurl/curl-7.62.x/src/Makefile.m32 @@ -101,7 +101,7 @@ CURL_AR := $(CROSSPREFIX)ar endif CC = $(CURL_CC) -CFLAGS = $(CURL_CFLAG_EXTRAS) -g -O2 -Wall -W +CFLAGS = $(CURL_CFLAG_EXTRAS) -g -O3 -Wall -W CFLAGS += -fno-strict-aliasing # comment LDFLAGS below to keep debug info LDFLAGS = $(CURL_LDFLAG_EXTRAS) $(CURL_LDFLAG_EXTRAS_EXE) -s diff --git a/trunk/libs/libcurl/curl-7.62.x/src/Makefile.netware b/trunk/libs/libcurl/curl-7.62.x/src/Makefile.netware index 7f58bcd6..5946aeeb 100644 --- a/trunk/libs/libcurl/curl-7.62.x/src/Makefile.netware +++ b/trunk/libs/libcurl/curl-7.62.x/src/Makefile.netware @@ -123,7 +123,7 @@ DB = NDEBUG endif # Optimization: -O or debugging: -g ifeq ($(DB),NDEBUG) - OPT = -O2 + OPT = -O3 OBJDIR = release else OPT = -g diff --git a/trunk/libs/libcurl/curl-7.62.x/src/makefile.amiga b/trunk/libs/libcurl/curl-7.62.x/src/makefile.amiga index 3bc0080f..489ad87c 100644 --- a/trunk/libs/libcurl/curl-7.62.x/src/makefile.amiga +++ b/trunk/libs/libcurl/curl-7.62.x/src/makefile.amiga @@ -8,7 +8,7 @@ ATCPSDKI= /GG/netinclude CC = m68k-amigaos-gcc -CFLAGS = -I$(ATCPSDKI) -m68020-60 -O2 -msoft-float -noixemul -g -I. -I../include -W -Wall +CFLAGS = -I$(ATCPSDKI) -m68020-60 -O3 -msoft-float -noixemul -g -I. -I../include -W -Wall LIBS = ../lib/libcurl.a -lssl -lcrypto -lz MANPAGE = ../docs/curl.1 README = ../docs/MANUAL diff --git a/trunk/libs/libcurl/curl-7.62.x/winbuild/MakefileBuild.vc b/trunk/libs/libcurl/curl-7.62.x/winbuild/MakefileBuild.vc index 5cda3900..5b1f4c34 100644 --- a/trunk/libs/libcurl/curl-7.62.x/winbuild/MakefileBuild.vc +++ b/trunk/libs/libcurl/curl-7.62.x/winbuild/MakefileBuild.vc @@ -1,628 +1,628 @@ -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) 1999 - 2018, Daniel Stenberg, , et al. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the COPYING file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -#*************************************************************************** - -########################################################################### -# -# Makefile for building libcurl with MSVC 6 through to 15 -# -# Usage: see usage message below -# Should be invoked from winbuild directory -# Edit the paths and desired library name -# SSL path is only required if you intend compiling -# with SSL. -# -# This make file leaves the result either a .lib or .dll file -# in the \lib directory. It should be called from the \lib -# directory. -# -# An option would have been to allow the source directory to -# be specified, but I saw no requirement. -# -# Another option would have been to leave the .lib and .dll -# files in the "cfg" directory, but then the make file -# in \src would need to be changed. -# -############################################################## - -CFGSET=FALSE -WINBUILD_DIR=`cd` - -# Utilities. -# If a path is required that contains characters such as space, quote the path. -MT = mt.exe -RC = rc.exe -ZIP = zip.exe - -# Allow changing C compiler via environment variable CC (default cl.exe) -# This command macro is not set by default: https://msdn.microsoft.com/en-us/library/ms933742.aspx -!If "$(CC)" == "" -CC = cl.exe -!Endif - -!IF "$(VC)"=="6" -CC_NODEBUG = $(CC) /O2 /DNDEBUG -CC_DEBUG = $(CC) /Od /Gm /Zi /D_DEBUG /GZ -CFLAGS = /I. /I../lib /I../include /nologo /W4 /wd4127 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL -!ELSE -CC_NODEBUG = $(CC) /O2 /DNDEBUG -CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd -CFLAGS = /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL -!ENDIF - -LFLAGS = /nologo /machine:$(MACHINE) -LNKDLL = link.exe /DLL -# 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 - -CFLAGS_LIBCURL_STATIC = /DCURL_STATICLIB - -WIN_LIBS = ws2_32.lib wldap32.lib advapi32.lib crypt32.lib - -BASE_NAME = libcurl -BASE_NAME_DEBUG = $(BASE_NAME)_debug -BASE_NAME_STATIC = $(BASE_NAME)_a -BASE_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC)_debug - -LIB_NAME_STATIC = $(BASE_NAME_STATIC).lib -LIB_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC_DEBUG).lib -LIB_NAME_DLL = $(BASE_NAME).dll -LIB_NAME_IMP = $(BASE_NAME).lib -LIB_NAME_DLL_DEBUG = $(BASE_NAME_DEBUG).dll -LIB_NAME_IMP_DEBUG = $(BASE_NAME_DEBUG).lib - -PDB_NAME_STATIC = $(BASE_NAME_STATIC).pdb -PDB_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC_DEBUG).pdb -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 = /out:$(DIRDIST)\bin\$(PROGRAM_NAME) /subsystem:console $(LFLAGS) -CURL_RESFLAGS = /i../include - -############################################################# -## Nothing more to do below this line! -LIBCURL_SRC_DIR = ..\lib -CURL_SRC_DIR = ..\src - -!IFNDEF WITH_DEVEL -WITH_DEVEL = ../../deps -!ENDIF -DEVEL_INCLUDE= $(WITH_DEVEL)/include -DEVEL_LIB = $(WITH_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" || "$(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 = $(WITH_SSL) -!IF "$(WITH_SSL)"=="static" -WIN_LIBS = $(WIN_LIBS) gdi32.lib user32.lib crypt32.lib -!ENDIF -!ENDIF - -!IFDEF USE_SSL -SSL_CFLAGS = /DUSE_OPENSSL /I"$(SSL_INC_DIR)" -!IF EXISTS("$(SSL_INC_DIR)\is_boringssl.h") -SSL_CFLAGS = $(SSL_CFLAGS) /DHAVE_BORINGSSL -!ENDIF -!IF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="false" -SSL_CFLAGS = $(SSL_CFLAGS) /DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG -!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 /I"$(NGHTTP2_INC_DIR)" -NGHTTP2_LIBS = nghttp2.lib -!ELSEIF "$(WITH_NGHTTP2)"=="static" -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 /I"$(MBEDTLS_INC_DIR)" -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 -!ELSE -CARES_LIBS = cares.lib -!ENDIF -USE_CARES = true -CARES = dll -!ELSEIF "$(WITH_CARES)"=="static" -!IF "$(DEBUG)"=="yes" -CARES_LIBS = libcaresd.lib -!ELSE -CARES_LIBS = libcares.lib -!ENDIF -USE_CARES = true -CARES = static -!ENDIF - -!IFDEF USE_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("$(ZLIB_LIB_DIR)\zlibwapi.lib") -ZLIB_LIBS = zlibwapi.lib -!ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zdll.lib") -ZLIB_LIBS = zdll.lib -!ELSE -ZLIB_LIBS = zlib.lib -!ENDIF -USE_ZLIB = true -ZLIB = dll -!ELSEIF "$(WITH_ZLIB)"=="static" -!IF EXISTS("$(ZLIB_LIB_DIR)\zlibstat.lib") -ZLIB_LIBS = zlibstat.lib -!ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlib.lib") -ZLIB_LIBS = zlib.lib -!ELSE -ZLIB_LIBS = zlib_a.lib -!ENDIF -USE_ZLIB = true -ZLIB = static -!ENDIF - -!IFDEF USE_ZLIB -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" -# 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$(SSH2_INC_DIR) -!ENDIF - - -!IFNDEF USE_IDN -USE_IDN = true -!ELSEIF "$(USE_IDN)"=="yes" -USE_IDN = true -!ENDIF - -!IF "$(USE_IDN)"=="true" -IDN_CFLAGS = $(IDN_CFLAGS) /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES -WIN_LIBS = $(WIN_LIBS) Normaliz.lib -!ENDIF - - -!IFNDEF USE_IPV6 -USE_IPV6 = true -!ELSEIF "$(USE_IPV6)"=="yes" -USE_IPV6 = true -!ENDIF - -!IF "$(USE_IPV6)"=="true" -IPV6_CFLAGS = $(IPV6_CFLAGS) /DUSE_IPV6 -!ENDIF - - -!IFNDEF USE_SSPI -USE_SSPI = true -!ELSEIF "$(USE_SSPI)"=="yes" -USE_SSPI = true -!ENDIF - -!IF "$(USE_SSPI)"=="true" -SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_WINDOWS_SSPI -!ENDIF - - -!IFNDEF USE_WINSSL -!IF "$(USE_SSL)"=="true" -USE_WINSSL = false -!ELSE -USE_WINSSL = $(USE_SSPI) -!ENDIF -!ELSEIF "$(USE_WINSSL)"=="yes" -USE_WINSSL = true -!ENDIF - - -!IF "$(USE_WINSSL)"=="true" -!IF "$(USE_SSPI)"!="true" -!ERROR cannot build with WinSSL without SSPI -!ENDIF -SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_SCHANNEL -WIN_LIBS = $(WIN_LIBS) Crypt32.lib -!ENDIF - - -!IF "$(GEN_PDB)"=="yes" -GEN_PDB = true -!ENDIF - - -!IFDEF EMBED_MANIFEST -MANIFESTTOOL = $(MT) -manifest $(DIRDIST)\bin\$(PROGRAM_NAME).manifest -outputresource:$(DIRDIST)\bin\$(PROGRAM_NAME);1 -!ELSE -CURL_RC_FLAGS = $(CURL_RC_FLAGS) /dCURL_EMBED_MANIFEST -!ENDIF - -# Runtime library configuration -!IF "$(RTLIBCFG)"=="static" -RTLIB = /MT -RTLIB_DEBUG = /MTd -!ELSE -RTLIB = /MD -RTLIB_DEBUG = /MDd -!ENDIF - -!IF "$(MODE)"=="static" -TARGET = $(LIB_NAME_STATIC) -CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC) -AS_DLL = false -CFGSET = true -!ELSEIF "$(MODE)"=="dll" -TARGET = $(LIB_NAME_DLL) -CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP) -AS_DLL = true -CFGSET = true -!ENDIF - -!IF "$(CFGSET)" == "FALSE" -!ERROR please choose a valid mode -!ENDIF - - - -# CURL_XX macros are for the curl.exe command - -!IF "$(DEBUG)"=="yes" -RC_FLAGS = /dDEBUGBUILD=1 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc -CURL_CC = $(CC_DEBUG) $(RTLIB_DEBUG) -CURL_RC_FLAGS = /i../include /dDEBUGBUILD=1 /Fo $@ $(CURL_SRC_DIR)\curl.rc -!ELSE -RC_FLAGS = /dDEBUGBUILD=0 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc -CURL_CC = $(CC_NODEBUG) $(RTLIB) -CURL_RC_FLAGS = /i../include /dDEBUGBUILD=0 /Fo $@ $(CURL_SRC_DIR)\curl.rc -!ENDIF - -!IF "$(AS_DLL)" == "true" - -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) -PDB = $(PDB_NAME_DLL_DEBUG) -CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) -!ELSE -TARGET = $(LIB_NAME_DLL) -LNK = $(LNK) /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP) -PDB = $(PDB_NAME_DLL) -CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP) -!ENDIF -RESOURCE = $(LIB_DIROBJ)\libcurl.res - -# AS_DLL -!ELSE - -!IF "$(DEBUG)"=="yes" -TARGET = $(LIB_NAME_STATIC_DEBUG) -PDB = $(PDB_NAME_STATIC_DEBUG) -!ELSE -TARGET = $(LIB_NAME_STATIC) -PDB = $(PDB_NAME_STATIC) -!ENDIF -LNK = $(LNKLIB) /out:$(LIB_DIROBJ)\$(TARGET) -CURL_CC = $(CURL_CC) $(CFLAGS_LIBCURL_STATIC) - -# AS_DLL -!ENDIF - -!IF "$(USE_SSL)"=="true" -CFLAGS = $(CFLAGS) $(SSL_CFLAGS) -LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(SSL_LIBS) -!ENDIF - -!IF "$(USE_MBEDTLS)"=="true" -CFLAGS = $(CFLAGS) $(MBEDTLS_CFLAGS) -LFLAGS = $(LFLAGS) $(MBEDTLS_LFLAGS) $(MBEDTLS_LIBS) -!ENDIF - -!IF "$(USE_CARES)"=="true" -CFLAGS = $(CFLAGS) $(CARES_CFLAGS) -LFLAGS = $(LFLAGS) $(CARES_LFLAGS) $(CARES_LIBS) -!ENDIF - -!IF "$(USE_ZLIB)"=="true" -CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) -LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) $(ZLIB_LIBS) -!ENDIF - -!IF "$(USE_SSH2)"=="true" -CFLAGS = $(CFLAGS) $(SSH2_CFLAGS) -LFLAGS = $(LFLAGS) $(SSH2_LFLAGS) $(SSH2_LIBS) -!ENDIF - -!IF "$(USE_IDN)"=="true" -CFLAGS = $(CFLAGS) $(IDN_CFLAGS) -!ENDIF - -!IF "$(USE_IPV6)"=="true" -CFLAGS = $(CFLAGS) $(IPV6_CFLAGS) -!ENDIF - -!IF "$(USE_SSPI)"=="true" -CFLAGS = $(CFLAGS) $(SSPI_CFLAGS) -!ENDIF - -!IF "$(USE_NGHTTP2)"=="true" -CFLAGS = $(CFLAGS) $(NGHTTP2_CFLAGS) -LFLAGS = $(LFLAGS) $(NGHTTP2_LFLAGS) $(NGHTTP2_LIBS) -!ENDIF - -!IF "$(GEN_PDB)"=="true" -CFLAGS = $(CFLAGS) $(CFLAGS_PDB) /Fd"$(LIB_DIROBJ)\$(PDB)" -LFLAGS = $(LFLAGS) $(LFLAGS_PDB) -!ENDIF - -LIB_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib -CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl -DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\ - -# -# curl.exe -# -CURL_LINK = link.exe /incremental:no /libpath:"$(DIRDIST)\lib" - -!IF "$(CFGSET)" != "FALSE" -# A mode was provided, so the library can be built. -# -!include CURL_OBJS.inc -!include LIBCURL_OBJS.inc - -!IF "$(AS_DLL)" == "true" -LIB_OBJS = $(LIBCURL_OBJS) $(RESOURCE) -!ELSE -LIB_OBJS = $(LIBCURL_OBJS) -!ENDIF - -EXE_OBJS = $(CURL_OBJS) $(CURL_DIROBJ)\curl.res - -all : $(TARGET) $(PROGRAM_NAME) - -package: $(TARGET) - @cd $(DIRDIST) - @-$(ZIP) -9 -q -r ..\$(CONFIG_NAME_LIB).zip .>nul 2<&1 - @cd $(MAKEDIR) - -$(TARGET): $(LIB_OBJS) $(LIB_DIROBJ) $(DIRDIST) - @echo Using SSL: $(USE_SSL) - @echo Using NGHTTP2: $(USE_NGHTTP2) - @echo Using c-ares: $(USE_CARES) - @echo Using SSH2: $(USE_SSH2) - @echo Using ZLIB: $(USE_ZLIB) - @echo Using IDN: $(USE_IDN) - @echo Using IPv6: $(USE_IPV6) - @echo Using SSPI: $(USE_SSPI) - @echo Using WinSSL: $(USE_WINSSL) - @echo CFLAGS: $(CFLAGS) - @echo LFLAGS: $(LFLAGS) - @echo GenPDB: $(GEN_PDB) - @echo Debug: $(DEBUG) - @echo Machine: $(MACHINE) - $(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 - @if exist $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) $(DIRDIST)\bin\ /y >nul 2<&1 - @if exist $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) $(DIRDIST)\lib\ /y >nul 2<&1 - @if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP) $(DIRDIST)\lib\ /y >nul 2<&1 - @if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) $(DIRDIST)\lib >nul 2<&1 - @-copy $(LIB_DIROBJ)\*.exp $(DIRDIST)\lib /y >nul 2<&1 - @-copy $(LIB_DIROBJ)\*.pdb $(DIRDIST)\lib /y >nul 2<&1 - @-copy ..\include\curl\*.h $(DIRDIST)\include\curl\ /y >nul 2<&1 - -$(LIB_OBJS): $(LIB_DIROBJ) $(DIRDIST) - -$(DIRDIST): - @if not exist "$(DIRDIST)\bin" mkdir $(DIRDIST)\bin - @if not exist "$(DIRDIST)\include" mkdir $(DIRDIST)\include - @if not exist "$(DIRDIST)\include\curl" mkdir $(DIRDIST)\include\curl - @if not exist "$(DIRDIST)\lib" mkdir $(DIRDIST)\lib - -$(LIB_DIROBJ): - @if not exist "$(LIB_DIROBJ)" mkdir $(LIB_DIROBJ) - @if not exist "$(LIB_DIROBJ)\vauth" mkdir $(LIB_DIROBJ)\vauth - @if not exist "$(LIB_DIROBJ)\vtls" mkdir $(LIB_DIROBJ)\vtls - -$(CURL_DIROBJ): - @if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ) -# we need a lib dir for the portability functions from libcurl -# we use the .c directly here - @if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)\lib - -.SUFFIXES: .c .obj .res - -{$(LIBCURL_SRC_DIR)\}.c{$(LIB_DIROBJ)\}.obj: - $(CURL_CC) $(CFLAGS) /Fo"$@" $< - -{$(LIBCURL_SRC_DIR)\vauth\}.c{$(LIB_DIROBJ)\vauth\}.obj: - $(CURL_CC) $(CFLAGS) /Fo"$@" $< - -{$(LIBCURL_SRC_DIR)\vtls\}.c{$(LIB_DIROBJ)\vtls\}.obj: - $(CURL_CC) $(CFLAGS) /Fo"$@" $< - -$(LIB_DIROBJ)\libcurl.res: $(LIBCURL_SRC_DIR)\libcurl.rc - $(RC) $(RC_FLAGS) - -# -# curl.exe -# - - -!IF "$(MODE)"=="static" -!IF "$(DEBUG)"=="yes" -CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC_DEBUG) -!ELSE -CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC) -!ENDIF -!ELSEIF "$(MODE)"=="dll" -!IF "$(DEBUG)"=="yes" -CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP_DEBUG) -!ELSE -CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP) -!ENDIF -!ENDIF - -CURL_FROM_LIBCURL=$(CURL_DIROBJ)\tool_hugehelp.obj \ - $(CURL_DIROBJ)\nonblock.obj \ - $(CURL_DIROBJ)\strtoofft.obj \ - $(CURL_DIROBJ)\warnless.obj \ - $(CURL_DIROBJ)\curl_ctype.obj - -$(PROGRAM_NAME): $(CURL_DIROBJ) $(CURL_FROM_LIBCURL) $(EXE_OBJS) - $(CURL_LINK) $(CURL_LFLAGS) $(CURL_LIBCURL_LIBNAME) $(WIN_LIBS) $(CURL_FROM_LIBCURL) $(EXE_OBJS) - $(MANIFESTTOOL) - -{$(CURL_SRC_DIR)\}.c{$(CURL_DIROBJ)\}.obj: - $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" $< - -$(CURL_DIROBJ)\tool_hugehelp.obj: $(CURL_SRC_DIR)\tool_hugehelp.c - $(CURL_CC) $(CURL_CFLAGS) /Zm200 /Fo"$@" $(CURL_SRC_DIR)\tool_hugehelp.c -$(CURL_DIROBJ)\nonblock.obj: ../lib/nonblock.c - $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/nonblock.c -$(CURL_DIROBJ)\strtoofft.obj: ../lib/strtoofft.c - $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/strtoofft.c -$(CURL_DIROBJ)\warnless.obj: ../lib/warnless.c - $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/warnless.c -$(CURL_DIROBJ)\curl_ctype.obj: ../lib/curl_ctype.c - $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/curl_ctype.c -$(CURL_DIROBJ)\curl.res: $(CURL_SRC_DIR)\curl.rc - rc $(CURL_RC_FLAGS) - -!ENDIF # End of case where a config was provided. - -clean: - @-erase /s *.dll 2> NUL - @-erase /s *.exp 2> NUL - @-erase /s *.idb 2> NUL - @-erase /s *.lib 2> NUL - @-erase /s *.obj 2> NUL - @-erase /s *.pch 2> NUL - @-erase /s *.pdb 2> NUL - @-erase /s *.res 2> NUL - @if exist $(LIB_DIROBJ) rd /s/q $(LIB_DIROBJ) - @if exist $(CURL_DIROBJ)rd /s/q $(CURL_DIROBJ) - @if exist $(DIRDIST) rd /s/q $(DIRDIST) +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) 1999 - 2018, Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.haxx.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +#*************************************************************************** + +########################################################################### +# +# Makefile for building libcurl with MSVC 6 through to 15 +# +# Usage: see usage message below +# Should be invoked from winbuild directory +# Edit the paths and desired library name +# SSL path is only required if you intend compiling +# with SSL. +# +# This make file leaves the result either a .lib or .dll file +# in the \lib directory. It should be called from the \lib +# directory. +# +# An option would have been to allow the source directory to +# be specified, but I saw no requirement. +# +# Another option would have been to leave the .lib and .dll +# files in the "cfg" directory, but then the make file +# in \src would need to be changed. +# +############################################################## + +CFGSET=FALSE +WINBUILD_DIR=`cd` + +# Utilities. +# If a path is required that contains characters such as space, quote the path. +MT = mt.exe +RC = rc.exe +ZIP = zip.exe + +# Allow changing C compiler via environment variable CC (default cl.exe) +# This command macro is not set by default: https://msdn.microsoft.com/en-us/library/ms933742.aspx +!If "$(CC)" == "" +CC = cl.exe +!Endif + +!IF "$(VC)"=="6" +CC_NODEBUG = $(CC) /O3 /DNDEBUG +CC_DEBUG = $(CC) /Od /Gm /Zi /D_DEBUG /GZ +CFLAGS = /I. /I../lib /I../include /nologo /W4 /wd4127 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL +!ELSE +CC_NODEBUG = $(CC) /O3 /DNDEBUG +CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd +CFLAGS = /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL +!ENDIF + +LFLAGS = /nologo /machine:$(MACHINE) +LNKDLL = link.exe /DLL +# 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 + +CFLAGS_LIBCURL_STATIC = /DCURL_STATICLIB + +WIN_LIBS = ws2_32.lib wldap32.lib advapi32.lib crypt32.lib + +BASE_NAME = libcurl +BASE_NAME_DEBUG = $(BASE_NAME)_debug +BASE_NAME_STATIC = $(BASE_NAME)_a +BASE_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC)_debug + +LIB_NAME_STATIC = $(BASE_NAME_STATIC).lib +LIB_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC_DEBUG).lib +LIB_NAME_DLL = $(BASE_NAME).dll +LIB_NAME_IMP = $(BASE_NAME).lib +LIB_NAME_DLL_DEBUG = $(BASE_NAME_DEBUG).dll +LIB_NAME_IMP_DEBUG = $(BASE_NAME_DEBUG).lib + +PDB_NAME_STATIC = $(BASE_NAME_STATIC).pdb +PDB_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC_DEBUG).pdb +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 = /out:$(DIRDIST)\bin\$(PROGRAM_NAME) /subsystem:console $(LFLAGS) +CURL_RESFLAGS = /i../include + +############################################################# +## Nothing more to do below this line! +LIBCURL_SRC_DIR = ..\lib +CURL_SRC_DIR = ..\src + +!IFNDEF WITH_DEVEL +WITH_DEVEL = ../../deps +!ENDIF +DEVEL_INCLUDE= $(WITH_DEVEL)/include +DEVEL_LIB = $(WITH_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" || "$(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 = $(WITH_SSL) +!IF "$(WITH_SSL)"=="static" +WIN_LIBS = $(WIN_LIBS) gdi32.lib user32.lib crypt32.lib +!ENDIF +!ENDIF + +!IFDEF USE_SSL +SSL_CFLAGS = /DUSE_OPENSSL /I"$(SSL_INC_DIR)" +!IF EXISTS("$(SSL_INC_DIR)\is_boringssl.h") +SSL_CFLAGS = $(SSL_CFLAGS) /DHAVE_BORINGSSL +!ENDIF +!IF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="false" +SSL_CFLAGS = $(SSL_CFLAGS) /DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG +!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 /I"$(NGHTTP2_INC_DIR)" +NGHTTP2_LIBS = nghttp2.lib +!ELSEIF "$(WITH_NGHTTP2)"=="static" +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 /I"$(MBEDTLS_INC_DIR)" +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 +!ELSE +CARES_LIBS = cares.lib +!ENDIF +USE_CARES = true +CARES = dll +!ELSEIF "$(WITH_CARES)"=="static" +!IF "$(DEBUG)"=="yes" +CARES_LIBS = libcaresd.lib +!ELSE +CARES_LIBS = libcares.lib +!ENDIF +USE_CARES = true +CARES = static +!ENDIF + +!IFDEF USE_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("$(ZLIB_LIB_DIR)\zlibwapi.lib") +ZLIB_LIBS = zlibwapi.lib +!ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zdll.lib") +ZLIB_LIBS = zdll.lib +!ELSE +ZLIB_LIBS = zlib.lib +!ENDIF +USE_ZLIB = true +ZLIB = dll +!ELSEIF "$(WITH_ZLIB)"=="static" +!IF EXISTS("$(ZLIB_LIB_DIR)\zlibstat.lib") +ZLIB_LIBS = zlibstat.lib +!ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlib.lib") +ZLIB_LIBS = zlib.lib +!ELSE +ZLIB_LIBS = zlib_a.lib +!ENDIF +USE_ZLIB = true +ZLIB = static +!ENDIF + +!IFDEF USE_ZLIB +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" +# 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$(SSH2_INC_DIR) +!ENDIF + + +!IFNDEF USE_IDN +USE_IDN = true +!ELSEIF "$(USE_IDN)"=="yes" +USE_IDN = true +!ENDIF + +!IF "$(USE_IDN)"=="true" +IDN_CFLAGS = $(IDN_CFLAGS) /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES +WIN_LIBS = $(WIN_LIBS) Normaliz.lib +!ENDIF + + +!IFNDEF USE_IPV6 +USE_IPV6 = true +!ELSEIF "$(USE_IPV6)"=="yes" +USE_IPV6 = true +!ENDIF + +!IF "$(USE_IPV6)"=="true" +IPV6_CFLAGS = $(IPV6_CFLAGS) /DUSE_IPV6 +!ENDIF + + +!IFNDEF USE_SSPI +USE_SSPI = true +!ELSEIF "$(USE_SSPI)"=="yes" +USE_SSPI = true +!ENDIF + +!IF "$(USE_SSPI)"=="true" +SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_WINDOWS_SSPI +!ENDIF + + +!IFNDEF USE_WINSSL +!IF "$(USE_SSL)"=="true" +USE_WINSSL = false +!ELSE +USE_WINSSL = $(USE_SSPI) +!ENDIF +!ELSEIF "$(USE_WINSSL)"=="yes" +USE_WINSSL = true +!ENDIF + + +!IF "$(USE_WINSSL)"=="true" +!IF "$(USE_SSPI)"!="true" +!ERROR cannot build with WinSSL without SSPI +!ENDIF +SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_SCHANNEL +WIN_LIBS = $(WIN_LIBS) Crypt32.lib +!ENDIF + + +!IF "$(GEN_PDB)"=="yes" +GEN_PDB = true +!ENDIF + + +!IFDEF EMBED_MANIFEST +MANIFESTTOOL = $(MT) -manifest $(DIRDIST)\bin\$(PROGRAM_NAME).manifest -outputresource:$(DIRDIST)\bin\$(PROGRAM_NAME);1 +!ELSE +CURL_RC_FLAGS = $(CURL_RC_FLAGS) /dCURL_EMBED_MANIFEST +!ENDIF + +# Runtime library configuration +!IF "$(RTLIBCFG)"=="static" +RTLIB = /MT +RTLIB_DEBUG = /MTd +!ELSE +RTLIB = /MD +RTLIB_DEBUG = /MDd +!ENDIF + +!IF "$(MODE)"=="static" +TARGET = $(LIB_NAME_STATIC) +CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC) +AS_DLL = false +CFGSET = true +!ELSEIF "$(MODE)"=="dll" +TARGET = $(LIB_NAME_DLL) +CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP) +AS_DLL = true +CFGSET = true +!ENDIF + +!IF "$(CFGSET)" == "FALSE" +!ERROR please choose a valid mode +!ENDIF + + + +# CURL_XX macros are for the curl.exe command + +!IF "$(DEBUG)"=="yes" +RC_FLAGS = /dDEBUGBUILD=1 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc +CURL_CC = $(CC_DEBUG) $(RTLIB_DEBUG) +CURL_RC_FLAGS = /i../include /dDEBUGBUILD=1 /Fo $@ $(CURL_SRC_DIR)\curl.rc +!ELSE +RC_FLAGS = /dDEBUGBUILD=0 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc +CURL_CC = $(CC_NODEBUG) $(RTLIB) +CURL_RC_FLAGS = /i../include /dDEBUGBUILD=0 /Fo $@ $(CURL_SRC_DIR)\curl.rc +!ENDIF + +!IF "$(AS_DLL)" == "true" + +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) +PDB = $(PDB_NAME_DLL_DEBUG) +CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) +!ELSE +TARGET = $(LIB_NAME_DLL) +LNK = $(LNK) /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP) +PDB = $(PDB_NAME_DLL) +CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP) +!ENDIF +RESOURCE = $(LIB_DIROBJ)\libcurl.res + +# AS_DLL +!ELSE + +!IF "$(DEBUG)"=="yes" +TARGET = $(LIB_NAME_STATIC_DEBUG) +PDB = $(PDB_NAME_STATIC_DEBUG) +!ELSE +TARGET = $(LIB_NAME_STATIC) +PDB = $(PDB_NAME_STATIC) +!ENDIF +LNK = $(LNKLIB) /out:$(LIB_DIROBJ)\$(TARGET) +CURL_CC = $(CURL_CC) $(CFLAGS_LIBCURL_STATIC) + +# AS_DLL +!ENDIF + +!IF "$(USE_SSL)"=="true" +CFLAGS = $(CFLAGS) $(SSL_CFLAGS) +LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(SSL_LIBS) +!ENDIF + +!IF "$(USE_MBEDTLS)"=="true" +CFLAGS = $(CFLAGS) $(MBEDTLS_CFLAGS) +LFLAGS = $(LFLAGS) $(MBEDTLS_LFLAGS) $(MBEDTLS_LIBS) +!ENDIF + +!IF "$(USE_CARES)"=="true" +CFLAGS = $(CFLAGS) $(CARES_CFLAGS) +LFLAGS = $(LFLAGS) $(CARES_LFLAGS) $(CARES_LIBS) +!ENDIF + +!IF "$(USE_ZLIB)"=="true" +CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) +LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) $(ZLIB_LIBS) +!ENDIF + +!IF "$(USE_SSH2)"=="true" +CFLAGS = $(CFLAGS) $(SSH2_CFLAGS) +LFLAGS = $(LFLAGS) $(SSH2_LFLAGS) $(SSH2_LIBS) +!ENDIF + +!IF "$(USE_IDN)"=="true" +CFLAGS = $(CFLAGS) $(IDN_CFLAGS) +!ENDIF + +!IF "$(USE_IPV6)"=="true" +CFLAGS = $(CFLAGS) $(IPV6_CFLAGS) +!ENDIF + +!IF "$(USE_SSPI)"=="true" +CFLAGS = $(CFLAGS) $(SSPI_CFLAGS) +!ENDIF + +!IF "$(USE_NGHTTP2)"=="true" +CFLAGS = $(CFLAGS) $(NGHTTP2_CFLAGS) +LFLAGS = $(LFLAGS) $(NGHTTP2_LFLAGS) $(NGHTTP2_LIBS) +!ENDIF + +!IF "$(GEN_PDB)"=="true" +CFLAGS = $(CFLAGS) $(CFLAGS_PDB) /Fd"$(LIB_DIROBJ)\$(PDB)" +LFLAGS = $(LFLAGS) $(LFLAGS_PDB) +!ENDIF + +LIB_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib +CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl +DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\ + +# +# curl.exe +# +CURL_LINK = link.exe /incremental:no /libpath:"$(DIRDIST)\lib" + +!IF "$(CFGSET)" != "FALSE" +# A mode was provided, so the library can be built. +# +!include CURL_OBJS.inc +!include LIBCURL_OBJS.inc + +!IF "$(AS_DLL)" == "true" +LIB_OBJS = $(LIBCURL_OBJS) $(RESOURCE) +!ELSE +LIB_OBJS = $(LIBCURL_OBJS) +!ENDIF + +EXE_OBJS = $(CURL_OBJS) $(CURL_DIROBJ)\curl.res + +all : $(TARGET) $(PROGRAM_NAME) + +package: $(TARGET) + @cd $(DIRDIST) + @-$(ZIP) -9 -q -r ..\$(CONFIG_NAME_LIB).zip .>nul 2<&1 + @cd $(MAKEDIR) + +$(TARGET): $(LIB_OBJS) $(LIB_DIROBJ) $(DIRDIST) + @echo Using SSL: $(USE_SSL) + @echo Using NGHTTP2: $(USE_NGHTTP2) + @echo Using c-ares: $(USE_CARES) + @echo Using SSH2: $(USE_SSH2) + @echo Using ZLIB: $(USE_ZLIB) + @echo Using IDN: $(USE_IDN) + @echo Using IPv6: $(USE_IPV6) + @echo Using SSPI: $(USE_SSPI) + @echo Using WinSSL: $(USE_WINSSL) + @echo CFLAGS: $(CFLAGS) + @echo LFLAGS: $(LFLAGS) + @echo GenPDB: $(GEN_PDB) + @echo Debug: $(DEBUG) + @echo Machine: $(MACHINE) + $(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 + @if exist $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) $(DIRDIST)\bin\ /y >nul 2<&1 + @if exist $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) $(DIRDIST)\lib\ /y >nul 2<&1 + @if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP) $(DIRDIST)\lib\ /y >nul 2<&1 + @if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) $(DIRDIST)\lib >nul 2<&1 + @-copy $(LIB_DIROBJ)\*.exp $(DIRDIST)\lib /y >nul 2<&1 + @-copy $(LIB_DIROBJ)\*.pdb $(DIRDIST)\lib /y >nul 2<&1 + @-copy ..\include\curl\*.h $(DIRDIST)\include\curl\ /y >nul 2<&1 + +$(LIB_OBJS): $(LIB_DIROBJ) $(DIRDIST) + +$(DIRDIST): + @if not exist "$(DIRDIST)\bin" mkdir $(DIRDIST)\bin + @if not exist "$(DIRDIST)\include" mkdir $(DIRDIST)\include + @if not exist "$(DIRDIST)\include\curl" mkdir $(DIRDIST)\include\curl + @if not exist "$(DIRDIST)\lib" mkdir $(DIRDIST)\lib + +$(LIB_DIROBJ): + @if not exist "$(LIB_DIROBJ)" mkdir $(LIB_DIROBJ) + @if not exist "$(LIB_DIROBJ)\vauth" mkdir $(LIB_DIROBJ)\vauth + @if not exist "$(LIB_DIROBJ)\vtls" mkdir $(LIB_DIROBJ)\vtls + +$(CURL_DIROBJ): + @if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ) +# we need a lib dir for the portability functions from libcurl +# we use the .c directly here + @if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)\lib + +.SUFFIXES: .c .obj .res + +{$(LIBCURL_SRC_DIR)\}.c{$(LIB_DIROBJ)\}.obj: + $(CURL_CC) $(CFLAGS) /Fo"$@" $< + +{$(LIBCURL_SRC_DIR)\vauth\}.c{$(LIB_DIROBJ)\vauth\}.obj: + $(CURL_CC) $(CFLAGS) /Fo"$@" $< + +{$(LIBCURL_SRC_DIR)\vtls\}.c{$(LIB_DIROBJ)\vtls\}.obj: + $(CURL_CC) $(CFLAGS) /Fo"$@" $< + +$(LIB_DIROBJ)\libcurl.res: $(LIBCURL_SRC_DIR)\libcurl.rc + $(RC) $(RC_FLAGS) + +# +# curl.exe +# + + +!IF "$(MODE)"=="static" +!IF "$(DEBUG)"=="yes" +CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC_DEBUG) +!ELSE +CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC) +!ENDIF +!ELSEIF "$(MODE)"=="dll" +!IF "$(DEBUG)"=="yes" +CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP_DEBUG) +!ELSE +CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP) +!ENDIF +!ENDIF + +CURL_FROM_LIBCURL=$(CURL_DIROBJ)\tool_hugehelp.obj \ + $(CURL_DIROBJ)\nonblock.obj \ + $(CURL_DIROBJ)\strtoofft.obj \ + $(CURL_DIROBJ)\warnless.obj \ + $(CURL_DIROBJ)\curl_ctype.obj + +$(PROGRAM_NAME): $(CURL_DIROBJ) $(CURL_FROM_LIBCURL) $(EXE_OBJS) + $(CURL_LINK) $(CURL_LFLAGS) $(CURL_LIBCURL_LIBNAME) $(WIN_LIBS) $(CURL_FROM_LIBCURL) $(EXE_OBJS) + $(MANIFESTTOOL) + +{$(CURL_SRC_DIR)\}.c{$(CURL_DIROBJ)\}.obj: + $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" $< + +$(CURL_DIROBJ)\tool_hugehelp.obj: $(CURL_SRC_DIR)\tool_hugehelp.c + $(CURL_CC) $(CURL_CFLAGS) /Zm200 /Fo"$@" $(CURL_SRC_DIR)\tool_hugehelp.c +$(CURL_DIROBJ)\nonblock.obj: ../lib/nonblock.c + $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/nonblock.c +$(CURL_DIROBJ)\strtoofft.obj: ../lib/strtoofft.c + $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/strtoofft.c +$(CURL_DIROBJ)\warnless.obj: ../lib/warnless.c + $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/warnless.c +$(CURL_DIROBJ)\curl_ctype.obj: ../lib/curl_ctype.c + $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/curl_ctype.c +$(CURL_DIROBJ)\curl.res: $(CURL_SRC_DIR)\curl.rc + rc $(CURL_RC_FLAGS) + +!ENDIF # End of case where a config was provided. + +clean: + @-erase /s *.dll 2> NUL + @-erase /s *.exp 2> NUL + @-erase /s *.idb 2> NUL + @-erase /s *.lib 2> NUL + @-erase /s *.obj 2> NUL + @-erase /s *.pch 2> NUL + @-erase /s *.pdb 2> NUL + @-erase /s *.res 2> NUL + @if exist $(LIB_DIROBJ) rd /s/q $(LIB_DIROBJ) + @if exist $(CURL_DIROBJ)rd /s/q $(CURL_DIROBJ) + @if exist $(DIRDIST) rd /s/q $(DIRDIST)