1 dnl Autoconfigure input file for popclient
2 dnl Carl Harris, ceharris@mal.com
4 dnl Process this file with autoconf to produce a configure script.
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.
10 dnl Revision 1.1 1996/06/24 20:43:13 esr
13 dnl Revision 1.6 1995/09/07 22:37:33 ceharris
14 dnl Preparation for 3.0b4 release.
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.
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.
31 dnl Revision 1.3 1995/08/09 01:32:49 ceharris
32 dnl Version 3.0 beta 2 release.
34 dnl - .poprc functionality
35 dnl - GNU long options
36 dnl - multiple servers on the command line.
38 dnl - Passwords showing up in ps output.
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.
48 AC_INIT(popclient.h) dnl A distinctive file to look for in srcdir.
49 AC_CONFIG_HEADER(config.h)
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)
57 AC_MSG_CHECKING(system mailbox directory)
60 AC_DEFINE(USERFOLDER, "/var/mail/%s")
61 userfolder='/var/mail/$u'
62 elif test -d /usr/mail
64 AC_DEFINE(USERFOLDER, "/usr/mail/%s")
65 userfolder='/usr/mail/$u'
66 elif test -d /usr/spool/mail
68 AC_DEFINE(USERFOLDER, "/usr/spool/mail/%s")
69 userfolder='/usr/spool/mail/$u'
70 elif test -d /var/spool/mail
72 AC_DEFINE(USERFOLDER, "/var/spool/mail/%s")
73 userfolder='/var/mail/$u'
75 userfolder="can't find one, will fall back on system MDA."
77 AC_MSG_RESULT($userfolder)
79 AC_MSG_CHECKING(delivery agent for $host)
82 AC_DEFINE(DEF_MDA,"/usr/libexec/mail.local %s")
83 mdacmd="/usr/libexec/mail.local \$u"
87 AC_DEFINE(DEF_MDA,"/usr/bin/bellmail %s")
88 mdacmd="/usr/bin/bellmail \$u"
92 AC_DEFINE(DEF_MDA,"/bin/rmail -d %s")
93 mdacmd="/bin/rmail -d \$u"
97 if test -x "/usr/bin/deliver %s"
99 AC_DEFINE(DEF_MDA,"/usr/bin/deliver %s")
100 mdacmd="/usr/bin/deliver \$u"
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"
109 AC_MSG_RESULT($mdacmd)
112 AC_MSG_CHECKING(whether we want APOP support)
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)
123 AC_PROG_CPP dnl Later checks need this.
132 AC_CHECK_HEADERS(unistd.h termios.h termio.h sgtty.h memory.h)
134 AC_C_CONST dnl getopt needs this.
140 AC_CHECK_LIB(socket,socket)
141 AC_CHECK_LIB(nsl,inet_addr)
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"]))
151 AC_CHECK_FUNC(strdup, AC_DEFINE(HAVE_STRDUP),
152 [EXTRASRC="$EXTRASRC \$(srcdir)/strdup.c"
153 EXTRAOBJ="$EXTRAOBJ strdup.o"])
155 AC_CHECK_FUNC(strcasecmp, AC_DEFINE(HAVE_STRCASECMP),
156 [EXTRASRC="$EXTRASRC \$(srcdir)/strcasecmp.c"
157 EXTRAOBJ="$EXTRAOBJ strcasecmp.o"])
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"])
166 EXTRASRC="$EXTRASRC \$(srcdir)/alloca.c"
167 EXTRAOBJ="$EXTRAOBJ alloca.o"
170 dnl All AC_CHECK_FUNCs must precede the following AC_SUBSTs
175 AC_CHECK_FUNCS(dup2 strerror tcsetattr stty setsid flock)
177 dnl AC_FUNC_SETVBUF_REVERSED
179 dnl Check for usuable void pointer type
180 AC_MSG_CHECKING(use of void pointer type)
184 p = (char *) xmalloc(1);
186 [AC_DEFINE(HAVE_VOIDPOINTER) AC_MSG_RESULT(yes)],
189 dnl Check for usable function prototypes
190 AC_MSG_CHECKING(use of function prototypes);
193 int myProtoFn (int arg);
197 [AC_DEFINE(HAVE_PROTOTYPES) AC_MSG_RESULT(yes)],
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);
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;
213 /* Make sure union wait works with waitpid. */
214 pid = waitpid (-1, &status, 0);
217 [AC_DEFINE(HAVE_UNION_WAIT) AC_MSG_RESULT(yes)],
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>. */
225 #endif], [char *msg = *(sys_siglist + 1);],
226 [AC_DEFINE(SYS_SIGLIST_DECLARED) AC_MSG_RESULT(yes)],
229 # The presence of the following is not meant to imply
230 # that popclient necessarily works on those systems.
235 AC_OUTPUT(Makefile, [
236 # Makefile uses this timestamp file to know when to remake Makefile,
237 # build.sh, and glob/Makefile.
241 dnl comment-start: "dnl "
243 dnl comment-start-skip: "\\bdnl\\b\\s *"
244 dnl compile-command: "make configure config.h.in"