From 022a4188944bfd12cfd0dedef61644ac49e3fa13 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Thu, 17 Apr 2014 20:17:06 -0500 Subject: [PATCH] Make pthread tls configurable for Mingw build For the Mingw build we don't want to pull in the pthread DLL just because we can autodetect pthread support. That would make the jq.exe binary not self-contained. --- configure.ac | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index d3028f60..fb613041 100644 --- a/configure.ac +++ b/configure.ac @@ -79,9 +79,17 @@ EOF AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" != xno]) -AC_FIND_FUNC([pthread_key_create], [pthread], [#include ], [NULL, NULL]) -AC_FIND_FUNC([pthread_once], [pthread], [#include ], [NULL, NULL]) -AC_FIND_FUNC([atexit], [pthread], [#include ], [NULL]) +AC_ARG_ENABLE([pthread-tls], + [AC_HELP_STRING([--enable-pthread-tls], + [Enable use of pthread thread local storage])], + [], + [enable_pthread_tls=no]) + +if test $enable_pthread_tls = yes; then + AC_FIND_FUNC([pthread_key_create], [pthread], [#include ], [NULL, NULL]) + AC_FIND_FUNC([pthread_once], [pthread], [#include ], [NULL, NULL]) + AC_FIND_FUNC([atexit], [pthread], [#include ], [NULL]) +fi dnl Thread local storage have___thread=no