Imported Upstream version 7.44.0
[platform/upstream/curl.git] / lib / Makefile.m32
index a401c71..736e600 100644 (file)
@@ -1,7 +1,7 @@
 ###########################################################################
 #
 ## Makefile for building libcurl.a with MingW (GCC-3.2 or later)
-## and optionally OpenSSL (0.9.8), libssh2 (1.3), zlib (1.2.5), librtmp (2.3)
+## and optionally OpenSSL (1.0.2a), libssh2 (1.5), zlib (1.2.8), librtmp (2.4)
 ##
 ## Usage:   mingw32-make -f Makefile.m32 CFG=-feature1[-feature2][-feature3][...]
 ## Example: mingw32-make -f Makefile.m32 CFG=-zlib-ssl-sspi-winidn
@@ -18,23 +18,23 @@ ZLIB_PATH = ../../zlib-1.2.8
 endif
 # Edit the path below to point to the base of your OpenSSL package.
 ifndef OPENSSL_PATH
-OPENSSL_PATH = ../../openssl-0.9.8y
+OPENSSL_PATH = ../../openssl-1.0.2a
 endif
 # Edit the path below to point to the base of your LibSSH2 package.
 ifndef LIBSSH2_PATH
-LIBSSH2_PATH = ../../libssh2-1.4.3
+LIBSSH2_PATH = ../../libssh2-1.5.0
 endif
 # Edit the path below to point to the base of your librtmp package.
 ifndef LIBRTMP_PATH
-LIBRTMP_PATH = ../../librtmp-2.3
+LIBRTMP_PATH = ../../librtmp-2.4
 endif
 # Edit the path below to point to the base of your libidn package.
 ifndef LIBIDN_PATH
-LIBIDN_PATH = ../../libidn-1.18
+LIBIDN_PATH = ../../libidn-1.32
 endif
 # Edit the path below to point to the base of your MS IDN package.
 # Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1
-# http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ad6158d7-ddba-416a-9109-07607425a815
+# https://www.microsoft.com/en-us/download/details.aspx?id=734
 ifndef WINIDN_PATH
 WINIDN_PATH = ../../Microsoft IDN Mitigation APIs
 endif
@@ -42,6 +42,10 @@ endif
 ifndef LDAP_SDK
 LDAP_SDK = c:/novell/ndk/cldapsdk/win32
 endif
+# Edit the path below to point to the base of your nghttp2 package.
+ifndef NGHTTP2_PATH
+NGHTTP2_PATH = ../../nghttp2-1.0.0
+endif
 
 PROOT = ..
 
@@ -50,25 +54,36 @@ ifndef LIBCARES_PATH
 LIBCARES_PATH = $(PROOT)/ares
 endif
 
-# Edit the var below to set to your architecture or set environment var.
-ifndef ARCH
-ARCH = w32
-endif
-
 CC     = $(CROSSPREFIX)gcc
-CFLAGS = -g -O2 -Wall
+CFLAGS = $(CURL_CFLAG_EXTRAS) -g -O2 -Wall
 CFLAGS += -fno-strict-aliasing
-ifeq ($(ARCH),w64)
-CFLAGS += -D_AMD64_
-endif
 # comment LDFLAGS below to keep debug info
-LDFLAGS        = -s
+LDFLAGS        = $(CURL_LDFLAG_EXTRAS) -s
 AR     = $(CROSSPREFIX)ar
 RANLIB = $(CROSSPREFIX)ranlib
 RC     = $(CROSSPREFIX)windres
-RCFLAGS        = --include-dir=$(PROOT)/include -DDEBUGBUILD=0 -O COFF -i
+RCFLAGS        = --include-dir=$(PROOT)/include -DDEBUGBUILD=0 -O COFF
 STRIP  = $(CROSSPREFIX)strip -g
 
+# Set environment var ARCH to your architecture to override autodetection.
+ifndef ARCH
+ifeq ($(findstring x86_64,$(shell $(CC) -dumpmachine)),x86_64)
+ARCH   = w64
+else
+ARCH   = w32
+endif
+endif
+
+ifeq ($(ARCH),w64)
+CFLAGS  += -m64 -D_AMD64_
+LDFLAGS += -m64
+RCFLAGS += -F pe-x86-64
+else
+CFLAGS  += -m32
+LDFLAGS += -m32
+RCFLAGS += -F pe-i386
+endif
+
 # Platform-dependent helper tool macros
 ifeq ($(findstring /sh,$(SHELL)),/sh)
 DEL    = rm -f $1
