summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-10-15 12:18:47 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-10-15 13:05:47 +0100
commitdac73d260a9b9a848bb97436ad84081c51629511 (patch)
tree192548a3f1708554c056c70f2e9b8ea002f662ba /configure.ac
parentef9286751d8346ecb803bfb5916581ee4dfc84db (diff)
[build] Link against pthread-stubs
Avoid pulling in the real pthread library if the application is single threaded and not using pthreads, by linking against pthread-stubs instead.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac8
1 files changed, 7 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index c38d2c496..12a56ad53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -485,7 +485,13 @@ AC_ARG_ENABLE(pthread,
have_pthread=no
if test "x$use_pthread" != "xno"; then
- AC_CHECK_HEADERS([pthread.h], have_pthread=yes, have_pthread=no)
+ pthread_REQUIRES="pthread-stubs"
+ PKG_CHECK_MODULES(pthread, $pthread_REQUIRES,
+ [use_pthread=yes; have_pthread=yes],
+ [AC_CHECK_HEADERS([pthread.h], [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
fi
AM_CONDITIONAL(HAVE_PTHREAD, test "x$have_pthread" = "xyes")
if test "x$have_pthread" = xno -a "x$use_pthread" = xyes; then