From: Nicholas Clark Date: Sun, 6 Sep 2009 17:50:13 +0000 (+0100) Subject: Remove redundant parameters to build_extension(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=acb65a20b3f3b0f0cee262142e279624eaae58bb;p=p5sagit%2Fp5-mst-13.2.git Remove redundant parameters to build_extension(). $ext isn't used. $return_dir is just $up, and $up can be calculated from $ext_dir. $lib_dir and the default for $perl can be inferred from $up. --- diff --git a/make_ext.pl b/make_ext.pl index 64a7d4d..85bbacc 100644 --- a/make_ext.pl +++ b/make_ext.pl @@ -194,8 +194,6 @@ foreach my $spec (@extspec) { $copy =~ tr!/!-!; $ext_pathname = "ext/$copy"; } - my $up = $ext_pathname; - $up =~ s![^/]+!..!g; if ($Config{osname} eq 'catamount') { # Snowball's chance of building extensions. @@ -204,14 +202,20 @@ foreach my $spec (@extspec) { print "\tMaking $mname ($target)\n"; - build_extension('ext', $ext_pathname, $up, $perl || "$up/miniperl", - "$up/lib", $mname, + build_extension($ext_pathname, $perl, $mname, [@pass_through, @{$extra_passthrough{$spec} || []}]); } sub build_extension { - my ($ext, $ext_dir, $return_dir, $perl, $lib_dir, $mname, $pass_through) - = @_; + my ($ext_dir, $perl, $mname, $pass_through) = @_; + + my $up = $ext_dir; + $up =~ s![^/]+!..!g; + + $perl ||= "$up/miniperl"; + my $return_dir = $up; + my $lib_dir = "$up/lib"; + unless (chdir "$ext_dir") { warn "Cannot cd to $ext_dir: $!"; return;