]> Pileus Git - ~andy/fetchmail/blob - configure.in
Implement batchlimit option.
[~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 # 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)
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) 
27
28 AC_C_CONST                      dnl getopt needs this.
29
30 AC_PROG_LEX
31 AC_PROG_YACC
32 AC_SUBST(LIBOBJS)
33
34 AC_CHECK_LIB(socket,socket)
35 AC_CHECK_LIB(nsl,inet_addr)
36
37 AC_CHECK_FUNC(strcasecmp, AC_DEFINE(HAVE_STRCASECMP), 
38               [EXTRASRC="$EXTRASRC \$(srcdir)/strcasecmp.c"
39                EXTRAOBJ="$EXTRAOBJ strcasecmp.o"])
40              
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"])
44
45 AC_FUNC_ALLOCA
46 if test -n "$ALLOCA" 
47 then
48   EXTRASRC="$EXTRASRC \$(srcdir)/alloca.c"
49   EXTRAOBJ="$EXTRAOBJ alloca.o"
50 fi
51
52 if test -f "/usr/kerberos/include/krb.h"
53 then
54   CFLAGS="$CFLAGS -DKERBEROS_V4 -I/usr/kerberos/include"
55   LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
56   LIBS="$LIBS -lkrb -ldes"
57 fi
58
59 dnl All AC_CHECK_FUNCs must precede the following AC_SUBSTs
60
61 AC_SUBST(EXTRASRC)
62 AC_SUBST(EXTRAOBJ)
63
64 AC_CHECK_FUNCS(tcsetattr stty setsid seteuid gethostbyname)
65
66 dnl AC_FUNC_SETVBUF_REVERSED
67
68 dnl Check for usuable void pointer type
69 AC_MSG_CHECKING(use of void pointer type)
70 AC_TRY_COMPILE([],
71    [char *p;
72     void *xmalloc();
73     p = (char *) xmalloc(1);
74    ],
75  [AC_DEFINE(HAVE_VOIDPOINTER) AC_MSG_RESULT(yes)],
76  AC_MSG_RESULT(no))
77
78 dnl Check for usable function prototypes
79 AC_MSG_CHECKING(use of function prototypes);
80 AC_TRY_COMPILE([], 
81    [int x;
82     int myProtoFn (int arg); 
83     x = 0;
84     x = myProtoFn(x);
85    ],
86  [AC_DEFINE(HAVE_PROTOTYPES) AC_MSG_RESULT(yes)],
87  AC_MSG_RESULT(no))
88                 
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);
95 #ifdef WEXITSTATUS
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;
100 #endif
101 #ifdef HAVE_WAITPID
102 /* Make sure union wait works with waitpid.  */
103 pid = waitpid (-1, &status, 0);
104 #endif
105 ],
106   [AC_DEFINE(HAVE_UNION_WAIT) AC_MSG_RESULT(yes)],
107   AC_MSG_RESULT(no))
108
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>.  */
112 #ifdef HAVE_UNISTD_H
113 #include <unistd.h>
114 #endif], [char *msg = *(sys_siglist + 1);],
115   [AC_DEFINE(SYS_SIGLIST_DECLARED) AC_MSG_RESULT(yes)],
116   AC_MSG_RESULT(no))
117
118 AC_OUTPUT(Makefile, [
119 # Makefile uses this timestamp file to know when to remake Makefile,
120 # build.sh, and glob/Makefile.
121 touch stamp-config])
122
123 dnl Local Variables:
124 dnl comment-start: "dnl "
125 dnl comment-end: ""
126 dnl comment-start-skip: "\\bdnl\\b\\s *"
127 dnl compile-command: "make configure config.h.in"
128 dnl End: