summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-09-09 05:15:41 +0100
committerNicholas Clark <nick@ccl4.org>2009-09-09 05:15:41 +0100
commit0a3660e34f2e0cc69eaa07cad124563ed3e6fbdb (patch)
treead4a3ec8831323fb724aba49c1e0f61e77d44e45 /win32
parent63d52911fe68ef7d7ec09a7689281bfa19834d78 (diff)
downloadperl-0a3660e34f2e0cc69eaa07cad124563ed3e6fbdb.tar.gz
Use readdir rather than glob, beacuse perlglob.exe is unavailable at this time.
Diffstat (limited to 'win32')
-rw-r--r--win32/FindExt.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/win32/FindExt.pm b/win32/FindExt.pm
index 7c998147eb..3f12a23322 100644
--- a/win32/FindExt.pm
+++ b/win32/FindExt.pm
@@ -63,6 +63,16 @@ sub is_static
return $ext{$_[0]} eq 'static'
}
+sub has_xs_or_c {
+ my $dir = shift;
+ opendir my $dh, $dir or die "opendir $dir: $!";
+ while (defined (my $item = readdir $dh)) {
+ return 1 if $item =~ /\.xs$/;
+ return 1 if $item =~ /\.c$/;
+ }
+ return 0;
+}
+
# Function to find available extensions, ignoring DynaLoader
sub find_ext
{
@@ -78,8 +88,7 @@ sub find_ext
$this_ext =~ s!-!/!g;
$leaf =~ s/.*-//;
- my @files = glob "$ext_dir$item/*.{xs,c}";
- if (@files) {
+ if (has_xs_or_c("$ext_dir$item")) {
$ext{$this_ext} = $static{$this_ext} ? 'static' : 'dynamic';
} else {
$ext{$this_ext} = 'nonxs';