@@ -137,9 +152,6 @@ endif
 ifeq ($(findstring -sspi,$(CFG)),-sspi)
 SSPI = 1
 endif
-ifeq ($(findstring -spnego,$(CFG)),-spnego)
-SPNEGO = 1
-endif
 ifeq ($(findstring -ldaps,$(CFG)),-ldaps)
 LDAPS = 1
 endif
@@ -150,6 +162,9 @@ ifeq ($(findstring -winssl,$(CFG)),-winssl)
 WINSSL = 1
 SSPI = 1
 endif
+ifeq ($(findstring -nghttp2,$(CFG)),-nghttp2)
+NGHTTP2 = 1
+endif
 
 INCLUDES = -I. -I../include
 CFLAGS += -DBUILDING_LIBCURL
@@ -169,6 +184,11 @@ ifdef RTMP
   CFLAGS += -DUSE_LIBRTMP
   DLL_LIBS += -L"$(LIBRTMP_PATH)/librtmp" -lrtmp -lwinmm
 endif
+ifdef NGHTTP2
+  INCLUDES += -I"$(NGHTTP2_PATH)/include"
+  CFLAGS += -DUSE_NGHTTP2
+  DLL_LIBS += -L"$(NGHTTP2_PATH)/lib" -lnghttp2
+endif
 ifdef SSH2
   INCLUDES += -I"$(LIBSSH2_PATH)/include" -I"$(LIBSSH2_PATH)/win32"
   CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
@@ -196,14 +216,17 @@ ifdef SSL
       OPENSSL_LIBS = -lcrypto -lssl
     endif
   endif
+  ifndef DYN
+    OPENSSL_LIBS += -lgdi32 -lcrypt32
+  endif
   INCLUDES += -I"$(OPENSSL_INCLUDE)"
-  CFLAGS += -DUSE_SSLEAY -DUSE_OPENSSL -DHAVE_OPENSSL_ENGINE_H -DHAVE_OPENSSL_PKCS12_H \
+  CFLAGS += -DUSE_OPENSSL -DHAVE_OPENSSL_ENGINE_H -DHAVE_OPENSSL_PKCS12_H \
             -DHAVE_ENGINE_LOAD_BUILTIN_ENGINES -DOPENSSL_NO_KRB5 \
             -DCURL_WANTS_CA_BUNDLE_ENV
   DLL_LIBS += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS)
   ifdef SRP
     ifeq "$(wildcard $(OPENSSL_INCLUDE)/openssl/srp.h)" "$(OPENSSL_INCLUDE)/openssl/srp.h"
-      CFLAGS += -DHAVE_SSLEAY_SRP -DUSE_TLS_SRP
+      CFLAGS += -DHAVE_OPENSSL_SRP -DUSE_TLS_SRP
     endif
   endif
 endif
@@ -285,10 +308,10 @@ $(libcurl_dll_LIBRARY): $(libcurl_a_OBJECTS) $(RESOURCE) $(libcurl_dll_DEPENDENC
          $(libcurl_a_OBJECTS) $(RESOURCE) $(DLL_LIBS)
 
 %.o: %.c $(PROOT)/include/curl/curlbuild.h
-       $(CC) $(INCLUDES) $(CFLAGS) -c $<
+       $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
 
 %.res: %.rc
-       $(RC) $(RCFLAGS) $< -o $@
+       $(RC) $(RCFLAGS) -i $< -o $@
 
 clean:
 ifeq "$(wildcard $(PROOT)/include/curl/curlbuild.h.dist)" "$(PROOT)/include/curl/curlbuild.h.dist"
@@ -305,5 +328,3 @@ $(PROOT)/include/curl/curlbuild.h:
 
 $(LIBCARES_PATH)/libcares.a:
        $(MAKE) -C $(LIBCARES_PATH) -f Makefile.m32
-
-