diff options
author | H.Merijn Brand <perl5@tux.freedom.nl> | 2020-12-18 16:41:30 +0100 |
---|---|---|
committer | H.Merijn Brand <perl5@tux.freedom.nl> | 2020-12-18 17:05:15 +0100 |
commit | edd16cfcff2bae43fa676aa4880e03c16fda3133 (patch) | |
tree | 138fce83aea127d2c4b1b8fdd3ebc54c255dd533 /cpan | |
parent | 34ceef7614371cd1b4e29492d0a59425be75fe63 (diff) | |
download | perl-edd16cfcff2bae43fa676aa4880e03c16fda3133.tar.gz |
Update Config::Perl::V to 0.33
Diffstat (limited to 'cpan')
-rw-r--r-- | cpan/Config-Perl-V/V.pm | 165 | ||||
-rw-r--r-- | cpan/Config-Perl-V/t/35_plv52910g.t | 188 | ||||
-rw-r--r-- | cpan/Config-Perl-V/t/36_plv5300.t | 182 | ||||
-rw-r--r-- | cpan/Config-Perl-V/t/37_plv53111qm.t | 186 | ||||
-rw-r--r-- | cpan/Config-Perl-V/t/38_plv5320tld.t | 182 |
5 files changed, 821 insertions, 82 deletions
diff --git a/cpan/Config-Perl-V/V.pm b/cpan/Config-Perl-V/V.pm index dbb0f88ec1..774446a83f 100644 --- a/cpan/Config-Perl-V/V.pm +++ b/cpan/Config-Perl-V/V.pm @@ -6,12 +6,12 @@ use warnings; use Config; use Exporter; use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS); -$VERSION = "0.32"; +$VERSION = "0.33"; @ISA = qw( Exporter ); @EXPORT_OK = qw( plv2hash summary myconfig signature ); %EXPORT_TAGS = ( - all => [ @EXPORT_OK ], - sig => [ "signature" ], + 'all' => [ @EXPORT_OK ], + 'sig' => [ "signature" ], ); # Characteristics of this binary (from libperl): @@ -24,7 +24,7 @@ $VERSION = "0.32"; # perl -ne'(/^S_Internals_V/../^}/)&&s/^\s+"( .*)"/$1/ and print' perl.c # perl.h line 4566 PL_bincompat_options # perl -ne'(/^\w.*PL_bincompat/../^\w}/)&&s/^\s+"( .*)"/$1/ and print' perl.h -my %BTD = map { $_ => 0 } qw( +my %BTD = map {( $_ => 0 )} qw( DEBUGGING NO_HASH_SEED @@ -183,52 +183,52 @@ my @config_vars = qw( ); my %empty_build = ( - osname => "", - stamp => 0, - options => { %BTD }, - patches => [], + 'osname' => "", + 'stamp' => 0, + 'options' => { %BTD }, + 'patches' => [], ); sub _make_derived { my $conf = shift; - for ( [ lseektype => "Off_t" ], - [ myuname => "uname" ], - [ perl_patchlevel => "patch" ], + for ( [ 'lseektype' => "Off_t" ], + [ 'myuname' => "uname" ], + [ 'perl_patchlevel' => "patch" ], ) { - my ($official, $derived) = @$_; - $conf->{config}{$derived} ||= $conf->{config}{$official}; - $conf->{config}{$official} ||= $conf->{config}{$derived}; - $conf->{derived}{$derived} = delete $conf->{config}{$derived}; + my ($official, $derived) = @{$_}; + $conf->{'config'}{$derived} ||= $conf->{'config'}{$official}; + $conf->{'config'}{$official} ||= $conf->{'config'}{$derived}; + $conf->{'derived'}{$derived} = delete $conf->{'config'}{$derived}; } - if (exists $conf->{config}{version_patchlevel_string} && - !exists $conf->{config}{api_version}) { - my $vps = $conf->{config}{version_patchlevel_string}; + if (exists $conf->{'config'}{'version_patchlevel_string'} && + !exists $conf->{'config'}{'api_version'}) { + my $vps = $conf->{'config'}{'version_patchlevel_string'}; $vps =~ s{\b revision \s+ (\S+) }{}x and - $conf->{config}{revision} ||= $1; + $conf->{'config'}{'revision'} ||= $1; $vps =~ s{\b version \s+ (\S+) }{}x and - $conf->{config}{api_version} ||= $1; + $conf->{'config'}{'api_version'} ||= $1; $vps =~ s{\b subversion \s+ (\S+) }{}x and - $conf->{config}{subversion} ||= $1; + $conf->{'config'}{'subversion'} ||= $1; $vps =~ s{\b patch \s+ (\S+) }{}x and - $conf->{config}{perl_patchlevel} ||= $1; + $conf->{'config'}{'perl_patchlevel'} ||= $1; } - ($conf->{config}{version_patchlevel_string} ||= join " ", - map { ($_, $conf->{config}{$_} ) } - grep { $conf->{config}{$_} } + ($conf->{'config'}{'version_patchlevel_string'} ||= join " ", + map { ($_, $conf->{'config'}{$_} ) } + grep { $conf->{'config'}{$_} } qw( api_version subversion perl_patchlevel )) =~ s/\bperl_//; - $conf->{config}{perl_patchlevel} ||= ""; # 0 is not a valid patchlevel + $conf->{'config'}{'perl_patchlevel'} ||= ""; # 0 is not a valid patchlevel - if ($conf->{config}{perl_patchlevel} =~ m{^git\w*-([^-]+)}i) { - $conf->{config}{git_branch} ||= $1; - $conf->{config}{git_describe} ||= $conf->{config}{perl_patchlevel}; + if ($conf->{'config'}{'perl_patchlevel'} =~ m{^git\w*-([^-]+)}i) { + $conf->{'config'}{'git_branch'} ||= $1; + $conf->{'config'}{'git_describe'} ||= $conf->{'config'}{'perl_patchlevel'}; } - $conf->{config}{$_} ||= "undef" for grep m/^(?:use|def)/ => @config_vars; + $conf->{'config'}{$_} ||= "undef" for grep m{^(?:use|def)} => @config_vars; $conf; } # _make_derived @@ -238,20 +238,20 @@ sub plv2hash { my $pv = join "\n" => @_; - if ($pv =~ m/^Summary of my\s+(\S+)\s+\(\s*(.*?)\s*\)/m) { - $config{"package"} = $1; + if ($pv =~ m{^Summary of my\s+(\S+)\s+\(\s*(.*?)\s*\)}m) { + $config{'package'} = $1; my $rev = $2; - $rev =~ s/^ revision \s+ (\S+) \s*//x and $config{revision} = $1; - $rev and $config{version_patchlevel_string} = $rev; - my ($rel) = $config{"package"} =~ m{perl(\d)}; + $rev =~ s/^ revision \s+ (\S+) \s*//x and $config{'revision'} = $1; + $rev and $config{'version_patchlevel_string'} = $rev; + my ($rel) = $config{'package'} =~ m{perl(\d)}; my ($vers, $subvers) = $rev =~ m{version\s+(\d+)\s+subversion\s+(\d+)}; defined $vers && defined $subvers && defined $rel and - $config{version} = "$rel.$vers.$subvers"; + $config{'version'} = "$rel.$vers.$subvers"; } - if ($pv =~ m/^\s+(Snapshot of:)\s+(\S+)/) { - $config{git_commit_id_title} = $1; - $config{git_commit_id} = $2; + if ($pv =~ m{^\s+(Snapshot of:)\s+(\S+)}) { + $config{'git_commit_id_title'} = $1; + $config{'git_commit_id'} = $2; } # these are always last on line and can have multiple quotation styles @@ -275,11 +275,11 @@ sub plv2hash { }gx)) { # between every kv pair while (my ($k, $v) = each %kv) { - $k =~ s/\s+$//; - $v =~ s/\s*\n\z//; - $v =~ s/,$//; - $v =~ m/^'(.*)'$/ and $v = $1; - $v =~ s/\s+$//; + $k =~ s{\s+$} {}; + $v =~ s{\s*\n\z} {}; + $v =~ s{,$} {}; + $v =~ m{^'(.*)'$} and $v = $1; + $v =~ s{\s+$} {}; $config{$k} = $v; } } @@ -287,36 +287,36 @@ sub plv2hash { my $build = { %empty_build }; $pv =~ m{^\s+Compiled at\s+(.*)}m - and $build->{stamp} = $1; + and $build->{'stamp'} = $1; $pv =~ m{^\s+Locally applied patches:(?:\s+|\n)(.*?)(?:[\s\n]+Buil[td] under)}ms - and $build->{patches} = [ split m/\n+\s*/, $1 ]; + and $build->{'patches'} = [ split m{\n+\s*}, $1 ]; $pv =~ m{^\s+Compile-time options:(?:\s+|\n)(.*?)(?:[\s\n]+(?:Locally applied|Buil[td] under))}ms - and map { $build->{options}{$_} = 1 } split m/\s+|\n/ => $1; + and map { $build->{'options'}{$_} = 1 } split m{\s+|\n} => $1; - $build->{osname} = $config{osname}; + $build->{'osname'} = $config{'osname'}; $pv =~ m{^\s+Built under\s+(.*)}m - and $build->{osname} = $1; - $config{osname} ||= $build->{osname}; + and $build->{'osname'} = $1; + $config{'osname'} ||= $build->{'osname'}; return _make_derived ({ - build => $build, - environment => {}, - config => \%config, - derived => {}, - inc => [], + 'build' => $build, + 'environment' => {}, + 'config' => \%config, + 'derived' => {}, + 'inc' => [], }); } # plv2hash sub summary { my $conf = shift || myconfig (); ref $conf eq "HASH" - && exists $conf->{config} - && exists $conf->{build} - && ref $conf->{config} eq "HASH" - && ref $conf->{build} eq "HASH" or return; + && exists $conf->{'config'} + && exists $conf->{'build'} + && ref $conf->{'config'} eq "HASH" + && ref $conf->{'build'} eq "HASH" or return; my %info = map { - exists $conf->{config}{$_} ? ( $_ => $conf->{config}{$_} ) : () } + exists $conf->{'config'}{$_} ? ( $_ => $conf->{'config'}{$_} ) : () } qw( archname osname osvers revision patchlevel subversion version cc ccversion gccversion config_args inc_version_list d_longdbl d_longlong use64bitall use64bitint useithreads @@ -324,7 +324,7 @@ sub summary { doublesize intsize ivsize nvsize longdblsize longlongsize lseeksize default_inc_excludes_dot ); - $info{$_}++ for grep { $conf->{build}{options}{$_} } keys %{$conf->{build}{options}}; + $info{$_}++ for grep { $conf->{'build'}{'options'}{$_} } keys %{$conf->{'build'}{'options'}}; return \%info; } # summary @@ -336,19 +336,19 @@ sub signature { eval { require Digest::MD5 }; $@ and return $no_md5; - $conf->{cc} =~ s{.*\bccache\s+}{}; - $conf->{cc} =~ s{.*[/\\]}{}; + $conf->{'cc'} =~ s{.*\bccache\s+}{}; + $conf->{'cc'} =~ s{.*[/\\]}{}; - delete $conf->{config_args}; + delete $conf->{'config_args'}; return Digest::MD5::md5_hex (join "\xFF" => map { "$_=".(defined $conf->{$_} ? $conf->{$_} : "\xFE"); - } sort keys %$conf); + } sort keys %{$conf}); } # signature sub myconfig { my $args = shift; - my %args = ref $args eq "HASH" ? %$args : - ref $args eq "ARRAY" ? @$args : (); + my %args = ref $args eq "HASH" ? %{$args} : + ref $args eq "ARRAY" ? @{$args} : (); my $build = { %empty_build }; @@ -356,33 +356,34 @@ sub myconfig { my $stamp = eval { Config::compile_date () }; if (defined $stamp) { $stamp =~ s/^Compiled at //; - $build->{osname} = $^O; - $build->{stamp} = $stamp; - $build->{patches} = [ Config::local_patches () ]; - $build->{options}{$_} = 1 for Config::bincompat_options (), - Config::non_bincompat_options (); + $build->{'osname'} = $^O; + $build->{'stamp'} = $stamp; + $build->{'patches'} = [ Config::local_patches () ]; + $build->{'options'}{$_} = 1 for Config::bincompat_options (), + Config::non_bincompat_options (); } else { #y $pv = qx[$^X -e"sub Config::myconfig{};" -V]; my $cnf = plv2hash (qx[$^X -V]); - $build->{$_} = $cnf->{build}{$_} for qw( osname stamp patches options ); + $build->{$_} = $cnf->{'build'}{$_} for qw( osname stamp patches options ); } my @KEYS = keys %ENV; my %env = - map { $_ => $ENV{$_} } grep m/^PERL/ => @KEYS; - $args{env} and - map { $env{$_} = $ENV{$_} } grep m{$args{env}} => @KEYS; + map {( $_ => $ENV{$_} )} grep m{^PERL} => @KEYS; + if ($args{'env'}) { + $env{$_} = $ENV{$_} for grep m{$args{'env'}} => @KEYS; + } my %config = map { $_ => $Config{$_} } @config_vars; return _make_derived ({ - build => $build, - environment => \%env, - config => \%config, - derived => {}, - inc => \@INC, + 'build' => $build, + 'environment' => \%env, + 'config' => \%config, + 'derived' => {}, + 'inc' => \@INC, }); } # myconfig @@ -553,7 +554,7 @@ H.Merijn Brand <h.m.brand@xs4all.nl> =head1 COPYRIGHT AND LICENSE -Copyright (C) 2009-2018 H.Merijn Brand +Copyright (C) 2009-2020 H.Merijn Brand This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Config-Perl-V/t/35_plv52910g.t b/cpan/Config-Perl-V/t/35_plv52910g.t new file mode 100644 index 0000000000..6d822d1cb2 --- /dev/null +++ b/cpan/Config-Perl-V/t/35_plv52910g.t @@ -0,0 +1,188 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 128; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V qw( summary ); + +ok (my $conf = Config::Perl::V::plv2hash (<DATA>), "Read perl -v block"); +ok (exists $conf->{$_}, "Has $_ entry") for qw( build environment config inc ); + +is ($conf->{build}{osname}, $conf->{config}{osname}, "osname"); +is ($conf->{build}{stamp}, "Apr 13 2019 00:06:38", "Build time"); +is ($conf->{config}{version}, "5.29.10", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + DEBUGGING HAS_TIMES MULTIPLICITY PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV + PERL_IMPLICIT_CONTEXT PERLIO_LAYERS PERL_MALLOC_WRAP PERL_OP_PARENT + PERL_PRESERVE_IVUV PERL_TRACK_MEMPOOL PERL_USE_DEVEL USE_64_BIT_ALL + USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_LONG_DOUBLE + USE_PERL_ATOF USE_PERLIO USE_REENTRANT_API USE_THREAD_SAFE_LOCALE + )) { + is ($conf->{build}{options}{$o}, 1, "Runtime option $o set"); + delete $opt->{$o}; + } +foreach my $o (sort keys %$opt) { + is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset"); + } + +eval { require Digest::MD5; }; +my $md5 = $@ ? "0" x 32 : "8404b533829bd9752df7f662a710f993"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [ + "SMOKEdfba4714a9dc4c35123b4df0a5e1721ccb081d97" ], "No local patches"); + +my %check = ( + alignbytes => 16, + api_version => 29, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "g++", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-des -Dcc=g++ -Dusedevel -Duseithreads -Duse64bitall -Duselongdouble -DDEBUGGING", + gccversion => "8.3.1 20190226 [gcc-8-branch revision 269204]", + gnulibc_version => "2.29", + ivsize => 8, + ivtype => "long", + ld => "g++", + lddlflags => "-shared -O2 -g -L/pro/local/lib -fstack-protector-strong", + ldflags => "-L/pro/local/lib -fstack-protector-strong", + libc => "libc-2.29.so", + lseektype => "off_t", + osvers => "5.0.7-1-default", + use64bitall => "define", + use64bitint => "define", + usemymalloc => "n", + default_inc_excludes_dot + => "define", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + +ok (my $info = summary ($conf), "A summary"); +ok (exists $info->{$_}, "Summary has $_") for qw( cc config_args usemymalloc default_inc_excludes_dot ); +is ($info->{default_inc_excludes_dot}, "define", "This build has . NOT in INC"); + +__END__ +Summary of my perl5 (revision 5 version 29 subversion 10) configuration: + Snapshot of: dfba4714a9dc4c35123b4df0a5e1721ccb081d97 + Platform: + osname=linux + osvers=5.0.7-1-default + archname=x86_64-linux-thread-multi-ld + uname='linux lx09 5.0.7-1-default #1 smp sat apr 6 14:47:49 utc 2019 (8f18342) x86_64 x86_64 x86_64 gnulinux ' + config_args='-des -Dcc=g++ -Dusedevel -Duseithreads -Duse64bitall -Duselongdouble -DDEBUGGING' + hint=recommended + useposix=true + d_sigaction=define + useithreads=define + usemultiplicity=define + use64bitint=define + use64bitall=define + uselongdouble=define + usemymalloc=n + default_inc_excludes_dot=define + bincompat5005=undef + Compiler: + cc='g++' + ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -DDEBUGGING -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' + optimize='-O2 -g' + cppflags='-D_REENTRANT -D_GNU_SOURCE -fPIC -DDEBUGGING -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include' + ccversion='' + gccversion='8.3.1 20190226 [gcc-8-branch revision 269204]' + gccosandvers='' + intsize=4 + longsize=8 + ptrsize=8 + doublesize=8 + byteorder=12345678 + doublekind=3 + d_longlong=define + longlongsize=8 + d_longdbl=define + longdblsize=16 + longdblkind=3 + ivtype='long' + ivsize=8 + nvtype='long double' + nvsize=16 + Off_t='off_t' + lseeksize=8 + alignbytes=16 + prototype=define + Linker and Libraries: + ld='g++' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/include/c++/8 /usr/include/c++/8/x86_64-suse-linux /usr/include/c++/8/backward /usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 + libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat + perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc + libc=libc-2.29.so + so=so + useshrplib=false + libperl=libperl.a + gnulibc_version='2.29' + Dynamic Linking: + dlsrc=dl_dlopen.xs + dlext=so + d_dlsymun=undef + ccdlflags='-Wl,-E' + cccdlflags='-fPIC' + lddlflags='-shared -O2 -g -L/pro/local/lib -fstack-protector-strong' + + +Characteristics of this binary (from libperl): + Compile-time options: + DEBUGGING + HAS_TIMES + MULTIPLICITY + PERLIO_LAYERS + PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV + PERL_IMPLICIT_CONTEXT + PERL_MALLOC_WRAP + PERL_OP_PARENT + PERL_PRESERVE_IVUV + PERL_TRACK_MEMPOOL + PERL_USE_DEVEL + USE_64_BIT_ALL + USE_64_BIT_INT + USE_ITHREADS + USE_LARGE_FILES + USE_LOCALE + USE_LOCALE_COLLATE + USE_LOCALE_CTYPE + USE_LOCALE_NUMERIC + USE_LOCALE_TIME + USE_LONG_DOUBLE + USE_PERLIO + USE_PERL_ATOF + USE_REENTRANT_API + USE_THREAD_SAFE_LOCALE + Locally applied patches: + SMOKEdfba4714a9dc4c35123b4df0a5e1721ccb081d97 + Built under linux + Compiled at Apr 13 2019 00:06:38 + %ENV: + PERL6LIB="inst#/pro/3gl/CPAN/rakudo/install" + @INC: + lib + /opt/perl/lib/site_perl/5.29.10/x86_64-linux-thread-multi-ld + /opt/perl/lib/site_perl/5.29.10 + /opt/perl/lib/5.29.10/x86_64-linux-thread-multi-ld + /opt/perl/lib/5.29.10 diff --git a/cpan/Config-Perl-V/t/36_plv5300.t b/cpan/Config-Perl-V/t/36_plv5300.t new file mode 100644 index 0000000000..6db751245f --- /dev/null +++ b/cpan/Config-Perl-V/t/36_plv5300.t @@ -0,0 +1,182 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 128; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V qw( summary ); + +ok (my $conf = Config::Perl::V::plv2hash (<DATA>), "Read perl -v block"); +ok (exists $conf->{$_}, "Has $_ entry") for qw( build environment config inc ); + +is ($conf->{build}{osname}, $conf->{config}{osname}, "osname"); +is ($conf->{build}{stamp}, "May 23 2019 14:05:36", "Build time"); +is ($conf->{config}{version}, "5.30.0", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + PERL_OP_PARENT PERL_PRESERVE_IVUV USE_THREAD_SAFE_LOCALE + USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES + USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC + USE_LOCALE_TIME USE_LONG_DOUBLE USE_PERLIO USE_PERL_ATOF + USE_REENTRANT_API + )) { + is ($conf->{build}{options}{$o}, 1, "Runtime option $o set"); + delete $opt->{$o}; + } +foreach my $o (sort keys %$opt) { + is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset"); + } + +eval { require Digest::MD5; }; +my $md5 = $@ ? "0" x 32 : "b1138522685da4fff74f7b1118128d02"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [ ], "No patches"); + +my %check = ( + alignbytes => 16, + api_version => 30, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E -Wl,-rpath,/pro/lib/perl5/5.30.0/x86_64-linux-thread-multi-ld/CORE", + config_args => "-Dusethreads -Duseithreads -Duse64bitall -Duselongdouble -Duseshrplib -des", + gccversion => "8.3.1 20190226 [gcc-8-branch revision 269204]", + gnulibc_version => "2.29", + ivsize => 8, + ivtype => "long", + ld => "cc", + lddlflags => "-shared -O2 -L/pro/local/lib -fstack-protector-strong", + ldflags => "-L/pro/local/lib -fstack-protector-strong", + libc => "libc-2.29.so", + lseektype => "off_t", + osvers => "5.1.3-1-default", + use64bitall => "define", + use64bitint => "define", + usemymalloc => "n", + default_inc_excludes_dot + => "define", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + +ok (my $info = summary ($conf), "A summary"); +ok (exists $info->{$_}, "Summary has $_") for qw( cc config_args usemymalloc default_inc_excludes_dot ); +is ($info->{default_inc_excludes_dot}, "define", "This build has . NOT in INC"); + +__END__ +Summary of my perl5 (revision 5 version 30 subversion 0) configuration: + + Platform: + osname=linux + osvers=5.1.3-1-default + archname=x86_64-linux-thread-multi-ld + uname='linux lx09 5.1.3-1-default #1 smp fri may 17 04:54:29 utc 2019 (07d2e25) x86_64 x86_64 x86_64 gnulinux ' + config_args='-Dusethreads -Duseithreads -Duse64bitall -Duselongdouble -Duseshrplib -des' + hint=recommended + useposix=true + d_sigaction=define + useithreads=define + usemultiplicity=define + use64bitint=define + use64bitall=define + uselongdouble=define + usemymalloc=n + default_inc_excludes_dot=define + bincompat5005=undef + Compiler: + cc='cc' + ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' + optimize='-O2' + cppflags='-D_REENTRANT -D_GNU_SOURCE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include' + ccversion='' + gccversion='8.3.1 20190226 [gcc-8-branch revision 269204]' + gccosandvers='' + intsize=4 + longsize=8 + ptrsize=8 + doublesize=8 + byteorder=12345678 + doublekind=3 + d_longlong=define + longlongsize=8 + d_longdbl=define + longdblsize=16 + longdblkind=3 + ivtype='long' + ivsize=8 + nvtype='long double' + nvsize=16 + Off_t='off_t' + lseeksize=8 + alignbytes=16 + prototype=define + Linker and Libraries: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 + libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat + perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc + libc=libc-2.29.so + so=so + useshrplib=true + libperl=libperl.so + gnulibc_version='2.29' + Dynamic Linking: + dlsrc=dl_dlopen.xs + dlext=so + d_dlsymun=undef + ccdlflags='-Wl,-E -Wl,-rpath,/pro/lib/perl5/5.30.0/x86_64-linux-thread-multi-ld/CORE' + cccdlflags='-fPIC' + lddlflags='-shared -O2 -L/pro/local/lib -fstack-protector-strong' + + +Characteristics of this binary (from libperl): + Compile-time options: + HAS_TIMES + MULTIPLICITY + PERLIO_LAYERS + PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV + PERL_IMPLICIT_CONTEXT + PERL_MALLOC_WRAP + PERL_OP_PARENT + PERL_PRESERVE_IVUV + USE_64_BIT_ALL + USE_64_BIT_INT + USE_ITHREADS + USE_LARGE_FILES + USE_LOCALE + USE_LOCALE_COLLATE + USE_LOCALE_CTYPE + USE_LOCALE_NUMERIC + USE_LOCALE_TIME + USE_LONG_DOUBLE + USE_PERLIO + USE_PERL_ATOF + USE_REENTRANT_API + USE_THREAD_SAFE_LOCALE + Built under linux + Compiled at May 23 2019 14:05:36 + %ENV: + PERL6LIB="inst#/pro/3gl/CPAN/rakudo/install" + @INC: + /pro/lib/perl5/site_perl/5.30.0/x86_64-linux-thread-multi-ld + /pro/lib/perl5/site_perl/5.30.0 + /pro/lib/perl5/5.30.0/x86_64-linux-thread-multi-ld + /pro/lib/perl5/5.30.0 diff --git a/cpan/Config-Perl-V/t/37_plv53111qm.t b/cpan/Config-Perl-V/t/37_plv53111qm.t new file mode 100644 index 0000000000..f566f7607b --- /dev/null +++ b/cpan/Config-Perl-V/t/37_plv53111qm.t @@ -0,0 +1,186 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 128; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V qw( summary ); + +ok (my $conf = Config::Perl::V::plv2hash (<DATA>), "Read perl -v block"); +ok (exists $conf->{$_}, "Has $_ entry") for qw( build environment config inc ); + +is ($conf->{build}{osname}, $conf->{config}{osname}, "osname"); +is ($conf->{build}{stamp}, "Apr 9 2020 17:12:07", "Build time"); +is ($conf->{config}{version}, "5.31.11", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + DEBUGGING HAS_TIMES MULTIPLICITY PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERLIO_LAYERS + PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV PERL_TRACK_MEMPOOL + PERL_USE_DEVEL USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS + USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE + USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERL_ATOF USE_PERLIO + USE_QUADMATH USE_REENTRANT_API USE_THREAD_SAFE_LOCALE + )) { + is ($conf->{build}{options}{$o}, 1, "Runtime option $o set"); + delete $opt->{$o}; + } +foreach my $o (sort keys %$opt) { + is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset"); + } + +eval { require Digest::MD5; }; +my $md5 = $@ ? "0" x 32 : "146e648c6239f623b8a8242fc8b5759f"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [ ], "No patches"); + +my %check = ( + alignbytes => 16, + api_version => 31, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-Dusedevel -Duse64bitall -Dusethreads -Duseithreads -Dusequadmath -des", + gccversion => "10.0.1 20200302 (experimental) [revision 778a77357cad11e8dd4c810544330af0fbe843b1]", + gnulibc_version => "2.31", + ivsize => 8, + ivtype => "long", + ld => "cc", + lddlflags => "-shared -O2 -L/pro/local/lib -fstack-protector-strong", + ldflags => "-L/pro/local/lib -fstack-protector-strong", + libc => "libc-2.31.so", + lseektype => "off_t", + osvers => "5.6.2-1-default", + use64bitall => "define", + use64bitint => "define", + usemymalloc => "n", + default_inc_excludes_dot + => "define", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + +ok (my $info = summary ($conf), "A summary"); +ok (exists $info->{$_}, "Summary has $_") for qw( cc config_args usemymalloc default_inc_excludes_dot ); +is ($info->{default_inc_excludes_dot}, "define", "This build has . NOT in INC"); + +__END__ +Summary of my perl5 (revision 5 version 31 subversion 11) configuration: + Snapshot of: +0300 + Platform: + osname=linux + osvers=5.6.2-1-default + archname=x86_64-linux-thread-multi-quadmath + uname='linux lx09 5.6.2-1-default #1 smp thu apr 2 06:31:32 utc 2020 (c8170d6) x86_64 x86_64 x86_64 gnulinux ' + config_args='-Dusedevel -Duse64bitall -Dusethreads -Duseithreads -Dusequadmath -des' + hint=recommended + useposix=true + d_sigaction=define + useithreads=define + usemultiplicity=define + use64bitint=define + use64bitall=define + uselongdouble=undef + usemymalloc=n + default_inc_excludes_dot=define + bincompat5005=undef + Compiler: + cc='cc' + ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -DDEBUGGING -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' + optimize='-O2' + cppflags='-D_REENTRANT -D_GNU_SOURCE -fPIC -DDEBUGGING -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include' + ccversion='' + gccversion='10.0.1 20200302 (experimental) [revision 778a77357cad11e8dd4c810544330af0fbe843b1]' + gccosandvers='' + intsize=4 + longsize=8 + ptrsize=8 + doublesize=8 + byteorder=12345678 + doublekind=3 + d_longlong=define + longlongsize=8 + d_longdbl=define + longdblsize=16 + longdblkind=3 + ivtype='long' + ivsize=8 + nvtype='__float128' + nvsize=16 + Off_t='off_t' + lseeksize=8 + alignbytes=16 + prototype=define + Linker and Libraries: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/10/include-fixed /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 + libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat -lquadmath + perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -lquadmath + libc=libc-2.31.so + so=so + useshrplib=false + libperl=libperl.a + gnulibc_version='2.31' + Dynamic Linking: + dlsrc=dl_dlopen.xs + dlext=so + d_dlsymun=undef + ccdlflags='-Wl,-E' + cccdlflags='-fPIC' + lddlflags='-shared -O2 -L/pro/local/lib -fstack-protector-strong' + + +Characteristics of this binary (from libperl): + Compile-time options: + DEBUGGING + HAS_TIMES + MULTIPLICITY + PERLIO_LAYERS + PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV + PERL_IMPLICIT_CONTEXT + PERL_MALLOC_WRAP + PERL_OP_PARENT + PERL_PRESERVE_IVUV + PERL_TRACK_MEMPOOL + PERL_USE_DEVEL + USE_64_BIT_ALL + USE_64_BIT_INT + USE_ITHREADS + USE_LARGE_FILES + USE_LOCALE + USE_LOCALE_COLLATE + USE_LOCALE_CTYPE + USE_LOCALE_NUMERIC + USE_LOCALE_TIME + USE_PERLIO + USE_PERL_ATOF + USE_QUADMATH + USE_REENTRANT_API + USE_THREAD_SAFE_LOCALE + Built under linux + Compiled at Apr 9 2020 17:12:07 + %ENV: + PERL6LIB="inst#/pro/3gl/CPAN/rakudo/install" + @INC: + lib + /pro/lib/perl5/site_perl/5.31.11/x86_64-linux-thread-multi-quadmath + /pro/lib/perl5/site_perl/5.31.11 + /pro/lib/perl5/5.31.11/x86_64-linux-thread-multi-quadmath + /pro/lib/perl5/5.31.11 diff --git a/cpan/Config-Perl-V/t/38_plv5320tld.t b/cpan/Config-Perl-V/t/38_plv5320tld.t new file mode 100644 index 0000000000..a8f0d736dc --- /dev/null +++ b/cpan/Config-Perl-V/t/38_plv5320tld.t @@ -0,0 +1,182 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 128; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V qw( summary ); + +ok (my $conf = Config::Perl::V::plv2hash (<DATA>), "Read perl -v block"); +ok (exists $conf->{$_}, "Has $_ entry") for qw( build environment config inc ); + +is ($conf->{build}{osname}, $conf->{config}{osname}, "osname"); +is ($conf->{build}{stamp}, "Jun 21 2020 10:17:00", "Build time"); +is ($conf->{config}{version}, "5.32.0", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + PERL_OP_PARENT PERL_PRESERVE_IVUV USE_THREAD_SAFE_LOCALE + USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES + USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC + USE_LOCALE_TIME USE_LONG_DOUBLE USE_PERLIO USE_PERL_ATOF + USE_REENTRANT_API + )) { + is ($conf->{build}{options}{$o}, 1, "Runtime option $o set"); + delete $opt->{$o}; + } +foreach my $o (sort keys %$opt) { + is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset"); + } + +eval { require Digest::MD5; }; +my $md5 = $@ ? "0" x 32 : "901df8463a7bda6075bd75539214e75e"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [ ], "No patches"); + +my %check = ( + alignbytes => 16, + api_version => 32, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E -Wl,-rpath,/pro/lib/perl5/5.32.0/x86_64-linux-thread-multi-ld/CORE", + config_args => "-Dusethreads -Duseithreads -Duse64bitall -Duselongdouble -Duseshrplib -des", + gccversion => "10.1.1 20200507 [revision dd38686d9c810cecbaa80bb82ed91caaa58ad635]", + gnulibc_version => "2.31", + ivsize => 8, + ivtype => "long", + ld => "cc", + lddlflags => "-shared -O2 -L/pro/local/lib -fstack-protector-strong", + ldflags => "-L/pro/local/lib -fstack-protector-strong", + libc => "libc-2.31.so", + lseektype => "off_t", + osvers => "5.7.1-1-default", + use64bitall => "define", + use64bitint => "define", + usemymalloc => "n", + default_inc_excludes_dot + => "define", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + +ok (my $info = summary ($conf), "A summary"); +ok (exists $info->{$_}, "Summary has $_") for qw( cc config_args usemymalloc default_inc_excludes_dot ); +is ($info->{default_inc_excludes_dot}, "define", "This build has . NOT in INC"); + +__END__ +Summary of my perl5 (revision 5 version 32 subversion 0) configuration: + + Platform: + osname=linux + osvers=5.7.1-1-default + archname=x86_64-linux-thread-multi-ld + uname='linux lx09 5.7.1-1-default #1 smp wed jun 10 11:53:46 utc 2020 (6a549f6) x86_64 x86_64 x86_64 gnulinux ' + config_args='-Dusethreads -Duseithreads -Duse64bitall -Duselongdouble -Duseshrplib -des' + hint=recommended + useposix=true + d_sigaction=define + useithreads=define + usemultiplicity=define + use64bitint=define + use64bitall=define + uselongdouble=define + usemymalloc=n + default_inc_excludes_dot=define + bincompat5005=undef + Compiler: + cc='cc' + ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' + optimize='-O2' + cppflags='-D_REENTRANT -D_GNU_SOURCE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include' + ccversion='' + gccversion='10.1.1 20200507 [revision dd38686d9c810cecbaa80bb82ed91caaa58ad635]' + gccosandvers='' + intsize=4 + longsize=8 + ptrsize=8 + doublesize=8 + byteorder=12345678 + doublekind=3 + d_longlong=define + longlongsize=8 + d_longdbl=define + longdblsize=16 + longdblkind=3 + ivtype='long' + ivsize=8 + nvtype='long double' + nvsize=16 + Off_t='off_t' + lseeksize=8 + alignbytes=16 + prototype=define + Linker and Libraries: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/10/include-fixed /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 + libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat + perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc + libc=libc-2.31.so + so=so + useshrplib=true + libperl=libperl.so + gnulibc_version='2.31' + Dynamic Linking: + dlsrc=dl_dlopen.xs + dlext=so + d_dlsymun=undef + ccdlflags='-Wl,-E -Wl,-rpath,/pro/lib/perl5/5.32.0/x86_64-linux-thread-multi-ld/CORE' + cccdlflags='-fPIC' + lddlflags='-shared -O2 -L/pro/local/lib -fstack-protector-strong' + + +Characteristics of this binary (from libperl): + Compile-time options: + HAS_TIMES + MULTIPLICITY + PERLIO_LAYERS + PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV + PERL_IMPLICIT_CONTEXT + PERL_MALLOC_WRAP + PERL_OP_PARENT + PERL_PRESERVE_IVUV + USE_64_BIT_ALL + USE_64_BIT_INT + USE_ITHREADS + USE_LARGE_FILES + USE_LOCALE + USE_LOCALE_COLLATE + USE_LOCALE_CTYPE + USE_LOCALE_NUMERIC + USE_LOCALE_TIME + USE_LONG_DOUBLE + USE_PERLIO + USE_PERL_ATOF + USE_REENTRANT_API + USE_THREAD_SAFE_LOCALE + Built under linux + Compiled at Jun 21 2020 10:17:00 + %ENV: + PERL6LIB="inst#/pro/3gl/CPAN/rakudo/install" + @INC: + /pro/lib/perl5/site_perl/5.32.0/x86_64-linux-thread-multi-ld + /pro/lib/perl5/site_perl/5.32.0 + /pro/lib/perl5/5.32.0/x86_64-linux-thread-multi-ld + /pro/lib/perl5/5.32.0 |