]> Pileus Git - ~andy/fetchmail/commitdiff
Check if OpenSSL requires -ldl, too.
authorMatthias Andree <matthias.andree@gmx.de>
Sun, 25 Sep 2005 10:49:12 +0000 (10:49 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Sun, 25 Sep 2005 10:49:12 +0000 (10:49 -0000)
Consolidate target_os specific options into a case...esac structure.
Add -DBIND_8_COMPAT to CFLAGS on Darwin.

svn path=/trunk/; revision=4326

NEWS
configure.ac

diff --git a/NEWS b/NEWS
index 9845c176a120d2629a86fd23572a7f4e8996c8db..fa119da25b34243736e2b6904efa031f3657cfd4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -212,6 +212,9 @@ fetchmail 6.3.0 (not yet released officially):
 * Kerberos IV detection fix for FreeBSD 4. Simon Barner. (MA)
 * Fix display and documentation of --envelope option. Matthias Andree
 * Make "envelope 'Delivered-To'" work with dropdelivered. Timothy Lee. (MA)
+* Add -DBIND_8_COMPAT to Darwin (MacOS X) compiles, to fix build problems on
+  newer Darwin versions. Matthias Andree.
+* fetchmail should now automatically detect if OpenSSL requires -ldl.
 
 # INTERNAL CHANGES
 * Switched to automake. Matthias Andree.
index 3d3ee54080ab9dba05ef20e0926c01e1c05cafb6..7f80662dcf87253b84f11258ad256996e5cdc595 100644 (file)
@@ -10,6 +10,8 @@ AC_CONFIG_SRCDIR([fetchmail.h])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_LIBOBJ_DIR([.])
 
+AC_CANONICAL_TARGET
+
 dnl we may need a newer automake version - the oldest tested is 1.7
 AC_PREREQ(2.59)
 AM_INIT_AUTOMAKE(1.5 foreign no-installinfo)
@@ -52,31 +54,33 @@ AM_PROG_LEX
 AC_PROG_MAKE_SET
 AC_PROG_YACC
 
+# Check for OS special cases
+case $target_os in
+darwin*)
+    AC_MSG_NOTICE(found Darwin - Adding -DBIND_8_COMPAT to CFLAGS)
+    CPFLAGS="-DBIND_8_COMPAT"
+    ;;
+# Check for FreeBSD special case: more libs needed
+freebsd*)
+    AC_MSG_NOTICE(found FreeBSD - Adding -lmd -lkvm -lcom_err to standard libraries)
+    LIBS="$LIBS -lmd -lkvm -lcom_err"
+    ;;
 # Check for LynxOS special case: -lbsd needed (at least on 2.3.0) and -s
 # not working.
-if test `uname` = "LynxOS" 
-then
-  echo "Adding -lbsd to standard libraries"
-  LIBS="$LIBS -lbsd"
-  LDFLAGS=""
-  echo "Prepending standard include path to gcc flags"
-  CPFLAGS="-I/usr/include"
-fi
-
-# Check for FreeBSD special case: more libs needed
-if test `uname` = "FreeBSD" 
-then
-   echo "Adding -lmd -lkvm -lcom_err to standard libraries"
-   LIBS="$LIBS -lmd -lkvm -lcom_err"
-fi
+lynxos*)
+    AC_MSG_NOTICE(found LynxOS - Adding -lbsd to standard libraries)
+    LIBS="$LIBS -lbsd"
+    LDFLAGS=`echo $LDFLAGS | sed "s/-s //"`
+    AC_MSG_NOTICE(found LynxOS - Prepending standard include path to gcc flags)
+    CPFLAGS="-I/usr/include"
+    ;;
 # Check for Rhapsody special case: it doesn't like -s
-if test `uname` = "Rhapsody" 
-then
-   echo "Removing -s load flag"
-   LDFLAGS=`echo $LDFLAGS | sed "s/-s //"`
-fi
+rhapsody*)
+    AC_MSG_NOTICE(found Rhapsody - Removing -s load flag)
+    LDFLAGS=`echo $LDFLAGS | sed "s/-s //"`
+    ;;
+esac
+
 dnl i18n
 AM_GNU_GETTEXT([external], [need-ngettext])
 AM_GNU_GETTEXT_VERSION(0.14.1)
@@ -591,6 +595,16 @@ then
   fi
   LDEFLAGS="$LDEFLAGS -L$with_ssl/lib"
   LIBS="$LIBS -lssl -lcrypto"
+  dnl check if -ldl is needed!
+  AC_MSG_CHECKING([for additional library dependencies of SSL])
+  for i in "" "-ldl" ; do
+      save_LIBS="$LIBS"
+      LIBS="$LIBS $i"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM(,[SSL_library_init()])],break,LIBS="$save_LIBS")
+  done
+  if test "$i" = "" ; then i="(none)" ; fi
+  AC_MSG_RESULT($i)
+  dnl XXX FIXME: use pkg-config if available!
   AC_DEFINE(SSL_ENABLE)
 else
   echo 'Disabling SSL support...'