dnl Process this file with autoconf to produce a configure script. AC_INIT(ulogd.c) dnl Checks for programs. AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_INSTALL dnl Checks for libraries. AC_CHECK_LIB(dl, dlopen) dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_STRUCT_TM dnl Checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS(socket strerror) DATABASE_DIR="" DATABASE_LIB="" DATABASE_LIB_DIR="" DATABASE_DRIVERS="" dnl dnl test for MySQL dnl AC_ARG_WITH(mysql, --with-mysql= mysql installed in ,[ if test $withval != yes then dir=$withval else dir="/usr/local" fi mysqldir="" AC_MSG_CHECKING(for MySQL files) for d in $dir /usr /usr/local /usr/local/mysql /opt/mysql /opt/packages/mysql do if test -f $d/lib/mysql/libmysqlclient.so then AC_MSG_RESULT(found mysql in $d) mysqldir=$d mysqldir_suffix=/mysql break fi if test -f $d/lib/libmysqlclient.so then AC_MSG_RESULT(found mysql in $d) mysqldir=$d mysqldir_suffix= break fi done if test x$mysqldir = x then AC_MSG_WARN(MySQL backend not used) else AC_DEFINE(HAVE_MYSQL) MYSQLINCLUDES=${mysqldir}/include${mysqldir_suffix} MYSQLLIBS=${mysqldir}/lib${mysqldir_suffix} DATABASE_DIR="${DATABASE_DIR} mysql" DATABASE_LIB="${DATABASE_LIB} -lmysqlclient " DATABASE_LIB_DIR="${DATABASE_LIB_DIR} -L${MYSQLLIBS} " DATABASE_DRIVERS="${DATABASE_DRIVERS} ../mysql/mysql_driver.o " DB_DEF="${DB_DEF} -DHAVE_MYSQL " AC_SUBST(MYSQLINCLUDES) if test -f $MYSQLLIBS/libmystrings.so then DATABASE_LIB="${DATABASE_LIB} -lmystrings " else MYSQLEXTRALIBS= fi dnl Here we check whether we have an old MySQL client library dnl installed, which does not support the mysql_real_escape_string(), dnl but the real_escape_string() function. dnl Having a look in the libary itself should be more reliable than dnl parsing the output of mysql --version. AC_MSG_CHECKING(for mysql_real_escape_string support) MYSQL_FUNCTION_TEST=`strings ${MYSQLLIBS}/libmysqlclient.so | grep mysql_real_escape_string` if test "x$MYSQL_FUNCTION_TEST" = x then EXTRA_MYSQL_DEF="OLD_MYSQL=1 " AC_MSG_RESULT(found old MySQL) else AC_MSG_RESULT(found new MySQL) fi fi ]) dnl dnl Check whether the user wants log IP-addresses as strings rather dnl than as unsigned long-integers to his MySQL-database. Since this dnl feature is only used in ulogd_MYSQL.c, there are no checks in any dnl way. dnl AC_ARG_WITH(mysql-log-ip-as-string, --with-mysql-log-ip-as-string log IPs as string rather than as unsigned long-integer. ,[ EXTRA_MYSQL_DEF="${EXTRA_MYSQL_DEF} -DIP_AS_STRING=1" AC_MSG_WARN(the use of --with-mysql-log-ip-as-string is discouraged) ]) AC_SUBST(DATABASE_DIR) AC_SUBST(DATABASE_LIB) AC_SUBST(DATABASE_LIB_DIR) AC_SUBST(DB_DEF) AC_SUBST(EXTRA_MYSQL_DEF) AC_SUBST(DATABASE_DRIVERS) AM_CONDITIONAL(HAVE_MYSQL, test x$mysqldir != x) AC_OUTPUT(extensions/Makefile doc/Makefile conffile/Makefile libipulog/Makefile mysql/Makefile Makefile Rules.make)