1 dnl Autoconfigure input file for fetchmail
2 dnl Eric S. Raymond <esr@thyrsus.com>
4 dnl Process this file with autoconf to produce a configure script.
7 AC_INIT(fetchmail.h) dnl A distinctive file to look for in srcdir.
8 AM_CONFIG_HEADER(config.h)
10 dnl We want these before the checks, so the checks can modify their values.
11 test -z "$CFLAGS" && CFLAGS="-O" AC_SUBST(CFLAGS)
12 test -z "$LDFLAGS" && LDFLAGS=AC_SUBST(LDFLAGS)
14 PACKAGE=`sed -n '/PACKAGE *= *\(.*\)/s//\1/p' <$srcdir/Makefile.in`
15 VERSION=`sed -n '/VERSION *= *\(.*\)/s//\1/p' <$srcdir/Makefile.in`
16 AM_INIT_AUTOMAKE("$PACKAGE", "$VERSION")
21 AC_PROG_CPP dnl Later checks need this.
30 AC_CHECK_HEADERS(unistd.h termios.h termio.h sgtty.h stdarg.h alloca.h)
31 AC_CHECK_HEADERS(sys/itimer.h fcntl.h sys/fcntl.h memory.h sys/wait.h sys/shm.h)
32 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h resolv.h net/socket.h sys/select.h)
34 AC_C_CONST dnl getopt needs this.
36 dnl do NOT use AM_PROG_LEX, builds without LEX are not supported properly
44 # Check for LynxOS special case: -lbsd needed (at least on 2.3.0) and -s
46 if test `uname` = "LynxOS"
48 echo "Adding -lbsd to standard libraries"
51 echo "Prepending standard include path to gcc flags"
52 CPFLAGS="-I/usr/include"
55 # Check for FreeBSD special case: more libs needed
56 if test `uname` = "FreeBSD"
58 echo "Adding -lmd -lkvm -lcom_err to standard libraries"
59 LIBS="$LIBS -lmd -lkvm -lcom_err"
62 # Check for Rhapsody special case: it doesn't like -s
63 if test `uname` = "Rhapsody"
65 echo "Removing -s load flag"
66 LDFLAGS=`echo $LDFLAGS | sed "s/-s //"`
70 ALL_LINGUAS="ca cs da de es fr gl ja pl pt_BR tr"
74 # Under sysV68, socket and friends are provided by the C library.
75 # -linet does not provide socket, but causes multiple definition
76 # errors at link-time. It is thus better to only use the C library.
77 # So don't add -linet to the link list unless it's necessary
79 AC_MSG_RESULT(using libc's socket),
80 AC_CHECK_LIB(socket,socket)
81 AC_CHECK_LIB(inet,socket))
83 # The condition in this test copes with the presence of inet_addr in libc6.
84 AC_CHECK_FUNC(inet_addr,
85 AC_MSG_RESULT(using libc's inet_addr),
86 AC_CHECK_LIB(nsl,inet_addr))
88 dnl Port hack for Interactive UNIX System V/386 Release 3.2
89 AC_CHECK_LIB(cposix, strchr,
90 [EXTRADEFS="$EXTRADEFS -D_SYSV3"
91 LIBS="$LIBS -lcposix"])
93 dnl Port hack for Sparc/NetBSD-1.5
94 AC_CHECK_LIB(intl, gettext,
95 [LIBS="$LIBS -lintl"])
97 AC_CHECK_FUNC(strstr, AC_DEFINE(HAVE_STRSTR),
98 [EXTRASRC="$EXTRASRC \$(srcdir)/strstr.c"
99 EXTRAOBJ="$EXTRAOBJ strstr.o"])
101 AC_CHECK_FUNC(strcasecmp, AC_DEFINE(HAVE_STRCASECMP),
102 [EXTRASRC="$EXTRASRC \$(srcdir)/strcasecmp.c"
103 EXTRAOBJ="$EXTRAOBJ strcasecmp.o"])
105 AC_CHECK_FUNC(memmove, AC_DEFINE(HAVE_MEMMOVE),
106 [EXTRASRC="$EXTRASRC \$(srcdir)/memmove.c"
107 EXTRAOBJ="$EXTRAOBJ memmove.o"])
109 AC_CHECK_FUNC(MD5Init, AC_DEFINE(HAVE_MD5),
110 [EXTRASRC="$EXTRASRC \$(srcdir)/md5c.c"
111 EXTRAOBJ="$EXTRAOBJ md5c.o"])
113 AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG),
114 [EXTRASRC="$EXTRASRC \$(srcdir)/getopt.c \$(srcdir)/getopt1.c"
115 EXTRAOBJ="$EXTRAOBJ getopt.o getopt1.o"])
121 EXTRASRC="$EXTRASRC \$(srcdir)/alloca.c"
122 EXTRAOBJ="$EXTRAOBJ alloca.o"
125 dnl AC_CHECK_FUNC calls that might hack the Makefile must precede
126 dnl the following AC_SUBSTs
132 AC_CHECK_FUNCS(tcsetattr stty setsid geteuid seteuid gethostbyname \
133 res_search herror strrchr strerror setlinebuf syslog \
134 snprintf vprintf vsnprintf vsyslog \
135 atexit inet_aton strftime setrlimit socketpair sigprocmask sigaction \
138 # Under Red Hat 4.0 (and many other Linuxes) -lresolv is seriously flaky
139 # and breaks gethostbyname(2). It's better to use the bind stuff in the C
140 # library. So don't add -lresolv to the link list unless it's necessary
141 # (It will be necessary when using GNU libc6).
142 AC_CHECK_FUNC(res_search,
143 AC_MSG_RESULT(using libc's resolver functions),
144 AC_CHECK_LIB(resolv,res_search,
145 [AC_DEFINE(HAVE_RES_SEARCH) AC_MSG_RESULT(found resolver functions in libresolv); LIBS="$LIBS -lresolv"], AC_MSG_RESULT(no resolver calls found)))
147 dnl Check for libcrypt -- it may live in libc or libcrypt, as on IRIX
148 AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt,crypt))
150 dnl Check for RSA refersence library in case we're using SSL
151 AC_CHECK_LIB(rsaref, RSAPublicDecrypt)
153 dnl AC_FUNC_SETVBUF_REVERSED
155 dnl Check for usable void pointer type
156 AC_MSG_CHECKING(use of void pointer type)
160 p = (char *) xmalloc(1);
162 [AC_DEFINE(HAVE_VOIDPOINTER) AC_MSG_RESULT(yes)],
165 dnl Check for ANSI volatile
166 AC_MSG_CHECKING(for ANSI volatile)
169 [AC_DEFINE(HAVE_VOLATILE) AC_MSG_RESULT(yes)],
172 dnl Check out the wait reality. We have to assume sys/wait.h is present.
173 AC_CHECK_FUNCS(waitpid wait3)
174 AC_MSG_CHECKING(for union wait);
175 AC_TRY_LINK([#include <sys/types.h>
176 #include <sys/wait.h>],
177 [union wait status; int pid; pid = wait (&status);
179 /* Some POSIXoid systems have both the new-style macros and the old
180 union wait type, and they do not work together. If union wait
181 conflicts with WEXITSTATUS et al, we don't want to use it at all. */
182 if (WEXITSTATUS (status) != 0) pid = -1;
185 /* Make sure union wait works with waitpid. */
186 pid = waitpid (-1, &status, 0);
189 [AC_DEFINE(HAVE_UNION_WAIT) AC_MSG_RESULT(yes)],
192 AC_MSG_CHECKING(sys_siglist declaration in signal.h or unistd.h)
193 AC_TRY_LINK([#include <signal.h>
194 /* NetBSD declares sys_siglist in <unistd.h>. */
197 #endif], [char *msg = *(sys_siglist + 1);],
198 [AC_DEFINE(SYS_SIGLIST_DECLARED) AC_MSG_RESULT(yes)],
201 # Find the right directory to put the root-mode PID file in
202 for dir in "/var/run" "/etc"
209 AC_MSG_RESULT(root-mode pid file will go in $dir)
210 AC_DEFINE_UNQUOTED(PID_DIR, "$dir")
212 # We may have a fallback MDA available in case the socket open to the
213 # local SMTP listener fails. Best to use procmail for this, as we know
214 # it won't try delivering through local SMTP and cause a mail loop.
215 # Sendmail without the -t option to use the message headers will work too,
216 # not just for sendmail itself but for workalikes like exim.
218 # Note1: A disadvantage of using procmail is that local alias expansion
219 # according to /etc/aliases won't get done if we fall back. This doesn't
220 # matter in single-drop mode.
222 # Note2: it would be a very bad idea to use any MDA that doesn't return
223 # a refuse-to-deliver status on disk- or process-table-full
224 # conditions; mail could get lost that way. Sendmail and all of the MDAs
225 # like exim that might be lurking under a sendmail alias) do the right
226 # thing in this circumstance. Matthias Andree warns that procmail does
229 # Note3: Defalt value of fallback is now off. Matthias writes:
231 # 1. there is no way to predict when the fallback is used. With some MTAs
232 # (such as those limiting load average), outer circumstances can cause
233 # the fallback to kick in.
235 # 2. the fallback changes fetchmail behaviour in unpredictable ways. It's
236 # not only about alias expansion, .forwards to special filters won't
237 # work, mail may end up in a different place (users claim "mail loss"
240 # 3. The claim procmail did the right thing with its exit codes is plain
241 # wrong. I've seen procmail exit with code 1 when it should have exited
242 # with code 75, like, configuration errors. Procmail is a dangerous
243 # beast and is best replaced by maildrop.
245 # 4. if multiple choices exist (like procmail and maildrop), fetchmail
246 # cannot tell which one it should choose. Say, your MTA is configured
247 # to use maildrop to deliver to user's mailboxes, if fetchmail then
248 # chooses procmail, this is plain wrong.
251 AC_PATH_PROG(procmail, procmail, "", $PATH:/usr/sbin)
252 AC_PATH_PROG(sendmail, sendmail, "", $PATH:/usr/sbin:/usr/lib)
253 AC_PATH_PROG(maildrop, maildrop, "", $PATH:/usr/local/bin)
255 ### use option --disable-fallback to disable fallback MDA
256 ### use option --enable-fallback=procmail or
257 ### --enable-fallback=sendmail to select
258 AC_ARG_ENABLE(fallback,
259 [ --enable-fallback=procmail enable procmail as fallback
260 --enable-fallback=sendmail enable /usr/sbin/sendmail as fallback
261 --enable-fallback=maildrop enable maildrop as fallback
262 --enable-fallback=no disable fallback],,[enable_fallback=no])
264 case "$enable_fallback" in
265 sendmail) if test -z "$sendmail" ; then
266 AC_ERROR([Sendmail selected as fallback, but not found])
269 AC_DEFINE_UNQUOTED(FALLBACK_MDA, "$sendmail -i %T")
270 echo "Will use $sendmail as fallback MDA."
272 procmail) if test -z "$procmail" ; then
273 AC_ERROR([procmail selected as fallback, but not found])
276 AC_DEFINE_UNQUOTED(FALLBACK_MDA, "$procmail -d %T")
277 echo "Will use $procmail as fallback MDA."
279 maildrop) if test -z "$maildrop" ; then
280 AC_ERROR([maildrop selected as fallback, but not found])
283 AC_DEFINE_UNQUOTED(FALLBACK_MDA, "$maildrop -d %T")
284 echo "Will use $maildrop as fallback MDA."
286 no|unset) echo "Will not use a fallback MDA"
288 auto|yes|set) if test -n "$sendmail" ; then
289 AC_DEFINE_UNQUOTED(FALLBACK_MDA,"$sendmail -i %T")
290 echo "Will use $sendmail as fallback MDA."
292 echo "No fallback MDA available. procmail and maildrop are not eligible"
293 echo "for automatic fallback MDA configuration for reliability reasons."
296 *) AC_ERROR([unkown value for --enable-fallback given: $enable_fallback])
301 AC_CHECK_SIZEOF(short)
303 AC_CHECK_SIZEOF(long)
305 ### use option --enable-POP2 to compile in the POP2 support
307 [ --enable-POP2 compile in POP2 protocol support (obsolete)],
308 [with_POP2=$enableval],
310 test "$with_POP2" = "yes" && AC_DEFINE(POP2_ENABLE)
312 ### use option --disable-POP3 to omit the POP3 support
314 [ --disable-POP3 don't compile in POP3 protocol support],
315 [with_POP3=$enableval],
317 test "$with_POP3" = "yes" && AC_DEFINE(POP3_ENABLE)
319 ### use option --disable-IMAP to omit the IMAP support
321 [ --disable-IMAP don't compile in IMAP protocol support],
322 [with_IMAP=$enableval],
324 test "$with_IMAP" = "yes" && AC_DEFINE(IMAP_ENABLE)
326 ### use option --disable-ETRN to omit the ETRN support
328 [ --disable-ETRN don't compile in ETRN protocol support],
329 [with_ETRN=$enableval],
331 test "$with_ETRN" = "yes" && AC_DEFINE(ETRN_ENABLE)
333 ### use option --disable-ODMR to omit the ODMR support
335 [ --disable-ODMR don't compile in ODMR protocol support],
336 [with_ODMR=$enableval],
338 test "$with_ODMR" = "yes" && AC_DEFINE(ODMR_ENABLE)
340 ### use option --enable-RPA to compile in the RPA support
342 [ --enable-RPA compile in RPA protocol support],
343 [with_RPA=$enableval],
345 test "$with_RPA" = "yes" && AC_DEFINE(RPA_ENABLE)
347 ### use option --enable-NTLM to compile in the NTLM support
349 [ --enable-NTLM compile in NTLM authentication support],
350 [with_NTLM=$enableval],
352 test "$with_NTLM" = "yes" && AC_DEFINE(NTLM_ENABLE)
354 ### use option --enable-SDPS to compile in the SDPS support
356 [ --enable-SDPS compile in SDPS protocol support],
357 [with_SDPS=$enableval],
359 test "$with_SDPS" = "yes" && AC_DEFINE(SDPS_ENABLE)
361 ### use option --enable-opie to compile in the OPIE support
363 [ --enable-opie support OTP through the OPIE library],
364 [ AC_CHECK_HEADER(opie.h,, [echo 'configure: cannot find <opie.h>, which is required for OPIE support.'; exit 1])
365 AC_CHECK_LIB(opie,opiegenerator,, [echo 'configure: cannot find libopie, which is required for OPIE support.'; exit 1])
366 with_opie=$enableval],
368 test "$with_opie" = "yes" && AC_DEFINE(OPIE_ENABLE)
371 [ --enable-inet6 support IPv6 (requires the inet6-apps library)],
373 [ AC_CHECK_FUNC(getaddrinfo, [with_inet6=yes],
374 [ LDFLAGS="$LDFLAGS -L/usr/inet6/lib";
375 AC_CHECK_LIB(inet6, getaddrinfo, [with_inet6=yes
376 LIBS="$LIBS -linet6"],
377 [ echo 'configure: cannot find proper glibc version or libinet6,';
378 echo ' which is required for IPv6 support.';
381 test "$with_inet6" = "yes" && AC_DEFINE(INET6_ENABLE)
383 AC_CHECK_FUNCS(inner_connect)
385 AC_ARG_ENABLE(netsec,
386 [ --enable-netsec support network security (requires inet6-apps library)],
387 [ unset ac_cv_lib_inet6_net_security_strtorequest; AC_CHECK_LIB(inet6, net_security_strtorequest,,
388 [ unset ac_cv_lib_inet6_net_security_strtorequest;
389 LDFLAGS="$LDFLAGS -L/usr/inet6/lib";
390 AC_CHECK_LIB(inet6, net_security_strtorequest,,
391 [ echo 'configure: cannot find net_security_strtorequest in libinet6, which is required';
392 echo ' for network security support. Either it does not exist, or it was';
393 echo ' not built with network security support enabled.';
395 unset ac_cv_header_net_security_h; AC_CHECK_HEADER(net/security.h,,
396 [ unset ac_cv_header_net_security_h;
397 CPPFLAGS="$CPPFLAGS -I/usr/inet6/include";
398 CFLAGS="$CFLAGS -I/usr/inet6/include"; AC_CHECK_HEADER(net/security.h,,
399 [ echo 'configure: cannot find <net/security.h>, which is required';
400 echo ' for network security support.';
403 test "$with_netsec" = "yes" && AC_DEFINE(NET_SECURITY)
405 # This version of the Kerberos 4 and 5 options addresses the follwing issues:
407 # * Build correctly under Heimdal kerberos if it is compiled with db2 and
408 # OpenSSL support (Debian's is)
409 # * Build the kerberos.c stuff (KPOP) only for kerberosIV, to avoid breakage.
410 # I don't know if this is 100% correct, but now at least IMAP and POP3
411 # behave the same way regarding kerberosV.
412 # * Build without any fuss for both kerberosIV and V at the same time.
413 # * Move all the kerberos header mess to kerberos.h, and #include that
414 # in driver.c and kerberos.c.
416 # Tested using the Heimdal Kerberos V libs, Kungliga Tekniska Högskolan (the
417 # Royal Institute of Technology in Stockholm, Sweden)'s kerberos IV libs, and
418 # the MIT reference implementation of KerberosV (all as packaged in Debian).
420 ### use option --with-kerberos5=DIR to point at a Kerberos 5 directory
421 ### make sure --with-ssl is run before --with-kerberos* !
422 AC_ARG_WITH(kerberos5,
423 [ --with-kerberos5=DIR point fetchmail compilation at a Kerberos 5
426 if test "$with_kerberos5" != "no"
428 # Check for a OpenBSD special case
429 if test "$with_kerberos5" = "yes" && ( test `uname` = "OpenBSD" )
431 AC_CHECKING([kerberosV for OpenBSD])
433 AC_DEFINE(KERBEROS_V5)
434 CEFLAGS="$CEFLAGS -I/usr/include/kerberosV"
435 LIBS="$LIBS -lasn1 -lkrb5 -lcom_err -lkafs"
437 if test "$with_kerberos5" != "yes"
439 LDEFLAGS="$LDEFLAGS -L${with_kerberos5}/lib"
440 searchdirs="$with_kerberos5"
442 searchdirs="/usr/kerberos /usr/local/krb5 /usr/athena /usr"
445 for dir in $searchdirs
446 do AC_MSG_CHECKING([for Kerberos V in $dir])
447 if test -f "$dir/include/krb5.h"
450 if test -f "$dir/include/roken.h"
452 ac_krblibs="-lasn1 -lroken -lcom_err"
453 AC_MSG_RESULT([Heimdal found])
454 dnl Attempt to detect if we need to -ldb2 to link Heimdal
455 dnl we assume we do if it is available
456 AC_CHECK_LIB(db2, db_open, ac_krblibs="$ac_krblibs -ldb2", [],
458 AC_CHECK_LIB(des, des_string_to_key, libk5crypto=-ldes,
459 AC_CHECK_LIB(ssl, MD5_Init, [],
460 AC_ERROR([DES libraries not found. Try adding --with-ssl to enable OpenSSL support]),
461 ${LDEFLAGS} ${ac_krblibs}),
462 ${LDEFLAGS} ${ac_krblibs})
465 AC_MSG_RESULT([found])
466 ac_krblibs="-lcom_err"
468 krb5_des_string_to_key,
469 libk5crypto=-lcrypto,
470 AC_CHECK_LIB(k5crypto,
471 krb5_des_string_to_key,
472 libk5crypto=-lk5crypto,
473 AC_ERROR([Kerberos 5 DES libraries not found]),
474 ${LDEFLAGS} ${ac_krblibs}),
475 ${LDEFLAGS} ${ac_krblibs})
477 AC_CHECK_LIB(krb5, krb5_init_context,[],
479 ${LDEFLAGS} ${ac_krblibs})
480 AC_DEFINE(KERBEROS_V5)
481 test "$dir" != "/usr" && CEFLAGS="$CEFLAGS -I$dir/include"
482 LDEFLAGS="$LDEFLAGS -L$dir/lib"
483 LIBS="$LIBS $ac_krblibs $libk5crypto"
487 AC_MSG_RESULT([not found])
490 if test -z "$with_kerberos5" ; then
491 AC_ERROR([Kerberos 5 libraries not found])
495 ]) dnl --with-kerberos5=DIR
497 ### use option --with-kerberos=DIR to point at a Kerberos 4 directory
498 AC_ARG_WITH(kerberos,
499 [ --with-kerberos=DIR point fetchmail compilation at a Kerberos 4
502 if test "$with_kerberos" != "no"
504 # Check for a NetBSD/OpenBSD special case
505 if test "$with_kerberos" = "yes" && ( test `uname` = "NetBSD" || test `uname` = "OpenBSD" )
507 AC_CHECKING([kerberosIV for `uname`])
508 AC_DEFINE(KERBEROS_V4)
509 CEFLAGS="$CEFLAGS -I/usr/include/kerberosIV"
510 LIBS="$LIBS -lkrb -ldes"
512 #we need to detect when we're building under a kerberosV compatibility
514 if test "$with_kerberos" != "yes" ; then
515 searchdirs="$with_kerberos"
517 searchdirs="$with_kerberos5 /usr/kerberos /usr/kerberosIV /usr/athena/usr"
520 ac_saveLDFLAGS="$LDFLAGS"
521 for dir in $searchdirs
523 AC_MSG_CHECKING([for Kerberos IV in $dir])
524 if test -f "$dir/include/krb.h" || test -f "$dir/include/krb4.h" \
525 || test -f "$dir/include/kerberosIV/krb.h"
527 AC_MSG_RESULT([found])
529 AC_MSG_RESULT([not found])
533 if test -f "$with_kerberos5/roken.h" ; then
534 AC_CHECK_LIB(45, krb_mk_req)
536 LDFLAGS="-L$dir/lib $ac_saveLDFLAGS"
537 AC_SEARCH_LIBS(des_string_to_key, [des425 des], [], continue)
538 AC_SEARCH_LIBS(krb_realmofhost, [krb4 krb], [], continue)
540 if test -f "$dir/include/kerberosIV/krb.h" ; then
541 dir="$dir/include/kerberosIV"
545 AC_DEFINE(KERBEROS_V4)
546 test -f "$with_kerberos5/roken.h" && AC_DEFINE(HEIMDAL)
547 test "$dir" != "/usr/include" && CEFLAGS="$CEFLAGS -I$dir"
548 LDEFLAGS="$LDEFLAGS -L$with_kerberos/lib"
551 if test -z "$with_kerberos" ; then
552 AC_ERROR([Kerberos 4 libraries not found])
554 LDFLAGS="$ac_saveLDFLAGS"
557 ]) dnl --with-kerberos=DIR
559 ### use option --with-ssl to compile in the SSL support
561 [ --with-ssl=[DIR] enable SSL support using libraries in DIR],
564 test "$with_ssl" != "no" && AC_DEFINE(SSL_ENABLE)
566 if test "$with_ssl" = "yes"
568 # He didn't specify an SSL location. Let's look at some common
569 # directories where SSL has been found in the past and try and auto
570 # configure for SSL. OpenSSL determination will be made later.
571 # This will screw up if an OpenSSL install is located in a later
572 # directory than an older SSLeay install, but the user should fix that
573 # anyways and he can override on the configure line.
582 if test -d "$ac_dir" ; then
589 if test -n "$with_ssl" -a "$with_ssl" != "no"
591 # With the autoconfigure above, the only time this is going to be
592 # true is going to be when we could not find the headers. If they
593 # are not in system standard locations, we are going to be broken.
594 if test "$with_ssl" = "yes"
596 # Let's just define the standard location for the SSLeay root
597 with_ssl="/usr/local/ssl"
599 if test -r $with_ssl/include/openssl/ssl.h
601 ### ssl.h found under openssl. Use openssl configuration preferentially
602 echo "Enabling OpenSSL support in $with_ssl"
603 CEFLAGS="$CEFLAGS -I$with_ssl/include -I$with_ssl/include/openssl"
604 ### OpenBSD comes with ssl headers
605 elif test -r /usr/include/ssl/ssl.h
607 echo "Enabling SSLeay support in $with_ssl"
608 CEFLAGS="$CEFLAGS -I/usr/include/ssl"
610 echo "Enabling SSLeay support in $with_ssl"
611 CEFLAGS="$CEFLAGS -I$with_ssl/include"
613 LDEFLAGS="$LDEFLAGS -L$with_ssl/lib"
614 LIBS="$LIBS -lssl -lcrypto"
615 AC_DEFINE(SSL_ENABLE)
617 echo 'Disabling SSL support...'
620 ### use option --with-socks=DIR to point at SOCKS library
622 [ --with-socks[=DIR] add built-in SOCKS firewall access],
624 if test "$with_socks" != no
626 if test "$with_socks" != yes
628 LDEFLAGS="$LDEFLAGS -L$with_socks"
630 AC_CHECK_LIB(socks, Rconnect,,
631 AC_MSG_ERROR([could not find libsocks which is needed for built-in SOCKS support]))
633 AC_DEFINE(HAVE_SOCKS)
634 CEFLAGS="$CEFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
638 ### use option --with-socks5=DIR to point at SOCKS library
640 [ --with-socks5[=DIR] add built-in SOCKS5 firewall access],
642 if test "$with_socks5" != no
644 if test "$with_socks5" != yes
646 LDEFLAGS="$LDEFLAGS -L$with_socks5"
648 ac_savedLDFLAGS="$LDFLAGS"
649 LDFLAGS="$LDEFLAGS $LDFLAGS"
650 AC_CHECK_LIB(socks5, SOCKSconnect,,
651 AC_MSG_ERROR([could not find libsocks5 which is needed for built-in SOCKS5 support]))
652 AC_DEFINE(HAVE_SOCKS)
653 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 -Dgethostbyname=SOCKSgethostbyname"
654 AC_CHECK_FUNC(SOCKSfclose, [CFLAGS="$CFLAGS -Dfclose=SOCKSfclose"])
655 LDFLAGS="$ac_savedLDFLAGS"
658 ### use option --with-hesiod=DIR to point at a HESIOD directory
660 [ --with-hesiod=DIR point fetchmail compilation at a HESIOD directory])
662 case "x$with_hesiod" in
666 for dir in /usr/athena /usr /usr/local
668 if test -f "$dir/include/hesiod.h"
670 test "$dir" != "/usr" && CEFLAGS="$CEFLAGS -DHESIOD -I$dir/include"
671 LDEFLAGS="$LDEFLAGS -L$dir/lib"
672 LIBS="$LIBS -lhesiod"
680 CEFLAGS="$CEFLAGS -DHESIOD -I$with_hesiod/include"
681 LDEFLAGS="$LDEFLAGS -L$with_hesiod/lib"
682 LIBS="$LIBS -lhesiod"
686 ### use option --with-gssapi=DIR to compile in GSSAPI support
688 [ --with-gssapi[=DIR] compile in GSSAPI support using libraries in DIR],
690 if test "$with_gssapi" != "no"
692 if test "$with_gssapi" = "yes" -a -n "$with_kerberos5"
694 with_gssapi=$with_kerberos5
696 if test "$with_gssapi" != "yes" -a -n "$with_gssapi"
698 CFLAGS="$CFLAGS -I$with_gssapi/include"
699 LDFLAGS="$LDFLAGS -L$with_gssapi/lib"
702 if test -f "$with_gssapi/include/roken.h"
704 LIBS="$LIBS -lkrb5 -lasn1 -ldes -lroken -ldb -ldl"
705 AC_CHECK_LIB(gssapi, gss_init_sec_context,LIBS="$LIBS -lgssapi",
706 AC_MSG_ERROR([could not find libgssapi which is needed for GSSAPI support]), )
709 AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,LIBS="$LIBS -lgssapi_krb5",
710 AC_MSG_ERROR([could not find libgssapi_krb5 which is needed for GSSAPI support]), -lkrb5)
713 save_CPPFLAGS=$CPPFLAGS
714 CPPFLAGS="-I$with_gssapi/include"
715 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h)
716 if test "$ac_cv_header_gssapi_h" = "yes"; then
717 AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE))
719 AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE))
723 AC_OUTPUT([Makefile intl/Makefile po/Makefile.in], [
724 # The reason for this odd makedepend line is that we want
725 # to have all dependencies evaluated relative to the source directory
726 # and let VPATH do all the dirty work when we build remotely
727 echo "You can ignore any makedepend error messages:";
728 echo timestamp > stamp-h;
729 (cd $srcdir; makedepend -f - *.c) >>Makefile])
732 dnl comment-start: "dnl "
734 dnl comment-start-skip: "\\bdnl\\b\\s *"
735 dnl compile-command: "make configure config.h.in"