AC_INIT AC_PREREQ(2.59) AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE(prelude-correlator, 0.9.0-beta1b) AM_CONFIG_HEADER(config.h) AM_DISABLE_STATIC AM_MAINTAINER_MODE dnl ********************************************************** dnl * Check required program. dnl ********************************************************** AC_PROG_CPP AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET dnl ********************************************************** dnl * Setup GnuLib, libtool and libltdl. dnl ********************************************************** gl_EARLY AC_LIBTOOL_DLOPEN AM_DISABLE_STATIC AC_PROG_LIBTOOL 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.15.2, libprelude=yes, libprelude=no) if test x$libprelude != xyes; then AC_MSG_ERROR(libprelude is required in order to build prelude-correlator.) fi dnl ************************************************** dnl * Check for PCRE * dnl ************************************************** AC_PATH_PROG(PCRE_CONFIG, pcre-config, no) if test x$PCRE_CONFIG = xno; then AC_MSG_ERROR(PCRE 4.1 or higher is required to build Prelude-LML. Get it from http://www.pcre.org .) fi PCRE_LIBS=`$PCRE_CONFIG --libs` PCRE_CFLAGS=`$PCRE_CONFIG --cflags` LIBS_bkp=$LIBS LIBS="$LIBS $PCRE_LIBS" CPPFLAGS_bkp=$CPPFLAGS CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS" AC_CHECK_LIB(pcre, pcre_get_named_substring, , AC_MSG_ERROR(PCRE 4.1 or higher is required to build Prelude-LML. Get it from http://www.pcre.org .) ) LIBS=$LIBS_bkp CPPFLAGS=$CPPFLAGS_bkp AC_SUBST(PCRE_LIBS) AC_SUBST(PCRE_CFLAGS) dnl ************************************************** dnl * LUA support * dnl ************************************************** PKG_CHECK_MODULES(LUA, lua >= 5.1, [], [ PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1) ]) dnl ************************************************** dnl * Typedefs, structures, compiler characteristics.* dnl ************************************************** AC_C_CONST AC_TYPE_UID_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_HEADER_TIME AC_TYPE_SIGNAL AC_C_INLINE AC_C_BIGENDIAN AC_SYS_LARGEFILE dnl ************************************************** dnl * Setup custom compiler 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_C_CHECK_FLAG(-no-cpp-precomp, , , GLOBAL_CFLAGS="$GLOBAL_CFLAGS -no-cpp-precomp") ;; *) AC_MSG_RESULT(none needed) ;; esac AX_LD_CHECK_FLAG(-z relro, , , LDFLAGS="$LDFLAGS -z relro") AX_LD_CHECK_FLAG(-z now, , , LDFLAGS="$LDFLAGS -z now") for i in -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ -Wbad-function-cast -Wcast-qual -Wcast-align -Wnested-externs -Wunused \ -Wformat -Wformat-security; do AX_C_CHECK_FLAG($i, , , GLOBAL_CFLAGS="$GLOBAL_CFLAGS $i") done if test x$buggy_pthread_initializers = xyes; then AX_C_CHECK_FLAG(-Wno-missing-braces, , , GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Wno-missing-braces") fi dnl ************************************************** dnl * Setup build variable * dnl ************************************************** AS_AC_EXPAND(LIBDIR, $libdir) AS_AC_EXPAND(DATADIR, $datadir) AS_AC_EXPAND(DOCDIR, $docdir) AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir) PRELUDE_CORRELATOR_CONF=$SYSCONFDIR/prelude-correlator/prelude-correlator.conf AC_SUBST(PRELUDE_CORRELATOR_CONF) PRELUDE_CORRELATOR_CONTEXT_DIR=$LOCALSTATEDIR/lib/prelude-correlator AC_SUBST(PRELUDE_CORRELATOR_CONTEXT_DIR) PRELUDE_CORRELATOR_CONFDIR=$SYSCONFDIR/prelude-correlator AC_SUBST(PRELUDE_CORRELATOR_CONFDIR) CORRELATION_PLUGIN_DIR=$LIBDIR/prelude-correlator AC_SUBST(CORRELATION_PLUGIN_DIR) LUA_DATADIR="$DATADIR/prelude-correlator/lua" AC_SUBST(LUA_DATADIR) AC_DEFINE_UNQUOTED(PRELUDE_CORRELATOR_CONF, "$PRELUDE_CORRELATOR_CONF", Path to Prelude-Correlator configuration file) AC_DEFINE_UNQUOTED(PRELUDE_CORRELATOR_CONTEXT_DIR, "$PRELUDE_CORRELATOR_CONTEXT_DIR", Path to Prelude-Correlator runtime file) AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(GLOBAL_CFLAGS) AC_SUBST(PRELUDE_MANAGER_CFLAGS) AC_CONFIG_FILES([ Makefile prelude-correlator.conf libmissing/Makefile src/Makefile src/include/Makefile plugins/Makefile plugins/lua/Makefile plugins/lua/ruleset/Makefile ]) AC_OUTPUT