diff options
author | Benjamin Otte <otte@redhat.com> | 2010-05-13 15:14:29 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-05-13 15:17:27 +0200 |
commit | e3b2212bc5c4884eab356ae263b8318e10c379ac (patch) | |
tree | a9469caaa939605820626414d8c17d5cb847930a /configure.ac | |
parent | acfbf95a0c7620359fd917224b5b391702740190 (diff) |
build: Fix pthread detection
Incorporate the pthread detection code from the autoconf archive. Should
fix build on obscure archs that pretend to be UNIXy - like Mac OS X
Tiger.
http://www.gnu.org/software/autoconf-archive/
http://www.gnu.org/software/autoconf-archive/ax_pthread.html
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index 493fdc1c..86c26ff2 100644 --- a/configure.ac +++ b/configure.ac @@ -40,13 +40,11 @@ AC_ARG_ENABLE(pthread, have_pthread=no if test "x$use_pthread" != "xno"; then pthread_REQUIRES="pthread" - PKG_CHECK_MODULES(pthread, $pthread_REQUIRES, + PKG_CHECK_MODULES(PTHREAD, $pthread_REQUIRES, [use_pthread=yes; have_pthread=yes], - [AC_CHECK_HEADERS([pthread.h], [use_pthread=yes; - pthread_CFLAGS="-pthread" - pthread_LIBS="-pthread" - have_pthread=yes - ], [use_pthread="no (requires $pthread_REQUIRES)"])]) + [AX_PTHREAD([use_pthread=yes; + have_pthread=yes + ], [use_pthread="no (requires $pthread_REQUIRES)"])]) if test "x$have_pthread" = "xyes"; then AC_DEFINE([CAIRO_HAS_PTHREAD], 1, [Define to 1 if we have pthread support]) fi @@ -55,8 +53,8 @@ AM_CONDITIONAL(HAVE_PTHREAD, test "x$have_pthread" = "xyes") if test "x$have_pthread" = xno -a "x$use_pthread" = xyes; then AC_MSG_ERROR([pthread requested but not found]) fi -CAIRO_CFLAGS="$CAIRO_CFLAGS $pthread_CFLAGS" -CAIRO_LIBS="$CAIRO_LIBS $pthread_LIBS" +CAIRO_CFLAGS="$CAIRO_CFLAGS $PTHREAD_CFLAGS" +CAIRO_LIBS="$CAIRO_LIBS $PTHREAD_LIBS" dnl =========================================================================== |