Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / libgc / threadlibs.c
index 247d3c652ec3a71c834879a1c2989de5778308cf..79428a9e49a028aea5e61faa280b4b653af4e4c9 100644 (file)
@@ -1,3 +1,4 @@
+# include "gc_config_macros.h"
 # include "private/gcconfig.h"
 # include <stdio.h>
 
@@ -10,10 +11,17 @@ int main()
               "-Wl,--wrap -Wl,pthread_sigmask -Wl,--wrap -Wl,sleep\n");
 #   endif
 #   if defined(GC_LINUX_THREADS) || defined(GC_IRIX_THREADS) \
-       || defined(GC_FREEBSD_THREADS) || defined(GC_SOLARIS_PTHREADS) \
+       || defined(GC_SOLARIS_PTHREADS) \
        || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)
         printf("-lpthread\n");
 #   endif
+#   if defined(GC_FREEBSD_THREADS) || defined(GC_OPENBSD_THREADS)
+#       if (__FREEBSD_version >= 500000)
+          printf("-lpthread\n");
+#       else
+          printf("-pthread\n");
+#       endif
+#   endif
 #   if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS)
        printf("-lpthread -lrt\n");
 #   endif