summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2006-08-20 20:17:53 +1000
committerDarren Tucker <dtucker@zip.com.au>2006-08-20 20:17:53 +1000
commit639bbe8bfe3d5038c279c97699de06cb0f120458 (patch)
treedaea3de927ee9deee1991514a7c41df630d04255 /configure.ac
parent3e6bde483de0de7ec38f131ee2639e52c828bec8 (diff)
- (dtucker) [configure.ac] Bug #1181: Explicitly test to see if OpenSSL
(0.9.8a and presumably newer) requires -ldl to successfully link.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac47
1 files changed, 42 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index a3eec952..b2939eee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.353 2006/08/20 10:03:50 dtucker Exp $
+# $Id: configure.ac,v 1.354 2006/08/20 10:17:53 dtucker Exp $
#
# Copyright (c) 1999-2004 Damien Miller
#
@@ -15,7 +15,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
-AC_REVISION($Revision: 1.353 $)
+AC_REVISION($Revision: 1.354 $)
AC_CONFIG_SRCDIR([ssh.c])
AC_CONFIG_HEADER(config.h)
@@ -1825,6 +1825,36 @@ Also see contrib/findssl.sh for help identifying header/library mismatches.])
]
)
+AC_MSG_CHECKING([if programs using OpenSSL functions will link])
+AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <openssl/evp.h>
+int main(void) { SSLeay_add_all_algorithms(); }
+ ]])],
+ [
+ AC_MSG_RESULT(yes)
+ ],
+ [
+ AC_MSG_RESULT(no)
+ saved_LIBS="$LIBS"
+ LIBS="$LIBS -ldl"
+ AC_MSG_CHECKING([if programs using OpenSSL need -ldl])
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <openssl/evp.h>
+int main(void) { SSLeay_add_all_algorithms(); }
+ ]])],
+ [
+ AC_MSG_RESULT(yes)
+ ],
+ [
+ AC_MSG_RESULT(no)
+ LIBS="$saved_LIBS"
+ ]
+ )
+ ]
+)
+
AC_ARG_WITH(ssl-engine,
[ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ],
[ if test "x$withval" != "xno" ; then
@@ -1926,12 +1956,19 @@ AC_ARG_WITH(pam,
PAM_MSG="yes"
+ LIBPAM="-lpam"
AC_DEFINE(USE_PAM, 1,
[Define if you want to enable PAM support])
+
if test $ac_cv_lib_dl_dlopen = yes; then
- LIBPAM="-lpam -ldl"
- else
- LIBPAM="-lpam"
+ case "$LIBS" in
+ *-ldl*)
+ # libdl already in LIBS
+ ;;
+ *)
+ LIBPAM="-$LIBPAM -ldl"
+ ;;
+ esac
fi
AC_SUBST(LIBPAM)
fi