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)
28 AC_C_CONST dnl getopt needs this.
34 AC_CHECK_LIB(socket,socket)
35 AC_CHECK_LIB(nsl,inet_addr)
37 AC_CHECK_FUNC(strcasecmp, AC_DEFINE(HAVE_STRCASECMP),
38 [EXTRASRC="$EXTRASRC \$(srcdir)/strcasecmp.c"
39 EXTRAOBJ="$EXTRAOBJ strcasecmp.o"])
41 AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPTLONG),
42 [EXTRASRC="$EXTRASRC \$(srcdir)/getopt.c \$(srcdir)/getopt1.c"
43 EXTRAOBJ="$EXTRAOBJ getopt.o getopt1.o"])
48 EXTRASRC="$EXTRASRC \$(srcdir)/alloca.c"
49 EXTRAOBJ="$EXTRAOBJ alloca.o"
52 if test -f "/usr/kerberos/include/krb.h"
54 CFLAGS="$CFLAGS -DKERBEROS_V4 -I/usr/kerberos/include"
55 LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
56 LIBS="$LIBS -lkrb -ldes"
59 dnl All AC_CHECK_FUNCs must precede the following AC_SUBSTs
64 AC_CHECK_FUNCS(tcsetattr stty setsid seteuid gethostbyname)
66 dnl AC_FUNC_SETVBUF_REVERSED
68 dnl Check for usuable void pointer type
69 AC_MSG_CHECKING(use of void pointer type)
73 p = (char *) xmalloc(1);
75 [AC_DEFINE(HAVE_VOIDPOINTER) AC_MSG_RESULT(yes)],
78 dnl Check for usable function prototypes
79 AC_MSG_CHECKING(use of function prototypes);
82 int myProtoFn (int arg);
86 [AC_DEFINE(HAVE_PROTOTYPES) AC_MSG_RESULT(yes)],
89 dnl Check out the wait reality. We have to assume sys/wait.h is present.
90 AC_CHECK_FUNCS(waitpid wait3)
91 AC_MSG_CHECKING(for union wait);
92 AC_TRY_LINK([#include <sys/types.h>
93 #include <sys/wait.h>],
94 [union wait status; int pid; pid = wait (&status);
96 /* Some POSIXoid systems have both the new-style macros and the old
97 union wait type, and they do not work together. If union wait
98 conflicts with WEXITSTATUS et al, we don't want to use it at all. */
99 if (WEXITSTATUS (status) != 0) pid = -1;
102 /* Make sure union wait works with waitpid. */
103 pid = waitpid (-1, &status, 0);
106 [AC_DEFINE(HAVE_UNION_WAIT) AC_MSG_RESULT(yes)],
109 AC_MSG_CHECKING(sys_siglist declaration in signal.h or unistd.h)
110 AC_TRY_LINK([#include <signal.h>
111 /* NetBSD declares sys_siglist in <unistd.h>. */
114 #endif], [char *msg = *(sys_siglist + 1);],
115 [AC_DEFINE(SYS_SIGLIST_DECLARED) AC_MSG_RESULT(yes)],
118 AC_OUTPUT(Makefile, [
119 # Makefile uses this timestamp file to know when to remake Makefile,
120 # build.sh, and glob/Makefile.
124 dnl comment-start: "dnl "
126 dnl comment-start-skip: "\\bdnl\\b\\s *"
127 dnl compile-command: "make configure config.h.in"