dnl -------------------------------------------------------------------------- dnl dnl POPular -- A POP3 server and proxy for large mail systems dnl dnl $Id: configure.in,v 1.51 2004/08/21 10:19:04 sqrt Exp $ dnl dnl http://www.remote.org/jochen/mail/popular/ dnl dnl -------------------------------------------------------------------------- dnl dnl Copyright (C) 1999-2004 Jochen Topf dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA dnl dnl -------------------------------------------------------------------------- AC_INIT(src/pserv.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(popular,1.5.5) AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL dnl -------------------------------------------------------------------------- dnl checks for programs dnl -------------------------------------------------------------------------- AC_PROG_CC AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_LN_S dnl -------------------------------------------------------------------------- dnl checks for libraries dnl -------------------------------------------------------------------------- dnl AC_CHECK_LIB(crypt, crypt) dnl AC_CHECK_LIB(crypt, crypt, HAVE_LIBCRYPT=yes) AC_CHECK_LIB(socket, socket) dnl AC_CHECK_LIB(nsl, gethostbyname) dnl AC_CHECK_LIB(resolv, gethostbyname) AC_CHECK_FUNCS(gethostbyname, , AC_CHECK_LIB(nsl,gethostbyname)) AC_CHECK_FUNCS(inet_aton, , AC_CHECK_LIB(resolv,inet_aton)) dnl -------------------------------------------------------------------------- dnl checks for header files dnl -------------------------------------------------------------------------- AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h) dnl -------------------------------------------------------------------------- dnl checks for typedefs, structures, and compiler characteristics dnl -------------------------------------------------------------------------- AC_C_CONST AC_TYPE_UID_T AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM dnl -------------------------------------------------------------------------- dnl checks for library functions. dnl -------------------------------------------------------------------------- AC_FUNC_MMAP dnl AC_CHECK_FUNCS(gethostname mkdir select socket strcspn strerror strspn strstr strtol) AC_CHECK_FUNCS(strlcat, have_strlcat=yes, have_strlcat=no) AM_CONDITIONAL(HAVE_STRLCAT, test "$have_strlcat" = "yes") AC_CHECK_FUNCS(getopt_long, have_getopt=yes, have_getopt=no) AM_CONDITIONAL(HAVE_GETOPT, test "$have_getopt" = "yes") dnl -------------------------------------------------------------------------- dnl Check for /proc/loadavg dnl -------------------------------------------------------------------------- AC_CHECK_FILE(/proc/loadavg, AC_DEFINE_UNQUOTED(LOADAVG_FILE, "/proc/loadavg", File with current load of host)) dnl -------------------------------------------------------------------------- dnl Berkeley DB dnl -------------------------------------------------------------------------- AC_CHECK_LIB(db2, db_open, LIB_DB2=db2, AC_CHECK_LIB(db, db_open, LIB_DB2=db, LIB_DB2="")) AC_CHECK_HEADER(db2/db.h, AC_DEFINE(HAVE_DB2_HEADER, , Do we have db2 header files?)) AC_SUBST(LIB_DB2) AC_CHECK_LIB(db-3.3, db_create, LIB_DB3=db-3.3, LIB_DB3="") AC_SUBST(LIB_DB3) AC_CHECK_LIB(db-4.0, db_create, LIB_DB40=db-4.0, LIB_DB40="") AC_SUBST(LIB_DB40) AC_CHECK_LIB(db-4.1, db_create, LIB_DB41=db-4.1, LIB_DB41="") AC_SUBST(LIB_DB41) dnl current version or use command line AC_MSG_CHECKING(whether to include bdb support) AC_ARG_WITH(bdb, [ --with-bdb(=VERSION) Berkeley DB Version to use], ac_bdbversion="$withval", ac_bdbversion="yes") if test "$ac_bdbversion" = "no" ; then AC_MSG_RESULT(no) USE_BDB="" BDB_VERSION="" else if test "$ac_bdbversion" = "yes" ; then AC_MSG_RESULT(yes) USE_BDB=1 BDB_VERSION="" else AC_MSG_RESULT(yes - version $ac_bdbversion) USE_BDB=1 BDB_VERSION="-$ac_bdbversion" fi fi AC_SUBST(USE_BDB) AC_SUBST(BDB_VERSION) dnl -------------------------------------------------------------------------- dnl build test programs? dnl -------------------------------------------------------------------------- AC_MSG_CHECKING(whether to build test programs) AC_ARG_ENABLE(test, [ --enable-test build test programs], [ if test "$enableval" = "no"; then MAKE_TEST="" AC_MSG_RESULT(no) else MAKE_TEST="test" AC_MSG_RESULT(yes) fi AC_SUBST(MAKE_TEST) ], AC_MSG_RESULT(no)) dnl -------------------------------------------------------------------------- dnl readline support dnl -------------------------------------------------------------------------- AC_MSG_CHECKING(whether to use readline) AC_ARG_ENABLE(readline, [ --disable-readline disable readline support], [ if test "$enableval" = "no"; then LIB_READLINE="" AC_MSG_RESULT(no) else LIB_READLINE="-lreadline -lcurses" AC_MSG_RESULT(yes) AC_DEFINE(USE_READLINE, , Should we use the readline library?) fi AC_SUBST(LIB_READLINE) ], AC_MSG_RESULT(yes)) dnl -------------------------------------------------------------------------- dnl SSL/TLS support dnl -------------------------------------------------------------------------- AC_MSG_CHECKING(whether to support SSL/TLS) AC_ARG_ENABLE(ssl, [ --enable-ssl=SSLDIR enable SSL/TLS support.], [ SSL_LIBS="" SSL_INCL="" if test "$enableval" = "no"; then AC_MSG_RESULT(no) else if test "$enableval" = "yes"; then ssldir="/usr" test -f /usr/local/ssl/include/openssl/ssl.h && ssldir="/usr/local/ssl" else ssldir="$enableval" fi if test -f "$ssldir/include/openssl/ssl.h"; then SSL_INCL="-I$ssldir/include" SSL_LIBS="-L$ssldir/lib -lssl -lcrypto" AC_DEFINE(USE_TLS, 1, Should we compile in SSL/TLS support?) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi fi AC_SUBST(SSL_LIBS) AC_SUBST(SSL_INCL) ], AC_MSG_RESULT(no)) dnl -------------------------------------------------------------------------- dnl cdb support dnl -------------------------------------------------------------------------- AC_MSG_CHECKING(whether to include cdb support) AC_ARG_WITH(cdb, [ --with-cdb=CDBDIR cdb source directory for cdb support], ac_cdbdir="$withval", ac_cdbdir="") if test -z "$ac_cdbdir"; then AC_MSG_RESULT(no) CDBDIR="" else AC_MSG_RESULT(yes) CDBDIR="$ac_cdbdir" if test ! -f "$ac_cdbdir/cdb.a"; then echo "cdb directory is wrong" CDBDIR="" fi fi AC_SUBST(CDBDIR) dnl -------------------------------------------------------------------------- dnl PDM modules dnl -------------------------------------------------------------------------- AC_MSG_CHECKING(which PDM modules to build) AC_ARG_WITH(pdm, [ --with-pdm=PDMLIST space separated list of PDM modules to build (default: any master db2 db3 db4 bdb cdb) ], ac_pdm_list="$withval", ac_pdm_list="") if test -z "$ac_pdm_list"; then ac_pdm_list="any master db2 db3 db4 bdb cdb" fi AC_MSG_RESULT($ac_pdm_list) if test -z "$USE_BDB"; then echo "not using Berkeley DB...removing 'bdb' from PDM list" ac_pdm_list1=`echo $ac_pdm_list | sed -e 's/bdb//' | sed -e 's/ / /'` ac_pdm_list="$ac_pdm_list1" fi if test -z "$LIB_DB2"; then echo "can't find Berkeley DB version 2 libs...removing 'db2' from PDM list" ac_pdm_list1=`echo $ac_pdm_list | sed -e 's/db2//' | sed -e 's/ / /'` ac_pdm_list="$ac_pdm_list1" fi if test -z "$LIB_DB3"; then echo "can't find Berkeley DB version 3 libs...removing 'db3' from PDM list" ac_pdm_list1=`echo $ac_pdm_list | sed -e 's/db3//' | sed -e 's/ / /'` ac_pdm_list="$ac_pdm_list1" fi if test -z "$LIB_DB40"; then echo "can't find Berkeley DB version 4.0 libs...removing 'db4' from PDM list" ac_pdm_list1=`echo $ac_pdm_list | sed -e 's/db4//' | sed -e 's/ / /'` ac_pdm_list="$ac_pdm_list1" fi if test -z "$CDBDIR"; then echo "can't find cdb...removing 'cdb' from PDM list" ac_pdm_list1=`echo $ac_pdm_list | sed -e 's/cdb//' | sed -e 's/ / /'` ac_pdm_list="$ac_pdm_list1" fi PDMLIST="$ac_pdm_list" echo "final list of PDM modules to build: $PDMLIST" AC_SUBST(PDMLIST) dnl -------------------------------------------------------------------------- dnl config directory dnl -------------------------------------------------------------------------- AC_MSG_CHECKING(where the config directory is) AC_ARG_WITH(confdir, [ --with-confdir=CONFDIR look for config files in this directory (default: /etc/popular) ], ac_conf_dir=$withval, ac_conf_dir=/etc/popular) AC_MSG_RESULT($ac_conf_dir) AC_DEFINE_UNQUOTED(CONF_DIR, "$ac_conf_dir", Configuration directory) dnl -------------------------------------------------------------------------- dnl perl binary dnl -------------------------------------------------------------------------- AC_PATH_PROG(PERL_PATH, perl, "unknown") AC_SUBST(PERL_PATH) dnl -------------------------------------------------------------------------- dnl SGML documentation dnl -------------------------------------------------------------------------- AC_MSG_CHECKING(whether you have docbook) AC_ARG_ENABLE(docbook, [ --enable-docbook enable making of manual from SGML sources], [ if test "$enableval" = "no"; then have_sgml="no" else AC_CHECK_PROG(have_sgml, sgmltools, yes, no) fi AC_SUBST(have_sgml) AC_MSG_RESULT($have_sgml) ], AC_MSG_RESULT(no)) AM_CONDITIONAL(MAKE_SGML, test "$have_sgml" = "yes") dnl -------------------------------------------------------------------------- dnl struct for file descriptor passing dnl -------------------------------------------------------------------------- AC_MSG_CHECKING(for msg_control (member of msghdr)) AC_EGREP_HEADER(msg_control, sys/socket.h, AC_DEFINE(HAVE_MSG_CONTROL, , Do we have msghdr.msg_control?) have_msg_control=yes,have_msg_control="no (msg_accrights?)") AC_MSG_RESULT($have_msg_control) dnl -------------------------------------------------------------------------- dnl install prefix dnl -------------------------------------------------------------------------- if test "$prefix" = "NONE" ; then AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "/usr/local", Install prefix) else AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "$prefix", Install prefix) fi dnl AM_CONDITIONAL(INSTALL_PREFIX, test x$prefix = xNONE && "/usr" || "$prefix") AC_SUBST(prefix) dnl test "$have_strlcat" = "no" && LIBS="$LIBS \$(top_builddir)/lib/libstrl.la" dnl test "$have_getopt" = "no" && LIBS="$LIBS \$(top_builddir)/lib/libgetopt.la" test "$have_strlcat" = "no" && LIB_STRL="\$(top_builddir)/lib/libstrl.la" test "$have_getopt" = "no" && LIB_GETOPT="\$(top_builddir)/lib/libgetopt.la" AC_SUBST(LIB_STRL) AC_SUBST(LIB_GETOPT) dnl -------------------------------------------------------------------------- dnl output files dnl -------------------------------------------------------------------------- AC_OUTPUT(Makefile \ lib/Makefile \ src/Makefile \ test/Makefile \ pdm/Makefile \ pdm/any/Makefile \ pdm/master/Makefile \ pdm/db2/Makefile \ pdm/db3/Makefile \ pdm/db4/Makefile \ pdm/bdb/Makefile \ pdm/cdb/Makefile \ pdm/skel/Makefile \ doc/Makefile \ doc/log/Makefile \ doc/man/Makefile \ redhat/Makefile \ ) dnl -- THE END ---------------------------------------------------------------