summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2018-10-07 20:07:22 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2018-10-07 23:47:56 -0400
commit778b07a034112157e69c3cfcef682fc6850772d2 (patch)
tree233718e890e1df525474e64f94e189587466a5e1
parent0074b6d34294b2785a89aecd3fc48e4db5e0dd0a (diff)
downloadlighttpd-git-778b07a034112157e69c3cfcef682fc6850772d2.tar.gz
[build] automake support for wolfSSL
-rw-r--r--configure.ac51
1 files changed, 48 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index e6fd5204..d8397334 100644
--- a/configure.ac
+++ b/configure.ac
@@ -635,8 +635,6 @@ AC_ARG_WITH([openssl-libs],
[AC_MSG_RESULT([no])]
)
-AM_CONDITIONAL([BUILD_WITH_OPENSSL], [test "$WITH_OPENSSL" != no])
-
if test "$WITH_OPENSSL" != no; then
if test "$WITH_KRB5" != no; then
AC_DEFINE([USE_OPENSSL_KERBEROS], [1], [with kerberos])
@@ -663,6 +661,53 @@ if test "$WITH_OPENSSL" != no; then
AC_SUBST([CRYPTO_LIB])
fi
+dnl Check for wolfSSL
+AC_MSG_NOTICE([----------------------------------------])
+AC_MSG_CHECKING([for wolfSSL])
+AC_ARG_WITH([wolfssl],
+ [AC_HELP_STRING([--with-wolfssl@<:@=DIR@:>@],
+ [Include openssl support (default no)]
+ )],
+ [WITH_WOLFSSL=$withval],
+ [WITH_WOLFSSL=no]
+)
+AC_MSG_RESULT([$WITH_WOLFSSL])
+
+if test "$WITH_WOLFSSL" != no; then
+ if test "$WITH_WOLFSSL" == yes; then
+ WITH_WOLFSSL="/usr/local"
+ fi
+
+ CPPFLAGS="${CPPFLAGS} -I$WITH_WOLFSSL/include -I$WITH_WOLFSSL/include/wolfssl"
+ LDFLAGS="${LDFLAGS} -L$WITH_WOLFSSL/lib"
+
+ AC_CHECK_HEADERS([wolfssl/ssl.h], [], [
+ AC_MSG_ERROR([wolfssl headers not found. install them or build without --with-wolfssl])
+ ])
+ AC_CHECK_LIB([wolfssl], [wolfSSL_Init],
+ [CRYPTO_LIB="-lwolfssl"],
+ [AC_MSG_ERROR([wolfssl crypto library not found. install it or build without --with-wolfssl])]
+ )
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #include <wolfssl/options.h>
+ #if !defined(HAVE_LIGHTY) && !defined(OPENSSL_ALL)
+ #error HAVE_LIGHTY macro not defined
+ #endif
+ ]])], [], [AC_MSG_ERROR([wolfssl must be built with ./configure --enable-lighty])])
+ SSL_LIB="-lwolfssl"
+
+ AC_SUBST([SSL_LIB])
+ AC_SUBST([CRYPTO_LIB])
+fi
+
+AM_CONDITIONAL([BUILD_WITH_OPENSSL],
+ [test "$WITH_OPENSSL" != no || test "$WITH_WOLFSSL" != no])
+
+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 pcre support
AC_MSG_NOTICE([----------------------------------------])
AC_MSG_CHECKING([for perl regular expressions support])
@@ -1419,7 +1464,7 @@ lighty_track_feature "pam" "mod_authn_pam" \
'test "$WITH_PAM" != no'
lighty_track_feature "network-openssl" "mod_openssl" \
- 'test "$WITH_OPENSSL" != no'
+ 'test "$WITH_OPENSSL" != no || test "$WITH_WOLFSSL" != no'
lighty_track_feature "auth-crypt" "" \
'test "$found_crypt" != no'