+undefined_sanitizer_cflags=
+undefined_sanitizer_cppflags=
+undefined_sanitizer_ldflags=
+AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
+AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
+ CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
+ AS_IF([test -z "$with_us_cflags"],
+ [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
+ undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
+ undefined_sanitizer_cppflags="-DVALGRIND=1"
+ undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
+ ])
+
+sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
+sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
+sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
+