mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Removed "make -C ..." in favor of a more portable method.
Added verbose output option to configure.
This commit is contained in:
@@ -58,114 +58,23 @@ AC_SUBST(MSC_REGRESSION_CONF_DIR)
|
||||
AC_SUBST(MSC_REGRESSION_LOGS_DIR)
|
||||
AC_SUBST(MSC_REGRESSION_DOCROOT_DIR)
|
||||
|
||||
# Find apxs
|
||||
AC_MSG_NOTICE(looking for Apache module support via DSO through APXS)
|
||||
AC_ARG_WITH(apxs,
|
||||
[AS_HELP_STRING([[--with-apxs=FILE]],
|
||||
[FILE is the path to apxs; defaults to "apxs".])],
|
||||
[
|
||||
if test "$withval" = "yes"; then
|
||||
APXS=apxs
|
||||
else
|
||||
APXS="$withval"
|
||||
fi
|
||||
])
|
||||
|
||||
if test -z "$APXS"; then
|
||||
for i in /usr/local/apache22/bin \
|
||||
/usr/local/apache2/bin \
|
||||
/usr/local/apache/bin \
|
||||
/usr/local/sbin \
|
||||
/usr/local/bin \
|
||||
/usr/sbin \
|
||||
/usr/bin;
|
||||
do
|
||||
if test -f "$i/apxs2"; then
|
||||
APXS="$i/apxs2"
|
||||
break
|
||||
elif test -f "$i/apxs"; then
|
||||
APXS="$i/apxs"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# arbitrarily picking the same version subversion looks for, don't know how
|
||||
# accurate this really is, but at least it'll force us to have apache2...
|
||||
HTTPD_WANTED_MMN=20020903
|
||||
|
||||
if test -n "$APXS" -a "$APXS" != "no" -a -x "$APXS" ; then
|
||||
APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
|
||||
if test -r $APXS_INCLUDE/httpd.h; then
|
||||
AC_MSG_NOTICE(found apxs at $APXS)
|
||||
AC_MSG_NOTICE(checking httpd version)
|
||||
AC_EGREP_CPP(VERSION_OK,
|
||||
[
|
||||
#include "$APXS_INCLUDE/ap_mmn.h"
|
||||
#if AP_MODULE_MAGIC_AT_LEAST($HTTPD_WANTED_MMN,0)
|
||||
VERSION_OK
|
||||
#endif],
|
||||
[AC_MSG_NOTICE(httpd is recent enough)],
|
||||
[AC_MSG_ERROR(apache is too old, mmn must be at least $HTTPD_WANTED_MMN)])
|
||||
fi
|
||||
APXS_INCLUDEDIR="`$APXS -q INCLUDEDIR`"
|
||||
# Make sure the include dir is used
|
||||
if test -n "$APXS_INCLUDEDIR"; then
|
||||
APXS_INCLUDES="-I${APXS_INCLUDEDIR} `$APXS -q INCLUDES` `$APXS -q EXTRA_INCLUDES`"
|
||||
else
|
||||
APXS_INCLUDES="`$APXS -q INCLUDES` `$APXS -q EXTRA_INCLUDES`"
|
||||
fi
|
||||
APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q EXTRA_CFLAGS`"
|
||||
APXS_LDFLAGS="`$APXS -q LDFLAGS` `$APXS -q EXTRA_LDFLAGS`"
|
||||
APXS_LIBDIR="`$APXS -q LIBDIR`"
|
||||
# Make sure the lib dir is used
|
||||
if test -n "$APXS_LIBDIR"; then
|
||||
APXS_LIBS="-L{$APXS_LIBDIR} `$APXS -q LIBS` `$APXS -q EXTRA_LIBS`"
|
||||
else
|
||||
APXS_LIBS="`$APXS -q LIBS` `$APXS -q EXTRA_LIBS`"
|
||||
fi
|
||||
APXS_LIBTOOL="`$APXS -q LIBTOOL`"
|
||||
APXS_CC="`$APXS -q CC`"
|
||||
APXS_BINDIR="`$APXS -q BINDIR`"
|
||||
APXS_SBINDIR="`$APXS -q SBINDIR`"
|
||||
APXS_PROGNAME="`$APXS -q PROGNAME`"
|
||||
APXS_LIBEXECDIR="`$APXS -q LIBEXECDIR`"
|
||||
if test "$APXS_SBINDIR" = "/"; then
|
||||
APXS_HTTPD="$APXS_SBINDIR/$APXS_PROGNAME"
|
||||
else
|
||||
APXS_HTTPD="$APXS_SBINDIR/$APXS_PROGNAME"
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR(couldn't find APXS)
|
||||
fi
|
||||
|
||||
# Use Apache httpd source srclib as base for pcre, apr and apu config scripts
|
||||
AC_ARG_WITH(httpd-src,
|
||||
[AS_HELP_STRING([[--with-httpd-src=PATH]],
|
||||
[PATH is to the Apache httpd source tree where srclib will be used as a base for pcre, apr and apu config scripts.])],
|
||||
[
|
||||
if test -n "$withval"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$withval/srclib/pcre"
|
||||
LDFLAGS="$LDFLAGS -L$withval/srclib/pcre"
|
||||
pcre_path="$withval/srclib/pcre"
|
||||
apr_path="$withval/srclib/apr"
|
||||
apu_path="$withval/srclib/apr-util"
|
||||
else
|
||||
AC_MSG_ERROR(--with-httpd-src requires a path)
|
||||
fi
|
||||
])
|
||||
|
||||
# Include M4 macros
|
||||
sinclude(build/find_pcre.m4)
|
||||
sinclude(build/find_apr.m4)
|
||||
sinclude(build/find_apu.m4)
|
||||
sinclude(build/find_xml.m4)
|
||||
sinclude(build/find_lua.m4)
|
||||
sinclude(build/find_curl.m4)
|
||||
|
||||
|
||||
### Configure Options
|
||||
|
||||
# Verbose output
|
||||
AC_ARG_ENABLE(verbose-output,
|
||||
AS_HELP_STRING([--enable-verbose-output],
|
||||
[Enable more verbose configure output.]),
|
||||
[
|
||||
if test "$enableval" != "no"; then
|
||||
verbose_output=1
|
||||
else
|
||||
verbose_output=0
|
||||
fi
|
||||
],
|
||||
[
|
||||
verbose_output=0
|
||||
])
|
||||
|
||||
# Strict Compile
|
||||
AC_ARG_ENABLE(strict-compile,
|
||||
AS_HELP_STRING([--enable-strict-compile],
|
||||
@@ -271,6 +180,125 @@ AC_ARG_ENABLE(modsec-api,
|
||||
modsec_api=
|
||||
])
|
||||
|
||||
# Find apxs
|
||||
AC_MSG_NOTICE(looking for Apache module support via DSO through APXS)
|
||||
AC_ARG_WITH(apxs,
|
||||
[AS_HELP_STRING([[--with-apxs=FILE]],
|
||||
[FILE is the path to apxs; defaults to "apxs".])],
|
||||
[
|
||||
if test "$withval" = "yes"; then
|
||||
APXS=apxs
|
||||
else
|
||||
APXS="$withval"
|
||||
fi
|
||||
])
|
||||
|
||||
if test -z "$APXS"; then
|
||||
for i in /usr/local/apache22/bin \
|
||||
/usr/local/apache2/bin \
|
||||
/usr/local/apache/bin \
|
||||
/usr/local/sbin \
|
||||
/usr/local/bin \
|
||||
/usr/sbin \
|
||||
/usr/bin;
|
||||
do
|
||||
if test -f "$i/apxs2"; then
|
||||
APXS="$i/apxs2"
|
||||
break
|
||||
elif test -f "$i/apxs"; then
|
||||
APXS="$i/apxs"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# arbitrarily picking the same version subversion looks for, don't know how
|
||||
# accurate this really is, but at least it'll force us to have apache2...
|
||||
HTTPD_WANTED_MMN=20020903
|
||||
|
||||
if test -n "$APXS" -a "$APXS" != "no" -a -x "$APXS" ; then
|
||||
APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
|
||||
if test -r $APXS_INCLUDE/httpd.h; then
|
||||
AC_MSG_NOTICE(found apxs at $APXS)
|
||||
AC_MSG_NOTICE(checking httpd version)
|
||||
AC_EGREP_CPP(VERSION_OK,
|
||||
[
|
||||
#include "$APXS_INCLUDE/ap_mmn.h"
|
||||
#if AP_MODULE_MAGIC_AT_LEAST($HTTPD_WANTED_MMN,0)
|
||||
VERSION_OK
|
||||
#endif],
|
||||
[AC_MSG_NOTICE(httpd is recent enough)],
|
||||
[AC_MSG_ERROR(apache is too old, mmn must be at least $HTTPD_WANTED_MMN)])
|
||||
fi
|
||||
APXS_INCLUDEDIR="`$APXS -q INCLUDEDIR`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs INCLUDEDIR: $APXS_INCLUDEDIR); fi
|
||||
# Make sure the include dir is used
|
||||
if test -n "$APXS_INCLUDEDIR"; then
|
||||
APXS_INCLUDES="-I${APXS_INCLUDEDIR} `$APXS -q INCLUDES` `$APXS -q EXTRA_INCLUDES`"
|
||||
else
|
||||
APXS_INCLUDES="`$APXS -q INCLUDES` `$APXS -q EXTRA_INCLUDES`"
|
||||
fi
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs INCLUDES: $APXS_INCLUDES); fi
|
||||
APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q EXTRA_CFLAGS`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs CFLAGS: $APXS_CFLAGS); fi
|
||||
APXS_LDFLAGS="`$APXS -q LDFLAGS` `$APXS -q EXTRA_LDFLAGS`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs LDFLAGS: $APXS_LDFLAGS); fi
|
||||
APXS_LIBDIR="`$APXS -q LIBDIR`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs LIBDIR: $APXS_LIBDIR); fi
|
||||
# Make sure the lib dir is used
|
||||
if test -n "$APXS_LIBDIR"; then
|
||||
APXS_LIBS="-L{$APXS_LIBDIR} `$APXS -q LIBS` `$APXS -q EXTRA_LIBS`"
|
||||
else
|
||||
APXS_LIBS="`$APXS -q LIBS` `$APXS -q EXTRA_LIBS`"
|
||||
fi
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs LIBS: $APXS_LIBS); fi
|
||||
APXS_LIBTOOL="`$APXS -q LIBTOOL`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs LIBTOOL: $APXS_LIBTOOL); fi
|
||||
APXS_CC="`$APXS -q CC`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs CC: $APXS_CC); fi
|
||||
APXS_BINDIR="`$APXS -q BINDIR`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs BINDIR: $APXS_BINDIR); fi
|
||||
APXS_SBINDIR="`$APXS -q SBINDIR`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs SBINDIR: $APXS_SBINDIR); fi
|
||||
APXS_PROGNAME="`$APXS -q PROGNAME`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs PROGNAME: $APXS_PROGNAME); fi
|
||||
APXS_LIBEXECDIR="`$APXS -q LIBEXECDIR`"
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs LIBEXECDIR: $APXS_LIBEXECDIR); fi
|
||||
if test "$APXS_SBINDIR" = "/"; then
|
||||
APXS_HTTPD="$APXS_SBINDIR/$APXS_PROGNAME"
|
||||
else
|
||||
APXS_HTTPD="$APXS_SBINDIR/$APXS_PROGNAME"
|
||||
fi
|
||||
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs HTTPD: $APXS_HTTPD); fi
|
||||
else
|
||||
AC_MSG_ERROR(couldn't find APXS)
|
||||
fi
|
||||
|
||||
# Use Apache httpd source srclib as base for pcre, apr and apu config scripts
|
||||
AC_ARG_WITH(httpd-src,
|
||||
[AS_HELP_STRING([[--with-httpd-src=PATH]],
|
||||
[PATH is to the Apache httpd source tree where srclib will be used as a base for pcre, apr and apu config scripts.])],
|
||||
[
|
||||
if test -n "$withval"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$withval/srclib/pcre"
|
||||
LDFLAGS="$LDFLAGS -L$withval/srclib/pcre"
|
||||
pcre_path="$withval/srclib/pcre"
|
||||
apr_path="$withval/srclib/apr"
|
||||
apu_path="$withval/srclib/apr-util"
|
||||
else
|
||||
AC_MSG_ERROR(--with-httpd-src requires a path)
|
||||
fi
|
||||
])
|
||||
|
||||
# Include M4 macros
|
||||
sinclude(build/find_pcre.m4)
|
||||
sinclude(build/find_apr.m4)
|
||||
sinclude(build/find_apu.m4)
|
||||
sinclude(build/find_xml.m4)
|
||||
sinclude(build/find_lua.m4)
|
||||
sinclude(build/find_curl.m4)
|
||||
|
||||
|
||||
### Build *EXTRA_CFLAGS vars
|
||||
|
||||
if test -n "$debug_mem"; then
|
||||
|
Reference in New Issue
Block a user