configure.in
1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
dnl Process this file with autoconf to procude a configure script. -*-m4-*-
AC_INIT(libmailbox/mailbox.c)
AM_INIT_AUTOMAKE(mailutils, 0.9.7.1999.09.12)
AM_CONFIG_HEADER(config.h)
dnl Check for programs
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AM_PROG_LIBTOOL
dnl Check for arguments
AC_ARG_ENABLE(pam,
[ --disable-pam disable pam],
[case "${enableval}" in
yes) testpam=yes ;;
no) testpam=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
esac],[testpam=yes])
dnl Check for headers
AC_HEADER_STDC
AM_C_PROTOTYPES
AC_CHECK_HEADERS(malloc.h stdlib.h stdio.h errno.h unistd.h\
paths.h sys/file.h syslog.h shadow.h)
AC_CHECK_HEADERS(string.h strings.h, break)
dnl Check for libraries
dnl Use either PAM or CRYPT, not both.
if test x"$testpam" = x"yes"; then
AC_CHECK_HEADERS(security/pam_appl.h)
if test x"$ac_cv_header_security_pam_appl_h" = x"yes"; then
AC_CHECK_LIB(pam, pam_start, AUTHLIBS="-lpam -ldl" ac_cv_have_libpam="yes",, -ldl)
AC_DEFINE(USE_LIBPAM)
AM_CONDITIONAL(USE_LIBPAM, test x"$ac_cv_have_libpam" != xno)
fi
fi
if test x"$ac_cv_have_libpam" != x"yes"; then
AC_CHECK_FUNCS(crypt)
if test x"$ac_cv_func_crypt" = x"no"; then
AC_CHECK_LIB(crypt, crypt, AUTHLIBS="-lcrypt",, -lcrypt)
fi
fi
AC_SUBST(AUTHLIBS)
dnl Do we need extra libs for networking?
AC_CHECK_FUNC(gethostbyname, [true],
AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="-lnsl $LIBS"))
AC_CHECK_FUNC(socket, [true],
AC_CHECK_LIB(socket, socket, LIBS="-lsocket $LIBS"))
dnl Output Makefiles
AC_OUTPUT(Makefile libmailbox/Makefile mail/Makefile pop3d/Makefile
imap4d/Makefile lib/Makefile doc/Makefile)