Add dependency of nghttp2-devel
[platform/upstream/curl.git] / src / Makefile.m32
index 1c22dd0..40852e5 100644 (file)
@@ -1,10 +1,32 @@
+#***************************************************************************
+#                                  _   _ ____  _
+#  Project                     ___| | | |  _ \| |
+#                             / __| | | | |_) | |
+#                            | (__| |_| |  _ <| |___
+#                             \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1999 - 2015, Daniel Stenberg, <daniel@haxx.se>, 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 curl.exe 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-spi-winidn
+## Example: mingw32-make -f Makefile.m32 CFG=-zlib-ssl-sspi-winidn
 ##
 ## Hint: you can also set environment vars to control the build, f.e.:
 ## set ZLIB_PATH=c:/zlib-1.2.8
@@ -18,19 +40,19 @@ 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 libmetalink package.
 ifndef LIBMETALINK_PATH
-LIBMETALINK_PATH = ../../libmetalink-0.1.2
+LIBMETALINK_PATH = ../../libmetalink-0.1.3
 endif
 # Edit the path below to point to the base of your libexpat package.
 ifndef LIBEXPAT_PATH
@@ -38,15 +60,15 @@ LIBEXPAT_PATH = ../../expat-2.1.0
 endif
 # Edit the path below to point to the base of your libxml2 package.
 ifndef LIBXML2_PATH
-LIBXML2_PATH = ../../libxml2-2.9.0
+LIBXML2_PATH = ../../libxml2-2.9.2
 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
@@ -54,6 +76,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 = ..
 
@@ -62,27 +88,39 @@ 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) $(CURL_LDFLAG_EXTRAS_EXE) -s
 AR     = $(CROSSPREFIX)ar
 RC     = $(CROSSPREFIX)windres
-RCFLAGS        = --include-dir=$(PROOT)/include -O COFF -i
+RCFLAGS        = --include-dir=$(PROOT)/include -O COFF
+STRIP  = $(CROSSPREFIX)strip -g
 
 # We may need these someday
 # PERL = perl
 # NROFF = nroff
 
+# 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
@@ -130,7 +168,9 @@ ZLIB = 1
 endif
 ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
 SSH2 = 1
+ifneq ($(findstring -winssl,$(CFG)),-winssl)
 SSL = 1
+endif
 ZLIB = 1
 endif
 ifeq ($(findstring -ssl,$(CFG)),-ssl)
@@ -148,9 +188,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
@@ -164,6 +201,9 @@ ifeq ($(findstring -winssl,$(CFG)),-winssl)
 WINSSL = 1
 SSPI = 1
 endif
+ifeq ($(findstring -nghttp2,$(CFG)),-nghttp2)
+NGHTTP2 = 1
+endif
 
 INCLUDES = -I. -I../include -I../lib
 
@@ -191,9 +231,18 @@ ifdef RTMP
   CFLAGS += -DUSE_LIBRTMP
   curl_LDADD += -L"$(LIBRTMP_PATH)/librtmp" -lrtmp -lwinmm
 endif
+ifdef NGHTTP2
+  CFLAGS += -DUSE_NGHTTP2
+  curl_LDADD += -L"$(NGHTTP2_PATH)/lib" -lnghttp2
+endif
 ifdef SSH2
   CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
   curl_LDADD += -L"$(LIBSSH2_PATH)/win32" -lssh2
+  ifdef WINSSL
+    ifndef DYN
+      curl_LDADD += -lbcrypt -lcrypt32
+    endif
+  endif
 endif
 ifdef SSL
   ifndef OPENSSL_INCLUDE
@@ -223,8 +272,12 @@ ifdef SSL
     OPENSSL_LIBS += -lgdi32 -lcrypt32
   endif
   INCLUDES += -I"$(OPENSSL_INCLUDE)"
-  CFLAGS += -DUSE_SSLEAY -DUSE_OPENSSL
+  CFLAGS += -DUSE_OPENSSL
   curl_LDADD += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS)
+else
+ifdef WINSSL
+  curl_LDADD += -lcrypt32
+endif
 endif
 ifdef ZLIB
   INCLUDES += -I"$(ZLIB_PATH)"
@@ -258,9 +311,6 @@ ifdef SSPI
     CFLAGS += -DUSE_SCHANNEL
   endif
 endif
-ifdef SPNEGO
-  CFLAGS += -DHAVE_SPNEGO
-endif
 ifdef IPV6
   CFLAGS += -DENABLE_IPV6 -D_WIN32_WINNT=0x0501
 endif
@@ -315,7 +365,7 @@ tool_hugehelp.c:
        $(CC) $(INCLUDES) $(CFLAGS) -c $<
 
 %.res: %.rc
-       $(RC) $(RCFLAGS) $< -o $@
+       $(RC) $(RCFLAGS) -i $< -o $@
 
 clean:
 ifeq "$(wildcard tool_hugehelp.c.cvs)" "tool_hugehelp.c.cvs"
@@ -325,4 +375,3 @@ endif
 
 distclean vclean: clean
        @$(call DEL, $(curl_PROGRAMS))
-