]> Pileus Git - ~andy/fetchmail/blob - configure.in
BeOS support.
[~andy/fetchmail] / configure.in
1 dnl Autoconfigure input file for fetchmail
2 dnl Eric S. Raymond <esr@thyrsus.com>
3 dnl
4 dnl Process this file with autoconf to produce a configure script.
5 dnl
6
7 AC_INIT(fetchmail.h)            dnl A distinctive file to look for in srcdir. 
8 AC_CONFIG_HEADER(config.h)
9
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=-s AC_SUBST(LDFLAGS)
13
14 AC_CANONICAL_HOST
15 AC_PROG_CC
16 AC_PROG_INSTALL
17 AC_PROG_CPP                     dnl Later checks need this.
18 AC_PROG_CC_C_O
19 AC_AIX
20 AC_ISC_POSIX
21 AC_MINIX
22 AC_HEADER_STDC
23 AC_TYPE_SIZE_T
24 AC_TYPE_PID_T
25 AC_TYPE_SIGNAL
26 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)
27 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h resolv.h net/socket.h)
28
29 AC_C_CONST                      dnl getopt needs this.
30
31 AC_PROG_LEX
32 AC_PROG_YACC
33 AC_SUBST(CPFLAGS)
34 AC_SUBST(CEFLAGS)
35 AC_SUBST(LDEFLAGS)
36 AC_SUBST(LIBOBJS)
37 AC_SUBST(POMAKE)
38
39 PACKAGE=`sed -n '/PACKAGE *= *\(.*\)/s//\1/p' <$srcdir/Makefile.in`
40 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
41 AC_SUBST(PACKAGE)
42
43 VERSION=`sed -n '/VERSION *= *\(.*\)/s//\1/p' <$srcdir/Makefile.in`
44 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
45 AC_SUBST(VERSION)
46
47 # Check for LynxOS special case: -lbsd needed (at least on 2.3.0) and -s
48 # not working.
49 if test `uname` = "LynxOS" 
50 then
51   echo "Adding -lbsd to standard libraries"
52   LIBS="$LIBS -lbsd"
53   LDFLAGS=""
54   echo "Prepending standard include path to gcc flags"
55   CPFLAGS="-I/usr/include"
56 fi
57
58 # Check for FreeBSD special case: -lkvm needed
59 if test `uname` = "FreeBSD" 
60 then
61    echo "Adding -lkvm to standard libraries"
62    LIBS="$LIBS -lkvm"
63 fi
64  
65 # Check for Rhapsody special case: it doesn't like -s
66 if test `uname` = "Rhapsody" 
67 then
68    echo "Removing -s load flag"
69    LDFLAGS=`echo $LDFLAGS | sed "s/-s //"`
70 fi
71  
72 # i18n
73 # Arnaldo Carvalho de Melo <acme@conectiva.com.br>
74 # Sat Nov  7 15:39:03 EDT 1998
75
76 ALL_LINGUAS="cs es fr pl pt_BR"
77
78 AM_GNU_GETTEXT
79
80 # end i18n
81
82 # Under sysV68, socket and friends are provided by the C library.
83 # -linet does not provide socket, but causes multiple definition
84 # errors at link-time.  It is thus better to only use the C library.
85 # So don't add -linet to the link list unless it's necessary
86 AC_CHECK_FUNC(socket,
87     AC_MSG_RESULT(using libc's socket),
88     AC_CHECK_LIB(socket,socket)
89     AC_CHECK_LIB(inet,socket))
90
91 # If gettext isn't in the C library, maybe there's a -lintl.
92 AC_CHECK_FUNC(gettext,
93     AC_MSG_RESULT(using libc's gettext),
94     AC_CHECK_LIB(intl,gettext))
95
96 # The condition in this test copes with the presence of inet_addr in libc6.
97 AC_CHECK_FUNC(inet_addr,
98     AC_MSG_RESULT(using libc's inet_addr),
99     AC_CHECK_LIB(nsl,inet_addr))
100
101 dnl Port hack for Interactive UNIX System V/386 Release 3.2
102 AC_CHECK_LIB(cposix, strchr,
103                 [EXTRADEFS="$EXTRADEFS -D_SYSV3"
104                 LIBS="$LIBS -lcposix"])
105
106 AC_CHECK_FUNC(strstr, AC_DEFINE(HAVE_STRSTR), 
107               [EXTRASRC="$EXTRASRC \$(srcdir)/strstr.c"
108                EXTRAOBJ="$EXTRAOBJ strstr.o"])
109
110 AC_CHECK_FUNC(strcasecmp, AC_DEFINE(HAVE_STRCASECMP), 
111               [EXTRASRC="$EXTRASRC \$(srcdir)/strcasecmp.c"
112                EXTRAOBJ="$EXTRAOBJ strcasecmp.o"])
113              
114 AC_CHECK_FUNC(memmove, AC_DEFINE(HAVE_MEMMOVE), 
115               [EXTRASRC="$EXTRASRC \$(srcdir)/memmove.c"
116                EXTRAOBJ="$EXTRAOBJ memmove.o"])
117              
118 AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPTLONG),
119               [EXTRASRC="$EXTRASRC \$(srcdir)/getopt.c \$(srcdir)/getopt1.c"
120                EXTRAOBJ="$EXTRAOBJ getopt.o getopt1.o"])
121
122 AC_CHECK_FUNC(MD5Init, AC_DEFINE(HAVE_MD5),
123               [EXTRASRC="$EXTRASRC \$(srcdir)/md5c.c"
124                EXTRAOBJ="$EXTRAOBJ md5c.o"])
125
126 AC_FUNC_VPRINTF
127 AC_FUNC_ALLOCA
128 if test -n "$ALLOCA" 
129 then
130   EXTRASRC="$EXTRASRC \$(srcdir)/alloca.c"
131   EXTRAOBJ="$EXTRAOBJ alloca.o"
132 fi
133
134 dnl AC_CHECK_FUNC calls that might hack the Makefile must precede
135 dnl the following AC_SUBSTs
136
137 AC_SUBST(EXTRADEFS)
138 AC_SUBST(EXTRASRC)
139 AC_SUBST(EXTRAOBJ)
140
141 AC_CHECK_FUNCS(tcsetattr stty setsid geteuid seteuid gethostbyname \
142   res_search herror strrchr strerror setlinebuf syslog \
143   snprintf vprintf vsnprintf vsyslog \
144   atexit inet_aton strftime setrlimit socketpair sigprocmask)
145
146 # Under Red Hat 4.0 (and many other Linuxes) -lresolv is seriously flaky
147 # and breaks gethostbyname(2).  It's better to use the bind stuff in the C
148 # library.  So don't add -lresolv to the link list unless it's necessary
149 # (It will be necessary when using GNU libc6).
150 AC_CHECK_FUNC(res_search,
151     AC_MSG_RESULT(using libc's resolver functions),
152     AC_CHECK_LIB(resolv,res_search, 
153         [AC_DEFINE(HAVE_RES_SEARCH) AC_MSG_RESULT(found resolver functions in libresolv); LIBS="$LIBS -lresolv"], AC_MSG_RESULT(no resolver calls found)))
154
155 dnl Check for libcrypt
156 AC_CHECK_LIB(crypt,crypt)
157
158 dnl Check for RSA refersence library in case we're using SSL
159 AC_CHECK_LIB(rsaref, RSAPublicDecrypt)
160
161 dnl AC_FUNC_SETVBUF_REVERSED
162
163 dnl Check for usable void pointer type
164 AC_MSG_CHECKING(use of void pointer type)
165 AC_TRY_COMPILE([],
166    [char *p;
167     void *xmalloc();
168     p = (char *) xmalloc(1);
169    ],
170  [AC_DEFINE(HAVE_VOIDPOINTER) AC_MSG_RESULT(yes)],
171  AC_MSG_RESULT(no))
172
173 dnl Check for ANSI volatile
174 AC_MSG_CHECKING(for ANSI volatile)
175 AC_TRY_COMPILE([],
176    [volatile int n;],
177  [AC_DEFINE(HAVE_VOLATILE) AC_MSG_RESULT(yes)],
178  AC_MSG_RESULT(no))
179
180 dnl Check out the wait reality.  We have to assume sys/wait.h is present.
181 AC_CHECK_FUNCS(waitpid wait3)
182 AC_MSG_CHECKING(for union wait);
183 AC_TRY_LINK([#include <sys/types.h>
184 #include <sys/wait.h>],
185                  [union wait status; int pid; pid = wait (&status);
186 #ifdef WEXITSTATUS
187 /* Some POSIXoid systems have both the new-style macros and the old
188    union wait type, and they do not work together.  If union wait
189    conflicts with WEXITSTATUS et al, we don't want to use it at all.  */
190 if (WEXITSTATUS (status) != 0) pid = -1;
191 #endif
192 #ifdef HAVE_WAITPID
193 /* Make sure union wait works with waitpid.  */
194 pid = waitpid (-1, &status, 0);
195 #endif
196 ],
197   [AC_DEFINE(HAVE_UNION_WAIT) AC_MSG_RESULT(yes)],
198   AC_MSG_RESULT(no))
199
200 AC_MSG_CHECKING(sys_siglist declaration in signal.h or unistd.h)
201 AC_TRY_LINK([#include <signal.h>
202 /* NetBSD declares sys_siglist in <unistd.h>.  */
203 #ifdef HAVE_UNISTD_H
204 #include <unistd.h>
205 #endif], [char *msg = *(sys_siglist + 1);],
206   [AC_DEFINE(SYS_SIGLIST_DECLARED) AC_MSG_RESULT(yes)],
207   AC_MSG_RESULT(no))
208
209 # Find the right directory to put the root-mode PID file in
210 for dir in "/var/run" "/etc"
211 do
212         if test -d $dir 
213         then
214                 break;
215         fi
216 done
217 AC_MSG_RESULT(root-mode pid file will go in $dir)
218 AC_DEFINE_UNQUOTED(PID_DIR, "$dir")
219
220 AC_CHECK_SIZEOF(short)
221 AC_CHECK_SIZEOF(int)
222 AC_CHECK_SIZEOF(long)
223
224 if test "$USE_NLS" = "yes"
225 then
226         echo 'Enabling internationalization support...'
227         POMAKE='$(MAKE) -C po'
228         if test "x$prefix" != xNONE; then
229                 EXTRADEFS="$EXTRADEFS -DLOCALEDIR='\"$prefix/share/locale\"'"
230         else
231                 EXTRADEFS="$EXTRADEFS -DLOCALEDIR='\"$ac_default_prefix/share/locale\"'"
232         fi
233 else
234         echo 'Disabling internationalization support...'
235         POMAKE="@echo '(NLS support disabled)'; #"
236 fi
237
238 ###     use option --enable-POP2 to compile in the POP2 support
239 AC_ARG_ENABLE(POP2,
240         [  --enable-POP2           compile in POP2 protocol support (obsolete)],
241         [with_POP2=$enableval],
242         [with_POP2=no])
243 test "$with_POP2" = "yes" && AC_DEFINE(POP2_ENABLE)
244
245 ###     use option --disable-POP3 to omit the POP3 support
246 AC_ARG_ENABLE(POP3,
247         [  --disable-POP3          don't compile in POP3 protocol support],
248         [with_POP3=$enableval],
249         [with_POP3=yes])
250 test "$with_POP3" = "yes" && AC_DEFINE(POP3_ENABLE)
251
252 ###     use option --disable-IMAP to omit the IMAP support
253 AC_ARG_ENABLE(IMAP,
254         [  --disable-IMAP          don't compile in IMAP protocol support],
255         [with_IMAP=$enableval],
256         [with_IMAP=yes])
257 test "$with_IMAP" = "yes" && AC_DEFINE(IMAP_ENABLE)
258
259 ###     use option --disable-ETRN to omit the ETRN support
260 AC_ARG_ENABLE(ETRN,
261         [  --disable-ETRN          don't compile in ETRN protocol support],
262         [with_ETRN=$enableval],
263         [with_ETRN=yes])
264 test "$with_ETRN" = "yes" && AC_DEFINE(ETRN_ENABLE)
265
266 ###     use option --enable-RPA to compile in the RPA support
267 AC_ARG_ENABLE(RPA,
268         [  --enable-RPA            compile in RPA protocol support],
269         [with_RPA=$enableval],
270         [with_RPA=no])
271 test "$with_RPA" = "yes" && AC_DEFINE(RPA_ENABLE)
272
273 ###     use option --enable-NTLM to compile in the NTLM support
274 AC_ARG_ENABLE(NTLM,
275         [  --enable-NTLM           compile in NTLM authentication support],
276         [with_NTLM=$enableval],
277         [with_NTLM=no])
278 test "$with_NTLM" = "yes" && AC_DEFINE(NTLM_ENABLE)
279
280 ###     use option --enable-SDPS to compile in the SDPS support
281 AC_ARG_ENABLE(SDPS,
282         [  --enable-SDPS           compile in SDPS protocol support],
283         [with_SDPS=$enableval],
284         [with_SDPS=no])
285 test "$with_SDPS" = "yes" && AC_DEFINE(SDPS_ENABLE)
286
287 ###     use option --enable-opie to compile in the OPIE support
288 AC_ARG_ENABLE(opie,
289         [  --enable-opie           support OTP through the OPIE library],
290         [ AC_CHECK_HEADER(opie.h,, [echo 'configure: cannot find <opie.h>, which is required for OPIE support.'; exit 1])
291           AC_CHECK_LIB(opie,opiegenerator,, [echo 'configure: cannot find libopie, which is required for OPIE support.'; exit 1])
292           with_opie=$enableval],
293         [with_opie=no])
294 test "$with_opie" = "yes" && AC_DEFINE(OPIE_ENABLE)
295
296 AC_ARG_ENABLE(inet6,
297         [  --enable-inet6          support IPv6 (requires the inet6-apps library)],
298
299         [ AC_CHECK_FUNC(getaddrinfo, [with_inet6=yes],
300           [ LDFLAGS="$LDFLAGS -L/usr/inet6/lib";
301             AC_CHECK_LIB(inet6, getaddrinfo, [with_inet6=yes
302             LIBS="$LIBS -linet6"],
303             [ echo 'configure: cannot find proper glibc version or libinet6,';
304               echo '           which is required for IPv6 support.';
305               exit 1]) ] )],
306         [with_inet6=no])
307 test "$with_inet6" = "yes" && AC_DEFINE(INET6_ENABLE)
308
309 AC_CHECK_FUNCS(inner_connect)
310
311 AC_ARG_ENABLE(netsec,
312         [  --enable-netsec         support network security (requires inet6-apps library)],
313         [ unset ac_cv_lib_inet6_net_security_strtorequest; AC_CHECK_LIB(inet6, net_security_strtorequest,,
314           [ unset ac_cv_lib_inet6_net_security_strtorequest;
315             LDFLAGS="$LDFLAGS -L/usr/inet6/lib"; 
316             AC_CHECK_LIB(inet6, net_security_strtorequest,,
317             [ echo 'configure: cannot find net_security_strtorequest in libinet6, which is required';
318               echo '           for network security support. Either it does not exist, or it was';
319               echo '           not built with network security support enabled.';
320               exit 1]) ])
321         unset ac_cv_header_net_security_h; AC_CHECK_HEADER(net/security.h,,
322         [ unset ac_cv_header_net_security_h; 
323         CPPFLAGS="$CPPFLAGS -I/usr/inet6/include"; 
324         CFLAGS="$CFLAGS -I/usr/inet6/include"; AC_CHECK_HEADER(net/security.h,,
325           [ echo 'configure: cannot find <net/security.h>, which is required';
326           echo '             for network security support.';
327           exit 1]) ]) ]
328         [with_netsec=no])
329 test "$with_netsec" = "yes" && AC_DEFINE(NET_SECURITY)
330
331 ###     use option --with-kerberos5=DIR to point at a Kerberos 5 directory
332 AC_ARG_WITH(kerberos5,
333         [  --with-kerberos5=DIR    point fetchmail compilation at a Kerberos 5 directory])
334
335 # The "then" arm (nonempty $with_kerberos5) is kind of a crock.  It works for
336 # configuring the BSD/OS Kerberos IV support, though. 
337 if test -n "$with_kerberos5" -a "$with_kerberos5" != "no"
338 then
339     # Path given
340     CEFLAGS="$CEFLAGS -DKERBEROS_V5 -I$with_kerberos5/include"
341     LDEFLAGS="$LDEFLAGS -L$with_kerberos5/lib"
342     if test -f "$with_kerberos5/include/roken.h"
343     then
344        AC_DEFINE(HEIMDAL)
345        LIBS="$LIBS -lkrb5 -lasn1 -ldes -lroken -lcom_err"
346     else
347        LIBS="$LIBS -lkrb5 -lcrypto -lcom_err"
348     fi
349 elif test "$with_kerberos" != "no"; then
350     for dir in /usr/kerberos /usr/local/krb5 /usr/athena
351     do
352       if test -f "$dir/include/krb5.h"
353       then
354         CEFLAGS="$CEFLAGS -DKERBEROS_V5 -I$dir/include"
355         LDEFLAGS="$LDEFLAGS -L$dir/lib"
356         if test -f "$dir/include/roken.h"
357         then
358            AC_DEFINE(HEIMDAL)
359            LIBS="$LIBS -lkrb5 -lasn1 -ldes -lcom_err"
360         else
361            LIBS="$LIBS -lkrb5 -lcrypto -lcom_err"
362         fi
363         with_kerberos5=$dir
364         break
365       fi
366     done
367 fi
368
369 ###     use option --with-ssl to compile in the SSL support
370 AC_ARG_WITH(ssl,
371         [  --with-ssl=[DIR]        enable SSL support using libraries in DIR],
372         [with_ssl=$withval],
373         [with_ssl=no])
374 test "$with_ssl" = "yes" && AC_DEFINE(SSL_ENABLE)
375
376 if test "$with_ssl" = "yes"
377 then
378 #       He didn't specify an SSL location.  Let's look at some common
379 #       directories where SSL has been found in the past and try and auto
380 #       configure for SSL.  OpenSSL determination will be made later.
381 #       This will screw up if an OpenSSL install is located in a later
382 #       directory than an older SSLeay install, but the user should fix that
383 #       anyways and he can override on the configure line.
384
385     for ac_dir in \
386       /usr/local/ssl \
387       /usr/ssl \
388       /local/ssl \
389       /opt/ssl \
390       ; \
391     do
392         if test -d "$ac_dir" ; then
393             with_ssl=$ac_dir
394             break;
395         fi
396     done
397 fi
398
399 if test -n "$with_ssl" -a "$with_ssl" != "no"
400 then
401     # With the autoconfigure above, the only time this is going to be
402     # true is going to be when we could not find the headers.  If they
403     # are not in system standard locations, we are going to be broken.
404     if test "$with_ssl" = "yes"
405     then
406 # Let's just define the standard location for the SSLeay root
407         with_ssl="/usr/local/ssl"
408     fi
409     if test -r $with_ssl/include/openssl/ssl.h
410     then
411 ###     ssl.h found under openssl.  Use openssl configuration preferentially
412         echo "Enabling OpenSSL support in $with_ssl"
413         CEFLAGS="$CEFLAGS -I$with_ssl/include -I$with_ssl/include/openssl"
414 ###     OpenBSD comes with ssl headers
415     elif test -r /usr/include/ssl/ssl.h
416     then
417         echo "Enabling SSLeay support in $with_ssl"
418         CEFLAGS="$CEFLAGS -I/usr/include/ssl"
419     else
420         echo "Enabling SSLeay support in $with_ssl"
421         CEFLAGS="$CEFLAGS -I$with_ssl/include"
422     fi
423     LDEFLAGS="$LDEFLAGS -L$with_ssl/lib"
424     LIBS="$LIBS -lssl -lcrypto"
425     AC_DEFINE(SSL_ENABLE)
426 else
427     echo 'Disabling SSL support...'
428 fi
429
430 ###     use option --with-kerberos=DIR to point at a Kerberos directory
431 AC_ARG_WITH(kerberos,
432         [  --with-kerberos=DIR     point fetchmail compilation at a Kerberos directory])
433
434 # The "elif" arm (nonempty $with_kerberos) is kind of a crock.  It works for
435 # configuring the BSD/OS Kerberos IV support, though. 
436
437 # Check for a NetBSD/OpenBSD special case
438 if test "$with_kerberos" = "yes" && test `uname` = "NetBSD" -o `uname` = "OpenBSD"
439 then
440   echo "Configuring kerberosIV for `uname`"
441   CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I/usr/include/kerberosIV"
442   LIBS="$LIBS -lkrb -ldes"
443 elif test -n "$with_kerberos" -a -n "$with_kerberos5" -a "$with_kerberos" != "no"
444 then
445     CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I$with_kerberos/include"
446     LDEFLAGS="$LDEFLAGS -L$with_kerberos/lib"
447     if test -f "$with_kerberos5/roken.h"
448     then
449        AC_DEFINE(HEIMDAL)
450        LIBS="-lkrb4 -l45 $LIBS" 
451     else
452        LIBS="-lkrb4 -ldes425 $LIBS"
453     fi
454 elif test -n "$with_kerberos5" -a "$with_kerberos" != "no"
455 then
456     for dir in /usr/kerberos /usr/kerberosIV /usr/athena
457     do
458       if test -f "$dir/include/kerberosIV/krb.h"
459       then
460         CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I$dir/include"
461         LDEFLAGS="$LDEFLAGS -L$dir/lib"
462         LIBS="-lkrb4 -ldes425 $LIBS"
463         break
464       fi
465     done
466 elif test -n "$with_kerberos" -a "$with_kerberos" != "no"
467 then
468     CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I$with_kerberos/include"
469     LDEFLAGS="$LDEFLAGS -L$with_kerberos/lib"
470     LIBS="$LIBS -lkrb -ldes"
471 else
472   if test "$with_kerberos" != "no"
473   then
474     for dir in /usr/kerberos /usr/kerberosIV /usr/athena
475     do
476       if test -f "$dir/include/krb.h"
477       then
478         CEFLAGS="$CEFLAGS -DKERBEROS_V4 -I$dir/include"
479         LDEFLAGS="$LDEFLAGS -L$dir/lib"
480         LIBS="$LIBS -lkrb -ldes"
481         break
482       fi
483     done
484 fi
485
486 ###     use option --with-socks=DIR to point at SOCKS library
487 AC_ARG_WITH(socks,
488         [  --with-socks[=DIR]      add built-in SOCKS firewall access],
489 [
490 if test "$with_socks" != no
491 then
492     if test "$with_socks" != yes
493     then
494         LDEFLAGS="$LDEFLAGS -L$with_socks"
495     else
496         AC_CHECK_LIB(socks, Rconnect,,
497                AC_MSG_ERROR([could not find libsocks which is needed for built-in SOCKS support]))
498     fi
499     AC_DEFINE(HAVE_SOCKS)
500     CEFLAGS="$CEFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
501     LIBS="-lsocks $LIBS"
502 fi])
503
504 ###     use option --with-socks5=DIR to point at SOCKS library
505 AC_ARG_WITH(socks5,
506         [  --with-socks5[=DIR]     add built-in SOCKS5 firewall access],
507 [
508 if test "$with_socks5" != no
509 then
510     if test "$with_socks5" != yes
511     then
512         LDEFLAGS="$LDEFLAGS -L$with_socks5"
513     else
514         AC_CHECK_LIB(socks5, SOCKSconnect,,
515                AC_MSG_ERROR([could not find libsocks5 which is needed for built-in SOCKS5 support]))
516     fi
517     AC_DEFINE(HAVE_SOCKS)
518     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"
519     LIBS="-lsocks5 $LIBS"
520 fi])
521
522 ###     use option --with-hesiod=DIR to point at a HESIOD directory
523 AC_ARG_WITH(hesiod,
524         [  --with-hesiod=DIR       point fetchmail compilation at a HESIOD directory])
525
526 case "x$with_hesiod" in
527 xno)
528     ;;
529 x)
530     for dir in /usr/athena /usr /usr/local
531     do
532       if test -f "$dir/include/hesiod.h"
533       then
534         CEFLAGS="$CEFLAGS -DHESIOD -I$dir/include"
535         LDEFLAGS="$LDEFLAGS -L$dir/lib"
536         LIBS="$LIBS -lhesiod"
537         with_hesiod=$dir
538         break
539       fi
540     done
541     ;;
542 *)
543     # Path given
544     CEFLAGS="$CEFLAGS -DHESIOD -I$with_hesiod/include"
545     LDEFLAGS="$LDEFLAGS -L$with_hesiod/lib"
546     LIBS="$LIBS -lhesiod"
547     ;;
548   esac
549 fi
550
551 ###     use option --with-gssapi=DIR to compile in GSSAPI support
552 AC_ARG_WITH(gssapi,
553         [  --with-gssapi[=DIR]     compile in GSSAPI support using libraries in DIR],
554 [
555 if test "$with_gssapi" != "no"
556 then
557   if test "$with_gssapi" = "yes" -a -n "$with_kerberos5"
558   then
559     with_gssapi=$with_kerberos5
560   fi
561   if test "$with_gssapi" != "yes" -a -n "$with_gssapi"
562   then
563     CFLAGS="$CFLAGS -I$with_gssapi/include"
564     LDFLAGS="$LDFLAGS -L$with_gssapi/lib"
565   fi
566
567   if test -f "$with_gssapi/include/roken.h"
568   then
569      LIBS="$LIBS -lkrb5 -lasn1 -ldes -lroken -ldb -ldl"
570      AC_CHECK_LIB(gssapi, gss_init_sec_context,LIBS="$LIBS -lgssapi",
571                   AC_MSG_ERROR([could not find libgssapi which is needed for GSSAPI support]), )
572      AC_DEFINE(HEIMDAL)
573   else
574      AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,LIBS="$LIBS -lgssapi_krb5",
575                   AC_MSG_ERROR([could not find libgssapi_krb5 which is needed for GSSAPI support]), -lkrb5)
576   fi
577   AC_DEFINE(GSSAPI)
578   save_CPPFLAGS=$CPPFLAGS
579   CPPFLAGS="-I$with_gssapi/include"
580   AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h)
581   if test "$ac_cv_header_gssapi_h" = "yes"; then
582     AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE))
583   else
584     AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE))
585   fi
586 fi])
587
588 AC_OUTPUT([Makefile intl/Makefile po/Makefile.in], [
589         # The reason for this odd makedepend line is that we want
590         # to have all dependencies evaluated relative to the source directory
591         # and let VPATH do all the dirty work when we build remotely
592         echo "You can ignore any makedepend error messages:";
593         echo timestamp > stamp-h;
594         (cd $srcdir; makedepend -f - *.c) >>Makefile])
595
596 dnl Local Variables:
597 dnl comment-start: "dnl "
598 dnl comment-end: ""
599 dnl comment-start-skip: "\\bdnl\\b\\s *"
600 dnl compile-command: "make configure config.h.in"
601 dnl End: