From d1c232e1c4bb0155ea19faeb0f885075f84acf65 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 17 Nov 2017 01:43:36 +0100 Subject: add --enable-sanitize config option Change-Id: I3be01e0682b479a71c545f718b68c441a1011b0f --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 0daa5e2df..9a6f96366 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,18 @@ AM_CONDITIONAL(HAVE_LIBCDK, test "$found_cdk" = yes) dnl Checks for typedefs, structures and compiler characteristics +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 + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " -- cgit v1.2.3