add --enable-sanitize

Add --enable-sanitize to ./configure, as a copy-paste from libosmocore.

When building libosmocore with --enable-sanitize, osmo-sip-connector cannot be
linked if it doesn't include asan as well.

This is particularly annoying to me when using sanitize.opts in osmo-dev. I'd
have to turn off *all* asan everywhere just to include the osmo-sip-connector
dep that was recently added.

Change-Id: I18761802db2f29d9f0c7f269197d5b5e191142c5
This commit is contained in:
Neels Hofmeyr 2018-11-05 05:12:10 +01:00
parent d9c059e92a
commit 5ff4c53fad
1 changed files with 12 additions and 0 deletions

View File

@ -27,6 +27,18 @@ PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0)
PKG_CHECK_MODULES(SOFIASIP, sofia-sip-ua-glib >= 1.12.0)
[Compile with address sanitizer enabled],
[sanitize=$enableval], [sanitize="no"])
if test x"$sanitize" = x"yes"
CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"