add configure arg '--enable-threadsanitizer'

This commit is contained in:
niels
2025-11-03 20:30:22 +01:00
parent 1ee04e9dfe
commit 6dae4f147d

View File

@@ -52,6 +52,8 @@ AC_ARG_ENABLE([portleak],
AC_ARG_ENABLE([debug], AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],[Compile in debugging information])) AS_HELP_STRING([--enable-debug],[Compile in debugging information]))
AC_ARG_ENABLE([threadsanitizer],
AS_HELP_STRING([--enable-threadsanitizer],[Compile with -fsanitize=thread]))
AC_ARG_ENABLE([profile], AC_ARG_ENABLE([profile],
AS_HELP_STRING([--enable-profiling],[Compile in profiling information])) AS_HELP_STRING([--enable-profiling],[Compile in profiling information]))
AC_ARG_ENABLE([strict], AC_ARG_ENABLE([strict],
@@ -169,6 +171,13 @@ if test "x$enable_debug" = "xyes" ; then
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
AC_MSG_CHECKING([whether to compile in thread sanitizer])
if test "x$enable_threadsanitizer" = "xyes" ; then
CFLAGS="$CFLAGS -fsanitize=thread"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING(whether to compile in profiling information) AC_MSG_CHECKING(whether to compile in profiling information)
if test "x$enable_profiling" = "xyes" ; then if test "x$enable_profiling" = "xyes" ; then
debugCFLAGS="$debugCFLAGS -fprofile-arcs -ftest-coverage" debugCFLAGS="$debugCFLAGS -fprofile-arcs -ftest-coverage"