aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-11-17 01:43:36 +0100
committerHarald Welte <laforge@gnumonks.org>2017-11-18 10:17:25 +0000
commit17b773acd1c0c0ddf53180efb1f67ef7de4b7ffe (patch)
tree698237df9a53ffa9c8b3f26ee20628f23af056e5 /configure.ac
parent2ddf399c5f387874da8085a309a813791a80b5e1 (diff)
add --enable-sanitize config option
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index f741441..a66ed26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,18 @@ AC_SUBST(found_sqlite3)
dnl Checks for typedefs, structures and compiler characteristics
+AC_ARG_ENABLE(sanitize,
+ [AS_HELP_STRING(
+ [--enable-sanitize],
+ [Compile with address sanitizer enabled],
+ )],
+ [sanitize=$enableval], [sanitize="no"])
+if test x"$sanitize" = x"yes"
+then
+ CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
+ CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
+fi
+
# The following test is taken from WebKit's webkit.m4
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden "