release
[hcoop/debian/courier-authlib.git] / configure.in
index 47f18ce..5ff71cd 100644 (file)
@@ -1,15 +1,16 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl
-dnl $Id: configure.in,v 1.153 2007/10/14 00:19:54 mrsam Exp $
+dnl $Id: configure.in,v 1.177 2009/12/25 21:53:37 mrsam Exp $
 dnl
-dnl Copyright 1998 - 2007 Double Precision, Inc.  See COPYING for
+dnl Copyright 1998 - 2009 Double Precision, Inc.  See COPYING for
 dnl distribution information.
 
-AC_PREREQ(2.59)
-AC_INIT(courier-authlib, 0.60.2, [courier-users@lists.sourceforge.net])
+AC_PREREQ(2.63)
+AC_INIT([courier-authlib],[0.63.0],[courier-users@lists.sourceforge.net])
 
 AC_CONFIG_SRCDIR([courierauth.h])
-AM_CONFIG_HEADER([courier_auth_config.h])
+AC_CONFIG_HEADERS([courier_auth_config.h])
+AC_CONFIG_MACRO_DIR([libltdl/m4])
 
 AM_INIT_AUTOMAKE
 >confdefs.h  # Kill PACKAGE_ macros
@@ -23,9 +24,9 @@ AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_SYSCONFTOOL
-AC_LIBLTDL_INSTALLABLE
-AC_LIBTOOL_DLOPEN
-AM_PROG_LIBTOOL
+LT_CONFIG_LTDL_DIR([libltdl])
+LT_INIT(dlopen)
+LTDL_INIT
 AC_SUBST(LTDLINCL)
 AC_SUBST(LIBLTDL)
 AC_PATH_PROGS(PERL, perl5 perl, perl, $LPATH)
@@ -116,78 +117,6 @@ AC_ARG_WITH(pkgconfdir,
      [pkgconfdir="$withval"],
      [pkgconfdir="$sysconfdir/authlib"])
 
-SASL_LIST="SASL(\"PLAIN\", authsasl_plain, authsaslclient_plain) SASL(\"LOGIN\", authsasl_login, authsaslclient_login)"
-
-dnl #########################################################################
-
-dnl Check if the MD5 library is available
-
-dnl #########################################################################
-
-
-if test -d ${srcdir}/md5
-then
-       MD5=1
-       AC_DEFINE_UNQUOTED(HAVE_MD5LIB, 1,
-                       [ Whether we have the MD5 library available ])
-       MD5LIB=md5/libmd5.la
-       if test -d ${srcdir}/md5
-       then
-               SASL_LIST="SASL(\"CRAM-MD5\", authsasl_cram, authsaslclient_crammd5) $SASL_LIST"
-       fi
-else
-       MD5LIB=""
-       MD5=0
-fi
-AC_SUBST(MD5LIB)
-AM_CONDITIONAL(HAVE_MD5, test "$MD5" = 1)
-
-dnl #########################################################################
-
-dnl Check if the SHA1 library is available
-
-dnl #########################################################################
-
-
-if test -d ${srcdir}/sha1
-then
-       SHA1=1
-       AC_DEFINE_UNQUOTED(HAVE_SHA1LIB, 1,
-                       [ Whether we have the SHA1 library available ])
-       SHA1LIB=sha1/libsha1.la
-       if test -d ${srcdir}/sha1
-       then
-               SASL_LIST="SASL(\"CRAM-SHA1\", authsasl_cram, authsaslclient_cramsha1) $SASL_LIST"
-               SASL_LIST="SASL(\"CRAM-SHA256\", authsasl_cram, authsaslclient_cramsha256) $SASL_LIST"
-       fi
-else
-       SHA1LIB=""
-       SHA1=0
-fi
-AC_SUBST(SHA1LIB)
-AM_CONDITIONAL(HAVE_SHA1, test "$SHA1" = 1)
-
-
-
-dnl #########################################################################
-
-dnl Check if the HMAC library is available
-
-dnl #########################################################################
-
-if test -d ${srcdir}/libhmac
-then
-       HMAC=1
-       AC_DEFINE_UNQUOTED(HAVE_HMACLIB, 1,
-                        [ Whether we have the HMAC library available ])
-       HMACLIB=libhmac/libhmac.la
-else
-       HMACLIB=""
-       HMAC=0
-fi
-AC_SUBST(HMACLIB)
-AM_CONDITIONAL(HAVE_HMACLIB, test "$HMAC" = 1)
-
 saveLIBS="$LIBS"
 NETLIBS=""
 USENSL=no
@@ -289,7 +218,6 @@ if test "$HAVE_GDBM" = "y"
 then
        LIBDB=""
        USE_GDBM=1
-       DBSUBDIR=gdbmobj
        if test "$needs_withdb" = 1
        then
                ac_configure_args="$ac_configure_args --with-db=gdbm"
