]> Pileus Git - ~andy/fetchmail/blobdiff - configure.in
FETCHMAILHOME
[~andy/fetchmail] / configure.in
index 72522aca5097be8838e5103c6f2cdcaab8961b81..52a06f954dea9107e0c332c35ef5932f4209edac 100644 (file)
@@ -24,6 +24,7 @@ AC_TYPE_SIZE_T
 AC_TYPE_PID_T
 AC_TYPE_SIGNAL
 AC_CHECK_HEADERS(unistd.h termios.h termio.h sgtty.h stdarg.h alloca.h sys/itimer.h fcntl.h sys/fcntl.h memory.h sys/wait.h)
+AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h resolv.h net/socket.h)
 
 AC_C_CONST                     dnl getopt needs this.
 
@@ -72,7 +73,7 @@ fi
 # Arnaldo Carvalho de Melo <acme@conectiva.com.br>
 # Sat Nov  7 15:39:03 EDT 1998
 
-ALL_LINGUAS="cs es fr pl pt_BR ru"
+ALL_LINGUAS="cs es fr pl pt_BR gl"
 
 AM_GNU_GETTEXT
 
@@ -118,6 +119,10 @@ AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPTLONG),
               [EXTRASRC="$EXTRASRC \$(srcdir)/getopt.c \$(srcdir)/getopt1.c"
                EXTRAOBJ="$EXTRAOBJ getopt.o getopt1.o"])
 
+AC_CHECK_FUNC(MD5Init, AC_DEFINE(HAVE_MD5),
+              [EXTRASRC="$EXTRASRC \$(srcdir)/md5c.c"
+               EXTRAOBJ="$EXTRAOBJ md5c.o"])
+
 AC_FUNC_VPRINTF
 AC_FUNC_ALLOCA
 if test -n "$ALLOCA" 
@@ -147,8 +152,11 @@ 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 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
 
@@ -326,7 +334,7 @@ AC_ARG_WITH(kerberos5,
 
 # The "then" arm (nonempty $with_kerberos5) is kind of a crock.  It works for
 # configuring the BSD/OS Kerberos IV support, though. 
-if test -n "$with_kerberos5"
+if test -n "$with_kerberos5" -a "$with_kerberos5" != "no"
 then
     # Path given
     CEFLAGS="$CEFLAGS -DKERBEROS_V5 -I$with_kerberos5/include"
@@ -338,8 +346,7 @@ then
     else
        LIBS="$LIBS -lkrb5 -lcrypto -lcom_err"
     fi
-else
-  if test "$with_kerberos5" != "no" ; then
+elif test "$with_kerberos" != "no"; then
     for dir in /usr/kerberos /usr/local/krb5 /usr/athena
     do
       if test -f "$dir/include/krb5.h"
@@ -357,7 +364,6 @@ else
         break
       fi
     done
-  fi
 fi
 
 ###    use option --with-ssl to compile in the SSL support
@@ -416,6 +422,7 @@ then
     fi
     LDEFLAGS="$LDEFLAGS -L$with_ssl/lib"
     LIBS="$LIBS -lssl -lcrypto"
+    AC_DEFINE(SSL_ENABLE)
 else
     echo 'Disabling SSL support...'
 fi
@@ -433,7 +440,7 @@ then
   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"
+elif test -n "$with_kerberos" -a -n "$with_kerberos5" -a "$with_kerberos" != "no"
 then
     CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I$with_kerberos/include"
     LDEFLAGS="$LDEFLAGS -L$with_kerberos/lib"
@@ -444,7 +451,7 @@ then
     else
        LIBS="-lkrb4 -ldes425 $LIBS"
     fi
-elif test -n "$with_kerberos5"
+elif test -n "$with_kerberos5" -a "$with_kerberos" != "no"
 then
     for dir in /usr/kerberos /usr/kerberosIV /usr/athena
     do
@@ -494,17 +501,32 @@ then
     LIBS="-lsocks $LIBS"
 fi])
 
+###     use option --with-socks5=DIR to point at SOCKS library
+AC_ARG_WITH(socks5,
+        [  --with-socks5[=DIR]     add built-in SOCKS5 firewall access],
+[
+if test "$with_socks5" != no
+then
+    if test "$with_socks5" != yes
+    then
+        LDEFLAGS="$LDEFLAGS -L$with_socks5"
+    else
+        AC_CHECK_LIB(socks5, SOCKSconnect,,
+               AC_MSG_ERROR([could not find libsocks5 which is needed for built-in SOCKS5 support]))
+    fi
+    AC_DEFINE(HAVE_SOCKS)
+    CEFLAGS="$CEFLAGS -Dconnect=SOCKSconnect -Dgetsockname=SOCKSgetsockname -Dbind=SOCKSbind -Daccept=SOCKSaccept -Dlisten=SOCKSlisten -Dselect=SOCKSselect -Drecvfrom=SOCKSrecvfrom -Dsendto=SOCKSsendto -Drecv=SOCKSrecv -Dsend=SOCKSsend -Dread=SOCKSread -Dwrite=SOCKSwrite -Drresvport=SOCKSrresvport -Dshutdown=SOCKSshutdown -Dlisten=SOCKSlisten -Dclose=SOCKSclose -Ddup=SOCKSdup -Ddup2=SOCKSdup2 -Dfclose=SOCKSfclose -Dgethostbyname=SOCKSgethostbyname"
+    LIBS="-lsocks5 $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])
 
-if test -n "$with_hesiod"
-then
-    # Path given
-    CEFLAGS="$CEFLAGS -DHESIOD -I$with_hesiod/include"
-    LDEFLAGS="$LDEFLAGS -L$with_hesiod/lib"
-    LIBS="$LIBS -lhesiod"
-else
+case "x$with_hesiod" in
+xno)
+    ;;
+x)
     for dir in /usr/athena /usr /usr/local
     do
       if test -f "$dir/include/hesiod.h"
@@ -516,7 +538,14 @@ else
         break
       fi
     done
-  fi
+    ;;
+*)
+    # Path given
+    CEFLAGS="$CEFLAGS -DHESIOD -I$with_hesiod/include"
+    LDEFLAGS="$LDEFLAGS -L$with_hesiod/lib"
+    LIBS="$LIBS -lhesiod"
+    ;;
+  esac
 fi
 
 ###    use option --with-gssapi=DIR to compile in GSSAPI support