8 my $no = join('|',qw(GDBM_File ODBM_File NDBM_File DB_File
9 Syslog SysV Langinfo));
20 return $ENV{'PWD'} = $_;
23 sub set_static_extensions {
24 # adjust results of scan_ext, and also save
25 # statics in case scan_ext hasn't been called yet.
26 # if '*' is passed then all XS extensions are static
27 # (with possible exclusions)
31 my %excl = map {$_=>1} map {m/^!(.*)$/} @_[1 .. $#_];
32 @list = grep {!exists $excl{$_}} keys %ext;
36 $ext{$_} = 'static' if $ext{$_} && $ext{$_} eq 'dynamic';
44 chdir($dir) || die "Cannot cd to $dir\n";
45 ($ext = getcwd()) =~ s,/,\\,g;
47 chdir($here) || die "Cannot cd to $here\n";
48 my @ext = extensions();
53 return sort grep $ext{$_} eq 'dynamic',keys %ext;
58 return sort grep $ext{$_} eq 'static',keys %ext;
63 return sort grep $ext{$_} eq 'nonxs',keys %ext;
68 return sort grep $ext{$_} ne 'known',keys %ext;
73 # faithfully copy Configure in not including nonxs extensions for the nonce
74 return sort grep $ext{$_} ne 'nonxs',keys %ext;
79 return $ext{$_[0]} eq 'static'
82 # Function to recursively find available extensions, ignoring DynaLoader
83 # NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
87 my @items = grep { !/^\.\.?$/ } readdir $dh;
89 for my $xxx (@items) {
90 if ($xxx ne "DynaLoader") {
91 if (-f "$xxx/$xxx.xs" || -f "$xxx/$xxx.c" ) {
92 $ext{"$_[0]$xxx"} = $static{"$_[0]$xxx"} ? 'static' : 'dynamic';
93 } elsif (-f "$xxx/Makefile.PL") {
94 $ext{"$_[0]$xxx"} = 'nonxs';
96 if (-d $xxx && @_ < 10) {
98 find_ext("$_[0]$xxx/", @_);
102 $ext{"$_[0]$xxx"} = 'known' if $ext{"$_[0]$xxx"} && $xxx =~ $no;
106 # Special case: Add in modules that nest beyond the first level.
107 # Currently threads/shared and Hash/Util/FieldHash, since they are
108 # not picked up by the recursive find above (and adding in general
109 # recursive finding breaks SDBM_File/sdbm).
110 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
112 if (!$_[0] && -d "threads/shared") {
113 $ext{"threads/shared"} = 'dynamic';
115 if (!$_[0] && -d "Hash/Util/FieldHash") {
116 $ext{"Hash/Util/FieldHash"} = 'dynamic';