AC_INIT(clamassassin, 1.2.4, james.lick@gmail.com) AC_REVISION($Id: configure.ac.in,v 1.53 2007/03/04 13:02:44 jlick Exp $) AC_CONFIG_FILES([clamassassin Makefile],[chmod 555 clamassassin]) AC_PATH_PROG(CONF_RM, rm) if test "$CONF_RM" = "" then AC_MSG_ERROR([Required utility rm not found.]) fi AC_PATH_PROG(CONF_CAT, cat) if test "$CONF_CAT" = "" then AC_MSG_ERROR([Required utility cat not found.]) fi AC_PATH_PROG(CONF_SED, sed) if test "$CONF_SED" = "" then AC_MSG_ERROR([Required utility sed not found.]) fi AC_PATH_PROG(CONF_ECHO, echo) if test "$CONF_ECHO" = "" then AC_MSG_ERROR([Required utility echo not found.]) fi AC_PATH_PROG(CONF_FORMAIL, formail) if test "$CONF_FORMAIL" = "" then AC_MSG_ERROR([Required utility formail not found.]) fi AC_PATH_PROG(CONF_MKTEMP, mktemp) if test "$CONF_MKTEMP" = "" then AC_MSG_ERROR([Required utility mktemp not found.]) fi AC_PATH_PROG(CONF_SIGTOOL, sigtool) if test "$CONF_SIGTOOL" = "" then AC_MSG_ERROR([Required utility sigtool not found.]) fi AC_PATH_PROG(CONF_CLAMSCAN, clamscan) if test "$CONF_CLAMSCAN" = "" then AC_MSG_ERROR([Required utility clamscan not found.]) fi AC_SUBST(CONF_CLAMSCANNER,${CONF_CLAMSCAN}) AC_PATH_PROG(CONF_CLAMDSCAN, clamdscan) AC_CHECK_FILES(/tmp/clamd) if test "$ac_cv_file__tmp_clamd" = "yes" then if test "$CONF_CLAMDSCAN" = "" then AC_MSG_NOTICE([/tmp/clamd found, but can't find clamdscan]) else AC_SUBST(CONF_CLAMSCANNER,${CONF_CLAMDSCAN}) fi else AC_SUBST(CONF_CLAMSCANNER,${CONF_CLAMSCAN}) fi AC_ARG_ENABLE(clamdscan, [ --enable-clamdscan Force clamassassin to use clamdscan even if /tmp/clamd not found. --disable-clamdscan Force clamassassin not to use clamdscan even if /tmp/clamd found.], [ case $enableval in no) AC_SUBST(CONF_CLAMSCANNER,${CONF_CLAMSCAN}) ;; *) if test "$CONF_CLAMDSCAN" = "" then AC_MSG_NOTICE([--enable-clamdscan requested, but can't find clamdscan]) else AC_SUBST(CONF_CLAMSCANNER,${CONF_CLAMDSCAN}) fi ;; esac ]) DO_VERSION_CHECK="yes"; AC_ARG_ENABLE(version-check, [ --enable-version-check (default) Checks ClamAV version for compatibility. --disable-version-check Skips checking ClamAV version for compatibility.], [ if test "$enableval" = "no" then DO_VERSION_CHECK="no"; fi ]) if test "${DO_VERSION_CHECK}" = "yes" then CLAMVERS=`${CONF_CLAMSCAN} -V --stdout | ${CONF_SED} -e "s/.*ClamAV //" \ -e "s/version //" -e "s/\/.*//"` CLAMVERSMAJ=`${CONF_ECHO} ${CLAMVERS} | ${CONF_SED} -e "s/[[-\.]].*//"` CLAMVERSMIN=`${CONF_ECHO} ${CLAMVERS} | \ ${CONF_SED} -e "s/[[^-\.]]*[[-\.]]*//" -e "s/[[^0-9]].*//"` CLAMVERSEXT=`${CONF_ECHO} ${CLAMVERS} | \ ${CONF_SED} -e "s/[[^-\.]]*[[-\.]]*//" \ -e "s/[[0-9]]*\([[^0-9]]*\)/\1/" -e "s/^[[-\.]]//"` AC_MSG_NOTICE([ClamAV version ${CLAMVERS} detected.]) # AC_MSG_NOTICE([maj ${CLAMVERSMAJ} min ${CLAMVERSMIN} ext ${CLAMVERSEXT}]) case ${CLAMVERSMAJ} in devel) AC_MSG_WARN([You are running a devel version of ClamAV. I guess you know what you're doing]) ;; 0) if test ${CLAMVERSMIN} -lt 90 then AC_MSG_ERROR([clamassassin requires ClamAV 0.90 or higher]) fi ;; esac fi AC_MSG_NOTICE([Using scanner ${CONF_CLAMSCANNER}]) AC_SUBST(CONF_CLAMSCANOPT,"--no-summary --stdout") AC_MSG_NOTICE([Using scanner options ${CONF_CLAMSCANOPT}]) SIGLOC=`${CONF_CLAMSCAN} --debug --tempdir=/dev/null /dev/null 2>&1 | ${CONF_SED} -e "/^LibClamAV debug: Loading databases from /!d" -e "s/.* //" -e q` if test "$SIGLOC" = "" then AC_MSG_ERROR([Cannot determine virus signature file directory]) else AC_MSG_NOTICE([Using virus signature file dir ${SIGLOC}]) AC_SUBST(CONF_SIGLOC,${SIGLOC}) fi AC_SUBST(CONF_SIGVERSFLAG,0) AC_ARG_ENABLE(signature-version, [ --enable-signature-version Turns on signature version reporting --disable-signature-version Turns off signature version reporting (default)], [ if test "$enableval" = "no" then AC_SUBST(CONF_SIGVERSFLAG,0) else AC_SUBST(CONF_SIGVERSFLAG,1) fi ]) if test ${CONF_SIGVERSFLAG} -eq 1 then AC_MSG_NOTICE([Signature version reporting is on.]) else AC_MSG_NOTICE([Signature version reporting is off.]) fi AC_SUBST(CONF_ADDSCANNERFLAG,1) AC_ARG_ENABLE(name-adding, [ --enable-name-adding Turns on adding of scanner name (default) --disable-name-adding Turns off adding of scanner name], [ if test "$enableval" = "no" then AC_SUBST(CONF_ADDSCANNERFLAG,0) else AC_SUBST(CONF_ADDSCANNERFLAG,1) fi ]) if test ${CONF_ADDSCANNERFLAG} -eq 1 then AC_MSG_NOTICE([Scanner name adding is on.]) else AC_MSG_NOTICE([Scanner name adding is off.]) fi if test "$TMP" = "" then AC_SUBST(CONF_TMP,/tmp) else AC_SUBST(CONF_TMP,$TMP) fi AC_MSG_NOTICE([Using temporary directory $CONF_TMP]) AC_ARG_ENABLE(subject_rewrite, [ --enable-subject-rewrite[[=message]] When a virus is detected, rewrite Subject: header to be prefixed with *****VIRUS***** or [[message]] if specified --disable-subject-rewrite Do not do Subject: header rewriting (default)], [ case $enableval in yes) SUBJECTHEAD="*****VIRUS*****" ;; no) SUBJECTHEAD="" ;; *) SUBJECTHEAD=$enableval ;; esac ],[ SUBJECTHEAD="" ]) if test "$SUBJECTHEAD" = "" then AC_MSG_NOTICE([Subject header rewriting is off.]) else AC_MSG_NOTICE([Subject header rewriting is on: $SUBJECTHEAD]) SUBJECTHEAD="${SUBJECTHEAD} " AC_SUBST(CONF_SUBJECTHEAD,$SUBJECTHEAD) fi AC_OUTPUT()