automake
[Top][All Lists]
Advanced

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

Re: PTHREAD_CFLAGS provided by AX_PTHREAD where best to be attached?


From: Bob Friesenhahn
Subject: Re: PTHREAD_CFLAGS provided by AX_PTHREAD where best to be attached?
Date: Thu, 12 Jul 2018 13:28:26 -0500 (CDT)
User-agent: Alpine 2.20 (GSO 67 2015-01-07)

On Thu, 12 Jul 2018, Dudziak Krzysztof wrote:

Hi,
For makefiles which build piece of software in two separate steps: compilation 
then linking,
will it be better to attach  PTHREAD_CFLAGS to higher-level_CPPFLAGS than to 
higher-level_CFLAGS variable?
Autotools along with libtool are used here, user-level variables (CFLAGS, 
CPPFLAGS) are not manipulated through whole build chain.
I can manipulate variables only at Makefile.am -level.

CPPFLAGS is for the pre-processor while CFLAGS is applied (as well as CPPFLAGS) while compiling. This means that putting the options in CFLAGS does work, although it would be better to deduce which options are for the pre-processor or the compiler and put them in the correct places.

I learned gcc expects -pthread option which translates among others to some 
preprocessor define,
therefore I wonder if it won't be better to attach PTHREAD_CFLAGS to 
higher-level_CPPFLAGS rather than
to higher-level_CFLAGS.

It should not work to put -pthread in CPPFLAGS since it is a compiler-driver option and not a pre-processor (e.g. /usr/bin/cpp) option.

Only, -I, -D, and -U type options (see the manual page for 'cpp') should be put in CPPFLAGS.

Bob
--
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/



reply via email to

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