Add '--enable-sanitize' from other osmocom projects

Change-Id: Iac9ce76ce4ca5f5247bc42c16bb365d94cfde156
This commit is contained in:
Harald Welte 2017-11-12 22:41:54 +09:00
parent 66a60a13b6
commit 134d0a386d
2 changed files with 13 additions and 1 deletions

View File

@ -24,6 +24,18 @@ case "$host" in
*) AC_MSG_ERROR([Linux only, dude!]);;
esac
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
regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT"
regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
-Wmissing-prototypes -Wshadow -Wstrict-prototypes \

View File

@ -5,7 +5,7 @@ set -ex
osmo-clean-workspace.sh
autoreconf --install --force
./configure CFLAGS="-Werror" CPPFLAGS="-Werror"
./configure --enable-sanitize CFLAGS="-Werror" CPPFLAGS="-Werror"
$MAKE $PARALLEL_MAKE
$MAKE distcheck