dnl Process this file with autoconf to produce a configure script. AC_INIT(src) AC_PREREQ(2.53) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(prelude-manager, 0.9.0-rc1) AM_CONFIG_HEADER(config.h) AM_DISABLE_STATIC AM_MAINTAINER_MODE AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL dnl Checks for programs. AC_PROG_CC AC_PROG_CPP gl_EARLY AC_PROG_INSTALL AC_PROG_MAKE_SET AC_C_INLINE AC_C_BIGENDIAN AC_SYS_LARGEFILE AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) if test "x$prefix" = "xNONE"; then prefix="/usr/local" fi if test "x$localstatedir" = "x\${prefix}/var"; then localstatedir="$prefix/var" fi if test "x$sysconfdir" = "x\${prefix}/etc"; then sysconfdir="$prefix/etc" fi if test "x$datadir" = "x\${prefix}/share"; then datadir="$prefix/share" fi dnl ************************************************** dnl * Check for missing function replacement * dnl ************************************************** gl_SOURCE_BASE(libmissing) gl_M4_BASE(libmissing/m4) gl_INIT dnl ************************************************** dnl * Check for libprelude * dnl ************************************************** AM_PATH_LIBPRELUDE(0.9.0, , AC_MSG_ERROR(Cannot find libprelude: Is libprelude-config in the path?) ) defined="$defined $LIBPRELUDE_PTHREAD_CFLAGS -DPRELUDE_CONFIG_DIR=\\\"$LIBPRELUDE_CONFIG_PREFIX\\\"" dnl ************************************************** dnl * Check for libpreludedb * dnl ************************************************** AM_PATH_LIBPRELUDEDB(0.9.0, enable_libpreludedb=yes, enable_libpreludedb=no) AM_CONDITIONAL(HAVE_LIBPRELUDEDB, test x$enable_libpreludedb = xyes) AC_SUBST(HAVE_LIBPRELUDEDB) dnl ******************************************************** dnl * Check for the Libxml2 * dnl ******************************************************** AM_PATH_XML2(, enable_xmlmod=yes, enable_xmlmod=no) AM_CONDITIONAL(HAVE_XML2, test x$enable_xmlmod = xyes) AC_SUBST(HAVE_XML2) dnl ************************************************** dnl * TCP WRAPPER CHECK * dnl ************************************************** AC_CHECK_HEADER(tcpd.h, have_tcpd_header=yes) if test x$have_tcpd_header = xyes; then AC_MSG_CHECKING(whether to use TCP wrappers) for tcpd_lib_path in /usr/lib /usr/local/lib; do if test -f $tcpd_lib_path/libwrap.a; then libwrap="$tcpd_lib_path/libwrap.a" break fi done if test -n "$libwrap"; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_CHECK_LIB(nsl, yp_get_default_domain, libnsl="-lnsl") AC_MSG_CHECKING(whether -lwrap require -lnsl) tcpd_ldflags="-L$tcpd_lib_path $libwrap" orig_libs=$LIBS LIBS="$LIBS $tcpd_ldflags" AC_TRY_LINK([extern int hosts_access; int allow_severity, deny_severity;], [return hosts_access;], [have_tcp_wrapper=yes libnsl=""], [LIBS="$LIBS $libnsl" AC_TRY_LINK([extern int hosts_access; int allow_severity, deny_severity;], [return hosts_access;], have_tcp_wrapper=yes) ]) if test -n "$libnsl"; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi LIBWRAP_LIBS="$LIBS" LIBS=$orig_libs if test x$have_tcp_wrapper = xyes; then AC_DEFINE_UNQUOTED(HAVE_TCP_WRAPPERS, , Define wether you have TCP wrapper installed on your system) AC_SUBST(LIBWRAP_LIBS) fi fi dnl Add -no-cpp-precomp to avoid GNU macro extension parsing errors on OSX AC_MSG_CHECKING("whether we need to add -no-cpp-precomp") if test $host_cpu = "powerpc" && test $host_vendor = "apple"; then AC_MSG_RESULT(yes) CPPFLAGS="$CPPFLAGS -no-cpp-precomp" else AC_MSG_RESULT(no) fi dnl ************************************************** dnl * Check for accept() prototype * dnl ************************************************** AC_PROTOTYPE_ACCEPT AC_DEFINE(socklen_t, ACCEPT_ARG3, Define socklen_t to accept third argument type) dnl ************************************************** dnl * Check for Ipv6. * dnl ************************************************** AC_CHECK_TYPES([struct sockaddr_in6], have_ipv6_type=yes,, [ #include #include #include ]) AC_CHECK_DECL(AF_INET6, have_ipv6_def=yes,, [ #include #include #include ]) if test x$have_ipv6_type = xyes && test x$have_ipv6_def = xyes; then AC_DEFINE_UNQUOTED(HAVE_IPV6, , Define wether Ipv6 is available on this system) fi dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME dnl Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(gettimeofday select socket strdup strerror strstr) configdir=$sysconfdir/prelude-manager prelude_manager_conf=$configdir/prelude-manager.conf plugindir=$libdir/prelude-manager report_plugin_dir=$plugindir/reports decode_plugin_dir=$plugindir/decodes filter_plugin_dir=$plugindir/filters db_plugin_dir=$plugindir/db manager_fifo_dir=$localstatedir/spool/prelude-manager manager_data_dir=$datadir/prelude-manager manager_run_dir=$localstatedir/run/prelude-manager AC_DEFINE_UNQUOTED(PRELUDE_MANAGER_CONFDIR, "$configdir", Define the Prelude Manager configuration directory) AC_DEFINE_UNQUOTED(PRELUDE_MANAGER_CONF, "$prelude_manager_conf", Define the Prelude Manager configuration file path) AC_SUBST(manager_data_dir) AC_SUBST(defined) AC_SUBST(configdir) AC_SUBST(localstatedir) AC_SUBST(prelude_manager_conf) AC_SUBST(report_plugin_dir) AC_SUBST(decode_plugin_dir) AC_SUBST(filter_plugin_dir) AC_SUBST(LIBWRAP_LIBS) AC_SUBST(manager_fifo_dir) AC_SUBST(manager_run_dir) AX_CFLAGS_GCC_OPTION(-Wall) AX_CFLAGS_GCC_OPTION(-Wstrict-prototypes) AX_CFLAGS_GCC_OPTION(-Wmissing-prototypes) AX_CFLAGS_GCC_OPTION(-Wmissing-declarations) AX_CFLAGS_GCC_OPTION(-Wbad-function-cast) AX_CFLAGS_GCC_OPTION(-Wcast-qual) AX_CFLAGS_GCC_OPTION(-Wcast-align) AX_CFLAGS_GCC_OPTION(-Wnested-externs) AX_CFLAGS_GCC_OPTION(-Wunused) AC_SUBST(CFLAGS) AC_OUTPUT([ Makefile libmissing/Makefile prelude-manager.conf src/Makefile src/include/Makefile plugins/Makefile plugins/decodes/Makefile plugins/filters/Makefile plugins/filters/idmef-criteria/Makefile plugins/reports/Makefile plugins/reports/db/Makefile plugins/reports/debug/Makefile plugins/reports/relaying/Makefile plugins/reports/textmod/Makefile plugins/reports/xmlmod/Makefile ]) echo echo "*** Dumping configuration ***" echo " - Enable Xml plugin : $enable_xmlmod"; echo " - Enable database support: $enable_libpreludedb";