]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
When checking for -lssl, include -ldl if it exists. OpenSSL 0.9.8 uses it.
authorTimo Sirainen <tss@iki.fi>
Fri, 27 Jun 2008 06:45:07 +0000 (09:45 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 27 Jun 2008 06:45:07 +0000 (09:45 +0300)
--HG--
branch : HEAD

configure.in

index 1a50d6d88b29d91cc9ee55fe3f0552c60aaad8d8..22f508d8a4e121b4da4474602273cee5bc752dd1 100644 (file)
@@ -1493,6 +1493,19 @@ if test "x$lib_cv_va_val_copy" = "xno"; then
   AC_DEFINE(VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
 fi
 
+dnl * dynamic modules?
+have_modules=no
+AC_CHECK_FUNC(dlopen, [
+  have_modules=yes
+  MODULE_LIBS="-export-dynamic"
+], [
+  AC_CHECK_LIB(dl, dlopen, [
+    have_modules=yes
+    MODULE_LIBS="-export-dynamic -ldl"
+    DLLIB=-ldl
+  ])
+])
+
 dnl **
 dnl ** SSL
 dnl **
@@ -1505,9 +1518,10 @@ if test $want_openssl != no && test $have_ssl = no; then
     CFLAGS="$CFLAGS $SSL_CFLAGS"
     have_openssl=yes
   else
+    # openssl 0.9.8 wants -ldl and it's required if there's only .a lib
     AC_CHECK_LIB(ssl, SSL_read, [
       AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h, [
-        SSL_LIBS="-lssl -lcrypto"
+        SSL_LIBS="-lssl -lcrypto $DLLIB"
         AC_SUBST(SSL_LIBS)
        have_openssl=yes
       ], [
@@ -1519,7 +1533,7 @@ if test $want_openssl != no && test $have_ssl = no; then
       if test $want_openssl = yes; then
         AC_ERROR([Can't build with OpenSSL: libssl not found])
       fi
-    ], -lcrypto)
+    ], -lcrypto $DLLIB)
   fi
   if test "$have_openssl" = "yes"; then
     AC_DEFINE(HAVE_OPENSSL,, Build with OpenSSL support)
@@ -2012,18 +2026,6 @@ AC_CHECK_FUNC(crypt,, [
   ])
 ])
 
-dnl * dynamic modules?
-have_modules=no
-AC_CHECK_FUNC(dlopen, [
-  have_modules=yes
-  MODULE_LIBS="-export-dynamic"
-], [
-  AC_CHECK_LIB(dl, dlopen, [
-    have_modules=yes
-    MODULE_LIBS="-export-dynamic -ldl"
-  ])
-])
-
 if test $have_modules = yes; then
   AC_DEFINE(HAVE_MODULES,, Define if you have dynamic module support)
   AC_SUBST(MODULE_LIBS)