Getting the pthread stuff to compile and work properly under IRIX requires a
few things:
1. that you build Berekely DB with _SGI_MP_SOURCE defined (the package
   automatically does this for you).  I've found it works just fine with 2.3.6,
   2.4.14, and 2.6.4 (with the 10 patches).
2. you define CPPFLAGS="-D_SGI_MP_SOURCE -D_SGI_REENTRANT_FUNCTIONS".  SGI
   recommends these, but I can't remember where I read it.  It may have been
   in their technical documentation library (see http://www.sgi.com).
3. you explicitly add -lpthread during configure, or it won't find a few
   of the pthread_* functions that it should.  The reason behind this one is that
   libc.so has weak definitions for most of the pthread_* routines, but not
   all (notably pthread_kill, pthread_detach, pthread_join).  But they are
   defined (*all* routines), with a global binding.  So you want -lpthread.
Now, one thing to think about here is that all your programs will now be linked
with libpthread.so.
I've found that the only places you need to have -lpthread in the AC_LIBS line
are in these Makefiles:
        servers/slapd/Makefile
        servers/slapd/tools/Makefile
        servers/slurpd/Makefile
You'll still need to do #1-3 even if you don't bother with the Makefile stuff.
This will get threads to build properly under IRIX. |