summaryrefslogtreecommitdiff
path: root/make_ext.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-09-24 14:52:34 +0100
committerNicholas Clark <nick@ccl4.org>2009-09-24 14:52:34 +0100
commit7c40aa71c55530661091304bfd36d642ff33d9b6 (patch)
tree77b75b4d7b2a28c6f1c151b3eb05b444d899a4d0 /make_ext.pl
parenta22f28a4268aa03ce2bafaf594271b8ff764a5f8 (diff)
downloadperl-7c40aa71c55530661091304bfd36d642ff33d9b6.tar.gz
Allow make_ext.pl to take multiple --dir options, and honour them all.
Diffstat (limited to 'make_ext.pl')
-rw-r--r--make_ext.pl62
1 files changed, 32 insertions, 30 deletions
diff --git a/make_ext.pl b/make_ext.pl
index 0e0bc9bac1..0fe892f7f9 100644
--- a/make_ext.pl
+++ b/make_ext.pl
@@ -76,7 +76,7 @@ foreach (@ARGV) {
} elsif (/^--([\w\-]+)$/) {
$opts{$1} = 1;
} elsif (/^--([\w\-]+)=(.*)$/) {
- $opts{$1} = $2;
+ push @{$opts{$1}}, $2;
} elsif (/=/) {
push @pass_through, $_;
} elsif (length) {
@@ -116,8 +116,8 @@ foreach (@extspec) {
my $makecmd = shift @pass_through; # Should be something like MAKE=make
unshift @pass_through, 'PERL_CORE=1';
-my $dir = $opts{dir} || 'ext';
-my $target = $opts{target};
+my @dirs = $opts{dir} || ['ext', 'cpan'];
+my $target = $opts{target}[0];
$target = 'all' unless defined $target;
# Previously, $make was taken from config.sh. However, the user might
@@ -171,35 +171,37 @@ if ($is_Win32) {
}
print "In ", getcwd();
- chdir($dir) || die "Cannot cd to $dir\n";
- (my $ext = getcwd()) =~ s{/}{\\}g;
- FindExt::scan_ext($ext);
- FindExt::set_static_extensions(split ' ', $Config{static_ext});
-
- my @ext;
- push @ext, FindExt::static_ext() if $static;
- push @ext, FindExt::dynamic_ext() if $dynamic;
- push @ext, FindExt::nonxs_ext() if $nonxs;
- push @ext, 'DynaLoader' if $dynaloader;
-
- foreach (sort @ext) {
- if (%incl and !exists $incl{$_}) {
- #warn "Skipping extension $ext\\$_, not in inclusion list\n";
- next;
- }
- if (exists $excl{$_}) {
- warn "Skipping extension $ext\\$_, not ported to current platform";
- next;
- }
- push @extspec, $_;
- if($_ eq 'DynaLoader') {
- # No, we don't know why nmake can't work out the dependency chain
- push @{$extra_passthrough{$_}}, 'DynaLoader.c';
- } elsif(FindExt::is_static($_)) {
- push @{$extra_passthrough{$_}}, 'LINKTYPE=static';
+ foreach my $dir (@dirs) {
+ chdir($dir) || die "Cannot cd to $dir\n";
+ (my $ext = getcwd()) =~ s{/}{\\}g;
+ FindExt::scan_ext($ext);
+ FindExt::set_static_extensions(split ' ', $Config{static_ext});
+
+ my @ext;
+ push @ext, FindExt::static_ext() if $static;
+ push @ext, FindExt::dynamic_ext() if $dynamic;
+ push @ext, FindExt::nonxs_ext() if $nonxs;
+ push @ext, 'DynaLoader' if $dynaloader;
+
+ foreach (sort @ext) {
+ if (%incl and !exists $incl{$_}) {
+ #warn "Skipping extension $ext\\$_, not in inclusion list\n";
+ next;
+ }
+ if (exists $excl{$_}) {
+ warn "Skipping extension $ext\\$_, not ported to current platform";
+ next;
+ }
+ push @extspec, $_;
+ if($_ eq 'DynaLoader') {
+ # No, we don't know why nmake can't work out the dependency chain
+ push @{$extra_passthrough{$_}}, 'DynaLoader.c';
+ } elsif(FindExt::is_static($_)) {
+ push @{$extra_passthrough{$_}}, 'LINKTYPE=static';
+ }
}
+ chdir '..'; # now in the Perl build directory
}
- chdir '..'; # now in the Perl build directory
}
elsif ($is_VMS) {
$perl = $^X;