Commit 5d8093e7 authored by Henrik S. Gaßmann's avatar Henrik S. Gaßmann Committed by Daniel Stenberg
Browse files

winbuild: add mbedtls support

Add WITH_MBEDTLS option. Make WITH_SSL, WITH_MBEDTLS and ENABLE_WINSSL
options mutual exclusive.

Closes #606
parent 14c9b70c
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -64,6 +64,7 @@ where <options> is one or many of:
                                 Libraries can be fetched at http://windows.php.net/downloads/php-sdk/deps/
                                 Libraries can be fetched at http://windows.php.net/downloads/php-sdk/deps/
                                 Uncompress them into the deps folder.
                                 Uncompress them into the deps folder.
  WITH_SSL=<dll or static>     - Enable OpenSSL support, DLL or static
  WITH_SSL=<dll or static>     - Enable OpenSSL support, DLL or static
  WITH_MBEDTLS=<dll or static> - Enable mbedTLS support, DLL or static
  WITH_CARES=<dll or static>   - Enable c-ares support, DLL or static
  WITH_CARES=<dll or static>   - Enable c-ares support, DLL or static
  WITH_ZLIB=<dll or static>    - Enable zlib support, DLL or static
  WITH_ZLIB=<dll or static>    - Enable zlib support, DLL or static
  WITH_SSH2=<dll or static>    - Enable libSSH2 support, DLL or static
  WITH_SSH2=<dll or static>    - Enable libSSH2 support, DLL or static
+15 −1
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@ CFGSET=true
!MESSAGE   WITH_CARES=<dll or static>   - Enable c-ares 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_ZLIB=<dll or static>    - Enable zlib support, DLL or static
!MESSAGE   WITH_SSH2=<dll or static>    - Enable libSSH2 support, DLL or static
!MESSAGE   WITH_SSH2=<dll or static>    - Enable libSSH2 support, DLL or static
!MESSAGE   WITH_MBEDTLS=<dll or static> - Enable mbedTLS support, DLL or static
!MESSAGE   ENABLE_IDN=<yes or no>       - Enable use of Windows IDN APIs, defaults to yes
!MESSAGE   ENABLE_IDN=<yes or no>       - Enable use of Windows IDN APIs, defaults to yes
!MESSAGE                                  Requires Windows Vista or later, or installation from:
!MESSAGE                                  Requires Windows Vista or later, or installation from:
!MESSAGE                                  https://www.microsoft.com/en-us/download/details.aspx?id=734
!MESSAGE                                  https://www.microsoft.com/en-us/download/details.aspx?id=734
@@ -37,6 +38,10 @@ CFGSET=true


!ENDIF
!ENDIF


!IF DEFINED(WITH_SSL) && DEFINED(ENABLE_WINSSL) || DEFINED(WITH_SSL) && DEFINED(WITH_MBEDTLS) || DEFINED(WITH_MBEDTLS) && DEFINED(ENABLE_WINSSL)
!ERROR WITH_SSL, WITH_MBEDTLS and ENABLE_WINSSL are mutual exclusive options.
!ENDIF

!INCLUDE "../lib/Makefile.inc"
!INCLUDE "../lib/Makefile.inc"
LIBCURL_OBJS=$(CSOURCES:.c=.obj)
LIBCURL_OBJS=$(CSOURCES:.c=.obj)


@@ -87,7 +92,7 @@ USE_SSPI = false
!ENDIF
!ENDIF


!IFNDEF ENABLE_WINSSL
!IFNDEF ENABLE_WINSSL
!IFDEF WITH_SSL
!IF DEFINED(WITH_SSL) || DEFINED(WITH_MBEDTLS)
USE_WINSSL = false
USE_WINSSL = false
!ELSE
!ELSE
USE_WINSSL = $(USE_SSPI)
USE_WINSSL = $(USE_SSPI)
@@ -108,6 +113,11 @@ USE_SSL = true
SSL     = static
SSL     = static
!ENDIF
!ENDIF


!IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static"
USE_MBEDTLS = true
MBEDTLS     = $(WITH_MBEDTLS)
!ENDIF

!IF "$(WITH_CARES)"=="dll"
!IF "$(WITH_CARES)"=="dll"
USE_CARES = true
USE_CARES = true
CARES     = dll
CARES     = dll
@@ -150,6 +160,10 @@ CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-static
CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL)
CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL)
!ENDIF
!ENDIF


!IF "$(USE_MBEDTLS)"=="true"
CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-mbedtls-$(MBEDTLS)
!ENDIF

!IF "$(USE_CARES)"=="true"
!IF "$(USE_CARES)"=="true"
CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-cares-$(CARES)
CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-cares-$(CARES)
!ENDIF
!ENDIF
+14 −1
Original line number Original line Diff line number Diff line
@@ -5,7 +5,7 @@
#                            | (__| |_| |  _ <| |___
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#                             \___|\___/|_| \_\_____|
#
#
# Copyright (C) 1999 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1999 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
#
#
# This software is licensed as described in the file COPYING, which
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# you should have received as part of this distribution. The terms
@@ -121,6 +121,14 @@ SSL = static
SSL_CFLAGS   = /DUSE_OPENSSL /I"$(DEVEL_INCLUDE)/openssl"
SSL_CFLAGS   = /DUSE_OPENSSL /I"$(DEVEL_INCLUDE)/openssl"
!ENDIF
!ENDIF


!IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static"
USE_MBEDTLS    = true
MBEDTLS        = $(WITH_MBEDTLS)
MBEDTLS_CFLAGS = /DUSE_MBEDTLS
MBEDTLS_LIBS   = mbedtls.lib mbedcrypto.lib mbedx509.lib
!ENDIF


!IF "$(WITH_CARES)"=="dll"
!IF "$(WITH_CARES)"=="dll"
!IF "$(DEBUG)"=="yes"
!IF "$(DEBUG)"=="yes"
CARES_LIBS     = caresd.lib
CARES_LIBS     = caresd.lib
@@ -318,6 +326,11 @@ CFLAGS = $(CFLAGS) $(SSL_CFLAGS)
LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(SSL_LIBS)
LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(SSL_LIBS)
!ENDIF
!ENDIF


!IF "$(USE_MBEDTLS)"=="true"
CFLAGS = $(CFLAGS) $(MBEDTLS_CFLAGS)
LFLAGS = $(LFLAGS) $(MBEDTLS_LFLAGS) $(MBEDTLS_LIBS)
!ENDIF

!IF "$(USE_CARES)"=="true"
!IF "$(USE_CARES)"=="true"
CFLAGS = $(CFLAGS) $(CARES_CFLAGS)
CFLAGS = $(CFLAGS) $(CARES_CFLAGS)
LFLAGS = $(LFLAGS) $(CARES_LFLAGS) $(CARES_LIBS)
LFLAGS = $(LFLAGS) $(CARES_LFLAGS) $(CARES_LIBS)