]> Pileus Git - ~andy/fetchmail/blobdiff - configure.in
Mimedecode now defaults to "off".
[~andy/fetchmail] / configure.in
index 90b724ba7bbbb11a5d040879ce9595012346cf8b..f146305eb1c00ebce7065a0151e6ba9c83231564 100644 (file)
@@ -35,11 +35,11 @@ AC_SUBST(LDEFLAGS)
 AC_SUBST(LIBOBJS)
 AC_SUBST(POMAKE)
 
-PACKAGE=`sed -n '/PACKAGE *= *\(.*\)/s//\1/p' <Makefile.in`
+PACKAGE=`sed -n '/PACKAGE *= *\(.*\)/s//\1/p' <$srcdir/Makefile.in`
 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
 AC_SUBST(PACKAGE)
 
-VERSION=`sed -n '/VERSION *= *\(.*\)/s//\1/p' <Makefile.in`
+VERSION=`sed -n '/VERSION *= *\(.*\)/s//\1/p' <$srcdir/Makefile.in`
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
 AC_SUBST(VERSION)
 
@@ -50,18 +50,29 @@ then
   echo "Adding -lbsd to standard libraries"
   LIBS="$LIBS -lbsd"
   LDFLAGS=""
-  if test `uname -r` = "2.5.0"
-  then
-    echo "Prepending standard include path to gcc flags"
-    CPFLAGS="-I/usr/include"
-  fi
+  echo "Prepending standard include path to gcc flags"
+  CPFLAGS="-I/usr/include"
 fi
 
+# Check for FreeBSD special case: -lkvm needed
+if test `uname` = "FreeBSD" 
+then
+   echo "Adding -lkvm to standard libraries"
+   LIBS="$LIBS -lkvm"
+fi
+# 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
 # i18n
 # Arnaldo Carvalho de Melo <acme@conectiva.com.br>
 # Sat Nov  7 15:39:03 EDT 1998
 
-ALL_LINGUAS="pt_BR"
+ALL_LINGUAS="cs es fr pl pt_BR ru"
 
 AM_GNU_GETTEXT
 
@@ -122,9 +133,10 @@ AC_SUBST(EXTRADEFS)
 AC_SUBST(EXTRASRC)
 AC_SUBST(EXTRAOBJ)
 
-AC_CHECK_FUNCS(tcsetattr stty setsid seteuid gethostbyname res_search herror \
-  strrchr strerror setlinebuf syslog snprintf vprintf vsnprintf vsyslog \
-  atexit inet_aton strftime setrlimit socketpair)
+AC_CHECK_FUNCS(tcsetattr stty setsid geteuid seteuid gethostbyname \
+  res_search herror strrchr strerror setlinebuf syslog \
+  snprintf vprintf vsnprintf vsyslog \
+  atexit inet_aton strftime setrlimit socketpair sigprocmask)
 
 # Under Red Hat 4.0 (and many other Linuxes) -lresolv is seriously flaky
 # and breaks gethostbyname(2).  It's better to use the bind stuff in the C
@@ -135,6 +147,9 @@ AC_CHECK_FUNC(res_search,
     AC_CHECK_LIB(resolv,res_search, 
        [AC_DEFINE(HAVE_RES_SEARCH) AC_MSG_RESULT(found resolver functions in libresolv); LIBS="$LIBS -lresolv"], AC_MSG_RESULT(no resolver calls found)))
 
+dnl Check for libcrypt
+AC_CHECK_LIB(crypt,crypt)
+
 dnl AC_FUNC_SETVBUF_REVERSED
 
 dnl Check for usable void pointer type
@@ -202,6 +217,11 @@ if test "$USE_NLS" = "yes"
 then
        echo 'Enabling internationalization support...'
        POMAKE='$(MAKE) -C po'
