From 5ff4c53fad728bf32cdff7ac0cbe1cc170c6a92a Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 5 Nov 2018 05:12:10 +0100 Subject: configure.ac: 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 --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index 98fdc94..cdb42a5 100644 --- a/configure.ac +++ b/configure.ac @@ -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) +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 + AC_ARG_ENABLE(werror, [AS_HELP_STRING( [--enable-werror], -- cgit v1.2.3