Getting the entire configure.cflags variable

Sean Farley sean at macports.org
Thu Oct 2 14:24:29 PDT 2014


Ryan Schmidt writes:

> On Oct 2, 2014, at 4:10 PM, Lawrence Velázquez wrote:
>
>> On Oct 2, 2014, at 5:08 PM, Sean Farley wrote:
>> 
>>> Ryan Schmidt writes:
>>> 
>>>> Unfortunately as far as I can tell the answer is no. Many variables are added to ${configure.cflags} right before the command is run and after the port has any opportunity to intercept it or learn about it.
>>> 
>>> This seems ... unfortunate.
>
> I think so too. What's your use case for needing it at this moment?

The petsc port, in an attempt to help users, ignores CFLAGS (and
friends) from the environment due to many users that accidentally had
them defined. So, I'm trying to pass the exact same CFLAGS to
configure.args.

>> I suspect the idea is to prevent ports from clearing CFLAGS and such.
>
> I think it's more that in many cases -- arch flags for example, or which C++ stdlib flag to use -- MacPorts won't know what to put in the cflags until after the rest of the port has been processed. What if you append something to configure.cflags, then later turn on (or turn off) the universal variant? Then the wrong arch flags will be in configure.cflags. This is why (as I understand it) MacPorts doesn't put them in until the port has been completely evaluated.

Should we go all the way to evaluate which CFLAGS are defined? That
seems fragile and error-prone.


More information about the macports-dev mailing list