|
Packit |
284210 |
dnl
|
|
Packit |
284210 |
dnl Autoconf configuration for ModSecurity
|
|
Packit |
284210 |
dnl
|
|
Packit |
284210 |
dnl Use ./autogen.sh to produce a configure script
|
|
Packit |
284210 |
dnl
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AC_PREREQ(2.63)
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AC_INIT([modsecurity], [2.9], [support@modsecurity.org])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AC_CONFIG_MACRO_DIR([build])
|
|
Packit |
284210 |
AC_CONFIG_SRCDIR([LICENSE])
|
|
Packit |
284210 |
AC_CONFIG_HEADERS([apache2/modsecurity_config_auto.h])
|
|
Packit |
284210 |
AC_CONFIG_AUX_DIR([build])
|
|
Packit |
284210 |
AC_PREFIX_DEFAULT([/usr/local/modsecurity])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
|
|
Packit |
284210 |
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
LT_PREREQ([2.2])
|
|
Packit |
284210 |
LT_INIT([dlopen])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Checks for programs.
|
|
Packit |
284210 |
AC_PROG_AWK
|
|
Packit |
284210 |
AC_PROG_CC
|
|
Packit |
284210 |
AC_PROG_CPP
|
|
Packit |
284210 |
AC_PROG_INSTALL
|
|
Packit |
284210 |
AC_PROG_LN_S
|
|
Packit |
284210 |
AC_PROG_MAKE_SET
|
|
Packit |
284210 |
AC_PROG_GREP
|
|
Packit |
284210 |
AC_PATH_PROGS(PERL, [perl perl5], )
|
|
Packit |
284210 |
AC_PATH_PROGS(ENV_CMD, [env printenv], )
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Checks for header files.
|
|
Packit |
284210 |
AC_HEADER_STDC
|
|
Packit |
284210 |
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h sys/types.h sys/stat.h sys/utsname.h])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Checks for typedefs, structures, and compiler characteristics.
|
|
Packit |
284210 |
AC_C_CONST
|
|
Packit |
284210 |
AC_C_INLINE
|
|
Packit |
284210 |
AC_C_RESTRICT
|
|
Packit |
284210 |
AC_TYPE_PID_T
|
|
Packit |
284210 |
AC_TYPE_SIZE_T
|
|
Packit |
284210 |
AC_STRUCT_TM
|
|
Packit |
284210 |
AC_TYPE_UINT8_T
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Checks for library functions.
|
|
Packit |
284210 |
AC_FUNC_MALLOC
|
|
Packit |
284210 |
AC_FUNC_MEMCMP
|
|
Packit |
284210 |
AC_CHECK_FUNCS([atexit getcwd memmove memset strcasecmp strchr strdup strerror strncasecmp strrchr strstr strtol fchmod strcasestr])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Some directories
|
|
Packit |
284210 |
MSC_BASE_DIR=`pwd`
|
|
Packit |
284210 |
MSC_PKGBASE_DIR="$MSC_BASE_DIR/.."
|
|
Packit |
284210 |
MSC_TEST_DIR="$MSC_BASE_DIR/tests"
|
|
Packit |
284210 |
MSC_REGRESSION_DIR="$MSC_TEST_DIR/regression"
|
|
Packit |
284210 |
MSC_REGRESSION_SERVERROOT_DIR="$MSC_REGRESSION_DIR/server_root"
|
|
Packit |
284210 |
MSC_REGRESSION_CONF_DIR="$MSC_REGRESSION_SERVERROOT_DIR/conf"
|
|
Packit |
284210 |
MSC_REGRESSION_LOGS_DIR="$MSC_REGRESSION_SERVERROOT_DIR/logs"
|
|
Packit |
284210 |
MSC_REGRESSION_DOCROOT_DIR="$MSC_REGRESSION_SERVERROOT_DIR/htdocs"
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AC_SUBST(MSC_BASE_DIR)
|
|
Packit |
284210 |
AC_SUBST(MSC_PKGBASE_DIR)
|
|
Packit |
284210 |
AC_SUBST(MSC_TEST_DIR)
|
|
Packit |
284210 |
AC_SUBST(MSC_REGRESSION_DIR)
|
|
Packit |
284210 |
AC_SUBST(MSC_REGRESSION_SERVERROOT_DIR)
|
|
Packit |
284210 |
AC_SUBST(MSC_REGRESSION_CONF_DIR)
|
|
Packit |
284210 |
AC_SUBST(MSC_REGRESSION_LOGS_DIR)
|
|
Packit |
284210 |
AC_SUBST(MSC_REGRESSION_DOCROOT_DIR)
|
|
Packit |
284210 |
|
|
Packit |
284210 |
### Configure Options
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Verbose output
|
|
Packit |
284210 |
AC_ARG_ENABLE(verbose-output,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-verbose-output],
|
|
Packit |
284210 |
[Enable more verbose configure output.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
verbose_output=1
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
verbose_output=0
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
verbose_output=0
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
#OS type
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AC_CANONICAL_HOST
|
|
Packit |
284210 |
CANONICAL_HOST=$host
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AH_TEMPLATE([AIX], [Define if the operating system is AIX])
|
|
Packit |
284210 |
AH_TEMPLATE([LINUX], [Define if the operating system is LINUX])
|
|
Packit |
284210 |
AH_TEMPLATE([OPENBSD], [Define if the operating system is OpenBSD])
|
|
Packit |
284210 |
AH_TEMPLATE([SOLARIS], [Define if the operating system is SOLARIS])
|
|
Packit |
284210 |
AH_TEMPLATE([HPUX], [Define if the operating system is HPUX])
|
|
Packit |
284210 |
AH_TEMPLATE([MACOSX], [Define if the operating system is Macintosh OSX])
|
|
Packit |
284210 |
AH_TEMPLATE([FREEBSD], [Define if the operating system is FREEBSD])
|
|
Packit |
284210 |
AH_TEMPLATE([NETBSD], [Define if the operating system is NetBSD])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
case $host in
|
|
Packit |
284210 |
*-*-aix*)
|
|
Packit |
284210 |
echo "Checking platform... Identified as AIX"
|
|
Packit |
284210 |
aixos=true
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
*-*-hpux*)
|
|
Packit |
284210 |
echo "Checking platform... Identified as HPUX"
|
|
Packit |
284210 |
hpuxos=true
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
*-*-darwin*)
|
|
Packit |
284210 |
echo "Checking platform... Identified as Macintosh OS X"
|
|
Packit |
284210 |
macos=true
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
*-*-linux*)
|
|
Packit |
284210 |
echo "Checking platform... Identified as Linux"
|
|
Packit |
284210 |
linuxos=true
|
|
Packit |
284210 |
case "${host_cpu}" in
|
|
Packit |
284210 |
s390x)
|
|
Packit |
284210 |
cpu_type="-DLINUX_S390"
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
esac
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
*-*-solaris*)
|
|
Packit |
284210 |
echo "Checking platform... Identified as Solaris"
|
|
Packit |
284210 |
solarisos=true
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
*-*-freebsd*)
|
|
Packit |
284210 |
echo "Checking platform... Identified as FreeBSD"
|
|
Packit |
284210 |
freebsdos=true
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
*-*-netbsd*)
|
|
Packit |
284210 |
echo "Checking platform... Identified as NetBSD"
|
|
Packit |
284210 |
netbsdos=true
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
*-*-openbsd*)
|
|
Packit |
284210 |
echo "Checking platform... Identified as OpenBSD"
|
|
Packit |
284210 |
openbsdos=true
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
*-*-kfreebsd*)
|
|
Packit |
284210 |
echo "Checking platform... Identified as kFreeBSD, treating as linux"
|
|
Packit |
284210 |
linuxos=true
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
*-*-gnu*.*)
|
|
Packit |
284210 |
echo "Checking platform... Identified as HURD, treating as linux"
|
|
Packit |
284210 |
linuxos=true
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
*)
|
|
Packit |
284210 |
echo "Unknown CANONICAL_HOST $host"
|
|
Packit |
284210 |
exit
|
|
Packit |
284210 |
;;
|
|
Packit |
284210 |
esac
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AM_CONDITIONAL([AIX], [test x$aixos = xtrue])
|
|
Packit |
284210 |
AM_CONDITIONAL([HPUX], [test x$hpuxos = xtrue])
|
|
Packit |
284210 |
AM_CONDITIONAL([MACOSX], [test x$macos = xtrue])
|
|
Packit |
284210 |
AM_CONDITIONAL([LINUX], [test x$linuxos = xtrue])
|
|
Packit |
284210 |
AM_CONDITIONAL([LINUX390], [test x$linuxos390 = xtrue])
|
|
Packit |
284210 |
AM_CONDITIONAL([SOLARIS], [test x$solarisos = xtrue])
|
|
Packit |
284210 |
AM_CONDITIONAL([FREEBSD], [test x$freebsdos = xtrue])
|
|
Packit |
284210 |
AM_CONDITIONAL([OPENBSD], [test x$openbsdos = xtrue])
|
|
Packit |
284210 |
AM_CONDITIONAL([NETBSD], [test x$netbsdos = xtrue])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
#Subdirs
|
|
Packit |
284210 |
TOPLEVEL_SUBDIRS="tools"
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Apache2 Module
|
|
Packit |
284210 |
AC_ARG_ENABLE(apache2-module,
|
|
Packit |
284210 |
AS_HELP_STRING([--disable-apache2-module],
|
|
Packit |
284210 |
[Disable building Apache2 module.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
build_apache2_module=1
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
build_apache2_module=0
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
build_apache2_module=1
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
AM_CONDITIONAL([BUILD_APACHE2_MODULE], [test "$build_apache2_module" -eq 1])
|
|
Packit |
284210 |
if test "$build_apache2_module" -eq 1; then
|
|
Packit |
284210 |
TOPLEVEL_SUBDIRS="$TOPLEVEL_SUBDIRS apache2"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Standalone Module
|
|
Packit |
284210 |
AC_ARG_ENABLE(standalone-module,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-standalone-module],
|
|
Packit |
284210 |
[Enable building standalone module.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
build_standalone_module=1
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
build_standalone_module=0
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
build_standalone_module=0
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
AM_CONDITIONAL([BUILD_STANDALONE_MODULE], [test "$build_standalone_module" -eq 1])
|
|
Packit |
284210 |
if test "$build_standalone_module" -eq 1; then
|
|
Packit |
284210 |
TOPLEVEL_SUBDIRS="$TOPLEVEL_SUBDIRS standalone"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Extensions
|
|
Packit |
284210 |
AC_ARG_ENABLE(extentions,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-extentions],
|
|
Packit |
284210 |
[Enable building extension.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
build_extentions=1
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
build_extentions=0
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
build_extentions=0
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
AM_CONDITIONAL([BUILD_extentions], [test "$build_extentions" -eq 1])
|
|
Packit |
284210 |
if test "$build_extentions" -eq 1; then
|
|
Packit |
284210 |
TOPLEVEL_SUBDIRS="$TOPLEVEL_SUBDIRS ext"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Mlogc
|
|
Packit |
284210 |
AC_ARG_ENABLE(mlogc,
|
|
Packit |
284210 |
AS_HELP_STRING([--disable-mlogc],
|
|
Packit |
284210 |
[Disable building mlogc.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
build_mlogc=1
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
build_mlogc=0
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
build_mlogc=1
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
CHECK_CURL()
|
|
Packit |
284210 |
|
|
Packit |
284210 |
if test -z "${CURL_VERSION}"; then
|
|
Packit |
284210 |
AC_MSG_NOTICE([NOTE: mlgoc compilation was disabled.])
|
|
Packit |
284210 |
build_mlogc=0
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AM_CONDITIONAL([BUILD_MLOGC], [test "$build_mlogc" -eq 1])
|
|
Packit |
284210 |
if test "$build_mlogc" -eq 1; then
|
|
Packit |
284210 |
TOPLEVEL_SUBDIRS="$TOPLEVEL_SUBDIRS mlogc"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Audit Log Parser v2 (ALP2)
|
|
Packit |
284210 |
AC_ARG_ENABLE(alp2,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-alp2],
|
|
Packit |
284210 |
[Enable building audit log parser lib.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
build_alp2=1
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
build_alp2=0
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
build_alp2=0
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
AM_CONDITIONAL([BUILD_ALP2], [test "$build_alp2" -eq 1])
|
|
Packit |
284210 |
if test "$build_alp2" -eq 1; then
|
|
Packit |
284210 |
TOPLEVEL_SUBDIRS="$TOPLEVEL_SUBDIRS alp2"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Documentation
|
|
Packit |
284210 |
AC_ARG_ENABLE(docs,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-docs],
|
|
Packit |
284210 |
[Enable building documentation.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
build_docs=1
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
build_docs=0
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
build_docs=0
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
AM_CONDITIONAL([BUILD_DOCS], [test "$build_docs" -eq 1])
|
|
Packit |
284210 |
if test "$build_docs" -eq 1; then
|
|
Packit |
284210 |
TOPLEVEL_SUBDIRS="$TOPLEVEL_SUBDIRS doc"
|
|
Packit |
284210 |
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
|
Packit |
284210 |
if test -z "$DOXYGEN"; then
|
|
Packit |
284210 |
AC_MSG_WARN([Doxygen not found - continue without Doxygen support])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
if test "$build_apache2_module" -eq 1; then
|
|
Packit |
284210 |
AC_CONFIG_FILES([doc/doxygen-apache])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
if test "$build_standalone_module" -eq 1; then
|
|
Packit |
284210 |
AC_CONFIG_FILES([doc/doxygen-nginx])
|
|
Packit |
284210 |
AC_CONFIG_FILES([doc/doxygen-iis])
|
|
Packit |
284210 |
AC_CONFIG_FILES([doc/doxygen-standalone])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
AC_CONFIG_FILES([doc/Makefile])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Add PCRE Studying
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AC_ARG_ENABLE(pcre-study,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-pcre-study],
|
|
Packit |
284210 |
[Enable PCRE regex studying during configure.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
pcre_study='-DWITH_PCRE_STUDY'
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $pcre_study"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
pcre_study=''
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
pcre_study='-DWITH_PCRE_STUDY'
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Add PCRE JIT
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AC_ARG_ENABLE(pcre-jit,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-pcre-jit],
|
|
Packit |
284210 |
[Enable PCRE regex jit support during configure.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
pcre_jit='-DWITH_PCRE_JIT'
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $pcre_jit"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
pcre_jit=''
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
pcre_jit=''
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Limit PCRE matching
|
|
Packit |
284210 |
AC_ARG_ENABLE(pcre-match-limit,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-pcre-match-limit],
|
|
Packit |
284210 |
[Enable PCRE regex match limit during configure.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" = "yes"; then
|
|
Packit |
284210 |
AC_MSG_ERROR([PCRE match limits require a numeric value])
|
|
Packit |
284210 |
elif test "$enableval" = "no"; then
|
|
Packit |
284210 |
pcre_match_limit=''
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
pcre_match_limit="-DMODSEC_PCRE_MATCH_LIMIT=$enableval"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $pcre_match_limit"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
pcre_match_limit='-DMODSEC_PCRE_MATCH_LIMIT=1500'
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Limit PCRE matching recursion
|
|
Packit |
284210 |
AC_ARG_ENABLE(pcre-match-limit-recursion,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-pcre-match-limit-recursion],
|
|
Packit |
284210 |
[Enable PCRE regex match limit recursion during configure.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" = "yes"; then
|
|
Packit |
284210 |
AC_MSG_ERROR([PCRE match limits require a numeric value])
|
|
Packit |
284210 |
elif test "$enableval" = "no"; then
|
|
Packit |
284210 |
pcre_match_limit_recursion=''
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
pcre_match_limit_recursion="-DMODSEC_PCRE_MATCH_LIMIT_RECURSION=$enableval"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $pcre_match_limit_recursion"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
pcre_match_limit_recursion='-DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500'
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Enable Lua per transaction cache
|
|
Packit |
284210 |
AC_ARG_ENABLE(lua-cache,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-lua-cache],
|
|
Packit |
284210 |
[Enable Lua per transaction cache.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
lua_cache="-DCACHE_LUA"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $lua_cache"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
lua_cache=
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
lua_cache=
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Enable phase-1 in post_read_request
|
|
Packit |
284210 |
AC_ARG_ENABLE(htaccess-config,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-htaccess-config],
|
|
Packit |
284210 |
[Enable some mod_security directives into htaccess files.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
htaccess_config="-DHTACCESS_CONFIG"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $htaccess_config"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
htaccess_config=
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
htaccess_config=
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Enable phase-1 in post_read_request
|
|
Packit |
284210 |
AC_ARG_ENABLE(request-early,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-request-early],
|
|
Packit |
284210 |
[Place phase1 into post_read_request hook. default is hook_request_early]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
request_early="-DREQUEST_EARLY"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $request_early"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
request_early=
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
request_early='-DREQUEST_EARLY'
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Enable duplicate rules id
|
|
Packit |
284210 |
AC_ARG_ENABLE(rule-id-validation,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-rule-id-validation],
|
|
Packit |
284210 |
[Forbid duplicate rule ids and missing ones. This is the default]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
unique_id=
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
unique_id="-DALLOW_ID_NOT_UNIQUE"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $unique_id"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
unique_id=''
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Disable logging of filename
|
|
Packit |
284210 |
AC_ARG_ENABLE(filename-logging,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-filename-logging],
|
|
Packit |
284210 |
[Enable logging of filename in audit log. This is the default]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
log_filename=
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
log_filename="-DLOG_NO_FILENAME"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
log_filename=''
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Disable logging of "Server"
|
|
Packit |
284210 |
AC_ARG_ENABLE(server-logging,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-server-logging],
|
|
Packit |
284210 |
[Enable logging of "Server" in audit log when log level < 9. This is the default]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
log_server=
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
log_server="-DLOG_NO_SERVER"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
log_server=''
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Disable logging of problem when deleting collection
|
|
Packit |
284210 |
AC_ARG_ENABLE(collection-delete-problem-logging,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-collection-delete-problem-logging],
|
|
Packit |
284210 |
[Enable logging of collection delete problem even when log level is < 9. This is the default]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
log_collection_delete_problem=
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
log_collection_delete_problem="-DLOG_NO_COLL_DELET_PB"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
log_collection_delete_problem=''
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Disable logging of Apache handler
|
|
Packit |
284210 |
AC_ARG_ENABLE(handler-logging,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-handler-logging],
|
|
Packit |
284210 |
[Enable logging of Apache handler in audit log even when log level is < 9. This is the default]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
log_handler=
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
log_handler="-DLOG_NO_HANDLER"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
log_handler=''
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Disable logging of dechunking
|
|
Packit |
284210 |
AC_ARG_ENABLE(dechunk-logging,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-dechunk-logging],
|
|
Packit |
284210 |
[Enable logging of dechunking even when log level is < 9. This is the default]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
log_dechunk=
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
log_dechunk="-DLOG_NO_DECHUNK"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
log_dechunk=''
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Disable logging of stopwatches
|
|
Packit |
284210 |
AC_ARG_ENABLE(stopwatch-logging,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-stopwatch-logging],
|
|
Packit |
284210 |
[Enable logging of stopwatches even when log level is < 9. This is the default]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
log_stopwatch=
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
log_stopwatch="-DLOG_NO_STOPWATCH"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
log_stopwatch=''
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Disable logging of server context
|
|
Packit |
284210 |
AC_ARG_ENABLE(server-context-logging,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-server-context-logging],
|
|
Packit |
284210 |
[Enable logging of server info (log producer, sanitized objects, ...) in audit log even when log level < 9. This is the default]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
log_server_context=
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
log_server_context="-DLOG_NO_SERVER_CONTEXT"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
log_server_context=''
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Enable collection's global lock
|
|
Packit |
284210 |
AC_ARG_ENABLE(collection-global-lock,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-collection-global-lock],
|
|
Packit |
284210 |
[Enable collection correctness by using a global lock. May reduce performance significatively. This is disabled by default]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "yes"; then
|
|
Packit |
284210 |
collection_global_lock=""
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
collection_global_lock="-DGLOBAL_COLLECTION_LOCK"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
collection_global_lock=''
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Ignore configure errors
|
|
Packit |
284210 |
AC_ARG_ENABLE(errors,
|
|
Packit |
284210 |
AS_HELP_STRING([--disable-errors],
|
|
Packit |
284210 |
[Disable errors during configure.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
report_errors=1
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
report_errors=0
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
report_errors=1
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Strict Compile
|
|
Packit |
284210 |
AC_ARG_ENABLE(strict-compile,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-strict-compile],
|
|
Packit |
284210 |
[Enable strict compilation (warnings are errors).]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
strict_compile="-std=c99 -Wstrict-overflow=1 -Wextra -Wno-missing-field-initializers -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-unused-parameter -Wformat -Wformat-security -Werror -fstack-protector -D_FORTIFY_SOURCE=2"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $strict_compile"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
strict_compile=
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
strict_compile=
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# DEBUG_CONF
|
|
Packit |
284210 |
AC_ARG_ENABLE(debug-conf,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-debug-conf],
|
|
Packit |
284210 |
[Enable debug during configuration.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
debug_conf="-DDEBUG_CONF"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $debug_conf"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
debug_conf=
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
debug_conf=
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# CACHE_DEBUG
|
|
Packit |
284210 |
AC_ARG_ENABLE(debug-cache,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-debug-cache],
|
|
Packit |
284210 |
[Enable debug for transformation caching.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
debug_cache="-DCACHE_DEBUG"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $debug_cache"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
debug_cache=
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
debug_cache=
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# DEBUG_ACMP
|
|
Packit |
284210 |
AC_ARG_ENABLE(debug-acmp,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-debug-acmp],
|
|
Packit |
284210 |
[Enable debugging acmp code.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
debug_acmp="-DDEBUG_ACMP"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $debug_acmp"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
debug_acmp=
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
debug_acmp=
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# DEBUG_MEM
|
|
Packit |
284210 |
AC_ARG_ENABLE(debug-mem,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-debug-mem],
|
|
Packit |
284210 |
[Enable debug during configuration.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
debug_mem="-DDEBUG_MEM"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $debug_mem"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
debug_mem=
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
debug_mem=
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# PERFORMANCE_MEASUREMENT
|
|
Packit |
284210 |
AC_ARG_ENABLE(performance-measurement,
|
|
Packit |
284210 |
AS_HELP_STRING([--enable-performance-measurement],
|
|
Packit |
284210 |
[Enable performance-measurement stats.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "no"; then
|
|
Packit |
284210 |
perf_meas="-DPERFORMANCE_MEASUREMENT"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $perf_meas"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
perf_meas=
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
perf_meas=
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# NO_MODSEC_API
|
|
Packit |
284210 |
AC_ARG_ENABLE(modsec-api,
|
|
Packit |
284210 |
AS_HELP_STRING([--disable-modsec-api],
|
|
Packit |
284210 |
[Disable the API; compiling against some older Apache versions require this.]),
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$enableval" != "yes"; then
|
|
Packit |
284210 |
modsec_api="-DNO_MODSEC_API"
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $modsec_api"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
modsec_api=
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
modsec_api=
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Find apxs
|
|
Packit |
284210 |
AC_MSG_NOTICE(looking for Apache module support via DSO through APXS)
|
|
Packit |
284210 |
AC_ARG_WITH(apxs,
|
|
Packit |
284210 |
[AS_HELP_STRING([[--with-apxs=FILE]],
|
|
Packit |
284210 |
[FILE is the path to apxs; defaults to "apxs".])],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$withval" = "yes"; then
|
|
Packit |
284210 |
APXS=apxs
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
APXS="$withval"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
if test -z "$APXS"; then
|
|
Packit |
284210 |
for i in /usr/local/apache22/bin \
|
|
Packit |
284210 |
/usr/local/apache2/bin \
|
|
Packit |
284210 |
/usr/local/apache/bin \
|
|
Packit |
284210 |
/usr/local/sbin \
|
|
Packit |
284210 |
/usr/local/bin \
|
|
Packit |
284210 |
/usr/sbin \
|
|
Packit |
284210 |
/usr/bin;
|
|
Packit |
284210 |
do
|
|
Packit |
284210 |
if test -f "$i/apxs2"; then
|
|
Packit |
284210 |
APXS="$i/apxs2"
|
|
Packit |
284210 |
break
|
|
Packit |
284210 |
elif test -f "$i/apxs"; then
|
|
Packit |
284210 |
APXS="$i/apxs"
|
|
Packit |
284210 |
break
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
done
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# arbitrarily picking the same version subversion looks for, don't know how
|
|
Packit |
284210 |
# accurate this really is, but at least it'll force us to have apache2...
|
|
Packit |
284210 |
HTTPD_WANTED_MMN=20020903
|
|
Packit |
284210 |
|
|
Packit |
284210 |
if test -n "$APXS" -a "$APXS" != "no" -a -x "$APXS" ; then
|
|
Packit |
284210 |
APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
|
|
Packit |
284210 |
if test -r $APXS_INCLUDE/httpd.h; then
|
|
Packit |
284210 |
AC_MSG_NOTICE(found apxs at $APXS)
|
|
Packit |
284210 |
AC_MSG_NOTICE(checking httpd version)
|
|
Packit |
284210 |
AC_EGREP_CPP(VERSION_OK,
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
#include "$APXS_INCLUDE/ap_mmn.h"
|
|
Packit |
284210 |
#if AP_MODULE_MAGIC_AT_LEAST($HTTPD_WANTED_MMN,0)
|
|
Packit |
284210 |
VERSION_OK
|
|
Packit |
284210 |
#endif],
|
|
Packit |
284210 |
[AC_MSG_NOTICE(httpd is recent enough)],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
if test "$report_errors" -eq 1; then
|
|
Packit |
284210 |
AC_MSG_ERROR(apache is too old, mmn must be at least $HTTPD_WANTED_MMN)
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
AC_MSG_NOTICE(apache is too old, mmn must be at least $HTTPD_WANTED_MMN)
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
APXS_INCLUDEDIR="`$APXS -q INCLUDEDIR`"
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs INCLUDEDIR: $APXS_INCLUDEDIR); fi
|
|
Packit |
284210 |
# Make sure the include dir is used
|
|
Packit |
284210 |
if test -n "$APXS_INCLUDEDIR"; then
|
|
Packit |
284210 |
APXS_INCLUDES="-I${APXS_INCLUDEDIR} `$APXS -q INCLUDES` `$APXS -q EXTRA_INCLUDES`"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
APXS_INCLUDES="`$APXS -q INCLUDES` `$APXS -q EXTRA_INCLUDES`"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs INCLUDES: $APXS_INCLUDES); fi
|
|
Packit |
284210 |
APXS_CFLAGS=-I`$APXS -q INCLUDEDIR`
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs CFLAGS: $APXS_CFLAGS); fi
|
|
Packit |
284210 |
APXS_LDFLAGS=
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs LDFLAGS: $APXS_LDFLAGS); fi
|
|
Packit |
284210 |
APXS_LIBDIR="`$APXS -q LIBDIR`"
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs LIBDIR: $APXS_LIBDIR); fi
|
|
Packit |
284210 |
# Make sure the lib dir is used
|
|
Packit |
284210 |
if test -n "$APXS_LIBDIR"; then
|
|
Packit |
284210 |
APXS_LIBS="-L${APXS_LIBDIR} `$APXS -q LIBS` `$APXS -q EXTRA_LIBS`"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
APXS_LIBS="`$APXS -q LIBS` `$APXS -q EXTRA_LIBS`"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs LIBS: $APXS_LIBS); fi
|
|
Packit |
284210 |
APXS_LIBTOOL="`$APXS -q LIBTOOL`"
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs LIBTOOL: $APXS_LIBTOOL); fi
|
|
Packit |
284210 |
APXS_CC="`$APXS -q CC`"
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs CC: $APXS_CC); fi
|
|
Packit |
284210 |
APXS_BINDIR="`$APXS -q BINDIR`"
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs BINDIR: $APXS_BINDIR); fi
|
|
Packit |
284210 |
APXS_SBINDIR="`$APXS -q SBINDIR`"
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs SBINDIR: $APXS_SBINDIR); fi
|
|
Packit |
284210 |
APXS_PROGNAME="`$APXS -q PROGNAME`"
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs PROGNAME: $APXS_PROGNAME); fi
|
|
Packit |
284210 |
APXS_LIBEXECDIR="`$APXS -q LIBEXECDIR`"
|
|
Packit |
284210 |
if test "xx$APXS_LIBEXECDIR" = "xx"; then APXS_LIBEXECDIR="`$APXS -q LIBDIR`/modules"; fi
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs LIBEXECDIR: $APXS_LIBEXECDIR); fi
|
|
Packit |
284210 |
APXS_MODULES=$APXS_LIBEXECDIR
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs MODULES: $APXS_MODULES); fi
|
|
Packit |
284210 |
if test "$APXS_SBINDIR" = "/"; then
|
|
Packit |
284210 |
APXS_HTTPD="$APXS_SBINDIR/$APXS_PROGNAME"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
APXS_HTTPD="$APXS_SBINDIR/$APXS_PROGNAME"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs HTTPD: $APXS_HTTPD); fi
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
if test "$report_errors" -eq 1; then
|
|
Packit |
284210 |
AC_MSG_ERROR(couldn't find APXS)
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
AC_MSG_NOTICE(couldn't find APXS)
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
### Build *EXTRA_CFLAGS vars
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Allow overriding EXTRA_CFLAGS
|
|
Packit |
284210 |
if $ENV_CMD | $GREP "^EXTRA_CFLAGS" > /dev/null 2>&1; then
|
|
Packit |
284210 |
if test -z "$debug_mem"; then
|
|
Packit |
284210 |
EXTRA_CFLAGS="$EXTRA_CFLAGS $strict_compile"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
if test -n "$debug_mem"; then
|
|
Packit |
284210 |
EXTRA_CFLAGS="-O0 -g -Wall"
|
|
Packit |
284210 |
else
|
|
Packit |
284210 |
EXTRA_CFLAGS="-O2 -g -Wall $strict_compile"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$pcre_study $pcre_match_limit $pcre_match_limit_recursion $pcre_jit $request_early $htaccess_config $lua_cache $debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api $cpu_type $unique_id $log_filename $log_server $log_collection_delete_problem $log_dechunk $log_stopwatch $log_handler $log_server_contex $collection_global_lock"
|
|
Packit |
284210 |
|
|
Packit |
284210 |
APXS_WRAPPER=build/apxs-wrapper
|
|
Packit |
284210 |
APXS_EXTRA_CFLAGS=""
|
|
Packit |
284210 |
for f in $EXTRA_CFLAGS; do
|
|
Packit |
284210 |
APXS_EXTRA_CFLAGS="$APXS_EXTRA_CFLAGS -Wc,$f"
|
|
Packit |
284210 |
done;
|
|
Packit |
284210 |
MODSEC_APXS_EXTRA_CFLAGS=""
|
|
Packit |
284210 |
for f in $MODSEC_EXTRA_CFLAGS; do
|
|
Packit |
284210 |
MODSEC_APXS_EXTRA_CFLAGS="$MODSEC_APXS_EXTRA_CFLAGS -Wc,$f"
|
|
Packit |
284210 |
done;
|
|
Packit |
284210 |
|
|
Packit |
284210 |
### Substitute the vars
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AC_SUBST(TOPLEVEL_SUBDIRS)
|
|
Packit |
284210 |
AC_SUBST(EXTRA_CFLAGS)
|
|
Packit |
284210 |
AC_SUBST(MODSEC_EXTRA_CFLAGS)
|
|
Packit |
284210 |
AC_SUBST(APXS)
|
|
Packit |
284210 |
AC_SUBST(APXS_WRAPPER)
|
|
Packit |
284210 |
AC_SUBST(APXS_INCLUDEDIR)
|
|
Packit |
284210 |
AC_SUBST(APXS_INCLUDES)
|
|
Packit |
284210 |
AC_SUBST(APXS_EXTRA_CFLAGS)
|
|
Packit |
284210 |
AC_SUBST(MODSEC_APXS_EXTRA_CFLAGS)
|
|
Packit |
284210 |
AC_SUBST(APXS_LDFLAGS)
|
|
Packit |
284210 |
AC_SUBST(APXS_LIBS)
|
|
Packit |
284210 |
AC_SUBST(APXS_CFLAGS)
|
|
Packit |
284210 |
AC_SUBST(APXS_LIBTOOL)
|
|
Packit |
284210 |
AC_SUBST(APXS_CC)
|
|
Packit |
284210 |
AC_SUBST(APXS_LIBDIR)
|
|
Packit |
284210 |
AC_SUBST(APXS_BINDIR)
|
|
Packit |
284210 |
AC_SUBST(APXS_SBINDIR)
|
|
Packit |
284210 |
AC_SUBST(APXS_PROGNAME)
|
|
Packit |
284210 |
AC_SUBST(APXS_LIBEXECDIR)
|
|
Packit |
284210 |
AC_SUBST(APXS_MODULES)
|
|
Packit |
284210 |
AC_SUBST(APXS_HTTPD)
|
|
Packit |
284210 |
|
|
Packit |
284210 |
CHECK_PCRE()
|
|
Packit |
284210 |
if test "$build_apache2_module" -ne 0 -o "$build_mlogc" -ne 0; then
|
|
Packit |
284210 |
CHECK_APR()
|
|
Packit |
284210 |
CHECK_APU()
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
CHECK_LIBXML2()
|
|
Packit |
284210 |
CHECK_LUA()
|
|
Packit |
284210 |
#if test "$build_mlogc" -ne 0; then
|
|
Packit |
284210 |
#CHECK_CURL()
|
|
Packit |
284210 |
#fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Check for YAJL libs (for JSON body processor)
|
|
Packit |
284210 |
CHECK_YAJL()
|
|
Packit |
284210 |
#AC_SEARCH_LIBS([yajl_alloc], [yajl])
|
|
Packit |
284210 |
CHECK_SSDEEP()
|
|
Packit |
284210 |
#AC_SEARCH_LIBS([fuzzy_hash_buf], [fuzzy])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Temporarily set cflags for apr_crypto check, then restore
|
|
Packit |
284210 |
# since it's already used correctly to compile modsecurity module.
|
|
Packit |
284210 |
ORIG_CFLAGS="$CFLAGS $APU_CFLAGS"
|
|
Packit |
284210 |
ORIG_CPPFLAGS="$CPPFLAGS"
|
|
Packit |
284210 |
CFLAGS="$CFLAGS $APR_CFLAGS"
|
|
Packit |
284210 |
CPPFLAGS="$CPPFLAGS $APR_CPPFLAGS"
|
|
Packit |
284210 |
AC_TRY_COMPILE(
|
|
Packit |
284210 |
[#include <apr_crypto.h>],
|
|
Packit |
284210 |
[
|
|
Packit |
284210 |
#if APU_HAVE_CRYPTO == 0
|
|
Packit |
284210 |
#error APR util was not compiled with crypto support.
|
|
Packit |
284210 |
#endif
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[ AC_DEFINE([WITH_APU_CRYPTO], [1], [APR util was compiled with crypto support])
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS -DWITH_APU_CRYPTO"
|
|
Packit |
284210 |
],
|
|
Packit |
284210 |
[ AC_MSG_WARN([APR util was not compiled with crypto support. SecRemoteRule will not support the parameter 'crypto']) ]
|
|
Packit |
284210 |
)
|
|
Packit |
284210 |
# Restore env vars so that we don't clutter with duplicates that
|
|
Packit |
284210 |
# are eventually appended later on
|
|
Packit |
284210 |
CFLAGS="$ORIG_CFLAGS"
|
|
Packit |
284210 |
CPPFLAGS="$ORIG_CPPFLAGS"
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Current our unique download backend is curl, furhter we can support more.
|
|
Packit |
284210 |
if test ! -z "${CURL_VERSION}"; then
|
|
Packit |
284210 |
AC_DEFINE([WITH_REMOTE_RULES], [1], [Enables SecRemoteRules support])
|
|
Packit |
284210 |
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS -DWITH_REMOTE_RULES"
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AC_CONFIG_FILES([Makefile])
|
|
Packit |
284210 |
AC_CONFIG_FILES([tools/Makefile])
|
|
Packit |
284210 |
if test "$build_alp2" -ne 0; then
|
|
Packit |
284210 |
AC_CONFIG_FILES([alp2/Makefile])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
if test "$build_apache2_module" -ne 0; then
|
|
Packit |
284210 |
AC_CONFIG_FILES([apache2/Makefile])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
if test "$build_standalone_module" -ne 0; then
|
|
Packit |
284210 |
AC_CONFIG_FILES([standalone/Makefile])
|
|
Packit |
284210 |
AC_CONFIG_FILES([nginx/modsecurity/config])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
if test "$build_extentions" -ne 0; then
|
|
Packit |
284210 |
AC_CONFIG_FILES([ext/Makefile])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
AC_CONFIG_FILES([build/apxs-wrapper], [chmod +x build/apxs-wrapper])
|
|
Packit |
284210 |
if test -e "$PERL"; then
|
|
Packit |
284210 |
if test "$build_mlogc" -ne 0; then
|
|
Packit |
284210 |
AC_CONFIG_FILES([mlogc/mlogc-batch-load.pl], [chmod +x mlogc/mlogc-batch-load.pl])
|
|
Packit |
284210 |
AC_CONFIG_FILES([tests/regression/misc/40-secRemoteRules.t])
|
|
Packit |
284210 |
AC_CONFIG_FILES([tests/regression/misc/50-ipmatchfromfile-external.t])
|
|
Packit |
284210 |
AC_CONFIG_FILES([tests/regression/misc/60-pmfromfile-external.t])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
AC_CONFIG_FILES([tests/run-unit-tests.pl], [chmod +x tests/run-unit-tests.pl])
|
|
Packit |
284210 |
AC_CONFIG_FILES([tests/run-regression-tests.pl], [chmod +x tests/run-regression-tests.pl])
|
|
Packit |
284210 |
AC_CONFIG_FILES([tests/gen_rx-pm.pl], [chmod +x tests/gen_rx-pm.pl])
|
|
Packit |
284210 |
AC_CONFIG_FILES([tests/csv_rx-pm.pl], [chmod +x tests/csv_rx-pm.pl])
|
|
Packit |
284210 |
AC_CONFIG_FILES([tests/regression/server_root/conf/httpd.conf])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
# Perl based tools
|
|
Packit |
284210 |
AC_CONFIG_FILES([tools/rules-updater.pl], [chmod +x tools/rules-updater.pl])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
if test "$build_mlogc" -ne 0; then
|
|
Packit |
284210 |
AC_CONFIG_FILES([mlogc/Makefile])
|
|
Packit |
284210 |
fi
|
|
Packit |
284210 |
AC_CONFIG_FILES([tests/Makefile])
|
|
Packit |
284210 |
|
|
Packit |
284210 |
AC_OUTPUT
|