summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-11-17 01:43:36 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2017-11-17 02:05:32 +0100
commitbd2173796d90db181c22034e4acbe391d2cb57ce (patch)
tree5c60d304553fc9e5540fa8d5004992266c02d507
parent0a433101824b510f1e480c6365e401bd7d7fcd82 (diff)
add --enable-sanitize config option
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index dcec465..4d65c2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,18 @@ AC_CONFIG_MACRO_DIR([m4])
PKG_CHECK_MODULES(LIBTALLOC, talloc)
+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 "