dnl $Id: configure.in,v 1.72 2006/09/15 18:51:40 dm Exp $ dnl dnl Process this file with autoconf to produce a configure script. dnl AC_INIT(config.h.in) AM_INIT_AUTOMAKE(avenger, 0.7.7) AM_CONFIG_HEADER(config.h) AC_SUBST(LDADD) AC_SUBST(LDEPS) AC_CANONICAL_HOST dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_CXX SFS_WFLAGS AC_PROG_INSTALL AC_PROG_LN_S dnl AC_PROG_RANLIB test -z "$target" && target=NONE AM_DISABLE_SHARED AM_PROG_LIBTOOL AC_SEARCH_LIBS(clock_gettime, rt) dnl SFS_SFS SFS_PATH_PROG(logger) SFS_PATH_PROG(mail.local) SFS_DEV_RANDOM SFS_PERL_POD AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(sys/rusage.h) AC_CHECK_HEADERS(sys/sockio.h sys/filio.h sys/file.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_STRUCT_TM AC_TYPE_OFF_T AC_TYPE_UID_T AC_TYPE_SIZE_T AC_C_BIGENDIAN SFS_TIMESPEC SFS_CHECK_U_INT64 SFS_CHECK_TYPE(ssize_t) SFS_CHECK_TYPE(int32_t) SFS_CHECK_TYPE(u_int32_t) SFS_CHECK_TYPE(u_int16_t) SFS_CHECK_TYPE(u_int8_t) SFS_CHECK_TYPE(mode_t) SFS_CHECK_TYPE(u_char) SFS_CHECK_TYPE(u_int) SFS_CHECK_TYPE(u_long) SFS_CHECK_TYPE(int64_t) SFS_CHECK_TYPE(u_int64_t) SFS_CHECK_TYPE(socklen_t) SFS_CHECK_TYPE(rlim_t, [#ifdef HAVE_SYS_TIME_H #include #endif /* HAVE_SYS_TIME_H */ #include #ifdef HAVE_SYS_RUSAGE_H #include #endif /* !HAVE_SYS_RUSAGE_H */]) SFS_CHECK_OFF_T_64 SFS_SETGROUPS SFS_CHECK_DECL(getrusage, sys/rusage.h sys/resource.h, sys/time.h) SFS_CHECK_DECL(bindresvport, rpc/rpc.h) dnl Checks for library functions. AC_CHECK_FUNCS(strchr memcpy strcasecmp) AC_CHECK_FUNCS(getdtablesize) AC_CHECK_FUNCS(strerror) AC_CHECK_FUNCS(inet_aton bindresvport) AC_CHECK_FUNCS(issetugid geteuid getegid) AC_CHECK_FUNCS(arc4random) AC_CHECK_FUNCS(flock) AC_CHECK_FUNCS(unsetenv) dnl SFS specific checks SFS_DMALLOC SFS_CHECK_WIDE_SELECT SFS_PUTENV_COPY SFS_CHECK_SA_LEN SFS_CHECK_FDPASS SFS_CHECK_SOCK_BUF SFS_FIND_RESOLV SFS_CHECK_STAT_FIELD(st_atimespec) SFS_CHECK_STAT_FIELD(st_mtimespec) SFS_CHECK_STAT_FIELD(st_mtim) AC_CHECK_FUNCS(mkdtemp) SFS_CHECK_DECL(sys_signame, signal.h) SFS_CHECK_EGID_IN_GROUPLIST AC_CHECK_FUNCS(getspnam setlogin initgroups seteuid) SFS_PASSWD_FIELD(pw_expire) SFS_PASSWD_FIELD(pw_class) SFS_GETGROUPLIST SFS_CHECK_SETUSERCONTEXT SFS_CHECK_DECL(pread, unistd.h) SFS_CHECK_DECL(pwrite, unistd.h) CPPFLAGS="$CPPFLAGS "'-I$(top_srcdir)' USE_SYNFP=1 AC_ARG_ENABLE(synfp, --disable-synfp Disable code for collection of TCP SYN fingerprints, if test no = "$enableval"; then USE_SYNFP=0 fi) if test 1 = "$USE_SYNFP"; then for dir in ${prefix}/include/pcap /usr/include/pcap; do if test -d "$dir"; then CPPFLAGS="$CPPFLAGS -I$dir" break fi done AC_CHECK_HEADERS(pcap.h,, USE_SYNFP=0) fi if test 1 = "$USE_SYNFP"; then SFS_CHECK_TYPE(bpf_u_int32, [#include ]) saved_LIBS="$LIBS" LIBS="-lpcap $LIBS" AC_CHECK_FUNCS(pcap_freecode) LIBS="$saved_LIBS" fi if test 1 = "$USE_SYNFP"; then AC_DEFINE(USE_SYNFP, 1, [Define to include code for TCP SYN fingerprints]) fi unset LIBPCAP test 1 = "$USE_SYNFP" && LIBPCAP=-lpcap AC_SUBST(LIBPCAP) AC_ARG_ENABLE(ssl, --disable-ssl Disable STARTTLS command) unset LIBSSL if test no != "$enable_ssl"; then AC_MSG_CHECKING([for OpenSSL]) for dir in "$enable_ssl" "$prefix" "$prefix/ssl" \ /usr/ssl /usr /usr/local/ssl /usr/local; do unset ssl_cppflags unset ssl_libs if test -f "$dir/include/openssl/ssl.h"; then if test /usr = "$dir"; then ssl_cppflags="" else ssl_cppflags="-I$dir/include" fi fi test -z "${ssl_cppflags+set}" && continue if test /usr = "$dir"; then ssl_libs="-lssl -lcrypto" else ssl_libs="-L$dir/lib -lssl -lcrypto" fi if test -z "$enable_ssl"; then saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $ssl_cppflags" AC_TRY_COMPILE([#include ], [#if OPENSSL_VERSION_NUMBER < 0x00907000L #error untested version of openssl #endif],, unset ssl_libs) CPPFLAGS="$saved_CPPFLAGS" fi test -n "$ssl_libs" && break done if test -n "$ssl_libs"; then AC_MSG_RESULT($dir) CPPFLAGS="$CPPFLAGS $ssl_cppflags" LIBSSL="$ssl_libs" AC_DEFINE(STARTTLS, 1, [Define to implement STARTTLS command.]) elif test -z "$enable_ssl"; then AC_MSG_RESULT(no) else AC_MSG_ERROR([Could not find OpenSSL libraries]) fi fi AC_SUBST(LIBSSL) AM_CONDITIONAL(SSL, test -n "$LIBSSL") AC_ARG_ENABLE(sasl, --enable-sasl Enable SASL w. Cyrus SASL2 library,, enable_sasl=no) if test yes = "$enable_sasl"; then for dir in "$prefix" /usr/local /usr; do test -f "$dir/include/sasl/sasl.h" \ -a \( -f "$dir/lib/libsasl2.la" -o -f "$dir/lib/libsasl2.a" \) \ && sasl="$dir" && break done elif test -n "$enable_sasl" -a no != "$enable_sasl"; then sasl="$enable_sasl" fi unset LIBSASL if test -n "$sasl"; then if test -f "$dir/lib/libsasl2.la"; then LIBSASL="$dir/lib/libsasl2.la" else LIBSASL="-L$dir/lib -lsasl2" fi CPPFLAGS="$CPPFLAGS -I$sasl/include/sasl" AC_DEFINE(SASL, 1, [Define to use Cyrus libsasl2.]) fi AC_SUBST(LIBSASL) saved_LIBS="$LIBS" unset NDBM_LIBS unset NDBM_INC AC_SEARCH_LIBS(dbm_open, ndbm, [AC_DEFINE(HAVE_NDBM, 1, Define if you have dbm/ndbm)]) NDBM_LIBS=${LIBS% $saved_LIBS} if test "$ac_cv_search_dbm_open" != no; then if test ! -f /usr/include/ndbm.h; then if test -f /usr/include/db1/ndbm.h; then NDBM_INC="-I/usr/include/db1" fi fi fi LIBS="$saved_LIBS" AC_SUBST(NDBM_LIBS) AC_SUBST(NDBM_INC) SFS_SLEEPYCAT(4.4 4.3 4.2 4.1) AC_ARG_WITH(etcdir, --with-etcdir=DIR Location of per-host configuration files) etcdir="$with_etcdir" test -z "$etcdir" -o yes = "$etcdir" -o no = "$etcdir" && etcdir=/etc/avenger AC_SUBST(etcdir) CPPFLAGS="$CPPFLAGS -DETCDIR="'\"$(etcdir)\"' CPPFLAGS="$CPPFLAGS -DLIBEXEC="'\"$(libexecdir)\"' CPPFLAGS="$CPPFLAGS -DBINDIR="'\"$(bindir)\"' CPPFLAGS="$CPPFLAGS -DEXECDIR=LIBEXEC" CPPFLAGS="$CPPFLAGS -DDATADIR="'\"$(datadir)\"' if test -d /var/run; then piddir=/var/run else piddir="$etcdir" fi AC_SUBST(piddir) CPPFLAGS="$CPPFLAGS -DPIDDIR="'\"$(piddir)\"' AC_SUBST(sampledir) sampledir='${datadir}/avenger' SFS_CFLAGS LDADD="$LDADD "'$(top_builddir)/libasync/libasync.a' LDEPS="$LDEPS "'$(top_builddir)/libasync/libasync.a' CPPFLAGS="$CPPFLAGS "'-I$(top_srcdir)/libasync' ETAGS_ARGS='-C /dev/null' AC_SUBST(ETAGS_ARGS) AC_OUTPUT(Makefile libasync/Makefile asmtpd/Makefile util/Makefile local/Makefile doc/Makefile etc/Makefile)