]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
autotools: add --{disable,enable}-thread-safety
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 22 Aug 2018 11:13:29 +0000 (13:13 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 10 Dec 2018 15:22:26 +0000 (16:22 +0100)
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>
configure.ac

index 3cbaddf26bf4538532bbe29d9fe1970d7f28b9d9..f8c008458f8648b5fccd782468d50ac92b967d41 100644 (file)
@@ -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
@@ -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