dnl Process this file with autoconf to produce a configure script. AC_INIT AC_PREREQ(2.59) AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE(prelude-manager, 0.9.7) AM_CONFIG_HEADER(config.h) AM_DISABLE_STATIC AM_MAINTAINER_MODE dnl Checks for programs. AC_PROG_CPP AC_PROG_CC gl_EARLY AC_PROG_INSTALL AC_PROG_MAKE_SET AC_C_INLINE AC_C_BIGENDIAN AC_SYS_LARGEFILE AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL 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 platform specific flags * dnl ********************************************************** AC_MSG_CHECKING(for platform-specific compiler flags) case "$host_os" in darwin*) # # It may be called "cc", but it's really a GCC derivative # with a problematic special precompiler and precompiled # headers; turn off the special precompiler, as some # apparently-legal code won't compile with its precompiled # headers. # AC_MSG_RESULT(Darwin: adding -no-cpp-precomp) AX_CFLAGS_GCC_OPTION(-no-cpp-precomp) ;; *) AC_MSG_RESULT(none needed) ;; esac 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.7, , 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 *** Can we use -Werror -Wmissing-braces for some checks ? *** AX_CFLAGS_GCC_OPTION(-Werror -Wmissing-braces, buggy_pthread_cppflags) old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $buggy_pthread_cppflags" AC_MSG_CHECKING(for buggy pthread mutex initializers) AC_TRY_COMPILE( [ #include ], [ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; ], compile_ok="yes", compile_ok="no") CFLAGS="$old_CFLAGS" if test x$compile_ok = xyes; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) buggy_pthread_initializers="yes" fi dnl ************************************************** dnl * Check for GnuTLS. * dnl ************************************************** AM_PATH_LIBGNUTLS(1.0.17, gnutls=yes, gnutls=no) if test x$gnutls != xyes; then AC_MSG_ERROR(libgnutls is required in order to build prelude-manager.) fi old_CPPFLAGS=$CPPFLAGS CPPFLAGS="$LIBGNUTLS_CFLAGS" AC_CHECK_HEADER(gnutls/gnutls.h, , AC_MSG_ERROR("libgnutls development headers are required to build libprelude")) CPPFLAGS=$old_CPPFLAGS dnl ************************************************** dnl * Check for libpreludedb * dnl ************************************************** AM_PATH_LIBPRELUDEDB(0.9.4, enable_libpreludedb=yes, enable_libpreludedb=no) AM_CONDITIONAL(HAVE_LIBPRELUDEDB, test x$enable_libpreludedb = xyes) 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) dnl ************************************************** dnl * TCP WRAPPER CHECK * dnl ************************************************** AC_ARG_WITH(libwrap, AC_HELP_STRING(--with-libwrap@<:@=PFX@:>@, Compile in libwrap (tcp_wrappers) support @<:@default=auto@:>@.), libwrap_required=true, with_libwrap="yes") if test x$with_libwrap != xno; then LIBWRAP_INCLUDE="tcpd.h" if test -d $with_libwrap; then LIBWRAP_PATH="$with_libwrap" LIBWRAP_INCLUDE="$with_libwrap/include/tcpd.h" fi AC_CHECK_HEADER($LIBWRAP_INCLUDE, with_libwrap=yes, with_libwrap=no) if test x$with_libwrap = xyes; then AC_CHECK_LIB(wrap, request_init, LIBWRAP_LIBS="-L$LIBWRAP_PATH/lib -lwrap") AC_CHECK_LIB(nsl, yp_get_default_domain, LIBNSL_LIBS="-lnsl") AC_MSG_CHECKING(whether -lwrap require -lnsl) old_LIBS=$LIBS LIBS=$LIBWRAP_LIBS AC_TRY_LINK([extern int hosts_access; int allow_severity, deny_severity;], [return hosts_access;], with_libwrap=yes, with_libwrap=no) require_nsl="no" if test x$with_libwrap = xno; then LIBS="$LIBNSL_LIBS $LIBS" AC_TRY_LINK([extern int hosts_access; int allow_severity, deny_severity;], [return hosts_access;], [with_libwrap=yes require_nsl="yes"], with_libwrap=no) fi AC_MSG_RESULT($require_nsl) fi LIBWRAP_LIBS=$LIBS LIBS=$old_LIBS if test x$libwrap_required = xtrue && test x$with_libwrap = xno; then AC_MSG_ERROR([Could not find libwrap library]) fi fi if test x$with_libwrap = xyes; then AC_DEFINE_UNQUOTED(HAVE_TCP_WRAPPERS, [], Define if tcp wrapper support is enabled) fi 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 typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_UID_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME dnl Checks for library functions. AC_TYPE_SIGNAL 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_failover_dir=$localstatedir/spool/prelude-manager/failover manager_scheduler_dir=$localstatedir/spool/prelude-manager/scheduler 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_scheduler_dir) AC_SUBST(manager_failover_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) if test x$buggy_pthread_initializers = xyes; then AX_CFLAGS_GCC_OPTION(-Wno-missing-braces) fi AC_SUBST(CFLAGS) AC_CONFIG_FILES([ Makefile libmissing/Makefile prelude-manager.conf src/Makefile src/include/Makefile plugins/Makefile plugins/decodes/Makefile plugins/decodes/normalize/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 ]) AC_OUTPUT echo echo "*** Dumping configuration ***" echo " - TCP wrapper support : $with_libwrap"; echo " - XML plugin support : $enable_xmlmod"; echo " - Database plugin support: $enable_libpreludedb";