summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2005-09-29 00:23:44 +0000
committerSteve Peters <steve@fisharerojo.org>2005-09-29 00:23:44 +0000
commit2bd31f1a4a58e1269b235e3660ee031e5b786af9 (patch)
tree61ca43cac5d6a56bad724315d2e3f38b317cd2a7 /lib
parent73ea3450b2c8512de829cec5308e4cbe2a8cd9c5 (diff)
downloadperl-2bd31f1a4a58e1269b235e3660ee031e5b786af9.tar.gz
Upgrade to ExtUtils::CBuilder 0.14
p4raw-id: //depot/perl@25650
Diffstat (limited to 'lib')
-rw-r--r--lib/ExtUtils/CBuilder.pm2
-rw-r--r--lib/ExtUtils/CBuilder/Base.pm3
-rw-r--r--lib/ExtUtils/CBuilder/Platform/VMS.pm50
-rw-r--r--lib/ExtUtils/CBuilder/t/01-basic.t5
-rw-r--r--lib/ExtUtils/CBuilder/t/02-link.t5
5 files changed, 53 insertions, 12 deletions
diff --git a/lib/ExtUtils/CBuilder.pm b/lib/ExtUtils/CBuilder.pm
index 9100bc78d4..f137a00eb1 100644
--- a/lib/ExtUtils/CBuilder.pm
+++ b/lib/ExtUtils/CBuilder.pm
@@ -5,7 +5,7 @@ use File::Path ();
use File::Basename ();
use vars qw($VERSION @ISA);
-$VERSION = '0.12_01';
+$VERSION = '0.14';
$VERSION = eval $VERSION;
# Okay, this is the brute-force method of finding out what kind of
diff --git a/lib/ExtUtils/CBuilder/Base.pm b/lib/ExtUtils/CBuilder/Base.pm
index 774bb46f9e..a262a37e2d 100644
--- a/lib/ExtUtils/CBuilder/Base.pm
+++ b/lib/ExtUtils/CBuilder/Base.pm
@@ -176,7 +176,7 @@ sub link_executable {
my ($self, %args) = @_;
return $self->_do_link('exe_file', lddl => 0, %args);
}
-
+
sub _do_link {
my ($self, $type, %args) = @_;
@@ -195,6 +195,7 @@ 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});
+
$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..b69d6997af 100644
--- a/lib/ExtUtils/CBuilder/Platform/VMS.pm
+++ b/lib/ExtUtils/CBuilder/Platform/VMS.pm
@@ -10,8 +10,38 @@ $VERSION = '0.12';
sub need_prelink { 0 }
sub arg_include_dirs {
- my $self = shift;
- return '/include=(' . join(',', @_) . ')';
+ my ($self, @dirs) = @_;
+
+ # VMS can only have one include list, add the one from config.
+ if ($self->{config}{ccflags} =~ s{/inc[^=]+(?:=)+(?:\()?([^\/\)]*)} {}i) {
+ unshift @dirs, $1;
+ }
+ return unless @dirs;
+
+ return ('/include=(' . join(',', @dirs) . ')');
+}
+
+sub _do_link {
+ my ($self, $type, %args) = @_;
+
+ my $objects = delete $args{objects};
+ $objects = [$objects] unless ref $objects;
+
+ # VMS has two option files, the external symbol, and to pull in PerlShr
+ if ($args{lddl}) {
+ my @temp_files =
+ $self->prelink(%args, dl_name => $args{module_name});
+
+ $objects->[-1] .= ',';
+
+ # If creating a loadable library, the link option file is needed.
+ push @$objects, 'sys$disk:[]' . $temp_files[0] . '/opt,';
+
+ # VMS always needs the option file for the Perl shared image.
+ push @$objects, $self->perl_inc() . 'PerlShr.Opt/opt';
+ }
+
+ return $self->SUPER::_do_link($type, %args, objects => $objects);
}
sub arg_nolink { return; }
@@ -31,4 +61,20 @@ sub arg_share_object_file {
return ("$self->{config}{lddlflags}=$file");
}
+
+sub lib_file {
+ my ($self, $dl_file) = @_;
+ $dl_file =~ s/\.[^.]+$//;
+ $dl_file =~ tr/"//d;
+ $dl_file = $dl_file .= '.' . $self->{config}{dlext};
+
+ # Need to create with the same name as DynaLoader will load with.
+ if (defined &DynaLoader::mod2fname) {
+ my ($dev,$dir,$file) = File::Spec->splitpath($dl_file);
+ $file = DynaLoader::mod2fname([$file]);
+ $dl_file = File::Spec->catpath($dev,$dir,$file);
+ }
+ return $dl_file;
+}
+
1;
diff --git a/lib/ExtUtils/CBuilder/t/01-basic.t b/lib/ExtUtils/CBuilder/t/01-basic.t
index 39c6e5b1a2..b13f4d0bdc 100644
--- a/lib/ExtUtils/CBuilder/t/01-basic.t
+++ b/lib/ExtUtils/CBuilder/t/01-basic.t
@@ -47,10 +47,7 @@ my ($lib, @temps) = $b->link(objects => $object_file,
$lib =~ tr/"'//d;
ok $lib_file, $lib;
-for ($source_file, $lib_file, $object_file) {
- tr/"'//d;
- 1 while unlink;
-}
+unlink $source_file;
my @words = $b->split_like_shell(' foo bar');
ok @words, 2;
diff --git a/lib/ExtUtils/CBuilder/t/02-link.t b/lib/ExtUtils/CBuilder/t/02-link.t
index 48a63f08b6..ccfe4ee182 100644
--- a/lib/ExtUtils/CBuilder/t/02-link.t
+++ b/lib/ExtUtils/CBuilder/t/02-link.t
@@ -55,10 +55,7 @@ ok $exe_file;
ok my_system($exe_file), 11;
# Clean up
-for ($source_file, $exe_file, $object_file) {
- tr/"'//d;
- 1 while unlink;
-}
+unlink $source_file;
sub my_system {
my $cmd = shift;