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: Re: pthread versus freebsd Date: Sat, 20 Mar 2004 08:15:20 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87y8pwfpqf.fsf@zip.com.au> References: <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 1079734612 14267 80.91.224.253 (19 Mar 2004 22:16:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 Mar 2004 22:16:52 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Mar 19 23:16:42 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 1B4SID-0007Am-00 for ; Fri, 19 Mar 2004 23:16:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B4SI9-0002DT-JX for guile-devel@m.gmane.org; Fri, 19 Mar 2004 17:16:37 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B4SHt-00027t-Ea for guile-devel@gnu.org; Fri, 19 Mar 2004 17:16:21 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B4SHE-0001kV-HG for guile-devel@gnu.org; Fri, 19 Mar 2004 17:16:12 -0500 Original-Received: from [61.8.0.85] (helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B4SHB-0001hq-6r for guile-devel@gnu.org; Fri, 19 Mar 2004 17:15:37 -0500 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i2JMFV5v019260 for ; Sat, 20 Mar 2004 09:15:31 +1100 Original-Received: from localhost (ppp220.dyn11.pacific.net.au [61.8.11.220]) by mailproxy1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i2JMFTbq006523 for ; Sat, 20 Mar 2004 09:15:30 +1100 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1B4SGu-0000fL-00; Sat, 20 Mar 2004 08:15:20 +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.4 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:3532 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3532 --=-=-= Well, I've got doubts about the way gcc -pthread should be setup, so I've added the entry below to the TODO file, and left it at that. FreeBSD doesn't spring into life with just this change anyway, so it'll all have to wait. --=-=-= Content-Disposition: inline; filename=TODO.gcc-pthread.diff --- TODO.~1.106.~ 2003-11-15 06:45:14.000000000 +1000 +++ TODO 2004-03-20 08:15:03.000000000 +1000 @@ -90,6 +90,42 @@ - Eventually + - Select pthreads compile with "gcc -pthread" when available, with + something like the block below in configure.in. + + This is almost certainly the right way to get pthreads, but + consideration needs to be given to application compiles. Will an + application need to compile and/or link with the same "gcc + -pthread"? On systems like FreeBSD where -pthread changes the + libc used then very likely yes. Emitting such an option from the + guile-config script would, however, make that script compiler + dependent, which would be undesirable. + + # "gcc -pthread" is supposedly the way to get the right defines and + # libraries on pretty much all systems where it makes sense (though the + # gcc 3.3 manual only seems to describe it for a couple of targets). + # + # On FreeBSD, gcc -pthread is vital, there's no -lpthread on that system, + # instead -pthread option selects the special libc_r C library. + # + # Forcibly adding -pthread to user-selected CFLAGS is a bit rude, user + # stuff ought to be left alone. But adding ensures we get what we need, + # and it's actually quite convenient if the user is just setting + # optimization options or whatever. + # + if test $GCC = yes; then + 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 that didn't work then try just -lpthread. + # + if test "$SCM_I_GSC_USE_PTHREAD_THREADS" != 1; then + ... - pretty-print #:width can lower the allowed width, but cannot increase it, max-expr-width (50) appears to be a hard limit. --=-=-= 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 --=-=-=--