summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-02-12 13:04:32 +0100
committerMax <msuraev@sysmocom.de>2018-02-12 13:04:32 +0100
commit725e0038ee7400efa2d99b203b6d43f8ee6fe92e (patch)
tree26a5b5b20076566a485da50339de337b108ccf6d
parenta70b22376c49e8dcc122361c6618d2665062c377 (diff)
Add --enable-sanitize configure option
-rw-r--r--configure.ac9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 180e380..018c479 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,6 +61,15 @@ AC_SUBST(LTLDFLAGS_OSMOGAPK)
# Checks for programs.
AC_PROG_CC
+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
+
# Checks for libraries.
# libosmocore (codec module)
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2)