[cairo] Recent pthread mutexes addition in cairo

Jason Dorje Short jdorje at users.sf.net
Fri Jul 8 17:07:32 PDT 2005


Jason Dorje Short wrote:
> Albert Chin wrote:
> 
>>We have access to a diverse set of systems so I tried to determine
>>what platforms would require -lpthread because of the recent addition
>>of the pthread_mutex_* functions for cache locking:
> 
> 
> I don't see what the purpose of this is.  Simply add an
> 
>   AC_CHECK_LIB([pthread], [pthread_mutex_init], [LIBS="-lpthread"], [])
> 
> to configure.ac and everything should be taken care of.

Or more specifically this patch should do it.  If pthread.h isn't
available then -lpthread isn't checked.  On my system this gives these
results:

in "configure":
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_mutex_init in -lpthread... yes

in "make":

/bin/sh ../libtool --tag=CC --mode=link gcc  -g -O -Wall -Werror
-Wcast-align -Wmissing-prototypes -Wmissing-declarations   -o
libcairo.la -rpath /usr/local/lib -version-info 1:0:0 -no-undefined
cairo.lo cairo-arc.lo cairo-array.lo cairo-cache.lo cairo-color.lo
cairo-fixed.lo cairo-font.lo cairo-gstate.lo cairo-hull.lo
cairo-image-surface.lo cairo-matrix.lo cairo-path.lo
cairo-path-bounds.lo cairo-path-data.lo cairo-path-fill.lo
cairo-path-stroke.lo cairo-pen.lo cairo-polygon.lo cairo-slope.lo
cairo-spline.lo cairo-surface.lo cairo-traps.lo cairo-pattern.lo
cairo-unicode.lo cairo-output-stream.lo cairo-wideint.lo
cairo-meta-surface.lo  cairo-ft-font.lo cairo-ps-surface.lo
cairo-pdf-surface.lo cairo-font-subset.lo cairo-png.lo
cairo-xlib-surface.lo      -L/usr/X11R6/lib -lXrender -lX11 -lz -lpng12
   -L/usr/local/lib -lpixman   -lfontconfig   -lfreetype -lz -lpthread
-lz -lm

-jason
-------------- next part --------------
Index: configure.in
===================================================================
RCS file: /cvs/cairo/cairo/configure.in,v
retrieving revision 1.109
diff -p -u -r1.109 configure.in
--- configure.in	6 Jul 2005 18:23:39 -0000	1.109
+++ configure.in	9 Jul 2005 00:05:14 -0000
@@ -311,7 +311,9 @@ dnl ====================================
 # The FreeType backend uses pthread locking when avaialble
 #
 
-AC_CHECK_HEADERS([pthread.h])
+AC_CHECK_HEADERS([pthread.h],
+                 [AC_CHECK_LIB([pthread], [pthread_mutex_init],
+                               [CAIRO_LIBS="$CAIRO_LIBS -lpthread"])])
 
 dnl ===========================================================================
 


More information about the cairo mailing list