Harald Welte has submitted this change and it was merged.

Change subject: configure.ac: Add --enable-sanitize option
......................................................................


configure.ac: Add --enable-sanitize option

Change-Id: I1b5154a47bb2f66103ac254a0f422e8a80b2d3e0
---
M configure.ac
M contrib/jenkins.sh
2 files changed, 19 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/configure.ac b/configure.ac
index c80f1cf..8271dbf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,6 +78,18 @@
 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 @@
 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 \
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index c4d786d..e600e01 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -63,7 +63,7 @@
 
 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 @@
 
 cd "$base"
 autoreconf --install --force
-./configure $INSTR
+./configure --enable-sanitize $INSTR
 $MAKE $PARALLEL_MAKE
 $MAKE check \
   || cat-testlogs.sh

-- 
To view, visit https://gerrit.osmocom.org/7828
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b5154a47bb2f66103ac254a0f422e8a80b2d3e0
Gerrit-PatchSet: 4
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to