]> Pileus Git - ~andy/fetchmail/blobdiff - configure.ac
Credit John Beck's fixes.
[~andy/fetchmail] / configure.ac
index 75543406bf836f50fb3f1340493c1cfbc2ddc307..ebb4db56b7e4275c357256a0be95e375d2bff710 100644 (file)
@@ -3,12 +3,13 @@ dnl Autoconfigure input file for fetchmail
 # Fetchmail automatic configuration support
 #
 # Eric S. Raymond <esr@thyrsus.com>
-# 2004 - 2008 Matthias Andree <matthias.andree@gmx.de>
+# 2004 - 2012 Matthias Andree <matthias.andree@gmx.de>
 #
 dnl Process this file with autoconf to produce a configure script.
 dnl
 
-AC_INIT([fetchmail],[6.3.9],[fetchmail-users@lists.berlios.de])
+dnl XXX - if bumping version here, check fetchmail.man, too!
+AC_INIT([fetchmail],[6.3.25],[fetchmail-users@lists.berlios.de])
 AC_CONFIG_SRCDIR([fetchmail.h])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_LIBOBJ_DIR([.])
@@ -18,7 +19,8 @@ AC_CANONICAL_HOST
 dnl automake options are in Makefile.am
 AC_PREREQ(2.60)
 dnl 2.60 required for AC_USE_SYSTEM_EXTENSIONS
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([silent-rules -Wall])
+AM_SILENT_RULES
 
 dnl python is optional
 #
@@ -31,6 +33,7 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
 
 AC_PROG_AWK
 AC_PROG_CC
+AM_PROG_CC_C_O
 AC_PROG_INSTALL
 AC_PROG_CPP                    dnl Later checks need this.
 AC_PROG_RANLIB
