Getting the entire configure.cflags variable

Sean Farley sean at
Thu Oct 2 14:08:45 PDT 2014

Ryan Schmidt writes:

> On Oct 2, 2014, at 3:25 PM, Sean Farley wrote:
>> This seems very odd but is there a variable that stores the complete
>> string of what will eventually be CFLAGS in the environment
>> (e.g. CFLAGS=foo ./configure --args) passed to a command?
>> If you're like me, you're thinking: "Of course there is, use
>> configure.cflags!" But that only holds a substring:
>> pre-configure {
>>  puts "configure.cflags: ${configure.cflags}"
>> }
>> will output: "configure.cflags: -Os"
>> but the actual environment variable is set to "-pipe -Os -arch
>> x86_64". The arch argument is supplied by the configure.cc_archflags
>> variable.
>> So, is there a way to get the entire environment variable CFLAGS (and
>> friends) within a portfile?
> 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.

More information about the macports-dev mailing list