summaryrefslogtreecommitdiffstats
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
parent3e6bde483de0de7ec38f131ee2639e52c828bec8 (diff)
- (dtucker) [configure.ac] Bug #1181: Explicitly test to see if OpenSSL
(0.9.8a and presumably newer) requires -ldl to successfully link.
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac47
2 files changed, 45 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index dc43a054..62adc612 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@
afterward. Removes the need to mangle $LIBS later to remove -lpam and -ldl.
- (dtucker) [configure.ac] Relocate --with-pam parts in preparation for
fixing bug #1181. No changes yet.
+ - (dtucker) [configure.ac] Bug #1181: Explicitly test to see if OpenSSL
+ (0.9.8a and presumably newer) requires -ldl to successfully link.
20060819
- (djm) OpenBSD CVS Sync
@@ -5281,4 +5283,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
-$Id: ChangeLog,v 1.4501 2006/08/20 10:03:50 dtucker Exp $
+$Id: ChangeLog,v 1.4502 2006/08/20 10:17:53 dtucker Exp $
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