unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* pthread versus freebsd
@ 2004-02-16  0:37 Kevin Ryde
  2004-03-19 22:15 ` Kevin Ryde
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2004-02-16  0:37 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

The guile configury for pthreads doesn't work on freebsd, you have to
use "gcc -pthread" there, not -lpthread.  I'm looking at something
like the following, to hav that option used if it works.

Not quite sure if munging CFLAGS is the right thing to do.  Maybe CC
would be better, or maybe AM_CFLAGS.


[-- Attachment #2: configure.in.pthread.diff --]
[-- Type: text/plain, Size: 1099 bytes --]

--- configure.in.~1.230.~	2004-02-10 09:37:56.000000000 +1000
+++ configure.in	2004-02-16 10:32:42.000000000 +1000
@@ -914,12 +914,30 @@
 
 case "$with_threads" in
   "yes" | "pthread" | "pthreads" | "pthread-threads" | "")
+
+    # Note that gcc -pthread is vital on FreeBSD, there's no -lpthread
+    # normally used there, the threading stuff is in a special libc_r
+    # selected by gcc -pthread.
+    #
+    if test $GCC = yes; then
+      # try gcc -pthread
+      old_CFLAGS=$CFLAGS
+      CFLAGS="-pthread $CFLAGS"
+      AC_TRY_LINK([#include <pthread.h>], [pthread_yield();],
+        [SCM_I_GSC_USE_PTHREAD_THREADS=1
+         with_threads="pthreads"],
+        [CFLAGS=$old_CFLAGS])
+    fi
+
+    if test "$SCM_I_GSC_USE_PTHREAD_THREADS" != 1; then
+    # otherwise try just -lpthread
     AC_CHECK_LIB(pthread, main,
       LIBS="-lpthread $LIBS"
       SCM_I_GSC_USE_PTHREAD_THREADS=1
       with_threads="pthreads",
       with_threads="null")
-      
+    fi
+
     if test $GCC = yes; then
     AC_DEFINE(_THREAD_SAFE, 1,
       [Use thread safe versions of GNU Libc functions.])

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-19 22:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-16  0:37 pthread versus freebsd Kevin Ryde
2004-03-19 22:15 ` Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).