aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-06-04 17:21:02 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-06-04 17:21:02 +0000
commit9263a485750e02a7115f71c086cc289ac5924dce (patch)
treef0d690912db05603eb89eee2c246e96afb913543
parente77ce871e9cd9281e070ed84a6827fd48f23af26 (diff)
downloadmailfromd-9263a485750e02a7115f71c086cc289ac5924dce.tar.gz
mailfromd-9263a485750e02a7115f71c086cc289ac5924dce.tar.bz2
Updated for deep directory structure. Detect DBM/NDBM/GDBM, define variables for caching. Raised version number to 0.2
git-svn-id: file:///svnroot/mailfromd/trunk@17 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--configure.ac130
1 files changed, 126 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 9e83f32a..29c5de00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,8 +17,10 @@
# MA 02110-1301 USA
AC_PREREQ(2.59)
-AC_INIT([mailfromd], [0.1], [bug-mailfromd@gnu.org.ua])
-AC_CONFIG_SRCDIR([main.c])
+AC_INIT([mailfromd], [0.2], [bug-mailfromd@gnu.org.ua])
+AC_CONFIG_SRCDIR([src/main.c])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_LIBOBJ_DIR([src])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
@@ -37,9 +39,23 @@ AC_CHECK_HEADERS([stdlib.h unistd.h sysexits.h])
# Checks for library functions.
AC_CHECK_FUNCS([vsyslog setegid setregid setresgid seteuid setreuid])
-AC_REPLACE_FUNCS(daemon snprintf)
+AC_REPLACE_FUNCS(daemon snprintf strtok_r)
AC_FUNC_OBSTACK
+AC_CHECK_DECLS([strtok_r],
+ , , [
+#include <stdio.h>
+#include <string.h>
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif])
+
+AH_BOTTOM([
+#if !HAVE_DECL_STRTOK_R
+extern char *strtok_r (char *s, const char *delim, char **save_ptr);
+#endif
+])
+
# Check for pthreads (required by milter)
HAVE_PTHREAD=no
AC_CHECK_LIB(pthread, pthread_self,
@@ -84,6 +100,99 @@ MAILUTILS_LIBS=`$MU_CONFIG --link`
AC_DEFINE([MAILUTILS_VERSION_STRING], "\"$MAILUTILS_VERSION\"",
[Mailutils Version String])
+# Check for DBM flavor
+AH_TEMPLATE(BDB2_CURSOR_LASTARG,
+ [Last argument to the cursor member of Berkeley 2 DB structure])
+
+dnl The cursor member of DB structure used to take three arguments in older
+dnl implementations of Berkeley DB. Newer versions (>= 4.0) declare
+dnl it as taking four arguments.
+dnl This macro checks which of the variants we have.
+AC_DEFUN([MU_DB2_CURSOR],
+ [AC_CACHE_CHECK([whether db->cursor takes 4 arguments],
+ [mu_cv_bdb2_cursor_four_args],
+ [AC_TRY_COMPILE([#include <db.h>],
+ [
+DB *db;
+db->cursor(NULL, NULL, NULL, 0)
+ ],
+ [mu_cv_bdb2_cursor_four_args=yes],
+ [mu_cv_bdb2_cursor_four_args=no])])
+ if test $mu_cv_bdb2_cursor_four_args = yes; then
+ AC_DEFINE(BDB2_CURSOR_LASTARG,[,0])
+ else
+ AC_DEFINE(BDB2_CURSOR_LASTARG,[])
+ fi])
+
+use_dbm=no
+AC_ARG_WITH([gdbm],
+ AC_HELP_STRING([--with-gdbm],
+ [use GNU DBM]),
+ [
+case "${withval}" in
+ yes) use_dbm=GDBM ;;
+ no) use_dbm=no ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --with-gdbm) ;;
+esac])
+
+AC_ARG_WITH([db2],
+ AC_HELP_STRING([--with-db2],
+ [use Berkeley DB]),
+ [
+case "${withval}" in
+ yes) use_dbm=BDB2 ;;
+ no) use_dbm=no ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --with-db) ;;
+esac])
+
+AC_ARG_WITH([ndbm],
+ AC_HELP_STRING([--with-ndbm],
+ [use NDBM]),
+ [
+case "${withval}" in
+ yes) use_dbm=NDBM ;;
+ no) use_dbm=no ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --with-ndbm) ;;
+esac])
+
+AC_ARG_WITH([dbm],
+ AC_HELP_STRING([--with-dbm],
+ [use old DBM]),
+ [
+case "${withval}" in
+ yes) use_dbm=ODBM ;;
+ no) use_dbm=no ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --with-old-dbm) ;;
+esac])
+
+case "$use_dbm" in
+GDBM)
+ AC_CHECK_LIB(gdbm, gdbm_open,
+ [AC_CHECK_HEADERS(gdbm.h,
+ AC_DEFINE(WITH_GDBM,1,
+ [Enable use of GNU DBM library]))
+ LIBS="$LIBS -lgdbm"]);;
+BDB2)
+ AC_CHECK_LIB(db, db_open,
+ [AC_CHECK_HEADERS(db.h,
+ AC_DEFINE(WITH_BDB2,1,
+ [Enable use of Berkeley DB]))
+ LIBS="$LIBS -ldb"
+ MU_DB2_CURSOR]);;
+NDBM)
+ AC_CHECK_LIB(ndbm, dbm_open,
+ [AC_CHECK_HEADERS(ndbm.h,
+ AC_DEFINE(WITH_NDBM,1,
+ [Enable use of NDBM]))
+ LIBS="$LIBS -lndbm"]);;
+ODBM)
+ AC_CHECK_LIB(dbm, dbminit,
+ [AC_CHECK_HEADERS(dbm.h,
+ AC_DEFINE(WITH_OLD_DBM,1,
+ [Enable use of old DBM library]))
+ LIBS="$LIBS -ldbm"]);;
+esac
+
# Prepare default socket spec
AC_SUBST(DEFAULT_SOCKET)
AC_MSG_CHECKING(for default communication socket)
@@ -110,6 +219,19 @@ fi
AC_MSG_RESULT($DEFAULT_USER)
+# Test for default expiration interval
+AC_SUBST(DEFAULT_EXPIRE_INTERVAL)
+AC_MSG_CHECKING(for default expiration interval)
+
+AC_ARG_VAR([DEFAULT_EXPIRE_INTERVAL],
+ [Set default expiration interval])
+
+if test -z "$DEFAULT_EXPIRE_INTERVAL"; then
+ DEFAULT_USER=86400
+fi
+
+AC_MSG_RESULT($DEFAULT_EXPIRE_INTERVAL)
+
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT

Return to:

Send suggestions and report system problems to the System administrator.