summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-02-04 12:15:19 +0000
committerNicholas Clark <nick@ccl4.org>2009-02-04 17:14:06 +0000
commit3380c781dc67e9bba70bd5913c7f0f3aa2274bf3 (patch)
treecea4f2d385e10f548ce526b5cd641851a3570611 /win32
parent0598b5ab3697b872539de6ed6dc1522b873602e1 (diff)
downloadperl-3380c781dc67e9bba70bd5913c7f0f3aa2274bf3.tar.gz
Clearer variable names. Add a mode line coda.
Because a substantial amount of this file is about to be refactored, I decided that we should expand tabs to spaces.
Diffstat (limited to 'win32')
-rw-r--r--win32/FindExt.pm39
1 files changed, 23 insertions, 16 deletions
diff --git a/win32/FindExt.pm b/win32/FindExt.pm
index 69efa0adda..d122f3056c 100644
--- a/win32/FindExt.pm
+++ b/win32/FindExt.pm
@@ -71,23 +71,24 @@ sub is_static
# NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
sub find_ext
{
+ my $ext_dir = shift;
my $prefix = shift;
- my $dir = shift;
- opendir my $dh, "$prefix$dir";
- while (defined (my $xxx = readdir $dh)) {
- next if $xxx =~ /^\.\.?$/;
- if ($xxx ne "DynaLoader") {
- if (-f "$prefix$dir$xxx/$xxx.xs" || -f "$prefix$dir$xxx/$xxx.c" ) {
- $ext{"$dir$xxx"} = $static{"$dir$xxx"} ? 'static' : 'dynamic';
- } elsif (-f "$prefix$dir$xxx/Makefile.PL") {
- $ext{"$dir$xxx"} = 'nonxs';
- } else {
- if (-d "$prefix$dir$xxx" && $dir =~ tr#/## < 10) {
- find_ext($prefix, "$dir$xxx/");
- }
+ opendir my $dh, "$ext_dir$prefix";
+ while (defined (my $item = readdir $dh)) {
+ next if $item =~ /^\.\.?$/;
+ next if $item eq "DynaLoader";
+ my $this_ext = "$prefix$item";
+ if (-f "$ext_dir$this_ext/$item.xs" || -f "$ext_dir$this_ext/$item.c" ) {
+ $ext{$this_ext} = $static{$this_ext} ? 'static' : 'dynamic';
+ } elsif (-f "$ext_dir$this_ext/Makefile.PL") {
+ $ext{$this_ext} = 'nonxs';
+ } else {
+ # It's not actually an extension. So recurse into it.
+ if (-d "$ext_dir$this_ext" && $prefix =~ tr#/## < 10) {
+ find_ext($ext_dir, "$this_ext/");
}
- $ext{"$dir$xxx"} = 'known' if $ext{"$dir$xxx"} && $xxx =~ $no;
}
+ $ext{$this_ext} = 'known' if $ext{$this_ext} && $item =~ $no;
}
# Special case: Add in modules that nest beyond the first level.
@@ -96,12 +97,18 @@ sub find_ext
# recursive finding breaks SDBM_File/sdbm).
# A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
- if (!$dir && -d "${prefix}threads/shared") {
+ if (!$prefix && -d "${ext_dir}threads/shared") {
$ext{"threads/shared"} = 'dynamic';
}
- if (!$dir && -d "${prefix}Hash/Util/FieldHash") {
+ if (!$prefix && -d "${ext_dir}Hash/Util/FieldHash") {
$ext{"Hash/Util/FieldHash"} = 'dynamic';
}
}
1;
+# Local variables:
+# cperl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
+#
+# ex: set ts=8 sts=4 sw=4 et: