From a69e49a1b0af3aa0bdb66ad60772330e0786afb3 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Thu, 26 Nov 2015 17:11:40 -0300 Subject: [PATCH] Makes DebugLogs optional by compilation flag --- Makefile.am | 9 +++------ configure.ac | 48 +++++++++++++++++++++++++++++++++++++++++++++--- test/Makefile.am | 2 -- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/Makefile.am b/Makefile.am index 35926775..c85e6759 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index 59245a36..eeb10658 100644 --- a/configure.ac +++ b/configure.ac @@ -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 " " diff --git a/test/Makefile.am b/test/Makefile.am index bf52afa7..a60e02ae 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,6 +1,4 @@ -ACLOCAL_AMFLAGS = -I build - SUBDIRS = \ benchmark