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 AC_CONFIG_HEADER(config.h)
10 # We want these before the checks, so the checks can modify their values.
11 test -z "$CFLAGS" && CFLAGS=-g AC_SUBST(CFLAGS)
12 test -z "$LDFLAGS" && LDFLAGS=-g AC_SUBST(LDFLAGS)
17 AC_PROG_CPP dnl Later checks need this.
26 AC_CHECK_HEADERS(unistd.h termios.h termio.h sgtty.h stdarg.h alloca.h)
28 AC_C_CONST dnl getopt needs this.
34 AC_CHECK_LIB(socket,socket)
35 AC_CHECK_LIB(nsl,inet_addr)
38 # Under Red Hat 4.0 (and many other Linuxes) -lresolv is seriously flaky
39 # and breaks gethostbyname(2). It's better to use the bind stuff in the C
40 # library. So don't add -lresolv to the link list unless it's necessary
41 AC_CHECK_FUNC(res_search,, AC_CHECK_LIB(resolv,res_search))
43 AC_CHECK_FUNC(strcasecmp, AC_DEFINE(HAVE_STRCASECMP),
44 [EXTRASRC="$EXTRASRC \$(srcdir)/strcasecmp.c"
45 EXTRAOBJ="$EXTRAOBJ strcasecmp.o"])
47 AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPTLONG),
48 [EXTRASRC="$EXTRASRC \$(srcdir)/getopt.c \$(srcdir)/getopt1.c"
49 EXTRAOBJ="$EXTRAOBJ getopt.o getopt1.o"])
55 EXTRASRC="$EXTRASRC \$(srcdir)/alloca.c"
56 EXTRAOBJ="$EXTRAOBJ alloca.o"
59 if test -f "/usr/kerberos/include/krb.h"
61 CFLAGS="$CFLAGS -DKERBEROS_V4 -I/usr/kerberos/include"
62 LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
63 LIBS="$LIBS -lkrb -ldes"
66 if test -f "/usr/athena/include/krb.h"
68 CFLAGS="$CFLAGS -DKERBEROS_V4 -I/usr/athena/include"
69 LDFLAGS="$LDFLAGS -L/usr/athena/lib"
70 LIBS="$LIBS -lkrb -ldes"
74 dnl All AC_CHECK_FUNCs must precede the following AC_SUBSTs
79 AC_CHECK_FUNCS(tcsetattr stty setsid seteuid gethostbyname res_search herror \
82 dnl AC_FUNC_SETVBUF_REVERSED
84 dnl Check for usuable void pointer type
85 AC_MSG_CHECKING(use of void pointer type)
89 p = (char *) xmalloc(1);
91 [AC_DEFINE(HAVE_VOIDPOINTER) AC_MSG_RESULT(yes)],
94 dnl Check out the wait reality. We have to assume sys/wait.h is present.
95 AC_CHECK_FUNCS(waitpid wait3)
96 AC_MSG_CHECKING(for union wait);
97 AC_TRY_LINK([#include <sys/types.h>
98 #include <sys/wait.h>],
99 [union wait status; int pid; pid = wait (&status);
101 /* Some POSIXoid systems have both the new-style macros and the old
102 union wait type, and they do not work together. If union wait
103 conflicts with WEXITSTATUS et al, we don't want to use it at all. */
104 if (WEXITSTATUS (status) != 0) pid = -1;
107 /* Make sure union wait works with waitpid. */
108 pid = waitpid (-1, &status, 0);
111 [AC_DEFINE(HAVE_UNION_WAIT) AC_MSG_RESULT(yes)],
114 AC_MSG_CHECKING(sys_siglist declaration in signal.h or unistd.h)
115 AC_TRY_LINK([#include <signal.h>
116 /* NetBSD declares sys_siglist in <unistd.h>. */
119 #endif], [char *msg = *(sys_siglist + 1);],
120 [AC_DEFINE(SYS_SIGLIST_DECLARED) AC_MSG_RESULT(yes)],
123 AC_OUTPUT(Makefile, [
124 # Makefile uses this timestamp file to know when to remake Makefile,
125 # build.sh, and glob/Makefile.
129 dnl comment-start: "dnl "
131 dnl comment-start-skip: "\\bdnl\\b\\s *"
132 dnl compile-command: "make configure config.h.in"