diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-11-17 01:43:36 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-11-17 02:05:32 +0100 |
commit | bd2173796d90db181c22034e4acbe391d2cb57ce (patch) | |
tree | 5c60d304553fc9e5540fa8d5004992266c02d507 | |
parent | 0a433101824b510f1e480c6365e401bd7d7fcd82 (diff) |
add --enable-sanitize config option
Change-Id: I8f641c4bce361dcef5d8c149b8b81b21f12cbadf
-rw-r--r-- | configure.ac | 12 |
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 " |