[ 9604]
Split out extension finding code from buildext.pl into FindExt.pm
Use it to get Config.pm's idea of available extensions in line
with what is built.
[ 9603]
Cleanup correction for failed :Via() layer, also set an error code.
[ 9602]
Digests in lib/md5-file.t are for text files _without_ CRLF i.e. UNIX
style. So don't use binmode() on the handles so that Win32 etc. see
same sequence and produce same digests.
[ 9601]
Allow PerlIOBase_pushed to ignore prefix on mode (e.g. sysopen's "#r")
Else it complains and so crlf layer (say) does not get pushed.
[ 9599]
Quote $VERSION in Encode.pm.
regen_config_h as requested.
p4raw-link: @9604 on //depot/perlio:
8e2329934bcca9c59680f6d478c3c2bc3ef7c649
p4raw-link: @9603 on //depot/perlio:
267cbce72d0da7af102852e6d7e0bb5c1ce41da6
p4raw-link: @9602 on //depot/perlio:
9070af9fb87632d66faa82c00ab8b5cf20323a2b
p4raw-link: @9601 on //depot/perlio:
c5af4229019b04c7fa4be99300f8d9883c0bdf73
p4raw-link: @9599 on //depot/perlio:
b8a524e96d5b75be96d6a98368b9c29153780cfe
p4raw-id: //depot/perl@9606
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
{
STRLEN pkglen = 0;
char *pkg = SvPV(arg,pkglen);
- s->obj = arg;
+ s->obj = SvREFCNT_inc(arg);
s->stash = gv_stashpvn(pkg, pkglen, FALSE);
if (s->stash)
{
if (result)
{
if (sv_isobject(result))
- s->obj = SvREFCNT_inc(result);
+ {
+ s->obj = SvREFCNT_inc(result);
+ SvREFCNT_dec(arg);
+ }
else if (SvIV(result) != 0)
return SvIV(result);
}
else
{
Perl_warn(aTHX_ "Cannot find package '%.*s'",(int) pkglen,pkg);
+#ifdef ENOSYS
+ errno = ENOSYS;
+#else
+#ifdef ENOENT
+ errno = ENOENT;
+#endif
+#endif
code = -1;
}
}
l->flags |= PERLIO_F_FASTGETS;
if (mode)
{
+ if (*mode == '#' || *mode == 'I')
+ mode++;
switch (*mode++)
{
case 'r':
#print "$file $method\n";
open(FILE, $file) or die "Can't open $file: $!";
- binmode(FILE);
+# Digests avove are generated on UNIX without CRLF
+# so leave handles in text mode
+# binmode(FILE);
my $digest = Digest::MD5->new->addfile(*FILE)->$method();
close(FILE);
my($file) = @_;
local $/; # slurp
open(FILE, $file) or die "Can't open $file: $!";
- binmode(FILE);
+# Digests avove are generated on UNIX without CRLF
+# so leave handles in text mode
+# binmode(FILE);
my $tmp = <FILE>;
close(FILE);
$tmp;
--- /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