aboutsummaryrefslogtreecommitdiff
path: root/m4/threads.m4
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-02-11 10:15:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-02-11 10:15:33 +0200
commit64654174779a5a4f6163bca9164d65436dc5408c (patch)
tree4a69622a11dcaaf373ba2b5fd99cc2b00d0feab6 /m4/threads.m4
parent4bb8308f8a2d9a19aea68c1f54421bc250547e2b (diff)
Detect POSIX threads on MinGW-W642.2.0
Diffstat (limited to 'm4/threads.m4')
-rw-r--r--m4/threads.m411
1 files changed, 10 insertions, 1 deletions
diff --git a/m4/threads.m4 b/m4/threads.m4
index 9a7da53..1609a04 100644
--- a/m4/threads.m4
+++ b/m4/threads.m4
@@ -22,7 +22,16 @@ if test x$threads = xcheck; then
CXXFLAGS="$CXXFLAGS -mthreads"
;;
esac
- threads=win32
+
+ # Newer versions of GCC can be configured to use either Win32 or POSIX
+ # threads. It appears that -mthreads should be used in both cases but
+ # if the model is POSIX then GCC will also link -lpthread by default.
+ # Use that fact to test which model we have.
+ #
+ AC_TRY_LINK([#include <pthread.h>],
+ [pthread_create(0,0,0,0);],
+ [threads=posix],
+ [threads=win32])
;;
*)
ACX_PTHREAD