dnl Process this file with autoconf to produce a configure script. AC_REVISION([$Id$])dnl AC_INIT(daemon/zmscanner.c) AM_INIT_AUTOMAKE(zmscanner, 1.95) AM_CONFIG_HEADER(config.h) AC_LANG_C AC_PROG_CC AM_C_PROTOTYPES if test "X$CC" = "Xgcc"; then CFLAGS="$CFLAGS -Wall -g" fi AC_ARG_ENABLE(debug_link, [ --enable-debug-link (only in forking version) install SIGSEGV handler that saves a copy of offending queue file], AC_DEFINE(DEBUG_LINK,1,[Save queue files that caused SEGV])) : ${PLUGINS="breakzmsg breakrfc822 breakbody breakzhdr breakhdr breakhdr_ct\ breakhdr_cte decode_qp decode_b64 check_ct dispatch_ct dispatch_body"} AC_ARG_WITH(plugins, [ --with-plugins=LIST list of internal plugins [[breakzmsg breakrfc822 breakrfc822 breakbody decode_qp decode_b64 breakzhdr breakhdr breakhdr_ct breakhdr_cte check_ct dispatch_ct dispatch_body]]], PLUGINS="$withval") for f in $PLUGINS; do PLUG_SRC="$PLUG_SRC $f.c" PLUG_OBJ="$PLUG_OBJ $f.lo" done AC_SUBST(PLUGINS) AC_SUBST(PLUG_SRC) AC_SUBST(PLUG_OBJ) AC_ARG_ENABLE(pthreads, [ --disable-pthreads do not use pthreads even if they are present]) AC_ARG_ENABLE(milter, [ --disable-milter do not build milter frontend even if libmilter is present]) AC_PROG_MAKE_SET AC_SUBST(PROGS)dnl AC_SUBST(LIBPROGS)dnl AC_PATH_PROG(ECHO, echo, echo)dnl AC_PATH_PROG(CP, cp, cp)dnl AC_PATH_PROG(LN, ln, ln)dnl AC_PATH_PROG(MV, mv, mv)dnl AC_PATH_PROG(RM, rm, rm)dnl AC_PATH_PROG(PERL, perl, perl)dnl AC_PATH_PROG(NROFF, nroff, nroff)dnl AC_PATH_PROG(SVN, svn, svn)dnl AC_PATH_PROG(AR, ar, ar)dnl AC_PATH_PROG(LD, ld, ld)dnl AC_PATH_PROG(SED, sed, sed)dnl AC_PROG_INSTALL AC_PROG_LN_S AM_PROG_LIBTOOL if test "X$enable_pthreads" != "Xno"; then ACX_PTHREAD() LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC" fi if test "X$acx_pthread_ok" = "Xyes"; then dnl !! There is probably no need in the following DEFINE if ACX_PTHREAD dnl !! was used, but we preserve it just in case... AC_DEFINE(_REENTRANT,1,[need to define this for threaded build]) pthreads=yes else pthreads=no fi if test "X$enable_milter" != "Xno" -a "X$pthreads" != "Xno"; then AC_CHECK_HEADERS(libmilter/mfapi.h) AC_CHECK_LIB(milter, smfi_register) AC_CHECK_FUNCS(smfi_register) fi if test "X$ac_cv_header_libmilter_mfapi_h" = "Xyes" -a \ "X$ac_cv_lib_milter_smfi_register" = "Xyes"; then milter=yes MILTER_FRONTEND=smscanner MILTER_FRONTEND_MAN=smscanner.8 else milter=no fi AC_SUBST(MILTER_FRONTEND MILTER_FRONTEND_MAN) dnl Checks for libraries. AC_CHECK_LIB(socket, socket) dnl Checks for compilter specifics AC_C_INLINE dnl Checks for header files. AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS(errno.h unistd.h stddef.h fcntl.h sys/stat.h) AC_CHECK_HEADERS(sys/socket.h sys/mman.h sys/select.h regex.h) AC_CHECK_HEADERS(arpa/inet.h netinet/in.h netdb.h dlfcn.h link.h) dnl do not use termios. Change this if you want truly interactive zmsctl. dnl AC_CHECK_HEADERS(termios.h) AC_CHECK_HEADERS(sys/utsname.h) AC_CHECK_MEMBERS([struct utsname.domainname],,,[#include ]) AC_MSG_CHECKING([whether optarg is defined in headers]) AC_CACHE_VAL(ac_cv_optarg_defined, [AC_TRY_COMPILE([ #include #ifdef STDC_HEADERS #include #endif #ifdef HAVE_UNISTD_H #include #endif ], [ char *xxx; xxx=optarg; ], ac_cv_optarg_defined=yes, ac_cv_optarg_defined=no)])dnl AC_MSG_RESULT($ac_cv_optarg_defined) if test X$ac_cv_optarg_defined = Xyes; then AC_DEFINE(OPTARG_DEFINED,1,[whether optarg variable is defined]) fi dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_TYPE_UID_T dnl Checks for library functions. AC_CHECK_FUNCS(socket select syslog setsid mmap regcomp) AC_CHECK_FUNCS(gethostbyname gethostbyaddr) AC_CHECK_FUNCS(uname gethostname getdomainname) AC_REPLACE_FUNCS(getopt strerror strlcpy) AC_FUNC_SETPGRP AC_CHECK_LIB(dl, dlopen) AC_CHECK_FUNCS(dlopen) if test x$ac_cv_func_dlopen = xyes; then dso=yes else dso=no fi if test x$ac_cv_func_socket != xyes; then AC_MSG_ERROR([Cannot work without BSD sockets!]) fi if test x$ac_cv_func_select != xyes; then AC_MSG_ERROR([Cannot work without select() function!]) fi AC_CONFIG_FILES([Makefile inc/Makefile lib/Makefile \ plugins/Makefile daemon/Makefile \ tests/Makefile tests/test.conf \ tests/startserver tests/tryscan tests/stopserver \ zmscanner-config], [test -f tests/startserver && chmod +x tests/startserver test -f tests/tryscan && chmod +x tests/tryscan test -f tests/stopserver && chmod +x tests/stopserver test -f zmscanner-config && chmod +x zmscanner-config]) AC_OUTPUT AC_MSG_RESULT([]) AC_MSG_RESULT([Using pthreads: $pthreads]) AC_MSG_RESULT([Dynamically loaded modules: $dso]) AC_MSG_RESULT([Static plugins: $PLUGINS]) AC_MSG_RESULT([Milter frontend: $milter]) if test x$ac_cv_func_mmap != xyes; then AC_MSG_RESULT([ *** mmap() not present, zmscanner may be harmful for your system ***]) fi AC_MSG_RESULT([])