summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2017-10-25 21:52:23 +0200
committerGlenn Strauss <gstrauss@gluelogic.com>2017-10-28 22:48:12 -0400
commit34ded72469bb8c13ad6736b8174f4eccd5a97318 (patch)
tree82ffad54f0de63bc3ee41e5d196228e634bfdbc3
parent2c69ef6704b4858b224f9b25e159c9cd3f4667f4 (diff)
downloadlighttpd-git-34ded72469bb8c13ad6736b8174f4eccd5a97318.tar.gz
[autobuild] improve openssl
-rw-r--r--configure.ac63
1 files changed, 36 insertions, 27 deletions
diff --git a/configure.ac b/configure.ac
index 71a20380..84b32a63 100644
--- a/configure.ac
+++ b/configure.ac
@@ -547,53 +547,62 @@ AC_ARG_WITH([openssl],
AC_MSG_RESULT([$WITH_OPENSSL])
if test "$WITH_OPENSSL" != no; then
- use_openssl=yes
if test "$WITH_OPENSSL" != yes; then
- CPPFLAGS="$CPPFLAGS -I$WITH_OPENSSL/include"
- LDFLAGS="$LDFLAGS -L$WITH_OPENSSL/lib"
+ openssl_append_CPPFLAGS=" -I$WITH_OPENSSL/include"
+ openssl_append_LDFLAGS=" -L$WITH_OPENSSL/lib"
fi
-else
- use_openssl=no
fi
-AM_CONDITIONAL([BUILD_WITH_OPENSSL], [test "$WITH_OPENSSL" != no])
+AC_MSG_CHECKING([custom include directory for openssl])
AC_ARG_WITH([openssl-includes],
[AC_HELP_STRING([--with-openssl-includes=DIR], [OpenSSL includes])],
[
- use_openssl=yes
- CPPFLAGS="$CPPFLAGS -I$withval"
- ]
+ if test "$WITH_OPENSSL" = no; then
+ AC_MSG_ERROR([build --with-openssl to use --with-openssl-includes])
+ fi
+ openssl_append_CPPFLAGS=" -I$withval"
+ AC_MSG_RESULT([$withval])
+ ],
+ [AC_MSG_RESULT([no])]
)
+AC_MSG_CHECKING([custom lib directory for openssl])
AC_ARG_WITH([openssl-libs],
[AC_HELP_STRING([--with-openssl-libs=DIR], [OpenSSL libraries])],
[
- use_openssl=yes
- LDFLAGS="$LDFLAGS -L$withval"
- ]
+ if test "$WITH_OPENSSL" = no; then
+ AC_MSG_ERROR([build --with-openssl to use --with-openssl-libs])
+ fi
+ openssl_append_LDFLAGS=" -L$withval"
+ AC_MSG_RESULT([$withval])
+ ],
+ [AC_MSG_RESULT([no])]
)
-if test "$use_openssl" = yes; then
+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])
fi
- AC_CHECK_HEADERS([openssl/ssl.h])
- OLDLIBS="$LIBS"
+ CPPFLAGS="${CPPFLAGS}${openssl_append_CPPFLAGS}"
+ LDFLAGS="${LDFLAGS}${openssl_append_LDFLAGS}"
+
+ AC_CHECK_HEADERS([openssl/ssl.h], [], [
+ AC_MSG_ERROR([openssl headers not found. install them or build without --with-openssl])
+ ])
AC_CHECK_LIB([crypto], [BIO_f_base64],
- [AC_CHECK_LIB([ssl], [SSL_new],
- [
- SSL_LIB="-lssl -lcrypto"
- CRYPTO_LIB="-lcrypto"
- AC_DEFINE([HAVE_LIBSSL], [], [Have libssl])
- ],
- [],
- [ -lcrypto "$DL_LIB" ]
- )],
- [],
- []
+ [CRYPTO_LIB="-lcrypto"],
+ [AC_MSG_ERROR([openssl crypto library not found. install it or build without --with-openssl])]
)
- LIBS="$OLDLIBS"
+ AC_CHECK_LIB([ssl], [SSL_new],
+ [SSL_LIB="-lssl -lcrypto"],
+ [AC_MSG_ERROR([openssl ssl library not found. install it or build without --with-openssl])],
+ [ -lcrypto "$DL_LIB" ]
+ )
+
+ AC_DEFINE([HAVE_LIBSSL], [], [Have libssl])
AC_SUBST([SSL_LIB])
AC_SUBST([CRYPTO_LIB])
fi