AC_PREREQ(2.50) AC_INIT AM_INIT_AUTOMAKE(qscan, 1.5) AC_CONFIG_SRCDIR(src/qscan.c) AM_CONFIG_HEADER(config.h) AC_SUBST(VERSION) ISODATE=`date +%Y-%m-%d` AC_SUBST(ISODATE) dnl Checks for programs. AC_PROG_INSTALL AC_PROG_CC AC_AIX AC_ISC_POSIX AC_PROG_CC_STDC AC_ARG_VAR(SWEEP,local path to the Sophos antivirus) sweep_possible_path="/var/qmail/bin:/usr/bin:/usr/local/bin:/bin:/opt/sav/bin:/usr/local/sav/bin" AC_PATH_PROG(SWEEP,sweep,,$sweep_possible_path) if test "x$ac_cv_path_SWEEP" = "x"; then AC_MSG_ERROR(sweep not found) fi CPPFLAGS="$CPPFLAGS -DSWEEP='\"$ac_cv_path_SWEEP\"'" AC_ARG_VAR(RIPMIME,local path to the the ripmime executable) ripmime_possible_path="/var/qmail/bin:/usr/bin:/usr/local/bin:/bin:/opt/ripmime/bin:/usr/local/ripmime/bin" AC_PATH_PROG(RIPMIME,ripmime,,$ripmime_possible_path) if test "x$ac_cv_path_RIPMIME" = "x"; then AC_MSG_ERROR(ripmime not found) fi CPPFLAGS="$CPPFLAGS -DRIPMIME='\"$ac_cv_path_RIPMIME\"'" AC_ARG_VAR(QMAIL_QUEUE,local path to the original qmail-queue program) qmail_queue_possible_path="/var/qmail/bin:/usr/bin:/usr/local/bin:/bin:/opt/qmail/bin:/usr/local/qmail/bin" AC_PATH_PROG(QMAIL_QUEUE,qmail-queue-old,,$qmail_queue_possible_path) if test "x$ac_cv_path_QMAIL_QUEUE" = "x"; then AC_MSG_ERROR(qmail-queue-old not found) fi CPPFLAGS="$CPPFLAGS -DQMAIL_QUEUE='\"$ac_cv_path_QMAIL_QUEUE\"'" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE=1 -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" dnl Checks for header files AC_HEADER_STDC AC_HEADER_STAT AC_HEADER_TIME AC_HEADER_DIRENT AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(unistd.h string.h strings.h sys/param.h) AC_CHECK_HEADERS(sys/time.h sys/resource.h) AC_CHECK_HEADERS(stddef.h) AC_CHECK_HEADERS(stdarg.h varargs.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_PROG_GCC_TRADITIONAL AC_C_INLINE AC_C_CONST AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_STRUCT_TM AC_TYPE_SIGNAL AC_TYPE_UID_T AC_CHECK_TYPE(ssize_t, , [AC_DEFINE(ssize_t, long int, [ssize_t type])], [ #include #ifdef STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_UNISTD_H # include #endif #include ]) dnl Options AM_WITH_DMALLOC dnl Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_STAT AC_FUNC_VPRINTF AC_CHECK_FUNCS(snprintf vsnprintf vfprintf) AC_CHECK_FUNCS(nanosleep usleep) dnl Custom checks AC_MSG_CHECKING(whether usleep returns something) AC_TRY_COMPILE([ #include #ifdef STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif ], [ return (int) usleep(50000UL); ], [ AC_DEFINE(USLEEP_RETURNS_INT, , [usleep returns an integer]) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(probably nothing) ] ) AC_MSG_CHECKING(whether snprintf is C99 conformant) AC_TRY_RUN([ #include #ifdef STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_UNISTD_H # include #endif int main(void) { char buf[4]; (void) fprintf(fopen("conftestval", "wt"), "%d\n", (int) snprintf(buf, sizeof buf, "12345678")); return 0; } ], CONF_SNPRINTF_TYPE=`cat conftestval` ) AC_MSG_RESULT(done) if test "x$CONF_SNPRINTF_TYPE" = "x" ; then AC_MSG_WARN(your operating system doesn't implement snprintf) else AC_DEFINE_UNQUOTED(CONF_SNPRINTF_TYPE, $CONF_SNPRINTF_TYPE, [return value of an overflowed snprintf]) fi dnl Options AM_WITH_DMALLOC AC_ARG_WITH(concurrency, [AC_HELP_STRING([--with-concurrency],[Set max virus scanning concurrency])], [ if test "x$withval" != "x" ; then AC_DEFINE_UNQUOTED(SCAN_CONCURRENCY, $withval, [max scanning concurrency]) fi ]) dnl Output AC_CONFIG_FILES(Makefile src/Makefile) AC_OUTPUT