From 2547e87b94223d2a90057d87aa821f3745687196 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: Ie00859d981044d59b8114332884e3d7f6fc48ef7 --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index 5ced828..d146513 100644 --- a/configure.ac +++ b/configure.ac @@ -31,6 +31,18 @@ PKG_PROG_PKG_CONFIG([0.20]) AC_CONFIG_MACRO_DIR([m4]) +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 + CFLAGS="$CFLAGS -Wall" CPPFLAGS="$CPPFLAGS -Wall" -- cgit v1.2.3