On DragonFly (and perhaps some other platforms too) solely passing -pthread to gcc is good enough, there is no need to augment LIBS with -lpthread (which does not even exist). So the simple case of just tacking -lpthread if XTHREAD in Xlib is defined is rather crude and breaks compilation on DragonFly. In effect it means getting rid of -lpthread from LIBS and adding -pthread to CLFAGS.
This was observed in glitz 0.4.4 by the way. Cairo 1.0.0 seems to follow the right way.
Actually, tests/Makefile.in has a hardcoded -lpthread which will cause issues as well in cairo.
*** This bug has been marked as a duplicate of 4475 ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.