[Top][All Lists]

[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: Dudziak Krzysztof
Subject: RE: PTHREAD_CFLAGS provided by AX_PTHREAD where best to be attached?
Date: Fri, 14 Sep 2018 14:13:02 +0000

Actually question asked initially here does not seem to exist as preprocessing 
then compilation is one single step. Both ...CFLAGS and ...CPPFLAGS should go 
to that building stage.
Eventually the order matters, i.e. their's placement in gcc command line string.

Question asked initially might exist if to replace ax_pthread-generated 
variables with gcc's -pthread option as question's objective.
gcc's manual describes it as gcc process driver's option. Latter one translates 
it and passes it to preprocessor, compiler and linker flags.
But how to use -pthread in if makefile carries out building in two 
steps, compilation then linking (with libtool in between
which possibly is irrelevant here)?
I believe automake-generated makefile by default work that way.


-----Original Message-----
From: Bob Friesenhahn [mailto:address@hidden
Sent: Thursday, 12. July 2018 20:28
To: Dudziak Krzysztof <address@hidden>
Cc: address@hidden
Subject: Re: PTHREAD_CFLAGS provided by AX_PTHREAD where best to be attached?

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 -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 

Bob Friesenhahn
GraphicsMagick Maintainer,;;sdata=Fii3vstOw5Se1obwRwfN41COxKBnqZrNbpZ2aGl1e2o%3D&amp;reserved=0
 This message and any attachments are intended solely for the addressees and 
may contain confidential information. Any unauthorized use or disclosure, 
either whole or partial, is prohibited.
E-mails are susceptible to alteration. Our company shall not be liable for the 
message if altered, changed or falsified. If you are not the intended recipient 
of this message, please delete it and notify the sender.
Although all reasonable efforts have been made to keep this transmission free 
from viruses, the sender will not be liable for damages caused by a transmitted 

reply via email to

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