summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac12
-rwxr-xr-xcontrib/jenkins.sh5
2 files changed, 15 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index e3752b4e..ea688399 100644
--- a/configure.ac
+++ b/configure.ac
@@ -202,6 +202,18 @@ then
AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
fi
+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+=" -fsanitize=address -fsanitize=undefined"
+ CPPFLAGS+=" -fsanitize=address -fsanitize=undefined"
+fi
+
AC_OUTPUT(
libosmocore.pc
libosmocodec.pc
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index e5e17c86..108a73ab 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -3,7 +3,8 @@
set -ex
autoreconf --install --force
-./configure --enable-static
-$MAKE $PARALLEL_MAKE
+./configure --enable-static --enable-sanitize
+$MAKE $PARALLEL_MAKE check \
+ || cat-testlogs.sh
$MAKE distcheck \
|| cat-testlogs.sh