From: Nicholas Clark Date: Wed, 4 Feb 2009 17:13:30 +0000 (+0000) Subject: Also cope with extension directory names of the form ext/Data-Dumper/... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f44bdceebeee2f09fe107f15d8b99b0280171932;p=p5sagit%2Fp5-mst-13.2.git Also cope with extension directory names of the form ext/Data-Dumper/... --- diff --git a/win32/FindExt.pm b/win32/FindExt.pm index d122f30..9ba18b6 100644 --- a/win32/FindExt.pm +++ b/win32/FindExt.pm @@ -77,15 +77,20 @@ sub find_ext 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" ) { + my $this_ext = my $this_ext_dir = "$prefix$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" ) { $ext{$this_ext} = $static{$this_ext} ? 'static' : 'dynamic'; - } elsif (-f "$ext_dir$this_ext/Makefile.PL") { + } 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" && $prefix =~ tr#/## < 10) { - find_ext($ext_dir, "$this_ext/"); + if (-d "$ext_dir$this_ext_dir" && $prefix =~ tr#/## < 10) { + find_ext($ext_dir, "$this_ext_dir/"); } } $ext{$this_ext} = 'known' if $ext{$this_ext} && $item =~ $no;