From 65829504073425362fc56995a1dcc8cc464b751a Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Sat, 28 Sep 2013 01:03:55 -0400 Subject: [PATCH] Rename HAVE_PTHREAD_SETSPECIFIC to HAVE_PTHREADS The test for pthread_setspecific() can be used as a general test for whether pthreads are available, so rename the variable from HAVE_PTHREAD_SETSPECIFIC to HAVE_PTHREADS and run the test even when better support for thread local variables are available. However, the pthread arguments are still only added to CFLAGS and LDFLAGS when pthread_setspecific() is used for thread local variables. V2: AC_SUBST(PTHREAD_CFLAGS) --- configure.ac | 29 +++++++++++++++-------------- pixman/pixman-compiler.h | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index 263c63e..2dd4776 100644 --- a/configure.ac +++ b/configure.ac @@ -961,37 +961,38 @@ main () ]])) AC_DEFUN([PIXMAN_CHECK_PTHREAD],[dnl - if test "z$support_for_pthread_setspecific" != "zyes"; then + if test "z$support_for_pthreads" != "zyes"; then PIXMAN_LINK_WITH_ENV( [$1], [pthread_test_program], [PTHREAD_CFLAGS="$CFLAGS" PTHREAD_LIBS="$LIBS" PTHREAD_LDFLAGS="$LDFLAGS" - support_for_pthread_setspecific=yes]) + support_for_pthreads=yes]) fi ]) -if test $ac_cv_tls = none ; then - support_for_pthread_setspecific=no +support_for_pthreads=no - AC_MSG_CHECKING(for pthread_setspecific) +AC_MSG_CHECKING(for pthreads) - PIXMAN_CHECK_PTHREAD([CFLAGS="-pthread"; LDFLAGS="-pthread"]) - PIXMAN_CHECK_PTHREAD([CFLAGS="-D_REENTRANT"; LIBS="-lpthread"]) - PIXMAN_CHECK_PTHREAD([CFLAGS="-D_REENTRANT"; LDFLAGS="-lroot"]) +PIXMAN_CHECK_PTHREAD([CFLAGS="-pthread"; LDFLAGS="-pthread"]) +PIXMAN_CHECK_PTHREAD([CFLAGS="-D_REENTRANT"; LIBS="-lpthread"]) +PIXMAN_CHECK_PTHREAD([CFLAGS="-D_REENTRANT"; LDFLAGS="-lroot"]) - if test $support_for_pthread_setspecific = yes; then - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - AC_DEFINE([HAVE_PTHREAD_SETSPECIFIC], [], [Whether pthread_setspecific() is supported]) +if test $support_for_pthreads = yes; then + AC_DEFINE([HAVE_PTHREADS], [], [Whether pthreads is supported]) + if test $ac_cv_tls = none ; then + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" fi - - AC_MSG_RESULT($support_for_pthread_setspecific); fi +AC_MSG_RESULT($support_for_pthreads) + AC_SUBST(TOOLCHAIN_SUPPORTS__THREAD) -AC_SUBST(HAVE_PTHREAD_SETSPECIFIC) +AC_SUBST(HAVE_PTHREADS) AC_SUBST(PTHREAD_LDFLAGS) AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) dnl ===================================== dnl __attribute__((constructor)) diff --git a/pixman/pixman-compiler.h b/pixman/pixman-compiler.h index 9b190b4..2489adc 100644 --- a/pixman/pixman-compiler.h +++ b/pixman/pixman-compiler.h @@ -178,7 +178,7 @@ # define PIXMAN_GET_THREAD_LOCAL(name) \ (&name) -#elif defined(HAVE_PTHREAD_SETSPECIFIC) +#elif defined(HAVE_PTHREADS) #include -- 2.7.4