Makes DebugLogs optional by compilation flag

This commit is contained in:
Felipe Zimmerle 2015-11-26 17:11:40 -03:00
parent fbf8ea74f3
commit a69e49a1b0
3 changed files with 48 additions and 11 deletions

View File

@ -1,16 +1,13 @@
ACLOCAL_AMFLAGS = -I build
if WITH_YAJL
WITH_TESTS = tests
if TEST_UTILITIES
export MAYBE_TEST = test
endif
SUBDIRS = \
src \
doc \
examples \
$(WITH_TESTS)
$(MAYBE_TEST)
# make clean

View File

@ -185,12 +185,37 @@ MSC_GIT_VERSION=msc_version_git
AC_SUBST([MSC_GIT_VERSION])
# MODSEC_NO_LOGS="-DNO_LOGS=1"
# AC_SUBST(MODSEC_NO_LOGS)
AC_ARG_ENABLE(debug-logs,
[AC_HELP_STRING([--disable-debug-logs],[Turn off the SecDebugLog feature])],
[case "${enableval}" in
yes) debugLogs=true ;;
no) debugLogs=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-logs) ;;
esac],
[debugLogs=true]
)
if test "$debugLogs" != "true"; then
MODSEC_NO_LOGS="-DNO_LOGS=1"
AC_SUBST(MODSEC_NO_LOGS)
fi
# Decide if we want to build the tests or not.
buildTestUtilities=false
if test "x$YAJL_FOUND" = "x1"; then
# Regression tests will not be able to run without the logging support.
# But we still have the unit tests.
# if test "$debugLogs" = "true"; then
buildTestUtilities=true
# fi
fi
AM_CONDITIONAL([TEST_UTILITIES], [test $buildTestUtilities = true])
# Files to be generated via autotools.
AM_CONDITIONAL([WITH_YAJL], [test "$want_test" = yes])
AC_CONFIG_FILES([\
Makefile \
doc/Makefile \
@ -288,3 +313,20 @@ if test "x$YAJL_FOUND" = "x2"; then
fi
echo " "
echo " Other Options"
if test $buildTestUtilities = true; then
if test $debugLogs = true; then
echo " + Test Utilities ....enabled"
else
echo " + Test Utilities ....partially"
fi
else
echo " + Test Utilities ....disabled"
fi
if test $debugLogs = true; then
echo " + SecDebugLog ....enabled"
else
echo " + SecDebugLog ....disabled"
fi
echo " "

View File

@ -1,6 +1,4 @@
ACLOCAL_AMFLAGS = -I build
SUBDIRS = \
benchmark