8 my $no = join('|',qw(GDBM_File ODBM_File NDBM_File DB_File
9 VMS Sys-Syslog IPC-SysV I18N-Langinfo));
15 sub set_static_extensions {
16 # adjust results of scan_ext, and also save
17 # statics in case scan_ext hasn't been called yet.
18 # if '*' is passed then all XS extensions are static
19 # (with possible exclusions)
23 my %excl = map {$_=>1} map {m/^!(.*)$/} @_[1 .. $#_];
24 @list = grep {!exists $excl{$_}} keys %ext;
28 $ext{$_} = 'static' if $ext{$_} && $ext{$_} eq 'dynamic';
35 find_ext("$dir/", '');
42 sort grep $ext{$_} eq $key, keys %ext;
46 *dynamic_ext = _ext_eq('dynamic');
47 *static_ext = _ext_eq('static');
48 *nonxs_ext = _ext_eq('nonxs');
53 sort grep $ext{$_} ne $key, keys %ext;
57 *extensions = _ext_ne('known');
58 # faithfully copy Configure in not including nonxs extensions for the nonce
59 *known_extensions = _ext_ne('nonxs');
63 return $ext{$_[0]} eq 'static'
66 # Function to recursively find available extensions, ignoring DynaLoader
67 # NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
72 opendir my $dh, "$ext_dir$prefix";
73 while (defined (my $item = readdir $dh)) {
74 next if $item =~ /^\.\.?$/;
75 next if $item eq "DynaLoader";
76 my $this_ext = my $this_ext_dir = "$prefix$item";
82 if (-f "$ext_dir$this_ext_dir/$leaf.xs" || -f "$ext_dir$this_ext_dir/$leaf.c" ) {
83 $ext{$this_ext} = $static{$this_ext} ? 'static' : 'dynamic';
84 } elsif (-f "$ext_dir$this_ext_dir/Makefile.PL") {
85 $ext{$this_ext} = 'nonxs';
87 # It's not actually an extension. So recurse into it.
88 if (-d "$ext_dir$this_ext_dir" && $prefix =~ tr#/## < 10) {
89 find_ext($ext_dir, "$this_ext_dir/");
92 $ext{$this_ext} = 'known' if $ext{$this_ext} && $item =~ $no;
98 # cperl-indent-level: 4
99 # indent-tabs-mode: nil
102 # ex: set ts=8 sts=4 sw=4 et: