From ceeda829066b6373a98b8fc770e53a2cf1b53033 Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 1 May 2023 15:47:21 -0700 Subject: [PATCH] Add option to support disabling thread local `--disable-threadlocal`. Useful for cross-compile situation where thread local storage is not desired. ZD 16062 --- configure.ac | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index ef7290a04..016b9045f 100644 --- a/configure.ac +++ b/configure.ac @@ -159,9 +159,20 @@ then output_objdir=. fi + # Thread local storage -AX_TLS([thread_ls_on=yes],[thread_ls_on=no]) -AS_IF([test "x$thread_ls_on" = "xyes"],[AM_CFLAGS="$AM_CFLAGS -DHAVE_THREAD_LS"]) +thread_ls_on="no" +AC_ARG_ENABLE([threadlocal], + [AS_HELP_STRING([--enable-threadlocal],[Enable thread local support (default: enabled)])], + [ ENABLED_THREADLOCAL=$enableval ], + [ ENABLED_THREADLOCAL=yes ] + ) +if test "$ENABLED_THREADLOCAL" = "yes" +then + AX_TLS([thread_ls_on=yes],[thread_ls_on=no]) + AS_IF([test "x$thread_ls_on" = "xyes"],[AM_CFLAGS="$AM_CFLAGS -DHAVE_THREAD_LS"]) +fi + # DEBUG AX_DEBUG