configure.in 1.51 KB
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(mailbox-install,
[  --enable-mailbox-install	install libmailbox])

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])

AM_CONDITIONAL(INSTALL_MAILBOX, test x"${enable_mailbox_install-no}" != xno)

dnl Check for headers
AC_HEADER_STDC
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 Output Makefiles
AC_OUTPUT(Makefile libmailbox/Makefile mail/Makefile pop3d/Makefile
	imap4d/Makefile lib/Makefile doc/Makefile)