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
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT
AC_PREREQ(2.59)
AC_CANONICAL_TARGET([])
AM_INIT_AUTOMAKE(prelude-lml, 1.0.0)
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
AC_PATH_PROG(GREP, grep, no)
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 * Typedefs, structures, compiler characteristics.*
dnl **************************************************
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_TYPE_SIGNAL
AC_C_INLINE
AC_SYS_LARGEFILE
AC_CHECK_HEADERS_ONCE(sys/filio.h)
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
dnl **************************************************
dnl * Check for libprelude *
dnl **************************************************
AM_PATH_LIBPRELUDE(0.9.8, ,
AC_MSG_ERROR(Cannot find libprelude: Is libprelude-config in the path?), false)
dnl **************************************************
dnl * Check for libICU *
dnl **************************************************
PKG_CHECK_MODULES([ICU], [icu >= 3.0], [enable_icu=yes],
[AC_CHECK_ICU(3.8, enable_icu=yes, enable_icu=no)])
if test x$enable_icu = xyes; then
AC_DEFINE_UNQUOTED(HAVE_LIBICU, , Tell whether libicu is available for encoding convertion)
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 * Configure embedded libev *
dnl ********************************************************
AC_DEFINE_UNQUOTED(EV_PERIODIC_ENABLE, 0, Disable unused libev periodic timers)
AC_DEFINE_UNQUOTED(EV_IDLE_ENABLE, 0, Disable unused libev idle watchers)
AC_DEFINE_UNQUOTED(EV_FORK_ENABLE, 0, Disable unused libev fork watchers)
AC_DEFINE_UNQUOTED(EV_EMBED_ENABLE, 0, Disable unused libev embed watchers)
AC_DEFINE_UNQUOTED(EV_MULTIPLICITY, 0, Disable support for multiple libev event loop)
m4_include([libev/libev.m4])
dnl **************************************************
dnl * Setup build variable *
dnl **************************************************
AS_AC_EXPAND(LIBDIR, $libdir)
AS_AC_EXPAND(DATADIR, $datadir)
AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
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
AC_DEFINE_UNQUOTED(PRELUDE_LML_CONF, "$prelude_lml_conf", Path to the LML configuration file)
AC_DEFINE_UNQUOTED(LOG_PLUGIN_DIR, "$plugindir", Prelude-LML report plugin directory)
AC_DEFINE_UNQUOTED(REGEX_CONF, "$regex_conf", Prelude-LML plugin regex configuration)
AC_DEFINE_UNQUOTED(METADATA_DIR, "$metadata_dir", Prelude-LML Metadata directory)
AC_SUBST(configdir)
AC_SUBST(metadata_dir)
AC_SUBST(localstatedir)
AC_SUBST(GLOBAL_CFLAGS)
AC_CONFIG_FILES([
prelude-lml.conf
plugins.rules
Makefile
libev/Makefile
libmissing/Makefile
libmissing/tests/Makefile
m4/Makefile
src/Makefile
src/include/Makefile
plugins/Makefile
plugins/debug/Makefile
plugins/pcre/Makefile
plugins/pcre/ruleset/Makefile
plugins/pcre/ruleset/unsupported/Makefile
tests/Makefile
])
AC_OUTPUT
echo
echo "*** Dumping configuration ***"
echo " - Favor libICU over Iconv : $enable_icu"
echo " - Enable unsupported rulesets: $enable_unsupported_rulesets"
|