diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-05 12:33:45 (EST) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-05 12:50:28 (EST) |
commit | 6d3c5357b99d6c1a8246385d3f7f303734cbad52 (patch) | |
tree | 7844f148cd688a84cca4258c1fe4f9ed4af2116d | |
parent | db3710a0119896f235b90020d117b9949bc77f9f (diff) | |
download | marquee-6d3c5357b99d6c1a8246385d3f7f303734cbad52.zip marquee-6d3c5357b99d6c1a8246385d3f7f303734cbad52.tar.gz marquee-6d3c5357b99d6c1a8246385d3f7f303734cbad52.tar.bz2 |
configure.ac: Optionally enable address sanitization
-rw-r--r-- | configure.ac | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 2a03704..3d90581 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,26 @@ fi AX_CHECK_COMPILE_FLAG([-fdiagnostics-color=auto], [AX_APPEND_FLAG([-fdiagnostics-color=auto])]) +AC_ARG_ENABLE([address-sanitization], + [AS_HELP_STRING([--enable-address-sanitization], + [turn on AddressSanitizer (if available)])], + [case "${enableval}" in yes|no);; *) AC_MSG_ERROR( + [bad value ${enableval} for address-sanitization option]);; + esac], + [ + address_sanitization=no + gl_GCC_VERSION_IFELSE([4], [8], + [test -d "${srcdir}/.git" && address_sanitization=yes]) + ] +) +if test "x${address_sanitization}" = 'xyes'; then + AX_CHECK_COMPILE_FLAG([-fsanitize=address], + [AX_APPEND_FLAG([-fsanitize=address], [ASAN_CFLAGS])]) + AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer], + [AX_APPEND_FLAG([-fno-omit-frame-pointer], [ASAN_CFLAGS])]) + AC_SUBST([ASAN_CFLAGS]) +fi + PKG_PROG_PKG_CONFIG() PKG_CHECK_MODULES([GTK], [gtk+-3.0]) PKG_CHECK_MODULES([WEBKIT2GTK], [webkit2gtk-4.0]) |