aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-11-17 01:43:36 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2017-11-17 02:05:24 +0100
commit7c2232e0ffd8751376d354fb95a86467d68d3bc8 (patch)
tree69a138437ac13f2c4392ff2f0b466866f93a6bce
parent0f760a64769c63e267532080f476f63a42eda339 (diff)
add --enable-sanitize config option
-rw-r--r--configure.ac13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 305cc11..85270bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,6 +40,19 @@ AM_CONDITIONAL(HAVE_LIBXML2, test "$found_libxml2" = yes)
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset])
+
+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_OUTPUT([Makefile
def_frame/Makefile
def_list/Makefile