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

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


Hi,

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/bsd.port.mk, ll.
1787).

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

Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20050103/81f7759b/attachment.bin


More information about the freebsd-ports mailing list