@@ -298,7 +226,6 @@ then
 else
        LIBGDBM=""
        USE_DB=1
-       DBSUBDIR=bdbobj
        if test "$needs_withdb" = 1
        then
                ac_configure_args="$ac_configure_args --with-db=db"
@@ -306,11 +233,8 @@ else
        dblibrary=bdbobj/libbdbobj.la
 fi
 
-AC_SUBST(DBSUBDIR)
 AC_SUBST(USE_GDBM)
 AC_SUBST(USE_DB)
-AC_SUBST(LIBDB)
-AC_SUBST(LIBGDBM)
 
 AC_ARG_WITH(authuserdb,
 [ --without-authuserdb               Do not include the authuserdb module ],
@@ -569,82 +493,6 @@ AC_SUBST(LIBAUTHPWD)
 
 dnl #########################################################################
 
-dnl Prepare authvchkpw module if vchkpw is installed.
-
-dnl #########################################################################
-
-changequote(<<,>>)
-
-vpopmail_home=`$PERL -e '@a=getpwnam("vpopmail"); print "$a[7]";'`
-
-changequote([,])
-
-AC_ARG_WITH(authvchkpw,
-[ --without-authvchkpw               Do not include the authvchkpw module ],
-       doauthvchkpw="$withval",
-       doauthvchkpw=no
-       if test "$vpopmail_home" != ""
-       then
-               doauthvchkpw=yes
-       fi)
-
-if test "$doauthvchkpw" = "no"
-then
-       HAVE_VCHKPW=0
-       vpopmail_home=.
-else
-       HAVE_VCHKPW=1
-
-
-       cat  <<EOF
-----------------------------------------------------
-                     NOTE
-
-
-All questions regarding ANY vpopmail-related problems,
-such as compiling/building failures, or login errors
-should be referred to the vpopmail mailing list.
-Vpopmail questions sent to the Courier mailing lists
-will be IGNORED.
-----------------------------------------------------
-\a
-EOF
-       sleep 5
-
-       if test -f ${vpopmail_home}/etc/lib_deps
-       then
-               CFLAGS="`cat ${vpopmail_home}/etc/inc_deps` $CFLAGS"
-               VPOPMAILLIBS="`cat ${vpopmail_home}/etc/lib_deps`"
-       else
-               AC_MSG_ERROR(${vpopmail_home}/etc/lib_deps does not exist - upgrade vpopmail to the current version or fix the permissions on this file)
-       fi
-fi
-AC_SUBST(vpopmail_home)
-AC_SUBST(VPOPMAILLIBS)
-
-LIBAUTHVCHKPW=""
-if test "$HAVE_VCHKPW" = 1
-then
-       LIBAUTHVCHKPW="libauthvchkpw.la"
-       HAVE_VCHKPW="1"
-
-dnl Check if vpopmail has open_smtp_relay() function
-
-       _SAVE_LIBS=$LIBS
-       LIBS="$VPOPMAILLIBS $CRYPTLIBS $LIBS"
-       AC_CHECK_FUNC(open_smtp_relay, 
-               AC_DEFINE(HAVE_OPEN_SMTP_RELAY, 1,
-               [ Whether -lvpopmail has the open_smtp_relay() function ]) )
-       AC_CHECK_FUNC(vset_lastauth,
-               AC_DEFINE(HAVE_VSET_LASTAUTH, 1,
-               [ Whether -lvpopmail has the vset_lastauth() function ]))
-       LIBS=$_SAVE_LIBS
-fi
-
-AC_SUBST(LIBAUTHVCHKPW)
-
-dnl #########################################################################
-
 dnl Prepare authpgsql module
 
 dnl #########################################################################
@@ -844,10 +692,8 @@ AC_CHECK_HEADERS(sys/stat.h sys/time.h sys/wait.h sys/select.h unistd.h fcntl.h
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
-AC_PID_T
+AC_TYPE_PID_T
 AC_TYPE_UID_T
-AC_TYPE_SIGNAL
-
 dnl Other checks
 AC_CHECK_FUNCS(setsid setlogin)
 AC_CHECK_LIB(crypt, crypt, CRYPTLIBS="-lcrypt")
@@ -858,7 +704,7 @@ AC_CHECK_FUNC(crypt, AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1,
 LIBS="$saveLIBS"
 AC_CACHE_CHECK([for crypt() prototype],userdb_cv_NEED_CRYPT_PROTOTYPE,
 
-       AC_TRY_COMPILE( [
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
               #if HAVE_CRYPT_H
                #include <crypt.h>
                #endif
@@ -867,8 +713,7 @@ AC_CACHE_CHECK([for crypt() prototype],userdb_cv_NEED_CRYPT_PROTOTYPE,
               #endif
               int crypt(int, int);
 
-               ], [], userdb_cv_NEED_CRYPT_PROTOTYPE=1,
-                       userdb_cv_NEED_CRYPT_PROTOTYPE=0 )
+               ]], [[]])],[userdb_cv_NEED_CRYPT_PROTOTYPE=1],[userdb_cv_NEED_CRYPT_PROTOTYPE=0 ])
 
        )
 
