configure.ac: Add --enable-sanitize option

Change-Id: I1b5154a47bb2f66103ac254a0f422e8a80b2d3e0
This commit is contained in:
Pau Espin 2018-04-16 14:27:38 +02:00 committed by Harald Welte
parent 6462dd3963
commit 53bdb7f82a
2 changed files with 19 additions and 2 deletions

View File

@ -78,6 +78,18 @@ PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0)
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
CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
LDFLAGS="$LDFLAGS -fsanitize=address -fsanitize=undefined"
fi
AC_ARG_WITH(usrp1, [
AS_HELP_STRING([--with-usrp1],
[enable USRP1 gnuradio based transceiver])
@ -176,6 +188,11 @@ PKG_CHECK_MODULES(FFTWF, fftw3f)
AC_CHECK_HEADER([boost/config.hpp],[],
[AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])])
AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
AC_MSG_RESULT([CFLAGS="$CFLAGS"])
AC_MSG_RESULT([CXXFLAGS="$CXXFLAGS"])
AC_MSG_RESULT([LDFLAGS="$LDFLAGS"])
dnl Output files
AC_CONFIG_FILES([\
Makefile \

View File

@ -63,7 +63,7 @@ fi
mkdir "$deps" || true
osmo-build-dep.sh libosmocore "" "--disable-doxygen --disable-pcsc"
osmo-build-dep.sh libosmocore "" "--enable-sanitize --disable-doxygen --disable-pcsc"
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
@ -78,7 +78,7 @@ set -x
cd "$base"
autoreconf --install --force
./configure $INSTR
./configure --enable-sanitize $INSTR
$MAKE $PARALLEL_MAKE
$MAKE check \
|| cat-testlogs.sh