diff options
author | John E. Malmberg <wb8tyw@qsl.net> | 2005-09-07 15:59:36 -0400 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2005-09-08 06:07:53 +0000 |
commit | 3ee704ccbdce3405ca5ffed7195f318cf62e72c5 (patch) | |
tree | 3dba4f9dfd594117e0f28d0e0bb739177b79d732 /lib/ExtUtils/CBuilder | |
parent | e6ddefa8ea3de4bcc18352257210295203bcb7cb (diff) | |
download | perl-3ee704ccbdce3405ca5ffed7195f318cf62e72c5.tar.gz |
[patch@cbuilder_0.13] VMS fixes for cbuilder
From: "John E. Malmberg" <wb8tyw@qsl.net>
Message-ID: <431F7EE8.3040908@qsl.net>
p4raw-id: //depot/perl@25364
Diffstat (limited to 'lib/ExtUtils/CBuilder')
-rw-r--r-- | lib/ExtUtils/CBuilder/Base.pm | 24 | ||||
-rw-r--r-- | lib/ExtUtils/CBuilder/Platform/VMS.pm | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/lib/ExtUtils/CBuilder/Base.pm b/lib/ExtUtils/CBuilder/Base.pm index 774bb46f9e..0b250d71b2 100644 --- a/lib/ExtUtils/CBuilder/Base.pm +++ b/lib/ExtUtils/CBuilder/Base.pm @@ -89,6 +89,13 @@ sub compile { my @extra_compiler_flags = $self->split_like_shell($args{extra_compiler_flags}); my @cccdlflags = $self->split_like_shell($cf->{cccdlflags}); my @ccflags = $self->split_like_shell($cf->{ccflags}); + + #VMS can only have one include list, remove the one from config. + if ((@include_dirs != 0) && ($^O eq 'VMS')) { + for (@ccflags) { + s/\/Include[^\/]*//; + } + } my @optimize = $self->split_like_shell($cf->{optimize}); my @flags = (@include_dirs, @cccdlflags, @extra_compiler_flags, $self->arg_nolink, @@ -186,6 +193,15 @@ sub _do_link { $objects = [$objects] unless ref $objects; my $out = $args{$type} || $self->$type($objects->[0]); + # Need to create with the same name as Dyanloader will load with. + if ($^O eq 'VMS') { + my ($dev,$dir,$file) = File::Spec->splitpath($out); + if (defined &DynaLoader::mod2fname) { + $file = DynaLoader::mod2fname([$file]); + $out = File::Spec->catpath($dev,$dir,$file); + } + } + my @temp_files; @temp_files = $self->prelink(%args, @@ -195,6 +211,14 @@ sub _do_link { my @output = $args{lddl} ? $self->arg_share_object_file($out) : $self->arg_exec_file($out); my @shrp = $self->split_like_shell($cf->{shrpenv}); my @ld = $self->split_like_shell($cf->{ld}); + + # vms has two option files, the external symbol, and to pull in PerlShr + if ($^O eq 'VMS') { + $objects->[0] .= ','; + $objects->[1] = 'sys$disk:[]' . @temp_files[0] . '/opt,'; + $objects->[2] = $self->perl_inc() . 'PerlShr.Opt/opt'; + } + $self->do_system(@shrp, @ld, @output, @$objects, @linker_flags) or die "error building $out from @$objects"; diff --git a/lib/ExtUtils/CBuilder/Platform/VMS.pm b/lib/ExtUtils/CBuilder/Platform/VMS.pm index 9014e7cea1..dea0345758 100644 --- a/lib/ExtUtils/CBuilder/Platform/VMS.pm +++ b/lib/ExtUtils/CBuilder/Platform/VMS.pm @@ -7,7 +7,7 @@ use vars qw($VERSION @ISA); $VERSION = '0.12'; @ISA = qw(ExtUtils::CBuilder::Base); -sub need_prelink { 0 } +sub need_prelink { 1 } sub arg_include_dirs { my $self = shift; |