configure: Add support for building with mbedtls
Этот коммит содержится в:
родитель
3e6de50a24
Коммит
dc8f7ca3ab
@ -88,8 +88,8 @@ coverage: init-coverage build-coverage gen-coverage
|
||||
|
||||
# DSP/VCPROJ generation adapted from libcurl
|
||||
# only OpenSSL and WinCNG are supported with this build system
|
||||
CRYPTO_CSOURCES = openssl.c wincng.c
|
||||
CRYPTO_HHEADERS = openssl.h wincng.h
|
||||
CRYPTO_CSOURCES = openssl.c wincng.c mbedtls.c
|
||||
CRYPTO_HHEADERS = openssl.h wincng.h mbedtls.h
|
||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||
include Makefile.inc
|
||||
|
||||
|
2
Makefile.mbedTLS.inc
Обычный файл
2
Makefile.mbedTLS.inc
Обычный файл
@ -0,0 +1,2 @@
|
||||
CRYPTO_CSOURCES = mbedtls.c
|
||||
CRYPTO_HHEADERS = mbedtls.h
|
17
configure.ac
17
configure.ac
@ -93,6 +93,9 @@ AC_ARG_WITH(libgcrypt,
|
||||
AC_ARG_WITH(wincng,
|
||||
AC_HELP_STRING([--with-wincng],[Use Windows CNG for crypto]),
|
||||
use_wincng=$withval,use_wincng=auto)
|
||||
AC_ARG_WITH(mbedtls,
|
||||
AC_HELP_STRING([--with-mbedtls],[Use mbedTLS for crypto]),
|
||||
use_mbedtls=$withval,use_mbedtls=auto)
|
||||
AC_ARG_WITH(libz,
|
||||
AC_HELP_STRING([--with-libz],[Use zlib for compression]),
|
||||
use_libz=$withval,use_libz=auto)
|
||||
@ -163,11 +166,25 @@ AM_CONDITIONAL(WINCNG, test "$ac_cv_libbcrypt" = "yes")
|
||||
|
||||
AM_CONDITIONAL(OS400QC3, false)
|
||||
|
||||
# Look for libmbedtls
|
||||
if test "$found_crypto" = "none" && test "$use_mbedtls" != "no"; then
|
||||
AC_LIB_HAVE_LINKFLAGS([mbedtls], [], [#include <mbedtls/version.h>])
|
||||
fi
|
||||
if test "$ac_cv_libmbedtls" = "yes"; then
|
||||
AC_DEFINE(LIBSSH2_MBEDTLS, 1, [Use mbedtls])
|
||||
LIBSREQUIRED= # mbedtls doesn't provide a .pc file
|
||||
LIBS="$LIBS -lmbedtls -lmbedcrypto"
|
||||
found_crypto=libmbedtls
|
||||
support_clear_memory=yes
|
||||
fi
|
||||
AM_CONDITIONAL(MBEDTLS, test "$ac_cv_libmbedtls" = "yes")
|
||||
|
||||
# Check if crypto library was found
|
||||
if test "$found_crypto" = "none"; then
|
||||
AC_MSG_ERROR([No crypto library found!
|
||||
Try --with-libssl-prefix=PATH
|
||||
or --with-libgcrypt-prefix=PATH
|
||||
or --with-libmbedtls-prefix=PATH
|
||||
or --with-wincng on Windows\
|
||||
])
|
||||
fi
|
||||
|
@ -14,6 +14,9 @@ endif
|
||||
if OS400QC3
|
||||
include ../Makefile.os400qc3.inc
|
||||
endif
|
||||
if MBEDTLS
|
||||
include ../Makefile.mbedTLS.inc
|
||||
endif
|
||||
|
||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||
include ../Makefile.inc
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user