PThread Issue: -pthread vs. -lpthread for a new port

Simon Barner barner at
Mon Jan 3 13:42:32 GMT 2005


the ports framework has the variables ${PTHREAD_CFLAGS} and ${PTHREAD_LIBS}
that take care of the right usage of -D_THREAD_SAFE and -pthread, -lpthread,
-lc_r respectively.

Depending on your FreeBSD version, different combinations are necessary
to link in thread support (for details see ports/Mk/, ll.

To sum this up: You must not hard-code any of these thread things, but
use the PTHREAD_* variables.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-ports mailing list