From 1d175cda9de63cbbe9590bd265087a1a9361c3c6 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Sun, 13 Apr 2008 13:12:15 +0000 Subject: [PATCH] Upgrade to Devel::PPPort 3.13_02 p4raw-id: //depot/perl@33672 --- MANIFEST | 1 + ext/Devel/PPPort/Changes | 7 +++++ ext/Devel/PPPort/PPPort_pm.PL | 2 +- ext/Devel/PPPort/devel/buildperl.pl | 52 +++++++++++++++++++++++++++-------- ext/Devel/PPPort/parts/inc/format | 22 +++++++++++++-- ext/Devel/PPPort/parts/inc/misc | 6 ++-- ext/Devel/PPPort/soak | 2 +- ext/Devel/PPPort/t/format.t | 55 +++++++++++++++++++++++++++++++++++++ 8 files changed, 128 insertions(+), 19 deletions(-) create mode 100644 ext/Devel/PPPort/t/format.t diff --git a/MANIFEST b/MANIFEST index fc4aa65..f6c5f8d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -337,6 +337,7 @@ ext/Devel/PPPort/soak Devel::PPPort Test Harness to run under various Perls ext/Devel/PPPort/t/call.t Devel::PPPort test file ext/Devel/PPPort/t/cop.t Devel::PPPort test file ext/Devel/PPPort/t/exception.t Devel::PPPort test file +ext/Devel/PPPort/t/format.t Devel::PPPort test file ext/Devel/PPPort/t/grok.t Devel::PPPort test file ext/Devel/PPPort/t/limits.t Devel::PPPort test file ext/Devel/PPPort/t/magic.t Devel::PPPort test file diff --git a/ext/Devel/PPPort/Changes b/ext/Devel/PPPort/Changes index fb1face..1aa8ab7 100755 --- a/ext/Devel/PPPort/Changes +++ b/ext/Devel/PPPort/Changes @@ -1,3 +1,10 @@ +3.13_02 - 2008-04-13 + + * fix NV[efg]f format string macros for perl-5.6.0 built + using -Duselongdouble (thanks to Zefram for figuring this + out and to Jarkko Hietaniemi for keeping me in sync) + * add --patch and --oneshot options to devel/buildperl.pl + 3.13_01 - 2008-01-04 * fix dependency detection algorithm for functions diff --git a/ext/Devel/PPPort/PPPort_pm.PL b/ext/Devel/PPPort/PPPort_pm.PL index ea0be6d..583807a 100644 --- a/ext/Devel/PPPort/PPPort_pm.PL +++ b/ext/Devel/PPPort/PPPort_pm.PL @@ -508,7 +508,7 @@ package Devel::PPPort; use strict; use vars qw($VERSION $data); -$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.13_01 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; +$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.13_02 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; sub _init_data { diff --git a/ext/Devel/PPPort/devel/buildperl.pl b/ext/Devel/PPPort/devel/buildperl.pl index a54f11f..74a1682 100644 --- a/ext/Devel/PPPort/devel/buildperl.pl +++ b/ext/Devel/PPPort/devel/buildperl.pl @@ -5,9 +5,9 @@ # ################################################################################ # -# $Revision: 13 $ +# $Revision: 14 $ # $Author: mhx $ -# $Date: 2008/01/04 10:47:39 +0100 $ +# $Date: 2008/04/13 13:49:37 +0200 $ # ################################################################################ # @@ -27,7 +27,6 @@ use File::Find; use File::Path; use Data::Dumper; use IO::File; -use Archive::Tar; use Cwd; # TODO: - extra arguments to Configure @@ -39,12 +38,14 @@ use Cwd; # my %opt = ( - prefix => '/tmp/perl/install//', - build => '/tmp/perl/build/', - source => '/tmp/perl/source', - force => 0, - test => 0, - install => 1, + prefix => '/tmp/perl/install//', + build => '/tmp/perl/build/', + source => '/tmp/perl/source', + force => 0, + test => 0, + install => 1, + oneshot => 0, + configure => 0, 'test-archives' => 0, ); @@ -145,8 +146,26 @@ GetOptions(\%opt, qw( test install! test-archives=i + patch! + oneshot )) or pod2usage(2); +my %current; + +if ($opt{patch} || $opt{oneshot}) { + @{$opt{perl}} == 1 or die "Exactly one --perl must be given with --patch or --oneshot\n"; + my $perl = $opt{perl}[0]; + patch_source($perl) if !exists $opt{patch} || $opt{patch}; + if (exists $opt{oneshot}) { + eval { require String::ShellQuote }; + die "--oneshot requires String::ShellQuote to be installed\n" if $@; + %current = (config => 'oneshot', version => $perl); + $config{oneshot} = { config_args => String::ShellQuote::shell_quote(@ARGV) }; + build_and_install($perl{$perl}); + } + exit 0; +} + if (exists $opt{config}) { for my $cfg (@{$opt{config}}) { exists $config{$cfg} or die "Unknown configuration: $cfg\n"; @@ -198,8 +217,6 @@ if ($opt{'test-archives'}) { exit 0; } -my %current; - for my $cfg (@{$opt{config}}) { for my $perl (@perls) { my $config = $config{$cfg}; @@ -268,6 +285,9 @@ sub buildperl sub extract_source { + eval { require Archive::Tar }; + die "Archive processing requires Archive::Tar to be installed\n" if $@; + my $perl = shift; my $what = $opt{'test-archives'} ? 'test' : 'read'; @@ -467,6 +487,11 @@ buildperl.pl - build/install perl distributions --noinstall don't install after building + --patch only patch the perl source in the current directory + + --oneshot build from the perl source in the current directory + (extra arguments are passed to Configure) + options tagged with [MULTI] can be given multiple times options tagged with [EXPAND] expand the following items @@ -496,6 +521,11 @@ and don't install them, run: buildperl.pl --perl=5.8.5 --perl=5.8.6 --test --noinstall +To build and install a single version of perl with special configuration +options, use: + + buildperl.pl --perl=5.6.0 --prefix=/opt/p560ld --oneshot -- -des -Duselongdouble + =head1 COPYRIGHT Copyright (c) 2004-2008, Marcus Holland-Moritz. diff --git a/ext/Devel/PPPort/parts/inc/format b/ext/Devel/PPPort/parts/inc/format index 2e1413f..ef167f1 100644 --- a/ext/Devel/PPPort/parts/inc/format +++ b/ext/Devel/PPPort/parts/inc/format @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 7 $ +## $Revision: 8 $ ## $Author: mhx $ -## $Date: 2008/01/04 10:47:43 +0100 $ +## $Date: 2008/04/13 13:51:18 +0200 $ ## ################################################################################ ## @@ -41,7 +41,8 @@ #ifndef NVef # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \ - defined(PERL_PRIfldbl) /* Not very likely, but let's try anyway. */ + defined(PERL_PRIfldbl) && { VERSION != 5.6.0 } + /* Not very likely, but let's try anyway. */ # define NVef PERL_PRIeldbl # define NVff PERL_PRIfldbl # define NVgf PERL_PRIgldbl @@ -52,3 +53,18 @@ # endif #endif +=xsubs + +void +croak_NVgf(num) + NV num + PPCODE: + Perl_croak(aTHX_ "%.20" NVgf "\n", num); + +=tests plan => 1 + +my $num = 1.12345678901234567890; + +eval { Devel::PPPort::croak_NVgf($num) }; +ok($@ =~ /^1.1234567890/); + diff --git a/ext/Devel/PPPort/parts/inc/misc b/ext/Devel/PPPort/parts/inc/misc index 05c3ff7..5a54de1 100644 --- a/ext/Devel/PPPort/parts/inc/misc +++ b/ext/Devel/PPPort/parts/inc/misc @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 44 $ +## $Revision: 45 $ ## $Author: mhx $ -## $Date: 2008/01/04 14:54:43 +0100 $ +## $Date: 2008/01/04 15:50:58 +0100 $ ## ################################################################################ ## @@ -352,7 +352,7 @@ prepush() { dXSTARG; XSprePUSH; - mPUSHi(42); + PUSHi(42); XSRETURN(1); } diff --git a/ext/Devel/PPPort/soak b/ext/Devel/PPPort/soak index a239ee7..ba7eec2 100644 --- a/ext/Devel/PPPort/soak +++ b/ext/Devel/PPPort/soak @@ -33,7 +33,7 @@ use File::Find; use List::Util qw(max); use Config; -my $VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.13_01 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; +my $VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.13_02 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; $| = 1; my %OPT = ( diff --git a/ext/Devel/PPPort/t/format.t b/ext/Devel/PPPort/t/format.t new file mode 100644 index 0000000..66bf3f6 --- /dev/null +++ b/ext/Devel/PPPort/t/format.t @@ -0,0 +1,55 @@ +################################################################################ +# +# !!!!! Do NOT edit this file directly! !!!!! +# +# Edit mktests.PL and/or parts/inc/format instead. +# +# This file was automatically generated from the definition files in the +# parts/inc/ subdirectory by mktests.PL. To learn more about how all this +# works, please read the F file that came with this distribution. +# +################################################################################ + +BEGIN { + if ($ENV{'PERL_CORE'}) { + chdir 't' if -d 't'; + @INC = ('../lib', '../ext/Devel/PPPort/t') if -d '../lib' && -d '../ext'; + require Config; import Config; + use vars '%Config'; + if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) { + print "1..0 # Skip -- Perl configured without Devel::PPPort module\n"; + exit 0; + } + } + else { + unshift @INC, 't'; + } + + sub load { + eval "use Test"; + require 'testutil.pl' if $@; + } + + if (1) { + load(); + plan(tests => 1); + } +} + +use Devel::PPPort; +use strict; +$^W = 1; + +package Devel::PPPort; +use vars '@ISA'; +require DynaLoader; +@ISA = qw(DynaLoader); +bootstrap Devel::PPPort; + +package main; + +my $num = 1.12345678901234567890; + +eval { Devel::PPPort::croak_NVgf($num) }; +ok($@ =~ /^1.1234567890/); + -- 2.7.4