@@ -45,6 +48,24 @@ dnl INTERACTIVE Systems Corporation Unix on 2006-07-23.  New programs
 dnl need not use this macro.  It is implemented as
 dnl `AC_SEARCH_LIBS([strerror], [cposix])'
 
+dnl check for b0rked Solaris (and other shells) and find one that works
+AC_MSG_CHECKING(for a working shell...)
+for i in /usr/xpg6/bin/sh /usr/xpg4/bin/sh /usr/ccs/bin/sh /bin/sh /usr/bin/sh /bin/ksh /bin/bash /usr/local/bin/bash ; do
+    $i -c 'if ! false ; then echo $(echo ok) ; fi' >config.$$ 2>/dev/null
+    j=`cat config.$$`
+    rm -f config.$$
+    if test "x$j" = "xok" ; then
+        SHELL=$i
+        AC_SUBST(SHELL)
+        break
+    fi
+done
+AC_MSG_RESULT($SHELL)
+if test "x$SHELL" = "x" ; then
+    AC_MSG_ERROR(no SUS compliant shell found - on Solaris, install SUNWxcu4)
+fi
+
+
 AC_HEADER_STDC
 AC_HEADER_TIME
 AC_TYPE_SIZE_T
@@ -74,6 +95,13 @@ AC_CHECK_HEADERS([resolv.h],,,[
 #endif
 ])
 
+AC_CHECK_DECLS([h_errno],,,[
+       AC_INCLUDES_DEFAULT
+       #ifdef HAVE_NETDB_H
+       #include <netdb.h>
+       #endif
+])
+
 AC_C_CONST                     dnl getopt needs this.
 
 AM_PROG_LEX
@@ -88,8 +116,8 @@ darwin*)
     ;;
 # 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"
+    AC_MSG_NOTICE(found FreeBSD - Adding -lkvm -lcom_err to standard libraries)
+    LIBS="$LIBS -lkvm -lcom_err"
     ;;
 # Check for LynxOS special case: -lbsd needed (at least on 2.3.0) and -s
 # not working.
@@ -107,9 +135,11 @@ rhapsody*)
     ;;
 esac
 
+AC_CACHE_SAVE
+
 dnl i18n
 AM_GNU_GETTEXT([external], [need-ngettext])
-AM_GNU_GETTEXT_VERSION([0.14.6])
+AM_GNU_GETTEXT_VERSION([0.17])
 dnl end i18n
 
 # Under sysV68, socket and friends are provided by the C library.
@@ -142,10 +172,6 @@ dnl                [LIBS="$LIBS -lintl"])
 
 AC_REPLACE_FUNCS([strstr strcasecmp memmove stpcpy strlcpy strlcat])
 
-AC_CHECK_FUNC(MD5Init, [],
-             [AC_LIBSOURCE(md5c.c)
-               EXTRAOBJ="$EXTRAOBJ md5c.\$(OBJEXT)"])
-
 AC_CHECK_FUNC(getopt_long, [],
               [AC_LIBSOURCES([getopt.c, getopt1.c])
               EXTRAOBJ="$EXTRAOBJ getopt.\$(OBJEXT) getopt1.\$(OBJEXT)"])
@@ -159,7 +185,7 @@ AC_CHECK_FUNCS(tcsetattr stty setsid geteuid seteuid dnl
   atexit inet_aton strftime setrlimit socketpair dnl
   sigaction strdup setlocale)
 
-AC_CHECK_DECLS(strerror)
+AC_CHECK_DECLS([strerror,getenv])
 dnl INET6 is used by KAME/getnameinfo
 AC_CACHE_CHECK(for AF_INET6/PF_INET6,ac_cv_inet6,
 AC_COMPILE_IFELSE([
@@ -216,11 +242,6 @@ done
 dnl Check for libcrypt -- it may live in libc or libcrypt, as on IRIX
 AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt,crypt))
 
-dnl Check for RSA refersence library in case we're using SSL
-AC_CHECK_LIB(rsaref, RSAPublicDecrypt)
-
-dnl AC_FUNC_SETVBUF_REVERSED
-
 dnl Check for usable void pointer type
 AC_MSG_CHECKING(use of void pointer type)
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[char *p;
@@ -413,6 +434,7 @@ AC_ARG_ENABLE(NTLM,
        [with_NTLM=$enableval],
        [with_NTLM=no])
 test "$with_NTLM" = "yes" && AC_DEFINE(NTLM_ENABLE,1,Define if you want NTLM authentication)
+AM_CONDITIONAL(NTLM_ENABLE, test "$with_NTLM" = yes)
 
 ###    use option --enable-SDPS to compile in the SDPS support
 AC_ARG_ENABLE(SDPS,
@@ -432,11 +454,13 @@ if test "$with_POP3" != yes && test "$with_POP2" != yes \
     AC_MSG_ERROR([You must enable at least one of POP2, POP3 and IMAP.])
 fi
 
+AC_CACHE_SAVE
+
 ###    use option --enable-opie to compile in the OPIE support
 AC_ARG_ENABLE(opie,
        [  --enable-opie           support OTP through the OPIE library],
-       [ AC_CHECK_HEADER(opie.h,, [AC_MSG_ERROR(cannot find <opie.h>, which is required for OPIE support.)])
-          AC_CHECK_LIB(opie,opiegenerator,, [AC_MSG_ERROR(cannot find libopie, which is required for OPIE support.)])
+       [ AC_CHECK_HEADER(opie.h,, [AC_MSG_ERROR([cannot find <opie.h>, which is required for OPIE support.])])
+          AC_CHECK_LIB(opie,opiegenerator,, [AC_MSG_ERROR([cannot find libopie, which is required for OPIE support.])])
           with_opie=$enableval],
        [with_opie=no])
 test "$with_opie" = "yes" && AC_DEFINE(OPIE_ENABLE,1,Define if you want OPIE support compiled in)
@@ -472,7 +496,7 @@ AC_CACHE_CHECK([for getnameinfo],[fm_cv_getnameinfo],[
 #include <netdb.h>
 #endif
 #ifndef NULL
-#define NULL ((void *)0)
+#define NULL 0
 #endif
   ], [getnameinfo(NULL,0, NULL,0, NULL, 0, 0);],
     [ fm_cv_getnameinfo=yes],
@@ -568,7 +592,7 @@ else
            AC_CHECK_LIB(db2, db_open, ac_krblibs="$ac_krblibs -ldb2", [],
                 ${LDFLAGS})
            AC_CHECK_LIB(des, des_string_to_key, libk5crypto=-ldes,
-              AC_CHECK_LIB(ssl, MD5_Init, [],
+              AC_CHECK_LIB(crypto, MD5_Init, [],
                 AC_MSG_ERROR([DES libraries not found. Try adding --with-ssl to enable OpenSSL support]),
                 ${LDFLAGS} ${ac_krblibs}),
            ${LDFLAGS} ${ac_krblibs})
@@ -761,7 +785,7 @@ then
   save_LIBS="$LIBS"
   for i in "" "-ldl" ; do
       LIBS="$LDFLAGS $save_LIBS $i"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM(,[SSL_library_init()])],[found=1; break])
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <openssl/ssl.h>],[SSL_library_init()])],[found=1; break])
   done
   if test $found = 0 ; then
       AC_MSG_RESULT([error])
@@ -773,9 +797,15 @@ then
   dnl XXX FIXME: use pkg-config if available!
   AC_DEFINE(SSL_ENABLE)
 else
-  AC_MSG_NOTICE(Disabling SSL support.)
+  AC_MSG_WARN(Disabling SSL support.)
+  AC_MSG_WARN(Consider re-running configure --with-ssl.)
 fi
 
+case "$LIBS" in *-lssl*)
+       AC_CHECK_DECLS([SSLv2_client_method],,,[#include <openssl/ssl.h>])
+       ;;
+esac
+
 ###    use option --with-socks=DIR to point at SOCKS library
 AC_ARG_WITH(socks,
        [  --with-socks[=DIR]      add built-in SOCKS firewall access],
@@ -814,6 +844,7 @@ then
   LDFLAGS="$ac_savedLDFLAGS"
 fi])
 
+dnl for libesmtp/ modules:
 ACX_WHICH_GETHOSTBYNAME_R
 
 ###    use option --with-hesiod=DIR to point at a HESIOD directory
@@ -866,14 +897,23 @@ then
   fi
   AC_DEFINE(GSSAPI,1,Define if you want GSSAPI authentication)
   if test "$with_gssapi" != yes ; then
-    CPPFLAGS="$CPPFLAGS-I$with_gssapi/include"
+    CPPFLAGS="$CPPFLAGS -I$with_gssapi/include"
   fi
   AC_CHECK_HEADERS(gss.h gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h)
-  if test "$ac_cv_header_gssapi_h" = "yes"; then
-    AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,1,Define if you have MIT kerberos))
-  else
-    AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE))
-  fi
+  AC_CHECK_DECLS(GSS_C_NT_HOSTBASED_SERVICE,,,[
+    AC_INCLUDES_DEFAULT
+    #if HAVE_GSS_H
+    #include <gss.h>
+    #endif
+    #if HAVE_GSSAPI_GSSAPI_H
+    #include <gssapi/gssapi.h>
+    #elif HAVE_GSSAPI_H
+    #include <gssapi.h>
+    #endif
+    #if HAVE_GSSAPI_GSSAPI_GENERIC_H
+    #include <gssapi/gssapi_generic.h>
+    #endif
+    ])
 fi])
 
 dnl ,------------------------------------------------------------------
@@ -928,7 +968,7 @@ if test "$needtrio" = 1 ; then
 fi
 dnl ----------------------------------------------------------------'
 
-AC_CONFIG_FILES([Makefile po/Makefile.in genlsm.sh])
+AC_CONFIG_FILES([Makefile po/Makefile.in])
 AC_OUTPUT
 
 dnl Local Variables: