summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-11-02 12:50:45 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2009-11-02 12:50:45 +0000
commit9b42b6156d9916e64e19f2ccb0b43f4d1df72e79 (patch)
tree402367f725999ee9ce43a1e5b3af94e7c76c7742
parent3eecf2f60c85e0195360ff3c3a54d58ceaa4a6f1 (diff)
build: Add -pthread to real_pthread_CFLAGS
-rw-r--r--build/configure.ac.system12
-rw-r--r--configure.ac51
2 files changed, 34 insertions, 29 deletions
diff --git a/build/configure.ac.system b/build/configure.ac.system
index 3f6ab7e2..5194fe07 100644
--- a/build/configure.ac.system
+++ b/build/configure.ac.system
@@ -162,3 +162,15 @@ dnl Test for the tools required for building one big test binary
dnl
AC_CHECK_FUNCS(fork waitpid raise)
+
+dnl ===========================================================================
+
+have_real_pthread=no
+real_pthread_REQUIRES="pthread"
+PKG_CHECK_MODULES(real_pthread, $real_pthread_REQUIRES,
+ [have_real_pthread=yes],
+ [AC_CHECK_HEADERS([pthread.h],
+ [CAIRO_CC_TRY_FLAG("-pthread",, real_pthread_CFLAGS="-pthread", real_pthread_CFLAGS="")
+ real_pthread_LIBS="-lpthread"],
+ [have_real_pthread="no (requires $real_pthread_REQUIRES)"])])
+AM_CONDITIONAL(HAVE_REAL_PTHREAD, test "x$have_real_pthread" = "xyes")
diff --git a/configure.ac b/configure.ac
index 325af109..ba3cbc06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,28 @@ AC_CACHE_SAVE
dnl ===========================================================================
+AC_ARG_ENABLE(pthread,
+ AS_HELP_STRING([--disable-pthread],
+ [Do not use pthread]),
+ [use_pthread=$enableval], [use_pthread=auto])
+
+have_pthread=no
+if test "x$use_pthread" != "xno"; then
+ 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
+ AC_MSG_ERROR([pthread requested but not found])
+fi
+
+dnl ===========================================================================
+
AC_CHECK_LIB(z, compress,
[AC_CHECK_HEADER(zlib.h, [
have_libz=yes
@@ -478,35 +500,6 @@ fi
dnl ===========================================================================
-AC_ARG_ENABLE(pthread,
- AS_HELP_STRING([--disable-pthread],
- [Do not use pthread]),
- [use_pthread=$enableval], [use_pthread=auto])
-
-have_pthread=no
-if test "x$use_pthread" != "xno"; then
- 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
- AC_MSG_ERROR([pthread requested but not found])
-fi
-
-have_real_pthread=no
-real_pthread_REQUIRES="pthread"
-PKG_CHECK_MODULES(real_pthread, $real_pthread_REQUIRES,
- [have_real_pthread=yes],
- [AC_CHECK_HEADERS([pthread.h],[real_pthread_LIBS="-lpthread"], [have_real_pthread="no (requires $real_pthread_REQUIRES)"])])
-AM_CONDITIONAL(HAVE_REAL_PTHREAD, test "x$have_real_pthread" = "xyes")
-
-dnl ===========================================================================
-
CAIRO_ENABLE_SURFACE_BACKEND(ps, PostScript, yes, [
# The ps backend requires zlib.
use_ps=$have_libz