Add option to build with address-sanitizer

This commit is contained in:
Henrik Andersson 2017-10-17 09:18:07 +02:00
parent 295351792e
commit 42f3fad2c3

View File

@ -51,6 +51,16 @@ m4_ifdef([PKG_CHECK_MODULES], [], [
]) ])
]) ])
dnl Add option to build with using address sanitizer
AC_ARG_ENABLE([address-sanitizer], AS_HELP_STRING([--enable-address-sanitizer], \
[enabled AddressSanitizer support for detecting a wide variety of \
memory allocation and deallocation errors]), \
[AC_DEFINE(HAVE_ADDRESS_SANITIZER, 1, [enable AddressSanitizer])
CFLAGS="$CFLAGS -fsanitize=address"
AC_TRY_COMPILE([],[const int i=0;],[AC_MSG_NOTICE([Address Sanitizer Enabled])],
[AC_MSG_ERROR([Address Sanitizer not available])])
])
# #
# OpenSSL detection borrowed from stunnel # OpenSSL detection borrowed from stunnel
# #