From: Kevin Ryde <user42@zip.com.au>
Subject: pthread versus freebsd
Date: Mon, 16 Feb 2004 10:37:10 +1000 [thread overview]
Message-ID: <8765e7yi4p.fsf@zip.com.au> (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
next reply other threads:[~2004-02-16 0:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-16 0:37 Kevin Ryde [this message]
2004-03-19 22:15 ` pthread versus freebsd Kevin Ryde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8765e7yi4p.fsf@zip.com.au \
--to=user42@zip.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).