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
{
$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';