win32/des_fcrypt.patch Win32 port
win32/distclean.bat Remove _ALL_ files not listed here in MANIFEST
win32/dl_win32.xs Win32 port
+win32/FindExt.pm Scan for extensions
win32/genmk95.pl Perl code to generate command.com-usable makefile.95
win32/include/arpa/inet.h Win32 port
win32/include/dirent.h Win32 port
--- /dev/null
+package FindExt;
+use strict;
+use File::Find;
+use File::Basename;
+use Cwd;
+
+my $no = join('|',qw(DynaLoader GDBM_File ODBM_File NDBM_File DB_File Syslog Sysv));
+$no = qr/^(?:$no)$/i;
+
+my %ext;
+my $ext;
+sub scan_ext
+{
+ my $here = getcwd();
+ my $dir = shift;
+ chdir($dir) || die "Cannot cd to $dir\n";
+ ($ext = getcwd()) =~ s,/,\\,g;
+ find(\&find_ext,'.');
+ chdir($here) || die "Cannot cd to $here\n";
+ my @ext = extensions();
+}
+
+sub dynamic_extensions
+{
+ return grep $ext{$_} eq 'dynamic',keys %ext;
+}
+
+sub noxs_extensions
+{
+ return grep $ext{$_} eq 'noxs',keys %ext;
+}
+
+sub extensions
+{
+ return keys %ext;
+}
+
+sub find_ext
+{
+ if (/^(.*)\.pm$/i || /^(.*)_pm.PL$/i)
+ {
+ my $name = $1;
+ return if $name =~ $no;
+ my $dir = $File::Find::dir;
+ $dir =~ s,./,,;
+ return if exists $ext{$dir};
+ return unless -f "$ext/$dir/Makefile.PL";
+ if ($dir =~ /$name$/i)
+ {
+ if (-f "$ext/$dir/$name.xs")
+ {
+ $ext{$dir} = 'dynamic';
+ }
+ else
+ {
+ $ext{$dir} = 'nonxs';
+ }
+ }
+ }
+}
+
+1;
-use File::Find;
use File::Basename;
use Cwd;
+use FindExt;
my $here = getcwd();
my $perl = $^X;
$here =~ s,/,\\,g;
my $dir = shift;
chdir($dir) || die "Cannot cd to $dir\n";
(my $ext = getcwd()) =~ s,/,\\,g;
-my $no = join('|',qw(DynaLoader GDBM_File ODBM_File NDBM_File DB_File Syslog Sysv));
-$no = qr/^(?:$no)$/i;
-my %ext;
-find(\&find_xs,'.');
+FindExt::scan_ext($ext);
-foreach my $dir (sort keys %ext)
+my @ext = FindExt::extensions();
+
+foreach my $dir (sort @ext)
{
if (chdir("$ext\\$dir"))
{
}
}
-sub find_xs
-{
- if (/^(.*)\.pm$/i || /^(.*)_pm.PL$/i)
- {
- my $name = $1;
- return if $name =~ $no;
- my $dir = $File::Find::dir;
- $dir =~ s,./,,;
- return if exists $ext{$dir};
- return unless -f "$ext/$dir/Makefile.PL";
- if ($dir =~ /$name$/i)
- {
- $ext{$dir} = $name;
- }
- }
-}
+use FindExt;
# take a semicolon separated path list and turn it into a quoted
# list of paths that Text::Parsewords will grok
sub mungepath {
}
}
+FindExt::scan_ext("../ext");
+
my %opt;
+
my $optref = loadopts();
while (@{$optref} && $optref->[0] =~ /^([\w_]+)=(.*)$/) {
$opt{$1}=$2;
shift(@{$optref});
}
+$opt{'dynamic_ext'} = join(' ',FindExt::dynamic_extensions());
+$opt{'nonxs_ext'} = join(' ',FindExt::noxs_extensions());
+
my $pl_h = '../patchlevel.h';
if (-e $pl_h) {
_o=$(o) obj_ext=$(o) ~ \
_a=$(a) lib_ext=$(a) ~ \
static_ext=$(STATIC_EXT) ~ \
- dynamic_ext=$(DYNAMIC_EXT) ~ \
- nonxs_ext=$(NONXS_EXT) ~ \
use5005threads=$(USE_5005THREADS) ~ \
useithreads=$(USE_ITHREADS) ~ \
usethreads=$(USE_5005THREADS) ~ \
-del /f config.h
copy $(CFGH_TMPL) config.h
-..\config.sh : config.w32 $(MINIPERL) config_sh.PL
+..\config.sh : config.w32 $(MINIPERL) config_sh.PL FindExt.pm
$(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file \
$(mktmp $(CFG_VARS)) config.w32 > ..\config.sh