summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-12-20 15:49:45 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-12-22 15:16:30 -0800
commit4839b1135d68adca9d58a0226734cac4a9793071 (patch)
tree2af91e251f27f0f6ae401d7e145755bd9f808dfc /configure.ac
parent32a006f92a0f3cd3ce95d4df61e887e0d702a151 (diff)
downloadbluez-4839b1135d68adca9d58a0226734cac4a9793071.tar.gz
build: Add sanitizer options
Build using Address Sanitizer (asan), Leak Sanitizer (lsan), or Undefined Behavior Sanitizer (ubsan) by using one of these options for the configure script: --enable-asan --enable-lsan --enable-ubsan For each of these to work, the compiler must support the requested sanitizer and the requisite libraries must be installed (libasan, liblsan, libubsan).
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 6 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 2674e30d3..849e1db46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,6 +23,9 @@ AC_C_RESTRICT
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CC_PIE
+AC_PROG_CC_ASAN
+AC_PROG_CC_LSAN
+AC_PROG_CC_UBSAN
AC_PROG_INSTALL
AC_PROG_MKDIR_P
@@ -40,10 +43,12 @@ if (test "$USE_MAINTAINER_MODE" = "yes"); then
fi
AM_CONDITIONAL(COVERAGE, test "${enable_coverage}" = "yes")
AM_CONDITIONAL(DBUS_RUN_SESSION, test "${enable_dbus_run_session}" = "yes")
-AM_CONDITIONAL(VALGRIND, test "${enable_valgrind}" = "yes")
MISC_FLAGS
+AM_CONDITIONAL(VALGRIND, test "${enable_valgrind}" = "yes" &&
+ test "$ASAN_LIB" != "yes" && test "LSAN_LIB" != "yes")
+
AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
[enable threading support]), [enable_threads=${enableval}])