Review at  https://gerrit.osmocom.org/4879

add --enable-sanitize config option

Change-Id: Ie9bf734cb6cdee24e776cd64f9f1b800a7a9277c
---
M configure.ac
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/79/4879/1

diff --git a/configure.ac b/configure.ac
index 5165cdb..5b91522 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,18 @@
        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 "

-- 
To view, visit https://gerrit.osmocom.org/4879
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9bf734cb6cdee24e776cd64f9f1b800a7a9277c
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de>

Reply via email to