diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-11-17 01:43:36 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-11-18 10:19:04 +0000 |
commit | 0a30a8522d3f4d4a1593269daef1498c3411b9df (patch) | |
tree | 67dd1836ab0df07653e7469275e1f01d2e06f56e | |
parent | 7d9a19739068edc0267fc5a91a81bc3cd0890783 (diff) |
add --enable-sanitize config option
Change-Id: Ie9bf734cb6cdee24e776cd64f9f1b800a7a9277c
-rw-r--r-- | configure.ac | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 5165cdb..5b91522 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,18 @@ AC_SEARCH_LIBS([sctp_send], [sctp], [ AC_MSG_ERROR([sctp_send not found in searched libs])]) LIBS=$old_LIBS +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 " |