diff options
author | Craig A. Berry <craigberry@mac.com> | 2011-03-31 17:09:31 -0500 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2011-04-04 04:15:51 -0500 |
commit | a24b897525551a1d93b043c9f896a41b26dd3a15 (patch) | |
tree | ff7b13e411f28c5cbe8c4a68765e80224a924b03 /dist | |
parent | 57f45d7ba6658ede12e3850ae36f93319790c957 (diff) | |
download | perl-a24b897525551a1d93b043c9f896a41b26dd3a15.tar.gz |
Make ExtUtils::CBuilder reset ccflags on compile for VMS.
On VMS only, the /DEFINE and /INCLUDE qualifiers are parsed off the
local copy of $Config{ccflags} and consumed in the process. This is
necessary because you're only allowed one of each of these clauses
in the compile command, so to add whatever has been requested for a
specific compile, we have to combine them with whatever Perl was
built with.
But since they are consumed, multiple compiles on the same EU::CB
object were only using the correct flags for the first one. Even
calling the have_compiler() check before compile() would make the
latter miss the defines and includes that were used to build Perl.
The solution is add a platform override that resets the local copy
of $Config{ccflags} from its original in %Config every time a
compiler operation is initiated.
Fixes smoke failures in ExtUtils::ParseXS.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm index 4f6a36cfdb..92f17c0ba5 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm @@ -8,6 +8,7 @@ $VERSION = '0.280202'; @ISA = qw(ExtUtils::CBuilder::Base); use File::Spec::Functions qw(catfile catdir); +use Config; # We do prelink, but don't want the parent to redo it. @@ -47,6 +48,20 @@ sub arg_include_dirs { return ('/include=(' . join(',', @dirs) . ')'); } +# We override the compile method because we consume the includes and defines +# parts of ccflags in the process of compiling but don't save those parts +# anywhere, so $self->{config}{ccflags} needs to be reset for each compile +# operation. + +sub compile { + my ($self, %args) = @_; + + $self->{config}{ccflags} = $Config{ccflags}; + $self->{config}{ccflags} = $ENV{CFLAGS} if defined $ENV{CFLAGS}; + + return $self->SUPER::compile(%args); +} + sub _do_link { my ($self, $type, %args) = @_; |