aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-02-20 18:24:03 +0100
committerMax <msuraev@sysmocom.de>2017-02-20 18:24:03 +0100
commit8a3be282ab265a2587608e471b274dda200eae84 (patch)
treef6d495353f903be477d05a42a50fa358d013a881
parent254745880bb2ff7f17fe158fb7bfb5e1dc530906 (diff)
Enable sanitize
Add ./configure option to enable ASAN checks and use it for jenkins tests. While at it - also move to /bin/sh shebang as we don't use bashisms anyway. Change-Id: Ie26e54ab6b850c9adf124a6bc613ec9bc9e8a6e2
-rw-r--r--configure.ac12
-rwxr-xr-xcontrib/jenkins.sh4
2 files changed, 14 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index f463c2e..99d83f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,18 @@ PKG_CHECK_MODULES(ORTP, ortp >= 0.22.0)
AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built))
+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(
libosmoabis.pc
libosmotrau.pc
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 403909b..2ca3f46 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
set -ex
@@ -24,7 +24,7 @@ echo
set -x
autoreconf --install --force
-./configure
+./configure --enable-sanitize
$MAKE $PARALLEL_MAKE
$MAKE distcheck \
|| cat-testlogs.sh