dnl Process this file with autoconf to produce a configure script. AC_INIT AC_PREREQ(2.52) AC_CONFIG_SRCDIR([src/main.c]) dnl check system AC_CANONICAL_TARGET dnl automake init AM_INIT_AUTOMAKE(modlogan,0.8.13) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE dnl automake 1.5 only dnl AM_MAKE_INCLUDE dnl Checks for programs. AC_PROG_CC AC_PROG_LD AC_PROG_INSTALL AC_PROG_AWK AC_PROG_CPP dnl AC_PROG_CXX AC_PROG_LN_S AC_PROG_MAKE_SET dnl check environment AC_AIX AC_ISC_POSIX AC_MINIX dnl AC_CANONICAL_HOST case $host_os in *cygwin* ) CYGWIN=yes;; * ) CYGWIN=no;; esac AC_EXEEXT dnl more automake stuff AM_C_PROTOTYPES dnl libtool AM_ENABLE_STATIC AM_ENABLE_SHARED dnl AC_LIB_LTDL dnl AC_LIBLTDL_CONVENIENCE dnl AC_SUBST(LIBLTDL) dnl AC_SUBST(INCLTDL) AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL CFLAGS="${ac_save_CFLAGS}" # don't use CFLAGS from libtool dnl AC_CONFIG_SUBDIRS(libltdl) AC_CHECK_HEADER(dlfcn.h) if test "$ac_cv_header_dlfnc_h" = "no"; then echo "please install the libdl-headers (dlfnc.h)" echo "probably in glibc-devel"; exit fi AC_CHECK_HEADER(dmalloc.h) if test "$ac_cv_header_dmalloc_h" = "yes"; then AM_WITH_DMALLOC fi AC_STRUCT_TM AC_HEADER_MAJOR AC_FUNC_STAT AC_FUNC_MKTIME AC_FUNC_MALLOC AC_CHECK_HEADERS([libintl.h stddef.h termios.h errno.h alloca.h]) AC_CHECK_FUNCS([strtoul strstr strrchr strncasecmp strftime mkdir memset \ mempcpy getwd gettimeofday floor strsep \ getgrouplist setgroups \ memrchr strndup strdup setenv unsetenv putenv timegm]) AC_ARG_ENABLE(profiling, [ --enable-profiling Enables profiles option for gcc [default=no]], [case "${enableval}" in yes) do_profile=true ;; no) do_profile=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;; esac], [do_profile=false]) dnl do some GCC specific things here if test "${GCC}" = "yes"; then if test -z "$CFLAGS" ; then CFLAGS="-O2 -g -Wall -Wno-format-y2k" fi if test "$do_profile" = "true"; then CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage -pg" fi AC_MSG_CHECKING(version of GCC) GCC_version=`${CC} --version | sed -n '1s/^[[^ ]]* (.*) //;s/ .*$//;1p'` AC_MSG_RESULT(${GCC_version}) fi AC_ARG_ENABLE(check-dynamic, [ --enable-check-dynamic Enables a check for the correct behaviour of your dynamic libraries [default=yes]], [case "${enableval}" in yes) do_check=true ;; no) do_check=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-check-dynamic) ;; esac], [do_check=true]) AC_SEARCH_LIBS(dlopen, dl, [test "$ac_cv_search_dlopen" = "none required" || DL_LIB="$ac_cv_search_dlopen"], DL_LIB="") AC_SUBST(DL_LIB) ALL_LINGUAS="de cs es it fr pl ru hu" AM_GNU_GETTEXT([external]) dnl if test "x$USE_INCLUDED_LIBINTL" = "xyes"; then dnl INTLINC='-I$(top_srcdir)/intl' dnl AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET) dnl else dnl AC_SEARCH_LIBS(bind_textdomain_codeset, intl, [test \ dnl "$ac_cv_search_bind_textdomain_codeset" = "none required" || dnl INTLLIBS="$ac_cv_search_bind_textdomain_codeset"], ) dnl AC_CHECK_FUNCS([bind_textdomain_codeset]) dnl fi AC_SUBST(INTLINC) AC_SUBST(INTLLIBS) LIBGD_PATH=false AC_ARG_WITH(gd,[ --with-gd=DIR path the GD includes], LIBGD_PATH="${withval}") dnl --with-gd is only usefull with a path if test "x$LIBGD_PATH" = "xyes" ; then LIBGD_PATH=false fi dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h unistd.h sys/time.h pwd.h grp.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_HEADER_TIME AC_C_CONST dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_CHECK_FUNCS(strerror strtod strtol) AC_MSG_CHECKING(for __FUNCTION__) AC_TRY_COMPILE([],[printf("%s", __FUNCTION__);],[AC_DEFINE(HAVE_FUNCTION)]) AC_MSG_RESULT(done) AC_CHECK_HEADER(localizer.h) AC_CHECK_LIB(localizer, localizer_init,,,-lz -lbz2) AC_ARG_VAR(PCRE, "full path to pcre-config") AC_PATH_PROG([PCRE], [pcre-config]) CPPFLAGS="${CPPFLAGS} `${PCRE} --cflags`" LIBS="${LIBS} `${PCRE} --libs`" AC_CHECK_HEADER(pcre.h, HAVE_LIBPCRE=true, HAVE_LIBPCRE=false) if test "x$HAVE_LIBPCRE" = "xfalse"; then AC_MSG_ERROR("headers for libpcre were not found. please install libpcre and run configure again") fi if test "x$HAVE_LIBPCRE" = "xtrue"; then AC_CHECK_LIB(pcre, pcre_exec, HAVE_LIBPCRE=true, HAVE_LIBPCRE=false) if test "x$HAVE_LIBPCRE" = "xtrue"; then PCRE_LIB="-lpcre" AC_SUBST(PCRE_LIB) else AC_MSG_ERROR("libpcre was not found. please install libpcre and run configure again") fi else AC_MSG_ERROR("libpcre was not found. please install libpcre and run configure again") fi AC_SEARCH_LIBS(pow, "m", [test "$ac_cv_search_pow" = "none required" || M_LIB="$ac_cv_search_pow"], M_LIB="") AC_SUBST(M_LIB) AC_CHECK_LIB(adns, adns_wait, HAVE_LIBADNS=true, HAVE_LIBADNS=false) if test "x$HAVE_LIBADNS" = "xtrue"; then ADNS_LIB="-ladns" AC_SUBST(ADNS_LIB) AC_DEFINE(HAVE_LIBADNS) fi AC_CHECK_HEADER(zlib.h, HAVE_LIBZ=true, HAVE_LIBZ=false) if test "x$HAVE_LIBZ" = "xtrue"; then AC_CHECK_LIB(z, gzopen, HAVE_LIBZ=true, HAVE_LIBZ=false) if test "x$HAVE_LIBZ" = "xtrue"; then AC_DEFINE(HAVE_LIBZ) Z_LIB="-lz" AC_SUBST(Z_LIB) else AC_MSG_ERROR("the libraries of libz couldn't be found. please install libz and run configure again") fi else AC_MSG_ERROR("the headers of libz couldn't be found. please install libz and run configure again") fi AC_CHECK_HEADER(bzlib.h, HAVE_LIBBZ=true, HAVE_LIBBZ=false) if test "x$HAVE_LIBBZ" = "xtrue"; then AC_CHECK_LIB(bz2, BZ2_bzDecompress, HAVE_LIBBZ=true, HAVE_LIBBZ=false) if test "x$HAVE_LIBBZ" = "xtrue"; then AC_DEFINE(HAVE_LIBBZ) BZ_LIB="-lbz2" AC_SUBST(BZ_LIB) fi fi dnl AC_CHECK_LIB(localizer,localizer_search) AC_CHECK_HEADER(getopt.h, HAVE_GETOPT=true, HAVE_GETOPT=false) if test "x$HAVE_GETOPT" = "xtrue"; then AC_CHECK_LIB(c, getopt_long, HAVE_GETOPT=true, HAVE_GETOPT=false) if test "x$HAVE_GETOPT" = "xtrue"; then AC_DEFINE(HAVE_GETOPT_LONG) fi AC_DEFINE(HAVE_GETOPT_H) fi AC_CHECK_HEADER(expat.h, HAVE_EXPAT=true, HAVE_EXPAT=false) if test "x$HAVE_EXPAT" = "xtrue"; then AC_CHECK_LIB(expat, XML_ParserFree, HAVE_EXPAT=true, HAVE_EXPAT=false) if test "x$HAVE_EXPAT" = "xtrue"; then AC_DEFINE(HAVE_EXPAT) LIBS="${LIBS} -lexpat" else AC_MSG_ERROR( "headers of libexpat were found but no library" ) fi else AM_PATH_XML2(2.4.12, HAVE_LIBXML=true, HAVE_LIBXML=false) if test "x$HAVE_LIBXML" = "xtrue"; then AC_DEFINE(HAVE_LIBXML) CPPFLAGS="${CPPFLAGS} ${XML_CFLAGS}" LIBS="${LIBS} ${XML_LIBS}" else AC_MSG_ERROR( "the headers of libxml couldn't be found. please install libxml >= 2.4.1 and run configure again") fi fi AC_CHECK_LIB(png, main, HAVE_LIBPNG=true, HAVE_LIBPNG=false, -lm -lz) if test "x$HAVE_LIBPNG" = "xtrue" ; then AC_PATH_X OLDLIBS=${LIBS} if test "x$have_x" = "xyes"; then LIBS="${LIBS} -L$x_libraries" fi AC_CHECK_LIB(Xpm, main,HAVE_LIBXPM=true, HAVE_LIBXPM=false, -lX11) LIBS=${OLDLIBS} OLDINC=${CPPFLAGS} if test "x$LIBGD_PATH" != "xfalse" ; then CPPFLAGS="-I${LIBGD_PATH} ${INCLUDES}" fi AC_CHECK_HEADER(gd.h, HAVE_INCGD=true, HAVE_INCGD=false) CPPFLAGS=${OLDINC} if test "x$HAVE_INCGD" = "xfalse"; then OLDINC=${CPPFLAGS} if test "x$LIBGD_PATH" != "xfalse"; then CPPFLAGS="-I${LIBGD_PATH} ${INCLUDES}" fi AC_CHECK_HEADER(gd/gd.h, HAVE_INCGD=true, HAVE_INCGD=false) CPPFLAGS=${OLDINC} if test "x$HAVE_INCGD" = "xfalse"; then OLDINC=${CPPFLAGS} if test "x$LIBGD_PATH" != "xfalse" ; then CPPFLAGS="-I${LIBGD_PATH}/include ${INCLUDES}" fi AC_CHECK_HEADER(gd.h, HAVE_INCGD=true, HAVE_INCGD=false) CPPFLAGS=${OLDINC} if test "x$HAVE_INCGD" = "xtrue"; then GD_INCDIR="-I${LIBGD_PATH}/include" fi else AC_DEFINE(HAVE_GD_GD_H) if test "x$LIBGD_PATH" != "xfalse"; then GD_INCDIR="-I${LIBGD_PATH}" fi fi else if test "x$LIBGD_PATH" != "xfalse"; then GD_INCDIR="-I${LIBGD_PATH}" fi fi AC_MSG_CHECKING(gd and its deps) OLDLIBS=${LIBS} GDLPATH="" if test "x$LIBGD_PATH" != "xfalse"; then GDLPATH="-L${LIBGD_PATH}" fi HAVE_LIBGD=false # gd + png support LIBS="$GDLPATH -lz -lpng -lgd -lz" AC_TRY_LINK_FUNC(gdImagePng, HAVE_LIBGD=true,[ # gd + png + jpeg LIBS="$GDLPATH -lz -lpng -lgd -lz -ljpeg" AC_TRY_LINK_FUNC(gdImagePng, HAVE_LIBGD=true,[ # gd + png + freetype LIBS="$GDLPATH -lz -lpng -lgd -lz -lfreetype" AC_TRY_LINK_FUNC(gdImagePng, HAVE_LIBGD=true, [ # gd + png + freetype + jpeg LIBS="$GDLPATH -lz -lpng -lgd -lz -lfreetype -ljpeg" AC_TRY_LINK_FUNC(gdImagePng, HAVE_LIBGD=true, [ # gd + png + freetype + jpeg + xpm LIBS="$GDLPATH -lz -lpng -lgd -lz -lfreetype -ljpeg -lm -lX11 -lXpm" AC_TRY_LINK_FUNC(gdImagePng, HAVE_LIBGD=true, HAVE_LIBGD=false) ]) ]) ]) ]) GDLIBS=$LIBS AC_SUBST(GDLIBS) LIBS=${OLDLIBS} if test "x$HAVE_LIBGD" = "xfalse"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT($GDLIBS) fi if test "x$HAVE_INCGD" = "xfalse"; then AC_MSG_WARN( [-- couldn't detect libgd headers (did you use --with-gd=<...> ??)] [-- please install libgd > 1.7.x to get graphics in the reports] [+---> graphic support disabled]) else if test "x$HAVE_LIBGD" = "xfalse"; then AC_MSG_WARN( [-- couldn't detect libgd libraries with PNG-support] [-- either libgd is not installed or the dependecies can't be detected] [+----> graphic support disabled]) else AC_DEFINE(HAVE_LIBGD) AC_SUBST(GD_LIBDIR) AC_SUBST(GD_INCDIR) fi fi else AC_MSG_WARN( [-- couldn't detect libpng] [-- please install libpng to get graphics in the reports] [-> graphic support disabled]) fi dnl Checks for database. MYSQL_INCLUDE="" AC_MSG_CHECKING(for MySQL support) AC_ARG_WITH(mysql, [ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base install directory, defaults to /usr/local.], [ if test "$withval" != "no"; then if test "$withval" = "yes"; then withval=/usr fi if test -f $withval/include/mysql/mysql.h; then MYSQL_INCDIR=$withval/include/ MYSQL_LIBDIR=$withval/lib/ else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h under $withval) fi MYSQL_INCLUDE=-I$MYSQL_INCDIR MYSQL_LIBS="${ld_runpath_switch}$MYSQL_LIBDIR -L$MYSQL_LIBDIR -lmysqlclient" AC_MSG_RESULT(yes) dnl check for errmsg.h, which isn't installed by some versions of 3.21 old_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE" AC_CHECK_HEADERS(mysql/errmsg.h mysql/mysql.h) CPPFLAGS="$old_CPPFLAGS" AC_DEFINE(HAVE_MYSQL) else AC_MSG_RESULT(no) fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(MYSQL_LIBS) AC_SUBST(MYSQL_INCLUDE) dnl Checks for database. SYBASE_INCLUDE="" SYBASE_LDADD="" AC_MSG_CHECKING(for Sybase support) AC_ARG_WITH(sybase, [ --with-sybase[=DIR] Include Sybase support. DIR is the Sybase base install directory, defaults to /usr/local.], [ if test "$withval" != "no"; then if test "$withval" = "yes"; then SYBASE_INCDIR=/usr/local/include/mysql SYBASE_LIBDIR=/usr/local/lib/mysql else if test -f $withval/include/syberror.h; then SYBASE_INCDIR=$withval/include SYBASE_LIBDIR=$withval/lib else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid Sybase directory - unable to find syberror.h under $withval) fi fi SYBASE_INCLUDE=-I$SYBASE_INCDIR # SYBASE_LIBS=-lsybdb SYBASE_LIBS="-L$SYBASE_LIBDIR -lcs -lct -lcomn -lintl -ltcl" AC_MSG_RESULT(yes) dnl check for errmsg.h, which isn't installed by some versions of 3.21 old_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $SYBASE_INCLUDE" AC_CHECK_HEADERS(syberror.h sybdb.h) CPPFLAGS="$old_CPPFLAGS" AC_DEFINE(HAVE_SYBASE) else AC_MSG_RESULT(no) fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(SYBASE_LIBS) AC_SUBST(SYBASE_INCLUDE) FLOWTOOLS_INCLUDE="" FLOWTOOLS_LIBS="" HAVE_FLOWTOOLS=false AC_MSG_CHECKING(for Flow-tools support) dnl check for flow-tools AC_ARG_WITH(flow-tools, [ --with-flow-tools=DIR Include flow-tools support. DIR is the base source directory], [ if test "$withval" != "no"; then if test ! -f $withval/lib/libft.a -o ! -f $withval/lib/ftlib.h; then AC_MSG_RESULT(failed) AC_MSG_ERROR(is $withval really the source directory of a compiled flow-tools package ? ) fi FLOWTOOLS_INCLUDE="-I$withval/lib/" FLOWTOOLS_LIBS="$withval/lib/libft.a" AC_MSG_RESULT(yes) AC_DEFINE(HAVE_FLOWTOOLS) HAVE_FLOWTOOLS=true else AC_MSG_RESULT(no) fi ],[ AC_MSG_RESULT(no) ]) AC_SUBST(FLOWTOOLS_INCLUDE) AC_SUBST(FLOWTOOLS_LIBS) localedir='${datadir}/locale' AC_SUBST(localedir) AC_MSG_CHECKING(for tests) AM_CONDITIONAL(RUN_TESTS, test -x $srcdir/tests/run_tests.sh) if test -x $srcdir/tests/run_tests.sh; then AC_MSG_RESULT(found) else AC_MSG_RESULT(not found) fi AC_PATH_PROG(PERL, perl) config_path="${sysconfdir}/modlogan" AC_SUBST(config_path) dnl src/input/elmeg/Makefile dnl src/input/hicom116/Makefile dnl src/input/flow/Makefile dnl src/output/sybase_guj/Makefile dnl src/output/tkcontrol/Makefile AC_CONFIG_FILES([ m4/Makefile Makefile doc/Makefile doc/example-setup-1/Makefile doc/modlogan.conf-dist src/Makefile po/Makefile.in src/input/Makefile src/input/cp_ims_login/Makefile src/input/cp_ims_smtp/Makefile src/input/mod_log_sql/Makefile src/input/ippl/Makefile src/input/postfix/Makefile src/input/rsync/Makefile src/input/qmailscanner/Makefile src/input/isdn4bsd/Makefile src/input/bsdftpd/Makefile src/input/pureftpd/Makefile src/input/sendmail/Makefile src/input/flowraw/Makefile src/input/msmedia/Makefile src/input/qmail/Makefile src/input/viruswall/Makefile src/input/clf/Makefile src/input/isdnlog/Makefile src/input/ipchains/Makefile src/input/msiis/Makefile src/input/null/Makefile src/input/netscape/Makefile src/input/qtss/Makefile src/input/realserver/Makefile src/input/shoutcast/Makefile src/input/skeleton/Makefile src/input/squid/Makefile src/input/wuftpd/Makefile src/output/Makefile src/output/null/Makefile src/output/csv/Makefile src/output/modlogan/Makefile src/output/skeleton/Makefile src/output/template/Makefile src/output/text/Makefile src/output/webalizer/Makefile src/processor/Makefile src/processor/ippl/Makefile src/processor/mail/Makefile src/processor/null/Makefile src/processor/accounting/Makefile src/processor/firewall/Makefile src/processor/skeleton/Makefile src/processor/telecom/Makefile src/processor/web/Makefile src/datatypes/Makefile src/datatypes/ipplwatch/Makefile src/datatypes/string/Makefile src/datatypes/location/Makefile src/datatypes/mailhist/Makefile src/datatypes/netmask/Makefile src/datatypes/traffic/Makefile src/datatypes/split/Makefile src/datatypes/brokenlink/Makefile src/datatypes/visit/Makefile src/datatypes/sublist/Makefile src/datatypes/webhist/Makefile src/datatypes/state/Makefile src/datatypes/match/Makefile src/datatypes/record/Makefile src/datatypes/query/Makefile src/datatypes/count/Makefile src/datatypes/visited/Makefile src/datatypes/skeleton/Makefile tests/Makefile modlogan.spec ]) AC_OUTPUT $ECHO $ECHO "Configure finished:" $ECHO if test "x$HAVE_EXPAT" = "xtrue"; then $ECHO "xml-parser: expat" else $ECHO "xml-parser: libxml2" $ECHO "libxml2 : `$XML2_CONFIG --version`" fi $ECHO "pcre : `$PCRE --version`" if test "x$HAVE_LIBADNS" = "xtrue"; then $ECHO "resolver : enabled" else $ECHO "resolver : disabled" fi if test "x$HAVE_LIBGD" = "xfalse"; then $ECHO "graphics : disabled" else $ECHO "graphics : enabled" fi if test "x$HAVE_FLOWTOOLS" = "xfalse"; then $ECHO "flow-tools: disabled" else $ECHO "flow-tools: enabled" fi if test "x$HAVE_LIBLOCALIZER" = "xfalse"; then $ECHO "localizer : disabled" else $ECHO "localizer : enabled" fi $ECHO $ECHO_N "io-wrapper: plain$ECHO_C" if test "x$HAVE_LIBZ" = "xtrue"; then $ECHO $ECHO_N " .gz$ECHO_C" fi if test "x$HAVE_LIBBZ" = "xtrue"; then $ECHO $ECHO_N " .bz2$ECHO_C" fi $ECHO if test -r INSTALL.msg; then cat INSTALL.msg fi