aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-12-21 17:27:34 +0100
committerMax <msuraev@sysmocom.de>2017-12-21 17:27:34 +0100
commitb2f0b62cd4603b8aa12172423e9c32408e048560 (patch)
treefcc9cdd7913e598eab78cb5d87f12b11c34efc0b /configure.ac
parent327e121a0f2b1e816cc59d1337e6f2034553f2b8 (diff)
Add --enable-sanitize configure option
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3533af9e..5867cbe5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,15 @@ AC_HEADER_STDC
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)