summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-02-10 09:36:47 +0000
committerDavid Mitchell <davem@iabyn.com>2009-04-14 19:42:02 +0100
commit381d8361f8251984e006adc1ef9c9fba9f560e6f (patch)
treef997daaa14f62c8681b0f82823891dc8537a99c9 /win32
parent2bc0d203e8f10b392513323a64fda85f93e7112f (diff)
downloadperl-381d8361f8251984e006adc1ef9c9fba9f560e6f.tar.gz
All extensions are at the top level, so no longer any need to recurse.
(cherry picked from commit 1f8a0b38638b171cf789a9f44cc9e8cd38bbf4d3)
Diffstat (limited to 'win32')
-rw-r--r--win32/FindExt.pm20
1 files changed, 7 insertions, 13 deletions
diff --git a/win32/FindExt.pm b/win32/FindExt.pm
index 7ceb1ac703..7bf9d52ca5 100644
--- a/win32/FindExt.pm
+++ b/win32/FindExt.pm
@@ -32,7 +32,7 @@ sub set_static_extensions {
sub scan_ext
{
my $dir = shift;
- find_ext("$dir/", '');
+ find_ext("$dir/");
extensions();
}
@@ -63,31 +63,25 @@ sub is_static
return $ext{$_[0]} eq 'static'
}
-# Function to recursively find available extensions, ignoring DynaLoader
-# NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
+# Function to find available extensions, ignoring DynaLoader
sub find_ext
{
my $ext_dir = shift;
- my $prefix = shift;
- opendir my $dh, "$ext_dir$prefix";
+ opendir my $dh, "$ext_dir";
while (defined (my $item = readdir $dh)) {
next if $item =~ /^\.\.?$/;
next if $item eq "DynaLoader";
- my $this_ext = my $this_ext_dir = "$prefix$item";
+ next unless -d "$ext_dir$item";
+ my $this_ext = $item;
my $leaf = $item;
$this_ext =~ s!-!/!g;
$leaf =~ s/.*-//;
- if (-f "$ext_dir$this_ext_dir/$leaf.xs" || -f "$ext_dir$this_ext_dir/$leaf.c" ) {
+ if (-f "$ext_dir$item/$leaf.xs" || -f "$ext_dir$item/$leaf.c" ) {
$ext{$this_ext} = $static{$this_ext} ? 'static' : 'dynamic';
- } elsif (-f "$ext_dir$this_ext_dir/Makefile.PL") {
- $ext{$this_ext} = 'nonxs';
} else {
- # It's not actually an extension. So recurse into it.
- if (-d "$ext_dir$this_ext_dir" && $prefix =~ tr#/## < 10) {
- find_ext($ext_dir, "$this_ext_dir/");
- }
+ $ext{$this_ext} = 'nonxs';
}
$ext{$this_ext} = 'known' if $ext{$this_ext} && $item =~ $no;
}