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

Add --enable-sanitize configure option

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/44/5544/1

diff --git a/configure.ac b/configure.ac
index 3533af9..5867cbe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,15 @@
 
 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
+
 dnl checks for libraries
 PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore  >= 0.10.1)
 PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb2c1d6057012ed2f032e7504387a0767d02d75b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max <msur...@sysmocom.de>

Reply via email to