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 es pl fr"
+ALL_LINGUAS="cs es fr pl pt_BR"
AM_GNU_GETTEXT
[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"
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 \
+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
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
[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-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=$enableval],
[with_opie=no])
+test "$with_opie" = "yes" && AC_DEFINE(OPIE_ENABLE)
AC_ARG_ENABLE(inet6,
[ --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_CHECK_FUNC(getaddrinfo, [with_inet6=yes],
+ [ LDFLAGS="$LDFLAGS -L/usr/inet6/lib";
+ AC_CHECK_LIB(inet6, getaddrinfo, [with_inet6=yes
+ LIBS="$LIBS -linet6"],
+ [ echo 'configure: cannot find proper glibc version or libinet6,';
+ echo ' which is required for IPv6 support.';
+ exit 1]) ] )],
+ [with_inet6=no])
+test "$with_inet6" = "yes" && AC_DEFINE(INET6_ENABLE)
+
+AC_CHECK_FUNCS(inner_connect)
AC_ARG_ENABLE(netsec,
[ --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';
- echo ' for network security support. Either it does not exist, or it was';
- echo ' not built with network security support enabled.';
- exit 1]) ])
- unset ac_cv_header_net_security_h; AC_CHECK_HEADER(net/security.h,,
- [ unset ac_cv_header_net_security_h; CPPFLAGS="$CPPFLAGS -I/usr/inet6/include"; CFLAGS="$CFLAGS -I/usr/inet6/include"; AC_CHECK_HEADER(net/security.h,,
- [ echo 'configure: cannot find <net/security.h>, which is required for network security';
- echo ' support.';
- exit 1]) ])
- AC_DEFINE(NET_SECURITY, 1) ])
-
+ [ 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';
+ echo ' for network security support. Either it does not exist, or it was';
+ echo ' not built with network security support enabled.';
+ exit 1]) ])
+ unset ac_cv_header_net_security_h; AC_CHECK_HEADER(net/security.h,,
+ [ unset ac_cv_header_net_security_h;
+ CPPFLAGS="$CPPFLAGS -I/usr/inet6/include";
+ CFLAGS="$CFLAGS -I/usr/inet6/include"; AC_CHECK_HEADER(net/security.h,,
+ [ echo 'configure: cannot find <net/security.h>, which is required';
+ echo ' for network security support.';
+ exit 1]) ]) ]
+ [with_netsec=no])
+test "$with_netsec" = "yes" && AC_DEFINE(NET_SECURITY)
+
### 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])
# 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-ssl to compile in the SSL support
+AC_ARG_WITH(ssl,
+ [ --with-ssl=[DIR] enable SSL support using libraries in DIR],
+ [with_ssl=$withval],
+ [with_ssl=no])
+test "$with_ssl" = "yes" && AC_DEFINE(SSL_ENABLE)
+
+if test "$with_ssl" = "yes"
+then
+# He didn't specify an SSL location. Let's look at some common
+# directories where SSL has been found in the past and try and auto
+# configure for SSL. OpenSSL determination will be made later.
+# This will screw up if an OpenSSL install is located in a later
+# directory than an older SSLeay install, but the user should fix that
+# anyways and he can override on the configure line.
+
+ for ac_dir in \
+ /usr/local/ssl \
+ /usr/ssl \
+ /local/ssl \
+ /opt/ssl \
+ ; \
+ do
+ if test -d "$ac_dir" ; then
+ with_ssl=$ac_dir
+ break;
+ fi
+ done
+fi
+
+if test -n "$with_ssl" -a "$with_ssl" != "no"
+then
+ # With the autoconfigure above, the only time this is going to be
+ # true is going to be when we could not find the headers. If they
+ # are not in system standard locations, we are going to be broken.
+ if test "$with_ssl" = "yes"
+ then
+# Let's just define the standard location for the SSLeay root
+ with_ssl="/usr/local/ssl"
+ fi
+ if test -r $with_ssl/include/openssl/ssl.h
+ then
+### ssl.h found under openssl. Use openssl configuration preferentially
+ echo "Enabling OpenSSL support in $with_ssl"
+ CEFLAGS="$CEFLAGS -I$with_ssl/include -I$with_ssl/include/openssl"
+### OpenBSD comes with ssl headers
+ elif test -r /usr/include/ssl/ssl.h
+ then
+ echo "Enabling SSLeay support in $with_ssl"
+ CEFLAGS="$CEFLAGS -I/usr/include/ssl"
+ else
+ echo "Enabling SSLeay support in $with_ssl"
+ CEFLAGS="$CEFLAGS -I$with_ssl/include"
+ fi
+ LDEFLAGS="$LDEFLAGS -L$with_ssl/lib"
+ LIBS="$LIBS -lssl -lcrypto"
+else
+ echo 'Disabling SSL support...'
fi
### use option --with-kerberos=DIR to point 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
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"
break
fi
done
+ fi
fi
### use option --with-gssapi=DIR to compile in GSSAPI support
LDFLAGS="$LDFLAGS -L$with_gssapi/lib"
fi
- 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_gssapi/include/roken.h"
+ then
+ LIBS="$LIBS -lkrb5 -lasn1 -ldes -lroken -ldb -ldl"
+ 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
fi])
AC_OUTPUT([Makefile intl/Makefile po/Makefile.in], [
# The reason for this odd makedepend line is that we want
# to have all dependencies evaluated relative to the source directory
# and let VPATH do all the dirty work when we build remotely
- echo "You can ignore any makedepend error messages";
+ echo "You can ignore any makedepend error messages:";
+ echo timestamp > stamp-h;
(cd $srcdir; makedepend -f - *.c) >>Makefile])
dnl Local Variables: