1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
|
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.4)
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.6, 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, [ --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_ENABLE(fam, [ --enable-fam Enable support for realtime file notification using FAM [default=auto]],
enable_fam="$enableval", enable_fam="$enableval")
AC_ARG_WITH(fam, [ --with-fam=DIR use DIR where fam is installed.],
[FAM_CFLAGS="-I$withval/include"; FAM_LDFLAGS="-L$withval/lib"])
if test x$enable_fam = xyes; then
old_LIBS=$LIBS
old_LDFLAGS=$LDFLAGS
old_CPPFLAGS=$CPPFLAGS
LDFLAGS="$LDFLAGS $FAM_LDFLAGS"
CPPFLAGS="$CPPFLAGS $FAM_CFLAGS"
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=""
enable_fam=no;
else
enable_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$enable_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 <stdio.h>
#include <sys/types.h>
#include <sys/socket.h> ])
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 : $enable_fam"
echo " - Enable unsupported rulesets: : $enable_unsupported_rulesets"
|