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
45 # Check for LynxOS special case: -lbsd needed (at least on 2.3.0) and -s
47 if test `uname` = "LynxOS"
49 echo "Adding -lbsd to standard libraries"
52 echo "Prepending standard include path to gcc flags"
53 CPFLAGS="-I/usr/include"
56 # Check for FreeBSD special case: more libs needed
57 if test `uname` = "FreeBSD"
59 echo "Adding -lmd -lkvm -lcom_err to standard libraries"
60 LIBS="$LIBS -lmd -lkvm -lcom_err"
63 # Check for Rhapsody special case: it doesn't like -s
64 if test `uname` = "Rhapsody"
66 echo "Removing -s load flag"
67 LDFLAGS=`echo $LDFLAGS | sed "s/-s //"`
71 ALL_LINGUAS="cs da de es fr gl pl pt_BR tr"
75 # Under sysV68, socket and friends are provided by the C library.
76 # -linet does not provide socket, but causes multiple definition
77 # errors at link-time. It is thus better to only use the C library.
78 # So don't add -linet to the link list unless it's necessary
80 AC_MSG_RESULT(using libc's socket),
81 AC_CHECK_LIB(socket,socket)
82 AC_CHECK_LIB(inet,socket))
84 # The condition in this test copes with the presence of inet_addr in libc6.
85 AC_CHECK_FUNC(inet_addr,
86 AC_MSG_RESULT(using libc's inet_addr),
87 AC_CHECK_LIB(nsl,inet_addr))
89 dnl Port hack for Interactive UNIX System V/386 Release 3.2
90 AC_CHECK_LIB(cposix, strchr,
91 [EXTRADEFS="$EXTRADEFS -D_SYSV3"
92 LIBS="$LIBS -lcposix"])
94 dnl Port hack for Sparc/NetBSD-1.5
95 AC_CHECK_LIB(intl, gettext,
96 [LIBS="$LIBS -lintl"])
98 AC_CHECK_FUNC(strstr, AC_DEFINE(HAVE_STRSTR),
99 [EXTRASRC="$EXTRASRC \$(srcdir)/strstr.c"
100 EXTRAOBJ="$EXTRAOBJ strstr.o"])
102 AC_CHECK_FUNC(strcasecmp, AC_DEFINE(HAVE_STRCASECMP),
103 [EXTRASRC="$EXTRASRC \$(srcdir)/strcasecmp.c"
104 EXTRAOBJ="$EXTRAOBJ strcasecmp.o"])
106 AC_CHECK_FUNC(memmove, AC_DEFINE(HAVE_MEMMOVE),
107 [EXTRASRC="$EXTRASRC \$(srcdir)/memmove.c"
108 EXTRAOBJ="$EXTRAOBJ memmove.o"])
110 AC_CHECK_FUNC(MD5Init, AC_DEFINE(HAVE_MD5),
111 [EXTRASRC="$EXTRASRC \$(srcdir)/md5c.c"
112 EXTRAOBJ="$EXTRAOBJ md5c.o"])
114 AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG),
115 [EXTRASRC="$EXTRASRC \$(srcdir)/getopt.c \$(srcdir)/getopt1.c"
116 EXTRAOBJ="$EXTRAOBJ getopt.o getopt1.o"])
122 EXTRASRC="$EXTRASRC \$(srcdir)/alloca.c"
123 EXTRAOBJ="$EXTRAOBJ alloca.o"
126 dnl AC_CHECK_FUNC calls that might hack the Makefile must precede
127 dnl the following AC_SUBSTs
133 AC_CHECK_FUNCS(tcsetattr stty setsid geteuid seteuid gethostbyname \
134 res_search herror strrchr strerror setlinebuf syslog \
135 snprintf vprintf vsnprintf vsyslog \
136 atexit inet_aton strftime setrlimit socketpair sigprocmask sigaction \
139 # Under Red Hat 4.0 (and many other Linuxes) -lresolv is seriously flaky
140 # and breaks gethostbyname(2). It's better to use the bind stuff in the C
141 # library. So don't add -lresolv to the link list unless it's necessary
142 # (It will be necessary when using GNU libc6).
143 AC_CHECK_FUNC(res_search,
144 AC_MSG_RESULT(using libc's resolver functions),
145 AC_CHECK_LIB(resolv,res_search,
146 [AC_DEFINE(HAVE_RES_SEARCH) AC_MSG_RESULT(found resolver functions in libresolv); LIBS="$LIBS -lresolv"], AC_MSG_RESULT(no resolver calls found)))
148 dnl Check for libcrypt -- it may live in libc or libcrypt, as on IRIX
149 AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt,crypt))
151 dnl Check for RSA refersence library in case we're using SSL
152 AC_CHECK_LIB(rsaref, RSAPublicDecrypt)
154 dnl AC_FUNC_SETVBUF_REVERSED
156 dnl Check for usable void pointer type
157 AC_MSG_CHECKING(use of void pointer type)
161 p = (char *) xmalloc(1);
163 [AC_DEFINE(HAVE_VOIDPOINTER) AC_MSG_RESULT(yes)],
166 dnl Check for ANSI volatile
167 AC_MSG_CHECKING(for ANSI volatile)
170 [AC_DEFINE(HAVE_VOLATILE) AC_MSG_RESULT(yes)],
173 dnl Check out the wait reality. We have to assume sys/wait.h is present.
174 AC_CHECK_FUNCS(waitpid wait3)
175 AC_MSG_CHECKING(for union wait);
176 AC_TRY_LINK([#include <sys/types.h>
177 #include <sys/wait.h>],
178 [union wait status; int pid; pid = wait (&status);
180 /* Some POSIXoid systems have both the new-style macros and the old
181 union wait type, and they do not work together. If union wait
182 conflicts with WEXITSTATUS et al, we don't want to use it at all. */
183 if (WEXITSTATUS (status) != 0) pid = -1;
186 /* Make sure union wait works with waitpid. */
187 pid = waitpid (-1, &status, 0);
190 [AC_DEFINE(HAVE_UNION_WAIT) AC_MSG_RESULT(yes)],
193 AC_MSG_CHECKING(sys_siglist declaration in signal.h or unistd.h)
194 AC_TRY_LINK([#include <signal.h>
195 /* NetBSD declares sys_siglist in <unistd.h>. */
198 #endif], [char *msg = *(sys_siglist + 1);],
199 [AC_DEFINE(SYS_SIGLIST_DECLARED) AC_MSG_RESULT(yes)],
202 # Find the right directory to put the root-mode PID file in
203 for dir in "/var/run" "/etc"
210 AC_MSG_RESULT(root-mode pid file will go in $dir)
211 AC_DEFINE_UNQUOTED(PID_DIR, "$dir")
213 # We may have a fallback MDA available in case the socket open to the
214 # local SMTP listener fails. Best to use procmail for this, as we know
215 # it won't try delivering through local SMTP and cause a mail loop.
216 # Sendmail without the -t option to use the message headers will work too,
217 # not just for sendmail itself but for workalikes like exim.
219 # Note1: A disadvantage of using procmail is that local alias expansion
220 # according to /etc/aliases won't get done if we fall back. This doesn't
221 # matter in single-drop mode.
223 # Note2: it would be a very bad idea to use any MDA that doesn't return
224 # a refuse-to-deliver status on disk- or process-table-full
225 # conditions; mail could get lost that way. Both procmail and
226 # sendmail (and all of the MDAs like exim that might be lurking under
227 # a sendmail alias) do the right thing in this circumstance.
229 AC_PATH_PROG(procmail, procmail, "", $PATH:/usr/sbin)
230 AC_PATH_PROG(sendmail, sendmail, "", $PATH:/usr/sbin:/usr/lib)
231 AC_PATH_PROG(maildrop, maildrop, "", $PATH:/usr/local/bin)
233 ### use option --disable-fallback to disable fallback MDA
234 ### use option --enable-fallback=procmail or
235 ### --enable-fallback=sendmail to select
236 AC_ARG_ENABLE(fallback,
237 [ --enable-fallback=procmail enable procmail as fallback (default)
238 --enable-fallback=sendmail enable /usr/sbin/sendmail as fallback
239 --enable-fallback=maildrop enable maildrop as fallback
240 --enable-fallback=no disable fallback],,[enable_fallback=auto])
242 case "$enable_fallback" in
243 sendmail) if test -z "$sendmail" ; then
244 AC_ERROR([Sendmail selected as fallback, but not found])
247 AC_DEFINE_UNQUOTED(FALLBACK_MDA, "$sendmail %T")
248 echo "Will use $sendmail as fallback MDA."
250 procmail) if test -z "$procmail" ; then
251 AC_ERROR([procmail selected as fallback, but not found])
254 AC_DEFINE_UNQUOTED(FALLBACK_MDA, "$procmail -d %T")
255 echo "Will use $procmail as fallback MDA."
257 maildrop) if test -z "$maildrop" ; then
258 AC_ERROR([maildrop selected as fallback, but not found])
261 AC_DEFINE_UNQUOTED(FALLBACK_MDA, "$maildrop -d %T")
262 echo "Will use $maildrop as fallback MDA."
264 no|unset) echo "Will not use a fallback MDA"
266 auto|yes|set) if test -n "$procmail" ; then
267 AC_DEFINE_UNQUOTED(FALLBACK_MDA,"$procmail -d %T")
268 echo "Will use $procmail as fallback MDA."
269 elif test -n "$sendmail" ; then
270 AC_DEFINE_UNQUOTED(FALLBACK_MDA,"$sendmail %T")
271 echo "Will use $sendmail as fallback MDA."
272 else echo "No fallback MDA available."
275 *) AC_ERROR([unkown value for --enable-fallback given: $enable_fallback])
280 AC_CHECK_SIZEOF(short)
282 AC_CHECK_SIZEOF(long)
284 ### use option --enable-POP2 to compile in the POP2 support
286 [ --enable-POP2 compile in POP2 protocol support (obsolete)],
287 [with_POP2=$enableval],
289 test "$with_POP2" = "yes" && AC_DEFINE(POP2_ENABLE)
291 ### use option --disable-POP3 to omit the POP3 support
293 [ --disable-POP3 don't compile in POP3 protocol support],
294 [with_POP3=$enableval],
296 test "$with_POP3" = "yes" && AC_DEFINE(POP3_ENABLE)
298 ### use option --disable-IMAP to omit the IMAP support
300 [ --disable-IMAP don't compile in IMAP protocol support],
301 [with_IMAP=$enableval],
303 test "$with_IMAP" = "yes" && AC_DEFINE(IMAP_ENABLE)
305 ### use option --disable-ETRN to omit the ETRN support
307 [ --disable-ETRN don't compile in ETRN protocol support],
308 [with_ETRN=$enableval],
310 test "$with_ETRN" = "yes" && AC_DEFINE(ETRN_ENABLE)
312 ### use option --disable-ODMR to omit the ODMR support
314 [ --disable-ODMR don't compile in ODMR protocol support],
315 [with_ODMR=$enableval],
317 test "$with_ODMR" = "yes" && AC_DEFINE(ODMR_ENABLE)
319 ### use option --enable-RPA to compile in the RPA support
321 [ --enable-RPA compile in RPA protocol support],
322 [with_RPA=$enableval],
324 test "$with_RPA" = "yes" && AC_DEFINE(RPA_ENABLE)
326 ### use option --enable-NTLM to compile in the NTLM support
328 [ --enable-NTLM compile in NTLM authentication support],
329 [with_NTLM=$enableval],
331 test "$with_NTLM" = "yes" && AC_DEFINE(NTLM_ENABLE)
333 ### use option --enable-SDPS to compile in the SDPS support
335 [ --enable-SDPS compile in SDPS protocol support],
336 [with_SDPS=$enableval],
338 test "$with_SDPS" = "yes" && AC_DEFINE(SDPS_ENABLE)
340 ### use option --enable-opie to compile in the OPIE support
342 [ --enable-opie support OTP through the OPIE library],
343 [ AC_CHECK_HEADER(opie.h,, [echo 'configure: cannot find <opie.h>, which is required for OPIE support.'; exit 1])
344 AC_CHECK_LIB(opie,opiegenerator,, [echo 'configure: cannot find libopie, which is required for OPIE support.'; exit 1])
345 with_opie=$enableval],
347 test "$with_opie" = "yes" && AC_DEFINE(OPIE_ENABLE)
350 [ --enable-inet6 support IPv6 (requires the inet6-apps library)],
352 [ AC_CHECK_FUNC(getaddrinfo, [with_inet6=yes],
353 [ LDFLAGS="$LDFLAGS -L/usr/inet6/lib";
354 AC_CHECK_LIB(inet6, getaddrinfo, [with_inet6=yes
355 LIBS="$LIBS -linet6"],
356 [ echo 'configure: cannot find proper glibc version or libinet6,';
357 echo ' which is required for IPv6 support.';
360 test "$with_inet6" = "yes" && AC_DEFINE(INET6_ENABLE)
362 AC_CHECK_FUNCS(inner_connect)
364 AC_ARG_ENABLE(netsec,
365 [ --enable-netsec support network security (requires inet6-apps library)],
366 [ unset ac_cv_lib_inet6_net_security_strtorequest; AC_CHECK_LIB(inet6, net_security_strtorequest,,
367 [ unset ac_cv_lib_inet6_net_security_strtorequest;
368 LDFLAGS="$LDFLAGS -L/usr/inet6/lib";
369 AC_CHECK_LIB(inet6, net_security_strtorequest,,
370 [ echo 'configure: cannot find net_security_strtorequest in libinet6, which is required';
371 echo ' for network security support. Either it does not exist, or it was';
372 echo ' not built with network security support enabled.';
374 unset ac_cv_header_net_security_h; AC_CHECK_HEADER(net/security.h,,
375 [ unset ac_cv_header_net_security_h;
376 CPPFLAGS="$CPPFLAGS -I/usr/inet6/include";
377 CFLAGS="$CFLAGS -I/usr/inet6/include"; AC_CHECK_HEADER(net/security.h,,
378 [ echo 'configure: cannot find <net/security.h>, which is required';
379 echo ' for network security support.';
382 test "$with_netsec" = "yes" && AC_DEFINE(NET_SECURITY)
384 # This version of the Kerberos 4 and 5 options addresses the follwing issues:
386 # * Build correctly under Heimdal kerberos if it is compiled with db2 and
387 # OpenSSL support (Debian's is)
388 # * Build the kerberos.c stuff (KPOP) only for kerberosIV, to avoid breakage.
389 # I don't know if this is 100% correct, but now at least IMAP and POP3
390 # behave the same way regarding kerberosV.
391 # * Build without any fuss for both kerberosIV and V at the same time.
392 # * Move all the kerberos header mess to kerberos.h, and #include that
393 # in driver.c and kerberos.c.
395 # Tested using the Heimdal Kerberos V libs, Kungliga Tekniska Högskolan (the
396 # Royal Institute of Technology in Stockholm, Sweden)'s kerberos IV libs, and
397 # the MIT reference implementation of KerberosV (all as packaged in Debian).
399 ### use option --with-kerberos5=DIR to point at a Kerberos 5 directory
400 ### make sure --with-ssl is run before --with-kerberos* !
401 AC_ARG_WITH(kerberos5,
402 [ --with-kerberos5=DIR point fetchmail compilation at a Kerberos 5
405 if test "$with_kerberos5" != "no"
407 # Check for a OpenBSD special case
408 if test "$with_kerberos5" = "yes" && ( test `uname` = "OpenBSD" )
410 AC_CHECKING([kerberosV for OpenBSD])
412 AC_DEFINE(KERBEROS_V5)
413 CEFLAGS="$CEFLAGS -I/usr/include/kerberosV"
414 LIBS="$LIBS -lasn1 -lkrb5 -lcom_err"
416 if test "$with_kerberos5" != "yes"
418 LDEFLAGS="$LDEFLAGS -L${with_kerberos5}/lib"
419 searchdirs="$with_kerberos5"
421 searchdirs="/usr/kerberos /usr/local/krb5 /usr/athena /usr"
424 for dir in $searchdirs
425 do AC_MSG_CHECKING([for Kerberos V in $dir])
426 if test -f "$dir/include/krb5.h"
429 if test -f "$dir/include/roken.h"
431 ac_krblibs="-lasn1 -lroken -lcom_err"
432 AC_MSG_RESULT([Heimdal found])
433 dnl Attempt to detect if we need to -ldb2 to link Heimdal
434 dnl we assume we do if it is available
435 AC_CHECK_LIB(db2, db_open, ac_krblibs="$ac_krblibs -ldb2", [],
437 AC_CHECK_LIB(des, des_string_to_key, libk5crypto=-ldes,
438 AC_CHECK_LIB(ssl, MD5_Init, [],
439 AC_ERROR([DES libraries not found. Try adding --with-ssl to enable OpenSSL support]),
440 ${LDEFLAGS} ${ac_krblibs}),
441 ${LDEFLAGS} ${ac_krblibs})
444 AC_MSG_RESULT([found])
445 ac_krblibs="-lcom_err"
447 krb5_des_string_to_key,
448 libk5crypto=-lcrypto,
449 AC_CHECK_LIB(k5crypto,
450 krb5_des_string_to_key,
451 libk5crypto=-lk5crypto,
452 AC_ERROR([Kerberos 5 DES libraries not found]),
453 ${LDEFLAGS} ${ac_krblibs}),
454 ${LDEFLAGS} ${ac_krblibs})
456 AC_CHECK_LIB(krb5, krb5_init_context,[],
458 ${LDEFLAGS} ${ac_krblibs})
459 AC_DEFINE(KERBEROS_V5)
460 test "$dir" != "/usr" && CEFLAGS="$CEFLAGS -I$dir/include"
461 LDEFLAGS="$LDEFLAGS -L$dir/lib"
462 LIBS="$LIBS $ac_krblibs $libk5crypto"
466 AC_MSG_RESULT([not found])
469 if test -z "$with_kerberos5" ; then
470 AC_ERROR([Kerberos 5 libraries not found])
474 ]) dnl --with-kerberos5=DIR
476 ### use option --with-kerberos=DIR to point at a Kerberos 4 directory
477 AC_ARG_WITH(kerberos,
478 [ --with-kerberos=DIR point fetchmail compilation at a Kerberos 4
481 if test "$with_kerberos" != "no"
483 # Check for a NetBSD/OpenBSD special case
484 if test "$with_kerberos" = "yes" && ( test `uname` = "NetBSD" || test `uname` = "OpenBSD" )
486 AC_CHECKING([kerberosIV for `uname`])
487 AC_DEFINE(KERBEROS_V4)
488 CEFLAGS="$CEFLAGS -I/usr/include/kerberosIV"
489 LIBS="$LIBS -lkrb -ldes"
491 #we need to detect when we're building under a kerberosV compatibility
493 if test "$with_kerberos" != "yes" ; then
494 searchdirs="$with_kerberos"
496 searchdirs="$with_kerberos5 /usr/kerberos /usr/kerberosIV /usr/athena/usr"
499 ac_saveLDFLAGS="$LDFLAGS"
500 for dir in $searchdirs
502 AC_MSG_CHECKING([for Kerberos IV in $dir])
503 if test -f "$dir/include/krb.h" || test -f "$dir/include/krb4.h" \
504 || test -f "$dir/include/kerberosIV/krb.h"
506 AC_MSG_RESULT([found])
508 AC_MSG_RESULT([not found])
512 if test -f "$with_kerberos5/roken.h" ; then
513 AC_CHECK_LIB(45, krb_mk_req)
515 LDFLAGS="-L$dir/lib $ac_saveLDFLAGS"
516 AC_SEARCH_LIBS(des_string_to_key, [des425 des], [], continue)
517 AC_SEARCH_LIBS(krb_realmofhost, [krb4 krb], [], continue)
519 if test -f "$dir/include/kerberosIV/krb.h" ; then
520 dir="$dir/include/kerberosIV"
524 AC_DEFINE(KERBEROS_V4)
525 test -f "$with_kerberos5/roken.h" && AC_DEFINE(HEIMDAL)
526 test "$dir" != "/usr/include" && CEFLAGS="$CEFLAGS -I$dir"
527 LDEFLAGS="$LDEFLAGS -L$with_kerberos/lib"
530 if test -z "$with_kerberos" ; then
531 AC_ERROR([Kerberos 4 libraries not found])
533 LDFLAGS="$ac_saveLDFLAGS"
536 ]) dnl --with-kerberos=DIR
538 ### use option --with-ssl to compile in the SSL support
540 [ --with-ssl=[DIR] enable SSL support using libraries in DIR],
543 test "$with_ssl" != "no" && AC_DEFINE(SSL_ENABLE)
545 if test "$with_ssl" = "yes"
547 # He didn't specify an SSL location. Let's look at some common
548 # directories where SSL has been found in the past and try and auto
549 # configure for SSL. OpenSSL determination will be made later.
550 # This will screw up if an OpenSSL install is located in a later
551 # directory than an older SSLeay install, but the user should fix that
552 # anyways and he can override on the configure line.
560 if test -d "$ac_dir" ; then
567 if test -n "$with_ssl" -a "$with_ssl" != "no"
569 # With the autoconfigure above, the only time this is going to be
570 # true is going to be when we could not find the headers. If they
571 # are not in system standard locations, we are going to be broken.
572 if test "$with_ssl" = "yes"
574 # Let's just define the standard location for the SSLeay root
575 with_ssl="/usr/local/ssl"
577 if test -r $with_ssl/include/openssl/ssl.h
579 ### ssl.h found under openssl. Use openssl configuration preferentially
580 echo "Enabling OpenSSL support in $with_ssl"
581 CEFLAGS="$CEFLAGS -I$with_ssl/include -I$with_ssl/include/openssl"
582 ### OpenBSD comes with ssl headers
583 elif test -r /usr/include/ssl/ssl.h
585 echo "Enabling SSLeay support in $with_ssl"
586 CEFLAGS="$CEFLAGS -I/usr/include/ssl"
588 echo "Enabling SSLeay support in $with_ssl"
589 CEFLAGS="$CEFLAGS -I$with_ssl/include"
591 LDEFLAGS="$LDEFLAGS -L$with_ssl/lib"
592 LIBS="$LIBS -lssl -lcrypto"
593 AC_DEFINE(SSL_ENABLE)
595 echo 'Disabling SSL support...'
598 ### use option --with-socks=DIR to point at SOCKS library
600 [ --with-socks[=DIR] add built-in SOCKS firewall access],
602 if test "$with_socks" != no
604 if test "$with_socks" != yes
606 LDEFLAGS="$LDEFLAGS -L$with_socks"
608 AC_CHECK_LIB(socks, Rconnect,,
609 AC_MSG_ERROR([could not find libsocks which is needed for built-in SOCKS support]))
611 AC_DEFINE(HAVE_SOCKS)
612 CEFLAGS="$CEFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
616 ### use option --with-socks5=DIR to point at SOCKS library
618 [ --with-socks5[=DIR] add built-in SOCKS5 firewall access],
620 if test "$with_socks5" != no
622 if test "$with_socks5" != yes
624 LDEFLAGS="$LDEFLAGS -L$with_socks5"
626 ac_savedLDFLAGS="$LDFLAGS"
627 LDFLAGS="$LDEFLAGS $LDFLAGS"
628 AC_CHECK_LIB(socks5, SOCKSconnect,,
629 AC_MSG_ERROR([could not find libsocks5 which is needed for built-in SOCKS5 support]))
630 AC_DEFINE(HAVE_SOCKS)
631 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"
632 AC_CHECK_FUNC(SOCKSfclose, [CFLAGS="$CFLAGS -Dfclose=SOCKSfclose"])
633 LDFLAGS="$ac_savedLDFLAGS"
636 ### use option --with-hesiod=DIR to point at a HESIOD directory
638 [ --with-hesiod=DIR point fetchmail compilation at a HESIOD directory])
640 case "x$with_hesiod" in
644 for dir in /usr/athena /usr /usr/local
646 if test -f "$dir/include/hesiod.h"
648 CEFLAGS="$CEFLAGS -DHESIOD -I$dir/include"
649 LDEFLAGS="$LDEFLAGS -L$dir/lib"
650 LIBS="$LIBS -lhesiod"
658 CEFLAGS="$CEFLAGS -DHESIOD -I$with_hesiod/include"
659 LDEFLAGS="$LDEFLAGS -L$with_hesiod/lib"
660 LIBS="$LIBS -lhesiod"
664 ### use option --with-gssapi=DIR to compile in GSSAPI support
666 [ --with-gssapi[=DIR] compile in GSSAPI support using libraries in DIR],
668 if test "$with_gssapi" != "no"
670 if test "$with_gssapi" = "yes" -a -n "$with_kerberos5"
672 with_gssapi=$with_kerberos5
674 if test "$with_gssapi" != "yes" -a -n "$with_gssapi"
676 CFLAGS="$CFLAGS -I$with_gssapi/include"
677 LDFLAGS="$LDFLAGS -L$with_gssapi/lib"
680 if test -f "$with_gssapi/include/roken.h"
682 LIBS="$LIBS -lkrb5 -lasn1 -ldes -lroken -ldb -ldl"
683 AC_CHECK_LIB(gssapi, gss_init_sec_context,LIBS="$LIBS -lgssapi",
684 AC_MSG_ERROR([could not find libgssapi which is needed for GSSAPI support]), )
687 AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,LIBS="$LIBS -lgssapi_krb5",
688 AC_MSG_ERROR([could not find libgssapi_krb5 which is needed for GSSAPI support]), -lkrb5)
691 save_CPPFLAGS=$CPPFLAGS
692 CPPFLAGS="-I$with_gssapi/include"
693 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h)
694 if test "$ac_cv_header_gssapi_h" = "yes"; then
695 AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE))
697 AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE))
701 AC_OUTPUT([Makefile intl/Makefile po/Makefile.in], [
702 # The reason for this odd makedepend line is that we want
703 # to have all dependencies evaluated relative to the source directory
704 # and let VPATH do all the dirty work when we build remotely
705 echo "You can ignore any makedepend error messages:";
706 echo timestamp > stamp-h;
707 (cd $srcdir; makedepend -f - *.c) >>Makefile])
710 dnl comment-start: "dnl "
712 dnl comment-start-skip: "\\bdnl\\b\\s *"
713 dnl compile-command: "make configure config.h.in"