Removing -pthread from gcc

Dan Nelson dnelson at allantgroup.com
Tue Sep 2 11:21:14 PDT 2003


In the last episode (Aug 29), Terry Lambert said:
> "Pedro F. Giffuni" wrote:
> > I'm not understanding what the new world order will be, but please
> > try to agree something with the autoconf people: from my porting
> > experience, autoconf is not interested on what PTHREAD_LIBS says;
> > it just tries to link with pthread and if that fails it assumes the
> > platform doesn't support threads at all.
> 
> This is why autoconf sucks: it tries to identify the platform and
> make the code conform to that, rather than identifying the platform
> capabilities (note: different from "does -pthread work?") and using
> that.

Well, that's why badly-written autoconf tests suck.

> This is why imake and xmkmf can compile every X application that
> uses them, while autoconf and automake can only do it for the
> platforms they have been explicitly told about.

Then again, imake doesn't automatically realize that you've installed a
new piece of software, or upgraded an existing one that has new
capabilities or fixed bugs.
 
> The autoconf program balkanizes things, while imake unites them.
> 
> I wish autoconf would die.

Well-written autoconf macros test for features, not platforms.  There
is a nice pthreads macro that tries a bunch of pthreads flags, and uses
what works.  It also respects the PTHREAD_LIBS and PTHREAD_CFLAGS
environment variables, so it's easy to override.  It's got some
out-of-date tests (it tries -kthreads because it thinks FreeBSD
supports it), but does work on all the systems I have available.

http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-threads mailing list