@@ -898,12 +743,8 @@ AC_SUBST(authdaemonvar)
 
 AC_SUBST(LIBM)
 
-AC_DEFINE_UNQUOTED(SASL_LIST,$SASL_LIST,
-       [ This macro is used to build the list of SASL modules ])
-
 rm -f authdaemonrc.h authldaprc.h authmysqlrc.h authpgsqlrc.h vpopmail_config.h
 
-
 dnl
 dnl Need to settle on our uid/gids here
 dnl
@@ -914,7 +755,7 @@ if test -x "$COURIERCONFIG"
 then
        $COURIERCONFIG >conftest.out || exit 1
        sed -n '/^mail/p' <conftest.out >conftest2.out || exit 1
-       . conftest2.out
+       . ./conftest2.out
        rm -f conftest.out conftest2.out
 
        cmailuser="$mailuser"
@@ -926,7 +767,7 @@ if test -x "$bindir/courierauthconfig"
 then
        $bindir/courierauthconfig --configfiles >conftest.out || exit 1
        sed -n '/^mail/p' <conftest.out >conftest2.out || exit 1
-       . conftest2.out
+       . ./conftest2.out
        rm -f conftest.out conftest2.out
 
        cmailuser="$mailuser"
@@ -949,7 +790,7 @@ AC_ARG_WITH(mailuser,[  --with-mailuser=user    Specify mail user name (defaults
 
        if test "$cmailuser" = ""
        then
-               AC_TRY_RUN([
+               AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <pwd.h>
 #include <stdlib.h>
@@ -976,10 +817,7 @@ char       *p;
        exit (1);
        return (1);
 }
-       ],
-               mailuser=`cat conftest.out`,
-               AC_MSG_ERROR(Cannot determine mail user, use --with-mailuser.),
-               AC_MSG_ERROR(Must use --with-mailuser when cross compiling.))
+       ]])],[mailuser=`cat conftest.out`],[AC_MSG_ERROR(Cannot determine mail user, use --with-mailuser.)],[AC_MSG_ERROR(Must use --with-mailuser when cross compiling.)])
        else
                mailuser="$cmailuser"
        fi
@@ -995,7 +833,7 @@ AC_ARG_WITH(mailgroup, [  --with-mailgroup=group  Specify mail group name (defau
 
        if test "$cmailgroup" = ""
        then
-               AC_TRY_RUN([
+               AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <grp.h>
 #include <stdlib.h>
@@ -1021,11 +859,7 @@ FILE *f;
        exit (1);
        return (1);
 }
-       ],
-
-               mailgroup=`cat conftest.out`,
-               AC_MSG_ERROR(Cannot determine mail group, use --with-mailgroup.),
-               AC_MSG_ERROR(Must use --with-mailgroup when cross compiling.))
+       ]])],[mailgroup=`cat conftest.out`],[AC_MSG_ERROR(Cannot determine mail group, use --with-mailgroup.)],[AC_MSG_ERROR(Must use --with-mailgroup when cross compiling.)])
        else
                mailgroup="$cmailgroup"
        fi
@@ -1072,19 +906,12 @@ else
        AC_DEFINE_UNQUOTED(socklen_t, int, [ Default definition for socklen_t ])
 fi
 
-if test x"$enable_ltdl_install" = x"yes"
-then
-       LIBLTDL_SUBDIR=libltdl
-fi
-
-AC_SUBST(LIBLTDL_SUBDIR)
-
 AC_ARG_WITH(repository, [], REPOSITORY="$withval")
 AC_SUBST(REPOSITORY)
 
 AM_CONDITIONAL(HAVE_SGML, test -d ${srcdir}/docbook)
-AC_CONFIG_SUBDIRS(libltdl bdbobj gdbmobj md5 sha1 libhmac numlib makedat userdb rfc822 random128 liblock liblog)
+AC_CONFIG_SUBDIRS(bdbobj gdbmobj md5 sha1 libhmac numlib makedat userdb unicode rfc822 random128 liblock liblog)
 
-AC_CONFIG_FILES(Makefile authdaemond authdaemonrc authsystem.passwd README.authdebug.html dbobj.h authmigrate courier-authlib.spec courier-authlib.lpspec courier-authlib.sysvinit userdb-test-cram-md5.pl)
+AC_CONFIG_FILES(Makefile authdaemond authdaemonrc authsystem.passwd README.authdebug.html dbobj.config dbobj.h authmigrate courier-authlib.spec courier-authlib.lpspec courier-authlib.sysvinit userdb-test-cram-md5.pl)
 AC_OUTPUT