]> git.proxmox.com Git - mirror_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>
Wed, 22 Aug 2018 11:41:43 +0000 (13:41 +0200)
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 ed8bbc82f5ea23358d04d951bd9fbbdc1c5f8a4b..b2b2f71c9b31c6c1165272a56cd01f5caafb8e53 100644 (file)
@@ -682,6 +682,11 @@ if test "x$enable_werror" = "xyes"; then
        CFLAGS="$CFLAGS -Werror -Wvla -std=gnu11"
 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
@@ -925,4 +930,7 @@ Debugging:
 
 Paths:
  - Logs in configpath: $enable_configpath_log
+
+Thread-safety:
+ - enforce: $enable_thread_safety
 EOF