From 25f3b862309e7accdd59c55b01effecbe2316b23 Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Fri, 3 Apr 2009 09:14:12 +0000 Subject: [PATCH] A better way to check for __thread --- configure.in | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/configure.in b/configure.in index 8bce8a518f..8f334b6513 100644 --- a/configure.in +++ b/configure.in @@ -843,25 +843,10 @@ case "$PLATFORM" in esac dnl Detect support for ISO syntax for thread-locals -AC_CACHE_CHECK([for __thread], firebird_cv_gcc___thread, - [cat > conftest.c <<\EOF -__thread int a = 42; -main() { - a = a + 1; - return 0; -} -EOF -if AC_TRY_COMMAND([gcc -fPIC -o conftest conftest.c >&AS_MESSAGE_LOG_FD && ./conftest]); then - firebird_cv_gcc___thread=yes -else - firebird_cv_gcc___thread=no -fi -rm -f conftest*]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[__thread int a = 42;]],[[a = a + 1;]])], + AC_DEFINE(HAVE___THREAD, 1, [Define it if compiler supports ISO syntax for thread-local storage]),) -if test "$firebird_cv_gcc___thread" = yes; then - AC_DEFINE(HAVE___THREAD, 1, [Define it if compiler supports ISO syntax for thread-local storage]) -fi - dnl ##################### DO NOT ADD ANY TESTS BELOW ########################### AC_SUBST(SFIO_DIR)