+3.08_06 - 2006-06-25
+
+ * fix breakage on MSWin32, where generating XS files on
+ the fly doesn't seem to work the same way as under Linux
+ (thanks to Sadahiro Tomoyuki for providing a patch)
+ * load the shared files only when testing the module
+ * remove PPPort.xs from CPAN distribution
+
3.08_05 - 2006-06-23
* when in the core, generate PPPort.pm and PPPort.xs
#
################################################################################
#
-# $Revision: 21 $
+# $Revision: 24 $
# $Author: mhx $
-# $Date: 2006/06/23 15:55:22 +0200 $
+# $Date: 2006/06/25 06:30:56 +0200 $
#
################################################################################
#
################################################################################
use ExtUtils::MakeMaker;
+use strict;
require 5.003;
unless ($ENV{'PERL_CORE'}) {
$ENV{'PERL_CORE'} = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV;
}
-@ARGV = map { /^--with-(.*)/ && ++$opt{$1} ? () : $_ } @ARGV;
-
-%PL_FILES = (
- 'ppport_h.PL' => 'ppport.h',
- 'PPPort_pm.PL' => 'PPPort.pm',
- 'PPPort_xs.PL' => 'PPPort.xs',
-);
-
-@C_FILES = qw{ module2.c module3.c };
-
-@clean = qw{ $(H_FILES) PPPort.c };
-
-%depend = ( '$(OBJECT)' => '$(H_FILES)' );
-
-if ($opt{'apicheck'}) {
- $PL_FILES{'apicheck_c.PL'} = 'apicheck.c';
- push @C_FILES, qw{ apicheck.c };
- push @clean, qw{ apicheck.c apicheck.i };
- $depend{'apicheck.i'} = 'ppport.h';
-}
-
-if ($ENV{'PERL_CORE'}) {
- # Pods will be built by installman.
- push @moreopts, MAN3PODS => {};
- push @clean, qw( PPPort.pm PPPort.xs );
-}
-else {
- # Devel::PPPort is in the core since 5.7.3
- push @moreopts, INSTALLDIRS => ($] >= 5.007003 ? 'perl' : 'site');
-}
-
-if (eval $ExtUtils::MakeMaker::VERSION >= 6) {
- push @moreopts, AUTHOR => 'Marcus Holland-Moritz <mhx@cpan.org>';
- if (-f 'PPPort.pm') {
- push @moreopts, ABSTRACT_FROM => 'PPPort.pm';
- }
-}
+my %opt;
-if (eval $ExtUtils::MakeMaker::VERSION >= 6.30_01) {
- print "Setting license tag...\n";
- push @moreopts, LICENSE => 'perl';
-}
+@ARGV = map { /^--with-(.*)/ && ++$opt{$1} ? () : $_ } @ARGV;
WriteMakefile(
NAME => 'Devel::PPPort',
VERSION_FROM => 'PPPort_pm.PL',
- PL_FILES => \%PL_FILES,
PM => { 'PPPort.pm' => '$(INST_LIBDIR)/PPPort.pm' },
- C => \@C_FILES,
H => [ qw(ppport.h) ],
OBJECT => '$(BASEEXT)$(OBJ_EXT) $(O_FILES)',
XSPROTOARG => '-noprototypes',
- clean => { FILES => "@clean" },
- depend => \%depend,
- @moreopts,
+ CONFIGURE => \&configure,
);
-sub MY::postamble {
+sub configure
+{
+ my @clean = qw{ $(H_FILES) PPPort.xs PPPort.c };
+ my %depend = ('$(OBJECT)' => '$(H_FILES)');
+ my @C_FILES = qw{ module2.c module3.c },
+ my %PL_FILES = (
+ 'ppport_h.PL' => 'ppport.h',
+ 'PPPort_pm.PL' => 'PPPort.pm',
+ 'PPPort_xs.PL' => 'PPPort.xs',
+ );
+ my @moreopts;
+
+ if (eval $ExtUtils::MakeMaker::VERSION >= 6) {
+ push @moreopts, AUTHOR => 'Marcus Holland-Moritz <mhx@cpan.org>';
+ if (-f 'PPPort.pm') {
+ push @moreopts, ABSTRACT_FROM => 'PPPort.pm';
+ }
+ }
+
+ if (eval $ExtUtils::MakeMaker::VERSION >= 6.30_01) {
+ print "Setting license tag...\n";
+ push @moreopts, LICENSE => 'perl';
+ }
+
+ if ($ENV{'PERL_CORE'}) {
+ # Pods will be built by installman.
+ push @moreopts, MAN3PODS => {};
+ push @clean, 'PPPort.pm';
+ }
+ else {
+ # Devel::PPPort is in the core since 5.7.3
+ push @moreopts, INSTALLDIRS => ($] >= 5.007003 ? 'perl' : 'site');
+ }
+
+ if ($opt{'apicheck'}) {
+ $PL_FILES{'apicheck_c.PL'} = 'apicheck.c';
+ push @C_FILES, qw{ apicheck.c };
+ push @clean, qw{ apicheck.c apicheck.i };
+ $depend{'apicheck.i'} = 'ppport.h';
+ }
+
+ return {
+ C => \@C_FILES,
+ XS => { 'PPPort.xs' => 'PPPort.c' },
+ PL_FILES => \%PL_FILES,
+ depend => \%depend,
+ clean => { FILES => "@clean" },
+ @moreopts,
+ };
+}
+
+sub MY::postamble
+{
package MY;
my $post = shift->SUPER::postamble(@_);
$post .= <<'POSTAMBLE';
return $post;
}
-sub MY::c_o {
+sub MY::c_o
+{
package MY;
my $co = shift->SUPER::c_o(@_);
#
################################################################################
#
-# $Revision: 45 $
+# $Revision: 46 $
# $Author: mhx $
-# $Date: 2006/06/23 15:43:09 +0200 $
+# $Date: 2006/06/25 03:41:11 +0200 $
#
################################################################################
#
#
################################################################################
#
-# $Revision: 45 $
+# $Revision: 46 $
# $Author: mhx $
-# $Date: 2006/06/23 15:43:09 +0200 $
+# $Date: 2006/06/25 03:41:11 +0200 $
#
################################################################################
#
package Devel::PPPort;
use strict;
-use vars qw($VERSION @ISA $data);
+use vars qw($VERSION $data);
-$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.08_05 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
-
-# we don't care if the XS cannot be loaded, it's only needed for tests
-
-eval {
- require DynaLoader;
- @ISA = qw(DynaLoader);
- bootstrap Devel::PPPort;
-};
+$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.08_06 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
sub _init_data
{
#
################################################################################
#
-# $Revision: 22 $
+# $Revision: 25 $
# $Author: mhx $
-# $Date: 2006/05/21 23:15:21 +0200 $
+# $Date: 2006/06/25 06:30:35 +0200 $
#
################################################################################
#
my $template = do { local $/; <DATA> };
-my $file;
-for $file (glob 'parts/inc/*') {
- my($testfile) = $file =~ /(\w+)$/;
- $testfile = "t/$testfile.t";
+generate_tests();
- my $spec = parse_partspec($file);
- my $plan = 0;
+sub generate_tests
+{
+ my @tests;
+ my $file;
- if (exists $spec->{tests}) {
- exists $spec->{OPTIONS}{tests} &&
- exists $spec->{OPTIONS}{tests}{plan}
- or die "No plan for tests in $file\n";
-
- print "generating $testfile\n";
-
- my $tmpl = $template;
- $tmpl =~ s/__SOURCE__/$file/mg;
- $tmpl =~ s/__PLAN__/$spec->{OPTIONS}{tests}{plan}/mg;
- $tmpl =~ s/^__TESTS__$/$spec->{tests}/mg;
-
- open FH, ">$testfile" or die "$testfile: $!\n";
- print FH $tmpl;
- close FH;
+ for $file (glob 'parts/inc/*') {
+ my($testfile) = $file =~ /(\w+)\.?$/; # VMS has a trailing dot
+ $testfile = "t/$testfile.t";
+
+ my $spec = parse_partspec($file);
+ my $plan = 0;
+
+ if (exists $spec->{tests}) {
+ exists $spec->{OPTIONS}{tests} &&
+ exists $spec->{OPTIONS}{tests}{plan}
+ or die "No plan for tests in $file\n";
+
+ print "generating $testfile\n";
+
+ my $tmpl = $template;
+ $tmpl =~ s/__SOURCE__/$file/mg;
+ $tmpl =~ s/__PLAN__/$spec->{OPTIONS}{tests}{plan}/mg;
+ $tmpl =~ s/^__TESTS__$/$spec->{tests}/mg;
+
+ open FH, ">$testfile" or die "$testfile: $!\n";
+ print FH $tmpl;
+ close FH;
+
+ push @tests, $testfile;
+ }
}
+
+ return @tests;
}
-exit 0;
-
__DATA__
################################################################################
#
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
__TESTS__
#
################################################################################
#
-# $Revision: 6 $
+# $Revision: 7 $
# $Author: mhx $
-# $Date: 2006/01/14 22:38:30 +0100 $
+# $Date: 2006/06/25 03:41:08 +0200 $
#
################################################################################
#
################################################################################
package Devel::PPPort;
-sub bootstrap {};
require "PPPort.pm";
rename 'ppport.h', 'ppport.old' if -f 'ppport.h';
unlink "ppport.old" if WriteFile("ppport.h") && -f 'ppport.h';
use List::Util qw(max);
use Config;
-my $VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.08_05 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
+my $VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.08_06 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
$| = 1;
my $verbose = 0;
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
ok(&Devel::PPPort::MY_CXT_1());
ok(&Devel::PPPort::MY_CXT_2());
ok(&Devel::PPPort::MY_CXT_CLONE());
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
ok(&Devel::PPPort::SvPVbyte("mhx"), 3);
ok(&Devel::PPPort::SvPV_nolen("mhx"), 42);
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
for (Devel::PPPort::SvREFCNT()) {
ok(defined $_ and $_);
}
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
my $foo = 5;
ok(&Devel::PPPort::TestSvUV_set($foo, 12345), 42);
ok(&Devel::PPPort::TestSvPVX_const("mhx"), 43);
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
sub eq_array
{
my($a, $b) = @_;
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
my $package;
{
package MyPackage;
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
my $rv;
$Devel::PPPort::exception_caught = undef;
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
ok(&Devel::PPPort::grok_number("42"), 42);
ok(!defined(&Devel::PPPort::grok_number("A")));
ok(&Devel::PPPort::grok_bin("10000001"), 129);
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
ok(&Devel::PPPort::iv_size());
ok(&Devel::PPPort::uv_size());
ok(&Devel::PPPort::iv_type());
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
ok(join(':', &Devel::PPPort::mPUSHp()), "one:two:three");
ok(join(':', &Devel::PPPort::mPUSHn()), "0.5:-0.25:0.125");
ok(join(':', &Devel::PPPort::mPUSHi()), "-1:2:-3");
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
use Tie::Hash;
my %h;
tie %h, 'Tie::StdHash';
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
ok(Devel::PPPort::checkmem(), 4);
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
use vars qw($my_sv @my_av %my_hv);
my @s = &Devel::PPPort::newSVpvn();
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
&Devel::PPPort::call_newCONSTSUB_1();
ok(&Devel::PPPort::test_value_1(), 1);
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
ok(&Devel::PPPort::newRV_inc_REFCNT, 1);
ok(&Devel::PPPort::newRV_noinc_REFCNT, 1);
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
my @pods = qw( HACKERS PPPort.pm ppport.h devel/regenerate devel/buildperl.pl );
my $reason = '';
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
BEGIN {
if ($ENV{'SKIP_SLOW_TESTS'}) {
for (1 .. 202) {
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
my $x = 'foo';
ok(Devel::PPPort::newSVpvs(), "newSVpvs");
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
my($l, $s) = Devel::PPPort::my_snprintf();
ok($l, 8);
ok($s, "foobar42");
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
use Tie::Hash;
my %h;
tie %h, 'Tie::StdHash';
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
ok(&Devel::PPPort::no_THX_arg("42"), 43);
eval { &Devel::PPPort::with_THX_arg("yes\n"); };
ok($@ =~ /^yes/);
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
ok(&Devel::PPPort::sv_setuv(42), 42);
ok(&Devel::PPPort::newSVuv(123), 123);
ok(&Devel::PPPort::sv_2uv("4711"), 4711);
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
ok(Devel::PPPort::compare_PL_signals());
use strict;
$^W = 1;
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
$^W = 0;
my $warning;