dnl Process this file with autoconf to produce a configure script. AC_INIT AC_PREREQ(2.50) AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE(prelude-lml, 0.9.5) 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_LIBTOOL_DLOPEN AM_PROG_LIBTOOL AM_PROG_LEX AC_PROG_YACC AC_SYS_LARGEFILE 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 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.8, libprelude=yes, libprelude=no) if test x$libprelude != xyes; then AC_MSG_ERROR(libprelude is required in order to build prelude-lml.) 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 * Check for unsupported ruleset install request * dnl ************************************************** AC_ARG_ENABLE(unsupported-rulesets, AC_HELP_STRING(--enable-unsupported-rulesets, Enable install of unsupported rulesets [default=no]), enable_unsupported_rulesets="$enableval", enable_unsupported_rulesets="$enableval") AM_CONDITIONAL(ENABLE_UNSUPPORTED_RULESETS, test x$enable_unsupported_rulesets = xyes) dnl ************************************************** dnl * Check for FAM. * dnl ************************************************** AC_ARG_WITH(fam, AC_HELP_STRING(--with-fam@<:@=PATH@:>@, Path where FAM is installed @<:@default=auto@:>@), fam_required=true, with_fam=yes) if test x$with_fam != xno; then old_LIBS=$LIBS old_LDFLAGS=$LDFLAGS old_CPPFLAGS=$CPPFLAGS if test x$with_fam != xyes; then FAM_LIBS="-L$with_fam/lib" FAM_CFLAGS="-I$with_fam/include" LDFLAGS="$LDFLAGS -L$with_fam/lib" CPPFLAGS="$CPPFLAGS -I$with_fam/include" fi AC_CHECK_HEADER(fam.h, , fam_header_ok="no") AC_CHECK_LIB(fam, FAMOpen, , fam_lib_ok="no") LIBS="$old_LIBS" LDFLAGS="$old_LDFLAGS" CPPFLAGS="$old_CPPFLAGS" if test "$fam_header_ok" = "no" -o "$fam_lib_ok" = "no"; then FAM_LIBS="" FAM_CFLAGS="" FAM_LDFLAGS="" with_fam=no; else with_fam=yes; FAM_LIBS="-lfam" AC_DEFINE(HAVE_FAM, , Tell whether FAM support should be compiled in) fi fi AC_SUBST(FAM_LIBS) AC_SUBST(FAM_CFLAGS) AC_SUBST(FAM_LDFLAGS) AM_CONDITIONAL(HAVE_FAM, test x$with_fam = xyes) dnl ************************************************** dnl * Check what type to use in place of socklen_t * dnl ************************************************** AC_PROTOTYPE_RECVFROM AC_CHECK_TYPES([socklen_t], , AC_DEFINE(socklen_t, RECVFROM_ARG6, Define socklen_t to accept third argument type), [ #include #include #include ]) AC_CHECK_DECL(FILENAME_MAX, have_filename_max=yes, have_filename_max=no) if test x$have_filename_max = xno; then AC_DEFINE_UNQUOTED(FILENAME_MAX, 256, Define the maximum value of a filename) 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 configdir=$sysconfdir/prelude-lml prelude_lml_conf=$configdir/prelude-lml.conf regex_conf=$configdir/plugins.rules metadata_dir=$localstatedir/lib/prelude-lml plugindir=$libdir/prelude-lml log_plugin_dir=$plugindir AC_DEFINE_UNQUOTED(PRELUDE_LML_CONF, "$prelude_lml_conf", Path to the LML configuration file) defined="$defined $LIBPRELUDE_CFLAGS $PCRE_CFLAGS" AC_SUBST(defined) AC_SUBST(configdir) AC_SUBST(localstatedir) AC_SUBST(prelude_lml_conf) AC_SUBST(regex_conf) AC_SUBST(log_plugin_dir) AC_SUBST(LIBWRAP_LIBS) AC_SUBST(metadata_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_CONFIG_FILES([ prelude-lml.conf plugins.rules Makefile libmissing/Makefile src/Makefile src/include/Makefile plugins/Makefile plugins/debug/Makefile plugins/pcre/Makefile plugins/pcre/ruleset/Makefile plugins/pcre/ruleset/unsupported/Makefile ]) AC_OUTPUT echo echo "*** Dumping configuration ***" echo " - Enable FAM support : $with_fam" echo " - Enable unsupported rulesets: : $enable_unsupported_rulesets"