bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lock module question


From: Bruno Haible
Subject: Re: lock module question
Date: Wed, 5 Mar 2008 18:06:21 +0100
User-agent: KMail/1.9.1

Yoann Vandoorselaere asked:
> Is it expected that the lock module does not set the -pthread CFLAGS
> when compiling with GCC on a Linux architecture?

Yes it is normal. The module description has this, and gnulib-tool echoes it:

  Link:
  $(LTLIBTHREAD) when linking with libtool, $(LIBTHREAD) otherwise

You have to use this Makefile variable for linking those programs which need
it. Putting it into CFLAGS would have the effect to link _all_ programs with
the thread libraries, which is not desirable.

> Using -pthread allow option like -D_REENTRANT to be defined when
> compiling Gnulib, which sound like a requirement if the program using
> Gnulib is multithreaded.

Neither -pthread nor -D_REENTRANT is a requirement for building multithreaded
programs on Linux with glibc.

On platforms where it is needed (OSF/1 and Solaris), the 'lock' module adds
-D_REENTRANT to the CPPFLAGS. Make sure to use both CFLAGS and CPPFLAGS in
your compilation commands; these is automatically done if you use automake.

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]