From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: pthread versus freebsd Date: Mon, 16 Feb 2004 10:37:10 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <8765e7yi4p.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1076891963 14819 80.91.224.253 (16 Feb 2004 00:39:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Feb 2004 00:39:23 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Feb 16 01:39:15 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AsWn5-0001NJ-00 for ; Mon, 16 Feb 2004 01:39:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AsWmy-0007DN-CW for guile-devel@m.gmane.org; Sun, 15 Feb 2004 19:39:08 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AsWm9-0007An-VZ for guile-devel@gnu.org; Sun, 15 Feb 2004 19:38:17 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AsWlc-0006mC-GJ for guile-devel@gnu.org; Sun, 15 Feb 2004 19:38:15 -0500 Original-Received: from [61.8.0.84] (helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AsWlb-0006iB-33 for guile-devel@gnu.org; Sun, 15 Feb 2004 19:37:43 -0500 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1G0bbLE020129 for ; Mon, 16 Feb 2004 11:37:38 +1100 Original-Received: from localhost (ppp183.dyn10.pacific.net.au [61.8.10.183]) by mailproxy2.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1G0bacg022865 for ; Mon, 16 Feb 2004 11:37:36 +1100 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1AsWl6-00014O-00; Mon, 16 Feb 2004 10:37:12 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3385 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3385 --=-=-= 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. --=-=-= Content-Disposition: inline; filename=configure.in.pthread.diff --- 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_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.]) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel --=-=-=--