aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-06-27 13:42:51 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-06-27 13:42:51 +0200
commit57201c6c0a1f53390f3108a39e84744edf0c9bb1 (patch)
tree469e74a10fc91de1367793283a646fc75b1ad900 /openbsc
parente239764f5aaf0f9242b569006323f958ae43f78e (diff)
configure.ac: Add --enable-sanitize flag
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/configure.ac15
1 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index 2c3045ae9..f1f60383b 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -124,6 +124,18 @@ AC_SUBST(found_sqlite3)
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
+
# The following test is taken from WebKit's webkit.m4
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden "
@@ -201,6 +213,9 @@ AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
AC_MSG_RESULT([$enable_ext_tests])
AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
+AC_MSG_RESULT([CFLAGS="$CFLAGS"])
+AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
+
dnl Generate the output
AM_CONFIG_HEADER(bscconfig.h)