AC_INIT(havp) dnl This ksh/zsh feature conflicts with `cd blah ; pwd` unset CDPATH AC_PROG_CXX AC_PREFIX_DEFAULT(/usr/local) AC_CONFIG_HEADER(havp/default.h) AC_ARG_ENABLE(locking,[ --disable-locking Disable mandatory locking (not needed on Linux/Solaris system)], enable_locking=$enableval, enable_locking=yes) AC_ARG_ENABLE(ssl-tunnel,[ --enable-ssl-tunnel Enable SSL proxying (not scanned, only forwarded!)], enable_ssl_tunnel=$enableval, enable_ssl_tunnel=no) AC_ARG_ENABLE(clamav,[ --disable-clamav Disable ClamAV libclamav support (clamd is supported anyway)], enable_clamav=$enableval, enable_clamav=yes) AC_ARG_ENABLE(trophie,[ --disable-trophie Disable Trend Micro Library (Trophie) support], enable_trophie=$enableval, enable_trophie=yes) AC_CHECK_PROG(AR, ar, ar, no) if test "$AR" = "no"; then AC_MSG_ERROR([ar not found in PATH]) fi AC_CHECK_PROG(PERL, perl, perl, no) if test "$PERL" = "no"; then AC_MSG_ERROR([perl not found in PATH]) fi AC_MSG_CHECKING(OS) os="`uname`" case $os in Linux*) AC_MSG_RESULT(Linux) mandatory=yes ;; SunOS*) AC_MSG_RESULT(Solaris) mandatory=yes OSLIBS="-lsocket -lresolv -lnsl" ;; *) AC_MSG_RESULT($os) mandatory=no ;; esac AC_MSG_CHECKING(for mandatory locking support) if test "$enable_locking" = "no" then AC_MSG_RESULT([disabled, no dynamic scanning!]) AC_DEFINE(NOMAND) else if test "$mandatory" = "yes" then AC_MSG_RESULT([OS supported]) else AC_MSG_RESULT([OS not supported]) echo "" echo " Mandatory locking only works on Linux and Solaris." echo "" echo " You are running $os, so you must rerun configure" echo " with --disable-locking option." echo "" echo " This means you cannot use dynamic scanning features" echo " like KEEPBACKBUFFER. Everything is downloaded fully" echo " and only then sent to client." echo "" exit 1 fi fi if test "$enable_ssl_tunnel" = "yes" then AC_DEFINE(SSLTUNNEL) fi AC_MSG_CHECKING(for ClamAV scanner library) if test "$enable_clamav" = "yes" then clamprefix="`clamav-config --prefix 2>/dev/null`" clamversion="`clamav-config --version 2>/dev/null`" if test "x$clamprefix" = "x" then AC_MSG_RESULT([clamav-config not found]) echo "" echo " Error finding ClamAV installation!" echo " Add ClamAV binaries path to PATH and run configure again." echo "" echo " To disable ClamAV, use --disable-clamav (not recommended!)." echo "" exit 1 fi for cl in `clamav-config --cflags 2>/dev/null`; do if test "x`echo $cl | perl -ne 'print if (/^-I/)' 2>/dev/null`" != "x" then CFLAGS="$CFLAGS $cl" fi done for cl in `clamav-config --libs 2>/dev/null`; do if test "x`echo $cl | perl -ne 'print if (/(^-L|thread|c_r)/)' 2>/dev/null`" != "x" then LDFLAGS="$LDFLAGS $cl" fi done LDFLAGS="$LDFLAGS -lclamav" SCANNEROBJECTS="clamlibscanner.o" AC_DEFINE(USECLAMLIB) AC_MSG_RESULT([found $clamversion in $clamprefix]) else AC_MSG_RESULT([disabled :-(]) fi AC_MSG_CHECKING(for Trend Micro scanner) if test "$enable_trophie" = "yes" then if test -f "/etc/iscan/libvsapi.so" then AC_MSG_RESULT([/etc/iscan/libvsapi.so found]) SCANNEROBJECTS="$SCANNEROBJECTS trophiescanner.o" LDFLAGS="-L/etc/iscan -lvsapi $LDFLAGS" AC_DEFINE(USETROPHIE) else AC_MSG_RESULT([/etc/iscan/libvsapi.so not found, disabled]) fi else AC_MSG_RESULT([disabled]) fi LDFLAGS="$LDFLAGS $OSLIBS" CFLAGS="$CFLAGS -Wall -O2" test "$prefix" = "NONE" && prefix=/usr/local test "$localstatedir" = '${prefix}/var' && localstatedir=/var || localstatedir=$localstatedir sysconfdir=`eval echo $sysconfdir | $PERL -pe 's#/havp/?$##'` localstatedir=`eval echo $localstatedir` AC_DEFINE_UNQUOTED(CONFIGFILE, "$sysconfdir/havp/havp.config") AC_DEFINE_UNQUOTED(WHITELISTFILE, "$sysconfdir/havp/whitelist") AC_DEFINE_UNQUOTED(BLACKLISTFILE, "$sysconfdir/havp/blacklist") AC_DEFINE_UNQUOTED(TEMPLATEPATH, "$sysconfdir/havp/templates/en") AC_DEFINE_UNQUOTED(ACCESSLOG, "$localstatedir/log/havp/access.log") AC_DEFINE_UNQUOTED(ERRORLOG, "$localstatedir/log/havp/error.log") AC_DEFINE_UNQUOTED(SCANTEMPFILE, "$localstatedir/tmp/havp/havp-XXXXXX") AC_DEFINE_UNQUOTED(PIDFILE, "$localstatedir/run/havp/havp.pid") AC_SUBST(SCANNEROBJECTS) AC_SUBST(CFLAGS) AC_OUTPUT(Makefile havp/Makefile havp/scanners/Makefile etc/havp/havp.config)