summaryrefslogtreecommitdiff
blob: 876e9de167dcfa4a150c5aab5162696cd67f1c44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
When using gcc, use '-pthread' (or '-pthreads' on solaris)
compiler flag to do all pthread specific things.

http://sourceforge.net/mailarchive/forum.php?thread_name=4DDFA157.4040609%40gentoo.org&forum_name=mico-devel
--- configure.in.orig	2009-04-02 17:25:45 +0200
+++ configure.in	2009-04-02 17:32:00 +0200
@@ -524,7 +524,19 @@
       )
       AC_CHECK_HEADERS(semaphore.h)
       AC_DEFINE(HAVE_PTHREADS)
+      case "${GXX}:${target}" in
+      yes:*solaris*|yes:*sunos*)
+        CXXFLAGS="-pthreads ${CXXFLAGS}"
+        LDFLAGS="-pthreads ${LDFLAGS}"
+	;;
+      yes:*)
+	CXXFLAGS="-pthread ${CXXFLAGS}"
+	LDFLAGS="-pthread ${LDFLAGS}"
+	;;
+      *)
       SHLIBS="-lpthread"
+      ;;
+      esac
     else 
       AC_CHECK_LIB(c_r, pthread_create, use_pthreads=yes, use_pthreads=no)
       if test X"$use_pthreads" = Xyes; then