summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-11-05 05:12:10 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-11-05 05:15:19 +0100
commit5ff4c53fad728bf32cdff7ac0cbe1cc170c6a92a (patch)
tree6033a54bb113ddbc46ce742f86d27b83da0e7e56
parentd9c059e92ac7d09959a6d53510a1150658174b69 (diff)
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
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
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],