Skip to content

Commit

Permalink
autotools: add --{disable,enable}-thread-safety
Browse files Browse the repository at this point in the history
Fail the build if --enable-thread-safety is passed and the environment cannot
guarantee thread-safety.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Dec 10, 2018
1 parent 34484cd commit 0c0f005
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions configure.ac
Expand Up @@ -713,6 +713,11 @@ if test "x$GCC" = "xyes"; then
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
AC_CONFIG_FILES([
Makefile
Expand Down Expand Up @@ -975,6 +980,9 @@ Debugging:

Paths:
- Logs in configpath: $enable_configpath_log

Thread-safety:
- enforce: $enable_thread_safety
EOF

if test "x$ac_cv_func_pthread_atfork" = "xno" ; then
Expand Down

0 comments on commit 0c0f005

Please sign in to comment.