mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Adds configure option to [disa|ena]ble the library examples
This commit is contained in:
parent
936ec0b479
commit
ee996a8373
@ -3,11 +3,16 @@ if TEST_UTILITIES
|
|||||||
export MAYBE_TEST = test
|
export MAYBE_TEST = test
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if EXAMPLES
|
||||||
|
export MAYBE_EXAMPLES = examples
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
SUBDIRS = \
|
SUBDIRS = \
|
||||||
others \
|
others \
|
||||||
src \
|
src \
|
||||||
doc \
|
doc \
|
||||||
examples \
|
$(MAYBE_EXAMPLES) \
|
||||||
$(MAYBE_TEST)
|
$(MAYBE_TEST)
|
||||||
|
|
||||||
|
|
||||||
|
34
configure.ac
34
configure.ac
@ -234,6 +234,20 @@ AC_ARG_ENABLE(afl-fuzz,
|
|||||||
[aflFuzzer=false]
|
[aflFuzzer=false]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
AC_ARG_ENABLE(examples,
|
||||||
|
[AC_HELP_STRING([--enable-examples],[Turn on the examples compilation (default option)])],
|
||||||
|
|
||||||
|
[case "${enableval}" in
|
||||||
|
yes) buildExamples=true ;;
|
||||||
|
no) buildExamples=false ;;
|
||||||
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-examples) ;;
|
||||||
|
esac],
|
||||||
|
|
||||||
|
[buildExamples=true]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Decide if we want to build the tests or not.
|
# Decide if we want to build the tests or not.
|
||||||
buildTestUtilities=false
|
buildTestUtilities=false
|
||||||
@ -253,6 +267,8 @@ if test $buildTestUtilities = true; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AM_CONDITIONAL([EXAMPLES], [test $buildExamples = true])
|
||||||
|
|
||||||
|
|
||||||
# General link options
|
# General link options
|
||||||
if test "$PLATFORM" != "MacOSX"; then
|
if test "$PLATFORM" != "MacOSX"; then
|
||||||
@ -263,6 +279,7 @@ if test "$aflFuzzer" == "true"; then
|
|||||||
FUZZ_CPPCFLAGS="-fsanitize=address -fsanitize-coverage=edge,indirect-calls,8bit-counters "
|
FUZZ_CPPCFLAGS="-fsanitize=address -fsanitize-coverage=edge,indirect-calls,8bit-counters "
|
||||||
GLOBAL_LDADD="$GLOBAL_LDADD -fsanitize=address "
|
GLOBAL_LDADD="$GLOBAL_LDADD -fsanitize=address "
|
||||||
GLOBAL_CPPFLAGS="$GLOBAL_CPPFLAGS $FUZZ_CPPCFLAGS"
|
GLOBAL_CPPFLAGS="$GLOBAL_CPPFLAGS $FUZZ_CPPCFLAGS"
|
||||||
|
$buildExamples = false
|
||||||
fi
|
fi
|
||||||
AC_SUBST(GLOBAL_LDADD)
|
AC_SUBST(GLOBAL_LDADD)
|
||||||
AC_SUBST(GLOBAL_CPPFLAGS)
|
AC_SUBST(GLOBAL_CPPFLAGS)
|
||||||
@ -277,15 +294,17 @@ AC_CONFIG_FILES([\
|
|||||||
Makefile \
|
Makefile \
|
||||||
doc/Makefile \
|
doc/Makefile \
|
||||||
src/Makefile \
|
src/Makefile \
|
||||||
others/Makefile \
|
others/Makefile
|
||||||
examples/Makefile \
|
|
||||||
examples/simple_example_using_c/Makefile \
|
|
||||||
examples/multiprocess_c/Makefile \
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AM_COND_IF([TEST_UTILITIES],
|
AM_COND_IF([TEST_UTILITIES],
|
||||||
[AC_CONFIG_FILES([test/Makefile test/benchmark/Makefile])])
|
[AC_CONFIG_FILES([test/Makefile test/benchmark/Makefile])])
|
||||||
|
|
||||||
|
AM_COND_IF([EXAMPLES],
|
||||||
|
[AC_CONFIG_FILES([examples/Makefile \
|
||||||
|
examples/simple_example_using_c/Makefile \
|
||||||
|
examples/multiprocess_c/Makefile])])
|
||||||
|
|
||||||
AM_COND_IF([AFL_FUZZER],
|
AM_COND_IF([AFL_FUZZER],
|
||||||
[AC_CONFIG_FILES([test/fuzzer/Makefile])])
|
[AC_CONFIG_FILES([test/fuzzer/Makefile])])
|
||||||
|
|
||||||
@ -440,6 +459,13 @@ else
|
|||||||
echo " + afl fuzzer ....disabled"
|
echo " + afl fuzzer ....disabled"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$buildExamples" = "true"; then
|
||||||
|
echo " + library examples ....enabled"
|
||||||
|
else
|
||||||
|
echo " + library examples ....disabled"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user