How do I get Perl MakeMaker to change the default value for CFLAGS that it inserts into Makefiles? Based on this post, I tried this:
export CFLAGS=...
then inside cpan, I confirmed it with
! print $ENV{CFLAGS}
but it still uses whatever CFLAGS Perl was built with.
I looked in lib/perl/.../Config.pm as suggested by this post but CFLAGS doesn't appear to be set there.
I have a related question that got answered: How to tell CPAN about path to make and cc
I made a little headway in CPAN/Config.pm
'makepl_arg' => q[ CCFLAGS="-D_REENTRANT -O2 -m32 -I/opt/csw/bdb48/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -m32 -DVERSION=\"1.616\" -DXS_VERSION=\"1.616\" -fPIC -I/opt/csw/lib/perl/5.10.1/CORE"],
but this only appends the value to whatever was already in CFLAGS, which gcc doesn't understand (like "-x03" and "-KPIC").