X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2FFindExt.pm;h=7bf9d52ca51978d2ea2050dc7c866b650855843f;hb=17c79f43379fc059c3c23c26a109c793268b3956;hp=da0bf547c14095db8f6686dc72ace637149d5af1;hpb=442749d5efa49ff740739d8acc4deb49bf64ff30;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/FindExt.pm b/win32/FindExt.pm index da0bf54..7bf9d52 100644 --- a/win32/FindExt.pm +++ b/win32/FindExt.pm @@ -6,7 +6,7 @@ use strict; use warnings; my $no = join('|',qw(GDBM_File ODBM_File NDBM_File DB_File - VMS Syslog IPC-SysV Langinfo)); + VMS Sys-Syslog IPC-SysV I18N-Langinfo)); $no = qr/^(?:$no)$/i; my %ext; @@ -32,7 +32,7 @@ sub set_static_extensions { sub scan_ext { my $dir = shift; - find_ext("$dir/", ''); + find_ext("$dir/"); extensions(); } @@ -63,47 +63,28 @@ 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; } - -# Special case: Add in modules that nest beyond the first level. -# Currently threads/shared and Hash/Util/FieldHash, since they are -# not picked up by the recursive find above (and adding in general -# recursive finding breaks SDBM_File/sdbm). -# A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash) - - if (!$prefix && -d "${ext_dir}threads/shared") { - $ext{"threads/shared"} = 'dynamic'; - } - if (!$prefix && -d "${ext_dir}Hash/Util/FieldHash") { - $ext{"Hash/Util/FieldHash"} = 'dynamic'; - } } 1;