From owner-freebsd-current@FreeBSD.ORG Wed Sep 24 20:37:04 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5652616A4B3 for ; Wed, 24 Sep 2003 20:37:04 -0700 (PDT) Received: from motgate6.mot.com (motgate6.mot.com [144.189.100.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1ED3143F75 for ; Wed, 24 Sep 2003 20:37:03 -0700 (PDT) (envelope-from rittle@latour.rsch.comm.mot.com) Received: from az33exr03.mot.com (pobox3.mot.com [10.64.251.242]) by motgate6.mot.com (Motorola/Motgate6) with ESMTP id h8P3b2Y0013741 for ; Wed, 24 Sep 2003 20:37:02 -0700 (MST) Received: from latour.rsch.comm.mot.com (latour.rsch.comm.mot.com [145.1.80.116])h8P3b0IK026808 for ; Wed, 24 Sep 2003 22:37:01 -0500 Received: from latour.rsch.comm.mot.com (localhost.rsch.comm.mot.com [127.0.0.1])h8P3axgt035081; Wed, 24 Sep 2003 22:36:59 -0500 (CDT) (envelope-from rittle@latour.rsch.comm.mot.com) Received: (from rittle@localhost) by latour.rsch.comm.mot.com (8.12.9/8.12.9/Submit) id h8P3axl3035080; Wed, 24 Sep 2003 22:36:59 -0500 (CDT) Date: Wed, 24 Sep 2003 22:36:59 -0500 (CDT) From: Loren James Rittle Message-Id: <200309250336.h8P3axl3035080@latour.rsch.comm.mot.com> To: current@freebsd.org References: <200309241703.aa94887@salmon.maths.tcd.ie> Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs Subject: Re: Fixing -pthreads (Re: ports and -current) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2003 03:37:04 -0000 >I was looking through gcc last night to see how conceptually difficult >it would be to do something like this. But instead of a file, I was >thinking of this process: > >* if env("PTHREADS_LIBS") then LDFLAGS += PTHREADS_LIBS >* elseif fileexists("libpthread") then LDFLAGS += -lpthread >* elseif fileexists("libthr") then LDFLAGS += -lthr >* elseif fileexists("libc_r") then LDFLAGS += -lc_r >* else error("Threading not supported.") Hello Mike, I too thought about making -pthread an exact alias for env("PTHREADS_LIBS") (and, if empty, pick -lpthread or the classic default -lc_r). The main issue is that the FSF gcc has not accepted any code into the gcc driver which depends on environment variables. Loren