aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-10-08 13:39:51 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-10-08 13:39:51 +0200
commite241eada5581a9914b31caca2d60fdfc9e9b1b6c (patch)
tree935d1ecf31839460c3d36835d9895d82203499ad
parentf59fabf9dc51010899ebae705d149160be1483f8 (diff)
configure.ac: Add --enable-sanitize flag
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 5032255..b5468ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,6 +22,18 @@ AC_PROG_RANLIB
dnl checks for header files
AC_HEADER_STDC
+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],