Add configure option to enable AddressSanitizer
[privoxy.git] / configure.in
index 2614cab..7d5c89a 100644 (file)
@@ -162,6 +162,12 @@ if test "x$with_assertions" != "xyes"; then
     CFLAGS="$CFLAGS -DNDEBUG"
 fi
 
+AC_ARG_WITH(asan, [  --with-asan       Enable AddressSanitizer. Requires compiler support.])
+if test "x$with_asan" = "xyes"; then
+    CFLAGS="$CFLAGS -fsanitize=address"
+    LDFLAGS="$LDFLAGS -fsanitize=address"
+fi
+
 dnl =================================================================
 dnl Check for user and group validity
 dnl =================================================================