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
This commit is contained in:
Max 2017-02-20 18:24:03 +01:00
parent 254745880b
commit 8a3be282ab
2 changed files with 14 additions and 2 deletions

View File

@ -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

View File

@ -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