]> Pileus Git - ~andy/fetchmail/blob - configure.in
This is what I sent Harris.
[~andy/fetchmail] / configure.in
1 dnl Autoconfigure input file for popclient
2 dnl Carl Harris, ceharris@mal.com
3 dnl
4 dnl Process this file with autoconf to produce a configure script.
5 dnl
6 dnl $Log: configure.in,v $
7 dnl Revision 1.2  1996/06/26 19:08:56  esr
8 dnl This is what I sent Harris.
9 dnl
10 dnl Revision 1.1  1996/06/24 20:43:13  esr
11 dnl Initial revision
12 dnl
13 dnl Revision 1.6  1995/09/07 22:37:33  ceharris
14 dnl Preparation for 3.0b4 release.
15 dnl
16 dnl Revision 1.5  1995/08/14 18:36:37  ceharris
17 dnl Patches to support POP3's LAST command.
18 dnl Final revisions for beta3 release.
19 dnl
20 dnl Revision 1.4  1995/08/10 00:32:26  ceharris
21 dnl Preparation for 3.0b3 beta release:
22 dnl -   added code for --kill/--keep, --limit, --protocol, --flush
23 dnl     options; --pop2 and --pop3 options now obsoleted by --protocol.
24 dnl -   added support for APOP authentication, including --with-APOP
25 dnl     argument for configure.
26 dnl -   provisional and broken support for RPOP
27 dnl -   added buffering to SockGets and SockRead functions.
28 dnl -   fixed problem of command-line options not being correctly
29 dnl     carried into the merged options record.
30 dnl
31 dnl Revision 1.3  1995/08/09 01:32:49  ceharris
32 dnl Version 3.0 beta 2 release.
33 dnl Added
34 dnl -   .poprc functionality
35 dnl -   GNU long options
36 dnl -   multiple servers on the command line.
37 dnl Fixed
38 dnl -   Passwords showing up in ps output.
39 dnl
40 dnl Revision 1.2  1995/08/08 01:01:17  ceharris
41 dnl Added GNU-style long options processing.
42 dnl Fixed password in 'ps' output problem.
43 dnl Fixed various RCS tag blunders.
44 dnl Integrated .poprc parser, lexer, etc into Makefile processing.
45 dnl
46 dnl
47
48 AC_INIT(popclient.h)            dnl A distinctive file to look for in srcdir. 
49 AC_CONFIG_HEADER(config.h)
50
51 # We want these before the checks, so the checks can modify their values.
52 test -z "$CFLAGS" && CFLAGS=-g AC_SUBST(CFLAGS)
53 test -z "$LDFLAGS" && LDFLAGS=-g AC_SUBST(LDFLAGS)
54
55 AC_CANONICAL_HOST
56
57 AC_MSG_CHECKING(system mailbox directory)
58 if test -d /var/mail
59 then
60         AC_DEFINE(USERFOLDER, "/var/mail/%s")
61         userfolder='/var/mail/$u'
62 elif test -d /usr/mail
63 then
64         AC_DEFINE(USERFOLDER, "/usr/mail/%s")
65         userfolder='/usr/mail/$u'
66 elif test -d /usr/spool/mail
67 then
68         AC_DEFINE(USERFOLDER, "/usr/spool/mail/%s")
69         userfolder='/usr/spool/mail/$u'
70 elif test -d /var/spool/mail
71 then
72         AC_DEFINE(USERFOLDER, "/var/spool/mail/%s")
73         userfolder='/var/mail/$u'
74 else
75         userfolder="can't find one, will fall back on system MDA."
76 fi
77 AC_MSG_RESULT($userfolder)
78
79 AC_MSG_CHECKING(delivery agent for $host)
80 case $host in
81    *-*-*bsd*)
82         AC_DEFINE(DEF_MDA,"/usr/libexec/mail.local %s")
83         mdacmd="/usr/libexec/mail.local \$u"
84         ;;
85
86    *-*-aix*)
87         AC_DEFINE(DEF_MDA,"/usr/bin/bellmail %s")
88         mdacmd="/usr/bin/bellmail \$u"
89         ;;
90
91    *-*-hpux*)
92         AC_DEFINE(DEF_MDA,"/bin/rmail -d %s")
93         mdacmd="/bin/rmail -d \$u"
94         ;;
95
96    *)
97         if test -x "/usr/bin/deliver %s"
98         then
99                 AC_DEFINE(DEF_MDA,"/usr/bin/deliver %s")
100                 mdacmd="/usr/bin/deliver \$u"
101         else
102                 # default case assumes /bin/mail is an MDA -- may LOSE mail on
103                 # systems where it is not an MDA.
104                 AC_DEFINE(DEF_MDA,"/bin/mail -d %s")
105                 mdacmd="/bin/mail -d \$u"
106         fi
107         ;;
108 esac
109 AC_MSG_RESULT($mdacmd)
110
111
112 AC_MSG_CHECKING(whether we want APOP support)
113 AC_ARG_WITH(APOP,
114             [  --with-APOP              should we include APOP support?],
115             [EXTRASRC="$EXTRASRC \$(srcdir)/md5c.c \$(srcdir)/md5ify.c"
116              EXTRAOBJ="$EXTRAOBJ md5c.o md5ify.o" 
117              AC_DEFINE(HAVE_APOP_SUPPORT)
118              AC_MSG_RESULT(yes)],
119              AC_MSG_RESULT(no))
120
121 AC_PROG_CC
122 AC_PROG_INSTALL
123 AC_PROG_CPP                     dnl Later checks need this.
124 AC_PROG_CC_C_O
125 AC_AIX
126 AC_ISC_POSIX
127 AC_MINIX
128 AC_HEADER_STDC
129 AC_TYPE_SIZE_T
130 AC_TYPE_PID_T
131 AC_TYPE_SIGNAL
132 AC_CHECK_HEADERS(unistd.h termios.h termio.h sgtty.h memory.h) 
133
134 AC_C_CONST                      dnl getopt needs this.
135
136 AC_PROG_LEX
137 AC_PROG_YACC
138 AC_SUBST(LIBOBJS)
139
140 AC_CHECK_LIB(socket,socket)
141 AC_CHECK_LIB(nsl,inet_addr)
142
143
144
145 AC_CHECK_FUNC(bzero, AC_DEFINE(HAVE_BZERO), 
146    AC_CHECK_FUNC(memset, [AC_DEFINE(HAVE_MEMSET) 
147                           AC_DEFINE(HAVE_MEMCPY)], 
148                  [EXTRASRC="$EXTRASRC \$(srcdir)/bzero.c"
149                   EXTRAOBJ="$EXTRALIB bzero.o"]))
150
151 AC_CHECK_FUNC(strdup, AC_DEFINE(HAVE_STRDUP), 
152               [EXTRASRC="$EXTRASRC \$(srcdir)/strdup.c"
153                EXTRAOBJ="$EXTRAOBJ strdup.o"])
154              
155 AC_CHECK_FUNC(strcasecmp, AC_DEFINE(HAVE_STRCASECMP), 
156               [EXTRASRC="$EXTRASRC \$(srcdir)/strcasecmp.c"
157                EXTRAOBJ="$EXTRAOBJ strcasecmp.o"])
158              
159 AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPTLONG),
160               [EXTRASRC="$EXTRASRC \$(srcdir)/getopt.c \$(srcdir)/getopt1.c"
161                EXTRAOBJ="$EXTRAOBJ getopt.o getopt1.o"])
162
163 AC_FUNC_ALLOCA
164 if test -n "$ALLOCA" 
165 then
166   EXTRASRC="$EXTRASRC \$(srcdir)/alloca.c"
167   EXTRAOBJ="$EXTRAOBJ alloca.o"
168 fi
169
170 dnl All AC_CHECK_FUNCs must precede the following AC_SUBSTs
171
172 AC_SUBST(EXTRASRC)
173 AC_SUBST(EXTRAOBJ)
174
175 AC_CHECK_FUNCS(dup2 strerror tcsetattr stty setsid flock)
176
177 dnl AC_FUNC_SETVBUF_REVERSED
178
179 dnl Check for usuable void pointer type
180 AC_MSG_CHECKING(use of void pointer type)
181 AC_TRY_COMPILE([],
182    [char *p;
183     void *xmalloc();
184     p = (char *) xmalloc(1);
185    ],
186  [AC_DEFINE(HAVE_VOIDPOINTER) AC_MSG_RESULT(yes)],
187  AC_MSG_RESULT(no))
188
189 dnl Check for usable function prototypes
190 AC_MSG_CHECKING(use of function prototypes);
191 AC_TRY_COMPILE([], 
192    [int x;
193     int myProtoFn (int arg); 
194     x = 0;
195     x = myProtoFn(x);
196    ],
197  [AC_DEFINE(HAVE_PROTOTYPES) AC_MSG_RESULT(yes)],
198  AC_MSG_RESULT(no))
199                 
200 dnl Check out the wait reality.
201 AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
202 AC_MSG_CHECKING(for union wait);
203 AC_TRY_LINK([#include <sys/types.h>
204 #include <sys/wait.h>],
205                  [union wait status; int pid; pid = wait (&status);
206 #ifdef WEXITSTATUS
207 /* Some POSIXoid systems have both the new-style macros and the old
208    union wait type, and they do not work together.  If union wait
209    conflicts with WEXITSTATUS et al, we don't want to use it at all.  */
210 if (WEXITSTATUS (status) != 0) pid = -1;
211 #endif
212 #ifdef HAVE_WAITPID
213 /* Make sure union wait works with waitpid.  */
214 pid = waitpid (-1, &status, 0);
215 #endif
216 ],
217   [AC_DEFINE(HAVE_UNION_WAIT) AC_MSG_RESULT(yes)],
218   AC_MSG_RESULT(no))
219
220 AC_MSG_CHECKING(sys_siglist declaration in signal.h or unistd.h)
221 AC_TRY_LINK([#include <signal.h>
222 /* NetBSD declares sys_siglist in <unistd.h>.  */
223 #ifdef HAVE_UNISTD_H
224 #include <unistd.h>
225 #endif], [char *msg = *(sys_siglist + 1);],
226   [AC_DEFINE(SYS_SIGLIST_DECLARED) AC_MSG_RESULT(yes)],
227   AC_MSG_RESULT(no))
228
229 # The presence of the following is not meant to imply
230 # that popclient necessarily works on those systems.
231 dnl AC_DYNIX_SEQ
232 dnl AC_XENIX_DIR
233 dnl AC_IRIX_SUN
234
235 AC_OUTPUT(Makefile, [
236 # Makefile uses this timestamp file to know when to remake Makefile,
237 # build.sh, and glob/Makefile.
238 touch stamp-config])
239
240 dnl Local Variables:
241 dnl comment-start: "dnl "
242 dnl comment-end: ""
243 dnl comment-start-skip: "\\bdnl\\b\\s *"
244 dnl compile-command: "make configure config.h.in"
245 dnl End: