From b28a3714c46d96e4c561a582966465beeeebe73b Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Tue, 25 Feb 2020 00:39:23 -0500 Subject: [multiple] ./configure --with-nettle to use Nettle ./configure --with-nettle to use Nettle crypto lib for algorithms, instead of OpenSSL or wolfSSL. Note: Nettle does not provide TLS. x-ref: "How to use SHA-256 without OpenSSL?" https://redmine.lighttpd.net/boards/2/topics/8903 --- configure.ac | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index e9f0b60e..83d273b8 100644 --- a/configure.ac +++ b/configure.ac @@ -737,6 +737,35 @@ if test "$WITH_OPENSSL" != no && test "$WITH_WOLFSSL" != no; then AC_MSG_ERROR([lighttpd should not be built with both --with-openssl and --with-wolfssl]) fi +dnl Check for Nettle (and overwrite CRYPTO_LIB if set by OpenSSL or wolfSSL) +AC_MSG_NOTICE([----------------------------------------]) +AC_MSG_CHECKING([for Nettle]) +AC_ARG_WITH([nettle], + [AC_HELP_STRING([--with-nettle@<:@=DIR@:>@], + [Include Nettle support (default no)] + )], + [WITH_NETTLE=$withval], + [WITH_NETTLE=no] +) +AC_MSG_RESULT([$WITH_NETTLE]) + +if test "$WITH_NETTLE" != no; then + if test "$WITH_NETTLE" != yes; then + CPPFLAGS="${CPPFLAGS} -I$WITH_NETTLE/include" + LDFLAGS="${LDFLAGS} -L$WITH_NETTLE/lib" + fi + + AC_CHECK_HEADERS([nettle/nettle-types.h], [], [ + AC_MSG_ERROR([nettle headers not found. install them or build without --with-nettle]) + ]) + AC_CHECK_LIB([nettle], [nettle_md5_init], + [CRYPTO_LIB="-lnettle"], + [AC_MSG_ERROR([nettle crypto library not found. install it or build without --with-nettle])] + ) + + AC_SUBST([CRYPTO_LIB]) +fi + dnl pcre support AC_MSG_NOTICE([----------------------------------------]) -- cgit v1.2.1