8 my $no = join('|',qw(GDBM_File ODBM_File NDBM_File DB_File
9 Syslog SysV Langinfo));
17 $ENV{'PWD'} = Win32::GetCwd();
18 $ENV{'PWD'} =~ s:\\:/:g ;
22 sub set_static_extensions
24 # adjust results of scan_ext, and also save
25 # statics in case scan_ext hasn't been called yet.
29 $ext{$_} = 'static' if $ext{$_} && $ext{$_} eq 'dynamic';
37 chdir($dir) || die "Cannot cd to $dir\n";
38 ($ext = getcwd()) =~ s,/,\\,g;
40 chdir($here) || die "Cannot cd to $here\n";
41 my @ext = extensions();
46 return sort grep $ext{$_} eq 'dynamic',keys %ext;
51 return sort grep $ext{$_} eq 'static',keys %ext;
56 return sort grep $ext{$_} eq 'nonxs',keys %ext;
61 return sort grep $ext{$_} ne 'known',keys %ext;
66 # faithfully copy Configure in not including nonxs extensions for the nonce
67 return sort grep $ext{$_} ne 'nonxs',keys %ext;
72 return $ext{$_[0]} eq 'static'
75 # Function to recursively find available extensions, ignoring DynaLoader
76 # NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
80 my @items = grep { !/^\.\.?$/ } readdir $dh;
82 for my $xxx (@items) {
83 if ($xxx ne "DynaLoader") {
84 if (-f "$xxx/$xxx.xs") {
85 $ext{"$_[0]$xxx"} = $static{"$_[0]$xxx"} ? 'static' : 'dynamic';
86 } elsif (-f "$xxx/Makefile.PL") {
87 $ext{"$_[0]$xxx"} = 'nonxs';
89 if (-d $xxx && @_ < 10) {
91 find_ext("$_[0]$xxx/", @_);
95 $ext{"$_[0]$xxx"} = 'known' if $ext{"$_[0]$xxx"} && $xxx =~ $no;
99 # Special case: Add in threads/shared since it is not picked up by the
100 # recursive find above (and adding in general recursive finding breaks
101 # SDBM_File/sdbm). A.D. 10/25/2001.
103 if (!$_[0] && -d "threads/shared") {
104 $ext{"threads/shared"} = 'dynamic';