Subject: | 'extra_compiler_flags' not added to compiler command under ActivePerl |
'extra_compiler_flags' not added to compiler command under ActivePerl
I have an ActivePerl environment on my PC that uses the following:
ActivePerl v5.8.7 Build 813 # Latest version
ExtUtils-FakeConfig-0.06 # Allows overriding Config.pm
ExtUtils-CBuilder-0.13
ExtUtils-ParseXS-2.12
Module-Build-0.2611 # Tested with both versions
Module-Build-0.27_02 # (one at a time, of course)
My Build.PL files has the following:
'extra_compiler_flags' => [ '-DVERSION="4.04.00"',
'-DXS_VERSION="4.04.00"' ]
My module is built using the following commands:
set PERL5OPT=-MConfig_m
perl Build.PL
perl Build
However, the 'extra_compiler_flags' are not being added to the compiler
command (which subsequently fails):
gcc -c -g -O2 -DWIN32 -DPERL_IMPLICIT_CONTEXT -DPERL_MSVCRT_READFIX
-DHASATTRIBUTE -g -O2 -I"C:\Perl\lib\CORE" -I"\include" -o
"lib\Math\Random\MT\Auto.o" "lib\Math\Random\MT\Auto.c"
Both v0.2611 and v0.27_02 produce the same failure. Building with
ExtUtils::MakeMaker/Makefile.PL succeeds.
In my Cygwin environment, the 'extra_compiler_flags' are added properly:
gcc -I/usr/local/lib/perl5/5.8/cygwin/CORE -DVERSION="4.04.00"
-DXS_VERSION="4.04.00" -c -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing
-pipe -O3 -pipe -frename-registers -fomit-frame-pointer -march=pentium4
-mfpmath=sse -mmmx -msse -msse2 -o lib/Math/Random/MT/Auto.o
lib/Math/Random/MT/Auto.c
The contents Config_m.pm are:
package Config_m;
require ExtUtils::FakeConfig;
my $values = <<'EOT';
cc='gcc'
ccflags='-g -O2 -DWIN32 -DPERL_IMPLICIT_CONTEXT -DPERL_MSVCRT_READFIX'
cccdlflags='-DHASATTRIBUTE'
libpth='"(CC)\lib" "(CC)\i386-mingw32msvc\lib"'
libs=' -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr -lwinmm -lversion -lodbc32'
_a='.a'
_o='.o'
ar='ar'
cpp='gcc -E'
cppminus='-'
cpprun='gcc -E'
cppstdin='gcc -E'
d_attribut='define'
d_casti32='define'
i64type='long long'
ld='gcc'
lddlflags='-mdll -g -L"(PERL)\lib\CORE"'
ldflags='-g -L"(PERL)\lib\CORE"'
lib_ext='.a'
libc='-lmsvcrt'
libperl='libperl58.a'
longdblsize='12'
lseektype='long long'
nm='nm'
obj_ext='.o'
optimize='-g -O2'
perlpath='(PERL)\bin'perl.exe'
perllibs=' -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr -lwinmm -lversion -lodbc32'
quadtype='long long'
u64type='unsigned long long'
uquadtype='unsigned long long'
make='dmake'
EOT
# should these be overridable by the user?
my $cc_p = ( ExtUtils::FakeConfig::find_program( 'gcc' ) )[0];
$cc_p || warn "Unable to find compiler 'gcc'";
$cc_p =~ s/[\\\/]bin[\\\/]?$//;
my %values = ( CC => $cc_p,
PERL => $Config::Config{prefix} );
$values =~ s/\((\w+)\)/$values{$1}/ge;
my @arr = $values =~ m/^(\w+)\=[\'\"](.+)[\'\"]$/mg;
eval 'use ExtUtils::FakeConfig @arr';
1;
# EOF