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:35 +0100 |
commit | 2e05f883f92909bb1a29b9b912d5c24200394839 (patch) | |
tree | ee567b388012f3e8e40ec0f5e63b305c33f6218b /configure.ac | |
parent | 323d39d784417b5582098d6a27b24f94bb2e1d12 (diff) |
add --enable-sanitize config option
Change-Id: I59fea4a7199ca6aa71710d3aca0b25425df7d346
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index eb7733e..0e07330 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,18 @@ AC_CONFIG_MACRO_DIR([m4]) CFLAGS="$CFLAGS -Wall" CPPFLAGS="$CPPFLAGS -Wall" +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 " |