On Thu, Oct 10, 2013 at 07:40:44AM +0200, Richard PALO wrote:
Certain pthreads based applications specifically check for _PTHREADS
being defined, such as boost on solaris in which absence of this
CPPFLAGS issues this type of message:
The compiler is supposed to define that when used with -pthread:
gcc -pthread -dM -E - < /dev/null | fgrep _PTHREADS
and compare w/o -pthread. If your compiler doesn't do that, add it to a
OS/compiler specific section, as Obata suggested.
Martin
richard@devzone:~/src/pkgsrc/mk$ git diff .
diff --git a/mk/pthread.builtin.mk b/mk/pthread.builtin.mk
index 733edc9..03810d5 100644
--- a/mk/pthread.builtin.mk
+++ b/mk/pthread.builtin.mk
@@ -61,7 +61,7 @@ BUILDLINK_LDFLAGS.pthread= # empty
# XXX
# XXX This should really be a check for GCC!
# XXX
-BUILDLINK_OPSYS_SUPPORT_PTHREAD= DragonFly FreeBSD Linux MirBSD NetBSD
OpenBSD
+BUILDLINK_OPSYS_SUPPORT_PTHREAD= DragonFly FreeBSD Linux MirBSD NetBSD
OpenBSD SunOS
. if !empty(BUILDLINK_OPSYS_SUPPORT_PTHREAD:M${OPSYS})
BUILDLINK_CFLAGS.pthread+= -pthread
BUILDLINK_LDFLAGS.pthread+= -pthread