[cairo] Recent pthread mutexes addition in cairo
Owen Taylor
otaylor at redhat.com
Mon Aug 22 14:27:26 PDT 2005
On Fri, 2005-07-08 at 19:47 -0500, Albert Chin wrote:
> On Fri, Jul 08, 2005 at 08:34:52PM -0400, Jason Dorje Short wrote:
> > Albert Chin wrote:
> > > On Fri, Jul 08, 2005 at 07:17:09PM -0500, Albert Chin wrote:
> > >
> > >>No. You do *not* want -lpthread. You don't need it if the stubs in
> > >>libc are usable.
> > >
> > > Untested but you want something like below.
> >
> > Ahh, now I understand.
> >
> > The problem with AC_TRY_RUN is it won't work when cross-compiling.
> > Would an AC_LINK_IFELSE check be sufficient?
>
> Yeah, I know about the cross-compiling issue. But, I don't know how to
> work around it. IRIX has the pthread_mutex_* functions in libc (though
> they don't appear to work). So, it would pass AC_LINK and
> AC_LINK_IFELSE.
>
> I'll bug the SGI folks.
I think the simple thing here is just to use AC_CACHE_CHECK() and
the fourth argument to AC_TRY_RUN
AC_CACHE_CHECK([if posix mutexes require -lpthread], cairo_need_lpthread,
[AC_TRY_RUN([...],
cairo_need_lpthread=no,
cairo_need_lpthread=yes,
cairo_need_lpthread=no)]))
if test $cairo_need_lpthread = yes ; then
LIBS="$LIBS -lpthread"
fi
The AC_CACHE_CHECK gives an out for people who really are
cross-compiling targeting IRIX - they can pass --cache-file to
configure. But for everybody else it just works.
See:
http://developer.gnome.org/doc/API/2.0/glib/glib-cross-compiling.html
for a few more details of doing that.
Albert - do you think you can test out your checks in a setup like the
above on a few platforms? (Or - anybody else with access to machines
where the lack of -lpthread is causing problems want to try this?)
Thanks,
Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050822/ab8b2f40/attachment-0001.pgp
More information about the cairo
mailing list