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:16:52 +0000
commitd1c232e1c4bb0155ea19faeb0f885075f84acf65 (patch)
tree2566e08b0e88a3907158f902bac93bc536a2837b /configure.ac
parent77a3c17e1b986f7fe1e8bfd56d4d141bc4402c22 (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 0daa5e2..9a6f963 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,6 +91,18 @@ AM_CONDITIONAL(HAVE_LIBCDK, test "$found_cdk" = yes)
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 "