Files
smmapdfw/smmapdfw/configure.ac
2004-12-15 19:55:41 +00:00

283 lines
8.0 KiB
Plaintext

# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT(smmapdfw, 0.96, woho@hottis.de)
AM_INIT_AUTOMAKE(smmapdfw, 0.96)
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
AC_LANG_C
AC_ARG_WITH(bdb-lib-dir,
[AC_HELP_STRING(--with-bdb-lib-dir, [
Directory for Berkeley DB library files])],
[ case "$withval" in
no)
if test "x$ENABLE_CACHE" = "x1"; then
AC_MSG_ERROR(Need bdb-lib-dir)
fi
;;
yes)
;;
*)
LDFLAGS="$LDFLAGS -L$withval -R$withval"
;;
esac ]
)
AC_ARG_WITH(bdb-inc-dir,
[AC_HELP_STRING(--with-bdb-inc-dir, [
Directory for Berkeley include files])],
[ case "$withval" in
no)
if test "x$ENABLE_CACHE" = "x1"; then
AC_MSG_ERROR(Need bdb-inc-dir)
fi
;;
yes)
;;
*)
CPPFLAGS="$CPPFLAGS -I$withval"
;;
esac ]
)
WITHOUT_DJBDNS=0
AC_ARG_WITH(djbdns-lib-dir,
[AC_HELP_STRING(--with-djbdns-lib-dir, [
Directory for Bernstein's djbdns library files])],
[ case "$withval" in
no)
WITHOUT_DJBDNS=1
;;
yes)
;;
*)
LDFLAGS="$LDFLAGS -L$withval -R$withval"
;;
esac ]
)
AC_ARG_WITH(djbdns-inc-dir,
[AC_HELP_STRING(--with-djbdns-inc-dir, [
Directory for Bernstein's djbdns include files])],
[ case "$withval" in
no)
WITHOUT_DJBDNS=1
;;
yes)
;;
*)
CPPFLAGS="$CPPFLAGS -I$withval"
;;
esac ]
)
WITHOUT_NETSNMP=1
AC_ARG_WITH(netsnmp,
[AC_HELP_STRING(--with-netsnmp, [
With Net-SNMP])],
[ case "$withval" in
no)
WITHOUT_NETSNMP=1
;;
*)
WITHOUT_NETSNMP=0
;;
esac ]
)
AC_ARG_WITH(netsnmp-lib-dir,
[AC_HELP_STRING(--with-netsnmp-lib-dir, [
Directory for Net-SNMP library files])],
[ case "$withval" in
no)
;;
yes)
;;
*)
LDFLAGS="$LDFLAGS -L$withval -R$withval"
;;
esac ]
)
AC_ARG_WITH(netsnmp-inc-dir,
[AC_HELP_STRING(--with-netsnmp-inc-dir, [
Directory for Net-SNMP include files])],
[ case "$withval" in
no)
;;
yes)
;;
*)
CPPFLAGS="$CPPFLAGS -I$withval"
;;
esac ]
)
NETSNMP_BINDIR=""
AC_ARG_WITH(netsnmp-bin-dir,
[AC_HELP_STRING(--with-netsnmp-bin-dir, [
Directory for Net-SNMP bin files, specifically net-snmp-config])],
[ case "$withval" in
no)
;;
yes)
;;
*)
NETSNMP_BINDIR="$withval/"
;;
esac ]
)
ENABLE_CACHE=1
dnl AC_ARG_ENABLE(verify-cache,
dnl [AC_HELP_STRING(--enable-verify-cache, [
dnl Enables the cache in the verify worker.
dnl Required a dbm implemenation.
dnl (default=yes)])],
dnl if test "x$enableval" = xyes; then ENABLE_VERIFY_CACHE=1; fi
dnl if test "x$enableval" = xno; then ENABLE_VERIFY_CACHE=0; fi
dnl )
dnl verify_BUILD=
dnl AC_ARG_ENABLE(verify-worker,
dnl [AC_HELP_STRING(--enable-verify-worker, [
dnl Enables the sender address verification worker.
dnl (default=no)])],
dnl verify_BUILD=libverify_worker.la
dnl )
dnl test_BUILD=
dnl AC_ARG_ENABLE(test-worker,
dnl [AC_HELP_STRING(--enable-test-worker, [
dnl Enables the test worker (just an example).
dnl (default=no)])],
dnl test_BUILD=libtest_workers.la
dnl )
dnl cyrus_BUILD=
dnl AC_ARG_ENABLE(cyrus-worker,
dnl [AC_HELP_STRING(--enable-cyrus-worker, [
dnl Enables the cyrus mailbox checker.
dnl (default=no)])],
dnl cyrus_BUILD=libcyrus_worker.la
dnl )
ENABLE_STATS=0
AC_ARG_ENABLE(stats,
[AC_HELP_STRING(--enable-stats, [
Enables statistics collection.
(default=no)])],
if test "x$enableval" = xyes; then ENABLE_STATS=1; fi
if test "x$enableval" = xno; then ENABLE_STATS=0; fi
)
# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
# Checks for libraries.
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([m], [sin])
AC_CHECK_LIB([nsl], [gethostbyname])
AC_CHECK_LIB(pthread, pthread_create,
[ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
LIBS="$LIBS -lpthread"],
AC_CHECK_LIB(c_r, pthread_create,
[ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE"
LIBS="$LIBS -lc_r"],
[AC_MSG_ERROR([*** we can't go without threads])]
)
)
AC_CHECK_LIB([resolv], [inet_aton])
AC_CHECK_LIB([socket], [connect])
if test "x$WITHOUT_DJBDNS" = "x0"; then
AC_CHECK_LIB([djbdns], [dns_transmit_start])
fi
ENABLE_NETSNMP=0
if test "x$WITHOUT_NETSNMP" = "x0"; then
NET_SNMP_CONFIG=$NETSNMP_BINDIR"net-snmp-config"
NETSNMP_LIBS_1=`$NET_SNMP_CONFIG --agent-libs`
NETSNMP_LIBS_2=`$NET_SNMP_CONFIG --libs`
LIBS="$LIBS $NETSNMP_LIBS_1 $NETSNMP_LIBS_2"
ENABLE_NETSNMP=1
fi
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h strings.h sys/socket.h syslog.h unistd.h dlfcn.h])
AC_CHECK_HEADERS([db.h],
[],
[AC_MSG_ERROR([*** we can't go without Berkeley DB])])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_CHECK_TYPES(socklen_t)
# Checks for library functions.
AC_FUNC_FORK
dnl AC_FUNC_MALLOC
dnl AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_CHECK_FUNCS([inet_ntoa memset select socket strchr strdup strerror strrchr strtol dlopen dlsym dlerror], [],
[AC_MSG_ERROR([*** missing function, we can't go without it])])
if test "x$ENABLE_CACHE" = "x1"; then
AC_CHECK_LIB([db], [__db_ndbm_open],
[ BDB_LIBS="-ldb" ],
AC_CHECK_LIB([db], [__db_ndbm_open_4002],
[ BDB_LIBS="-ldb" ],
AC_CHECK_LIB([db41], [__db_ndbm_open],
[ BDB_LIBS="-ldb41" ],
AC_CHECK_LIB([db42], [__db_ndbm_open_4002],
[ BDB_LIBS="-ldb42" ],
BDB_NOT_FOUND=1
)
)
)
)
fi
AC_SUBST(BDB_LIBS)
if test "x$BDB_NOT_FOUND" = "x1"; then
echo "*** no db/dbm found, disabling verify cache"
ENABLE_CACHE=0
fi
AC_DEFINE_UNQUOTED(ENABLE_CACHE, ${ENABLE_CACHE}, [enable cache])
AC_DEFINE_UNQUOTED(ENABLE_STATS, ${ENABLE_STATS}, [enable stats])
AC_DEFINE_UNQUOTED(ENABLE_NETSNMP, ${ENABLE_NETSNMP}, [enable Net-SNMP])
dnl AC_SUBST(verify_BUILD)
dnl AC_SUBST(test_BUILD)
dnl AC_SUBST(cyrus_BUILD)
AC_CONFIG_FILES([Makefile libsmmapdfw/Makefile smmapd/Makefile test_worker/Makefile verify_worker/Makefile cyrus_worker/Makefile doc/Makefile m4/Makefile mib/Makefile])
AC_OUTPUT