Commit 57ab0879 57ab087927e117698ed06cb89512ae583396abc7 by Sergey Poznyakoff

New options: --with-gdbm, --with-ndbm, --with-old-dbm

1 parent 4547324e
......@@ -55,13 +55,38 @@ AC_ARG_WITH(mail-rc,
esac],
[SITE_MAIL_RC="\$(sysconfdir)/mail.rc"])
use_dbm=no
AC_ARG_WITH(gdbm,
[ --with-gdbm use GDBM],
[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,
[ --with-db2 use Berkeley DB],
[case "${withval}" in
yes) usedb2=yes ;;
no) usedb2=no ;;
yes) use_dbm=BDB2 ;;
no) use_dbm=no ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-db) ;;
esac],[usedb2=no])
esac])
AC_ARG_WITH(ndbm,
[ --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,
[ --with-old-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])
AC_MSG_CHECKING(for log facility)
log_facility="LOG_MAIL"
......@@ -221,11 +246,31 @@ if test x"$usereadline" = x"yes"; then
-lcurses)
fi
dnl Check for Berkeley DB
if test x"${usedb2}" = x"yes"; then
AC_CHECK_LIB(db, db_open, [AC_CHECK_HEADERS(db.h, AC_DEFINE(WITH_BDB2))
LIBS="$LIBS -ldb"])
fi
dnl Check for DBM
AC_SUBST(POPAUTH)
case "$use_dbm" in
GDBM)
AC_CHECK_LIB(gdbm, gdbm_open,
[AC_CHECK_HEADERS(gdbm.h, AC_DEFINE(WITH_GDBM))
LIBS="$LIBS -lgdbm"
POPAUTH=popauth]);;
BDB2)
AC_CHECK_LIB(db, db_open,
[AC_CHECK_HEADERS(db.h, AC_DEFINE(WITH_BDB2))
LIBS="$LIBS -ldb"
POPAUTH=popauth]);;
NDBM)
AC_CHECK_LIB(ndbm, dbm_open,
[AC_CHECK_HEADERS(ndbm.h, AC_DEFINE(WITH_NDBM))
LIBS="$LIBS -lndbm"
POPAUTH=popauth]);;
ODBM)
AC_CHECK_LIB(dbm, dbminit,
[AC_CHECK_HEADERS(dbm.h, AC_DEFINE(WITH_OLD_DBM))
LIBS="$LIBS -ldbm"
POPAUTH=popauth]);;
esac
dnl Make sysconfdir available to the application
CPPFLAGS="$CPPFLAGS -DSYSCONFDIR=\\\"\$(sysconfdir)\\\""
......@@ -258,4 +303,4 @@ AC_OUTPUT(Makefile mailutils.spec include/Makefile include/mailutils/Makefile
mailbox/include/Makefile from/Makefile mail/Makefile pop3d/Makefile
frm/Makefile sieve/Makefile messages/Makefile scripts/Makefile
libmu_scm/Makefile guimb/Makefile guimb/scm/Makefile
MySql/Makefile)
MySql/Makefile mh/Makefile comsat/Makefile)
......