diff --git a/Makefile.am b/Makefile.am index 3ec467f4..0161999b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,6 +41,10 @@ endif AM_CPPFLAGS += -DDEBUG endif AM_CPPFLAGS += -iquote. +if IS_ASAN +AM_CFLAGS += -fsanitize=address +AM_LDFLAGS += -fsanitize=address +endif endif # Set flags for Solaris. diff --git a/configure.ac b/configure.ac index fa474825..093d855b 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,15 @@ AC_ARG_ENABLE( ) AM_CONDITIONAL(IS_OPTIMIZED, test "x$enable_optimizations" = xyes) +# Is this --enable-asan? +AC_ARG_ENABLE( + asan, + AS_HELP_STRING(--enable-asan, enable ASAN build flags), + , + enable_asan=no +) +AM_CONDITIONAL(IS_ASAN, test "x$enable_asan" = xyes) + # Is this a static build? AC_ARG_ENABLE( static,