Getting the entire configure.cflags variable

Sean Farley sean at
Thu Oct 2 13:25:33 PDT 2014

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

So, is there a way to get the entire environment variable CFLAGS (and
friends) within a portfile?

More information about the macports-dev mailing list