+       if test "x$prefix" != xNONE; then
+               EXTRADEFS="$EXTRADEFS -DLOCALEDIR='\"$prefix/share/locale\"'"
+       else
+               EXTRADEFS="$EXTRADEFS -DLOCALEDIR='\"$ac_default_prefix/share/locale\"'"
+       fi
 else
        echo 'Disabling internationalization support...'
        POMAKE="@echo '(NLS support disabled)'; #"
@@ -209,63 +229,70 @@ fi
 
 ###    use option --enable-POP2 to compile in the POP2 support
 AC_ARG_ENABLE(POP2,
-       [  --enable-POP2        compile in POP2 protocol support (obsolete)],
+       [  --enable-POP2           compile in POP2 protocol support (obsolete)],
        [with_POP2=$enableval],
        [with_POP2=no])
 test "$with_POP2" = "yes" && AC_DEFINE(POP2_ENABLE)
 
 ###    use option --disable-POP3 to omit the POP3 support
 AC_ARG_ENABLE(POP3,
-       [  --disable-POP3       don't compile in POP3 protocol support],
+       [  --disable-POP3          don't compile in POP3 protocol support],
        [with_POP3=$enableval],
        [with_POP3=yes])
 test "$with_POP3" = "yes" && AC_DEFINE(POP3_ENABLE)
 
 ###    use option --disable-IMAP to omit the IMAP support
 AC_ARG_ENABLE(IMAP,
-       [  --disable-IMAP       don't compile in IMAP protocol support],
+       [  --disable-IMAP          don't compile in IMAP protocol support],
        [with_IMAP=$enableval],
        [with_IMAP=yes])
 test "$with_IMAP" = "yes" && AC_DEFINE(IMAP_ENABLE)
 
 ###    use option --disable-ETRN to omit the ETRN support
 AC_ARG_ENABLE(ETRN,
-       [  --disable-ETRN       don't compile in ETRN protocol support],
+       [  --disable-ETRN          don't compile in ETRN protocol support],
        [with_ETRN=$enableval],
        [with_ETRN=yes])
 test "$with_ETRN" = "yes" && AC_DEFINE(ETRN_ENABLE)
 
 ###    use option --enable-RPA to compile in the RPA support
 AC_ARG_ENABLE(RPA,
-       [  --enable-RPA         compile in RPA protocol support],
+       [  --enable-RPA            compile in RPA protocol support],
        [with_RPA=$enableval],
        [with_RPA=no])
 test "$with_RPA" = "yes" && AC_DEFINE(RPA_ENABLE)
 
+###    use option --enable-NTLM to compile in the NTLM support
+AC_ARG_ENABLE(NTLM,
+       [  --enable-NTLM           compile in NTLM authentication support],
+       [with_NTLM=$enableval],
+       [with_NTLM=no])
+test "$with_NTLM" = "yes" && AC_DEFINE(NTLM_ENABLE)
+
 ###    use option --enable-SDPS to compile in the SDPS support
 AC_ARG_ENABLE(SDPS,
-       [  --enable-SDPS        compile in SDPS protocol support],
+       [  --enable-SDPS           compile in SDPS protocol support],
        [with_SDPS=$enableval],
        [with_SDPS=no])
 test "$with_SDPS" = "yes" && AC_DEFINE(SDPS_ENABLE)
 
 ###    use option --enable-opie to compile in the OPIE support
 AC_ARG_ENABLE(opie,
-       [  --enable-opie        support OTP through the OPIE library],
+       [  --enable-opie           support OTP through the OPIE library],
        [ AC_CHECK_HEADER(opie.h,, [echo 'configure: cannot find <opie.h>, which is required for OPIE support.'; exit 1])
           AC_CHECK_LIB(opie,opiegenerator,, [echo 'configure: cannot find libopie, which is required for OPIE support.'; exit 1])
           AC_DEFINE(OPIE,1) ],
        [with_opie=no])
 
 AC_ARG_ENABLE(inet6,
-       [  --enable-inet6       support IPv6 (requires the inet6-apps library)],
+       [  --enable-inet6          support IPv6 (requires the inet6-apps library)],
         [ unset ac_cv_lib_inet6_getaddrinfo; AC_CHECK_LIB(inet6, getaddrinfo,,
        [ unset ac_cv_lib_inet6_getaddrinfo; LDFLAGS="$LDFLAGS -L/usr/inet6/lib"; AC_CHECK_LIB(inet6, getaddrinfo,,
         [ echo 'configure: cannot find libinet6, which is required for IPv6 support.'; exit 1]) ])
           AC_DEFINE(INET6, 1) ])
 
 AC_ARG_ENABLE(netsec,
-       [  --enable-netsec      support network security (requires inet6-apps library)],
+       [  --enable-netsec         support network security (requires inet6-apps library)],
         [ unset ac_cv_lib_inet6_net_security_strtorequest; AC_CHECK_LIB(inet6, net_security_strtorequest,,
        [ unset ac_cv_lib_inet6_net_security_strtorequest; LDFLAGS="$LDFLAGS -L/usr/inet6/lib"; AC_CHECK_LIB(inet6, net_security_strtorequest,,
         [ echo 'configure: cannot find net_security_strtorequest in libinet6, which is required';
@@ -281,7 +308,7 @@ AC_ARG_ENABLE(netsec,
   
 ###    use option --with-kerberos5=DIR to point at a Kerberos 5 directory
 AC_ARG_WITH(kerberos5,
-       [  --with-kerberos5=DIR  point fetchmail compilation at a Kerberos 5 directory])
+       [  --with-kerberos5=DIR    point fetchmail compilation at a Kerberos 5 directory])
 
 # The "then" arm (nonempty $with_kerberos5) is kind of a crock.  It works for
 # configuring the BSD/OS Kerberos IV support, though. 
@@ -290,39 +317,59 @@ then
     # Path given
     CEFLAGS="$CEFLAGS -DKERBEROS_V5 -I$with_kerberos5/include"
     LDEFLAGS="$LDEFLAGS -L$with_kerberos5/lib"
-    LIBS="$LIBS -lkrb5 -lcrypto -lcom_err"
+    if test -f "$with_kerberos5/include/roken.h"
+    then
+       AC_DEFINE(HEIMDAL)
+       LIBS="$LIBS -lkrb5 -lasn1 -ldes -lroken -lcom_err"
+    else
+       LIBS="$LIBS -lkrb5 -lcrypto -lcom_err"
+    fi
 else
+  if test "$with_kerberos5" != "no" ; then
     for dir in /usr/kerberos /usr/local/krb5 /usr/athena
     do
       if test -f "$dir/include/krb5.h"
       then
         CEFLAGS="$CEFLAGS -DKERBEROS_V5 -I$dir/include"
         LDEFLAGS="$LDEFLAGS -L$dir/lib"
-        LIBS="$LIBS -lkrb5 -lcrypto -lcom_err"
+       if test -f "$dir/include/roken.h"
+       then
+           AC_DEFINE(HEIMDAL)
+           LIBS="$LIBS -lkrb5 -lasn1 -ldes -lcom_err"
+        else
+           LIBS="$LIBS -lkrb5 -lcrypto -lcom_err"
+        fi
         with_kerberos5=$dir
         break
       fi
     done
+  fi
 fi
 
 ###    use option --with-kerberos=DIR to point at a Kerberos directory
 AC_ARG_WITH(kerberos,
-       [  --with-kerberos=DIR  point fetchmail compilation at a Kerberos directory])
+       [  --with-kerberos=DIR     point fetchmail compilation at a Kerberos directory])
 
 # The "elif" arm (nonempty $with_kerberos) is kind of a crock.  It works for
 # configuring the BSD/OS Kerberos IV support, though. 
 
-# Check for a NetBSD special case
-if test "$with_kerberos" = "yes" -a `uname` = "NetBSD" 
+# Check for a NetBSD/OpenBSD special case
+if test "$with_kerberos" = "yes" && test `uname` = "NetBSD" -o `uname` = "OpenBSD"
 then
-  echo "Configuring kerberosIV for NetBSD"
+  echo "Configuring kerberosIV for `uname`"
   CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I/usr/include/kerberosIV"
   LIBS="$LIBS -lkrb -ldes"
 elif test -n "$with_kerberos" -a -n "$with_kerberos5"
 then
     CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I$with_kerberos/include"
     LDEFLAGS="$LDEFLAGS -L$with_kerberos/lib"
-    LIBS="-lkrb4 -ldes425 $LIBS"
+    if test -f "$with_kerberos5/roken.h"
+    then
+       AC_DEFINE(HEIMDAL)
+       LIBS="-lkrb4 -l45 $LIBS" 
+    else
+       LIBS="-lkrb4 -ldes425 $LIBS"
+    fi
 elif test -n "$with_kerberos5"
 then
     for dir in /usr/kerberos /usr/kerberosIV /usr/athena
@@ -335,12 +382,14 @@ then
         break
       fi
     done
-elif test -n "$with_kerberos"
+elif test -n "$with_kerberos" -a "$with_kerberos" != "no"
 then
     CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I$with_kerberos/include"
     LDEFLAGS="$LDEFLAGS -L$with_kerberos/lib"
     LIBS="$LIBS -lkrb -ldes"
 else
+  if test "$with_kerberos" != "no"
+  then
     for dir in /usr/kerberos /usr/kerberosIV /usr/athena
     do
       if test -f "$dir/include/krb.h"
@@ -355,7 +404,7 @@ fi
 
 ###    use option --with-socks=DIR to point at SOCKS library
 AC_ARG_WITH(socks,
-       [  --with-socks[=DIR]   add built-in SOCKS firewall access],
+       [  --with-socks[=DIR]      add built-in SOCKS firewall access],
 [
 if test "$with_socks" != no
 then
@@ -371,10 +420,9 @@ then
     LIBS="-lsocks $LIBS"
 fi])
 
-
 ###    use option --with-hesiod=DIR to point at a HESIOD directory
 AC_ARG_WITH(hesiod,
-       [  --with-hesiod=DIR    point fetchmail compilation at a HESIOD directory])
+       [  --with-hesiod=DIR       point fetchmail compilation at a HESIOD directory])
 
 if test -n "$with_hesiod"
 then
@@ -394,11 +442,12 @@ else
         break
       fi
     done
+  fi
 fi
 
 ###    use option --with-gssapi=DIR to compile in GSSAPI support
 AC_ARG_WITH(gssapi,
-       [  --with-gssapi[=DIR]  compile in GSSAPI support using libraries in DIR],
+       [  --with-gssapi[=DIR]     compile in GSSAPI support using libraries in DIR],
 [
 if test "$with_gssapi" != "no"
 then
@@ -414,10 +463,25 @@ then
 
   AC_CHECK_LIB(krb5, krb5_init_context,,
                AC_MSG_ERROR([could not find libkrb5 which is needed for GSSAPI support]))
-  AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,,
-               AC_MSG_ERROR([could not find libgssapi_krb5 which is needed for GSSAPI support]), -lkrb5)
+  if test -f "$with_kerberos5/include/roken.h"
+  then
+     AC_CHECK_LIB(gssapi, gss_init_sec_context,LIBS="$LIBS -lgssapi",
+                  AC_MSG_ERROR([could not find libgssapi which is needed for GSSAPI support]), )
+     AC_DEFINE(HEIMDAL)
+  else
+     AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,LIBS="$LIBS -lgssapi_krb5",
+                  AC_MSG_ERROR([could not find libgssapi_krb5 which is needed for GSSAPI support]), -lkrb5)
+  fi
   AC_DEFINE(GSSAPI)
-  LIBS="$LIBS -lgssapi_krb5 -lkrb5"
+  save_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="-I$with_gssapi/include"
+  AC_CHECK_HEADERS(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))
+  else
+    AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE))
+  fi
+  CPPFLAGS=$save_CPPFLAGS
 fi])
 
 AC_OUTPUT([Makefile intl/Makefile po/Makefile.in], [