add --enable-sanitize config option

Change-Id: I83c7b16baeffd3b7ae86edf87a9bb4cbb7346609
This commit is contained in:
Neels Hofmeyr 2017-11-17 01:43:36 +01:00
parent 0f760a6476
commit 7c2232e0ff
1 changed files with 13 additions and 0 deletions

View File

@ -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