autotools: add --{disable,enable}-thread-safety

Fail the build if --enable-thread-safety is passed and the environment cannot guarantee thread-safety. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 34484cda
...@@ -713,6 +713,11 @@ if test "x$GCC" = "xyes"; then ...@@ -713,6 +713,11 @@ if test "x$GCC" = "xyes"; then
fi fi
fi fi
AC_ARG_ENABLE([thread-safety],
[AC_HELP_STRING([--enable-thread-safety], [enforce thread-safety otherwise fail the build [default=yes]])],
[], [enable_thread_safety=yes])
AM_CONDITIONAL([ENFORCE_THREAD_SAFETY], [test "x$enable_thread_safety" = "xyes"])
# Files requiring some variable expansion # Files requiring some variable expansion
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
...@@ -975,6 +980,9 @@ Debugging: ...@@ -975,6 +980,9 @@ Debugging:
Paths: Paths:
- Logs in configpath: $enable_configpath_log - Logs in configpath: $enable_configpath_log
Thread-safety:
- enforce: $enable_thread_safety
EOF EOF
if test "x$ac_cv_func_pthread_atfork" = "xno" ; then if test "x$ac_cv_func_pthread_atfork" = "xno" ; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment