diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4d7458c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,25 @@ +# General + +I am always open to improvements and suggestions. +Use [issues](https://github.com/Tux/Config-Perl-V/issues) + +Note that as this module is a Perl5 CORE module (dual-life), more strict +rules than normal might apply. + +# Style + +I will never accept pull request that do not strictly conform to my +style, however you might hate it. You can read the reasoning behind +my [preferences](http://tux.nl/style.html). + +I really do not care about mixed spaces and tabs in (leading) whitespace + +Perl::Tidy will help getting the code in shape, but as all software, it +is not perfect. You can find my preferences for these in +[.perltidy](https://github.com/Tux/Release-Checklist/blob/master/.perltidyrc) and +[.perlcritic](https://github.com/Tux/Release-Checklist/blob/master/.perlcriticrc). + +# Requirements + +The minimum version required to use this module is stated in +[Makefile.PL](./Makefile.PL) diff --git a/Changelog b/Changelog new file mode 100644 index 0000000..66a7fa8 --- /dev/null +++ b/Changelog @@ -0,0 +1,123 @@ +0.30 - 04 Jul 2018, H.Merijn Brand + * It's 2018 + * Add test for 5.27.11 (r is for rsync checkout) + * Add test for 5.28.0 + +0.29 - 12 Oct 2017, H.Merijn Brand + * It's 2017 + * Add test for 5.26.1-RC1 + * Fix signature with argument + * Ignore ccache and compiler path in signature + +0.28 - 27 Feb 2017, H.Merijn Brand + * Add default_inc_excludes_dot + +0.27 - 11 Aug 2016, H.Merijn Brand + * Sync with 5.25.3 - add PERL_OP_PARENT + +0.26 - 10 May 2016, H.Merijn Brand + * Some flags are special and can have embedded quotation + * Add windos 5.23.5/cl config + * It's 2016 + * Sync up with 5.24.0 - add SILENT_NO_TAINT_SUPPORT + +0.25 - 18 Nov 2015, H.Merijn Brand + * Travis will work on a git checkout *with* xt + * Add PERL_COPY_ON_WRITE (renamed from PERL_NEW_COPY_ON_WRITE) + * Add tests for 5.20.2 and 5.22.0 + * Add CONTRIBUTING.md + * Add USE_NO_REGISTRY (WIN32_NO_REGISTRY) for 5.23.x + * Add Strawberry 5.22.0.1 configuration test + +0.24 - 16 Apr 2015, H.Merijn Brand + * Typo in README + * Add USE_QUADMATH + * Auto-check against core + +0.23 - 11 Feb 2015, H.Merijn Brand + * Update copyright to 2015 + * Add summary tests + * Remove perl recommendation from META as it breaks cpan clients + * Move repo to github + +0.22 - 02 Aug 2014, H.Merijn Brand + * Fixed parsing locally applied patches (passed only first line) + * Fixed parsing compile-time options (passed only first line) + * Some settings run unquoted to end-of-line + * Not all key-value pairs were separated by ',' in older perl + * Small typo in test comment + +0.21 - 01 Aug 2014, H.Merijn Brand + * Add tests for each major distribution since 5.6.2 + * Better detect build times + * Sync with 5.20.1 + +0.20 - 19 Feb 2014, H.Merijn Brand + * Update copyright to 2014 + * Typo fix in comment (RT#92469) + * Sync up with blead + +0.19 - 30 Jul 2013, H.Merijn Brand + * TEST_REQUIRES was added in 6.63_03 (RT#85811) + * Removed duplicate entry (no visible change) + +0.18 - 24 May 2013, H.Merijn Brand + * Fixed typo in META (Chorny) + * Support for using uninstalled Test::NoWarnings (RT#82386) + * Sync up with perl-5.18.0 (and 5.19.0) + +0.17 - 10 Feb 2013, H.Merijn Brand + * Deal with spaces in patch descriptions + +0.16 - 25 Jan 2013, H.Merijn Brand + * Do not shell out on 5.14.0 and up if perl provides internals (Nicholas) + * Update copyright to 2013 + * Update list of known symbols to 5.17.8 + * Prevent tar paxheaders (http://www.perlmonks.org/?node_id=1004571) + +0.15 - 07 Jun 2012, H.Merijn Brand + * Update copyright to 2012 + * Prepare for CORE inclusion (BinGOs) + +0.14 - 07 Sep 2011, H.Merijn Brand + * Upped copyright to 2011 + * NAME / DISTNAME in Makefile.PL + +0.13 - 07 Sep 2011, H.Merijn Brand + * Some spelling fixes + * More cross-checks for META data + +0.12 - 16 Mar 2010, H.Merijn Brand + * YAML dropped to spec 1.0 (RT#55614) + +0.11 - 15 Mar 2010, H.Merijn Brand + * Upped copyright to 2010 + * osname in {build} can be different from {config} (OpenBSD vs openbsd) + * Add USE_ATTRIBUTES_FOR_PERLIO to the list of -V's compile-time options. + * Add USE_PERL_ATOF to the list of -V's compile-time options. + +0.10 - 24 Sep 2009, H.Merijn Brand + * Add PERL_DISABLE_PMC to the list of -V's compile-time options. + * Add PERL_IS_MINIPERL to the list of -V's compile-time options. + * pod fix (Jim Cromie) + +0.05 - 01 Jul 2009, H.Merijn Brand + * 0.04 was shipped with 0.05 as $VERSION. Sorry + +0.04 - 01 Jul 2009, H.Merijn Brand + * Default for summary is myconfig + * Added signature () + * Added @EXPORT_OK and EXPORT_TAGS + +0.03 - 05 Apr 2009, H.Merijn Brand + * Reconstruct version from perl-v output (dagolden) + +0.02 - 30 Mar 2009, H.Merijn Brand + * Added plv2hash () + * Documentation + * Added all (new) version related config entries, including git + * Added a derived section + * Added summary () + +0.01 - 29 Mar 2009, H.Merijn Brand + * Initial release diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..2b4dab0 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,29 @@ +MANIFEST +Changelog +Makefile.PL +README +CONTRIBUTING.md +V.pm +t/10_base.t +t/20_plv56.t +t/21_plv58.t +t/22_plv510.t +t/23_plv512.t +t/24_plv514.t +t/25_plv516.t +t/25_plv5162.t +t/26_plv518.t +t/26_plv5182.t +t/27_plv5200.t +t/27_plv5202.t +t/28_plv5220.t +t/28_plv52201w.t +t/29_plv5235w.t +t/30_plv5240.t +t/31_plv52511.t +t/32_plv5261rc1.t +t/33_plv52711r.t +t/34_plv5280.t +examples/show-v.pl +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff --git a/META.json b/META.json new file mode 100644 index 0000000..a163c32 --- /dev/null +++ b/META.json @@ -0,0 +1,58 @@ +{ + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : 2 + }, + "provides" : { + "Config::Perl::V" : { + "version" : "0.30", + "file" : "V.pm" + } + }, + "version" : "0.30", + "generated_by" : "Author", + "prereqs" : { + "test" : { + "requires" : { + "Test::More" : "0", + "Test::NoWarnings" : "0" + } + }, + "build" : { + "requires" : { + "perl" : "5.006" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "runtime" : { + "requires" : { + "Config" : "0", + "perl" : "5.006" + } + } + }, + "name" : "Config-Perl-V", + "dynamic_config" : 1, + "release_status" : "stable", + "resources" : { + "repository" : { + "web" : "https://github.com/Tux/Config-Perl-V", + "url" : "https://github.com/Tux/Config-Perl-V", + "type" : "git" + }, + "license" : [ + "http://dev.perl.org/licenses/" + ] + }, + "license" : [ + "perl_5" + ], + "author" : [ + "H.Merijn Brand " + ], + "abstract" : "Structured data retrieval of perl -V output" +} diff --git a/META.yml b/META.yml new file mode 100644 index 0000000..a66bf6a --- /dev/null +++ b/META.yml @@ -0,0 +1,28 @@ +--- +abstract: Structured data retrieval of perl -V output +author: + - H.Merijn Brand +build_requires: + perl: '5.006' +configure_requires: + ExtUtils::MakeMaker: 0 +dynamic_config: 1 +generated_by: Author, CPAN::Meta::Converter version 2.150010 +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: '1.4' +name: Config-Perl-V +provides: + Config::Perl::V: + file: V.pm + version: '0.30' +requires: + Config: 0 + Test::More: 0 + Test::NoWarnings: 0 + perl: '5.006' +resources: + license: http://dev.perl.org/licenses/ + repository: https://github.com/Tux/Config-Perl-V +version: '0.30' diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..3c9bb13 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,56 @@ +#!/usr/bin/perl + +# Copyright PROCURA B.V. (c) 2009-2018 H.Merijn Brand + +use strict; + +use ExtUtils::MakeMaker; +my $eummv = $ExtUtils::MakeMaker::VERSION; + +my %wm = ( + NAME => "Config::Perl::V", + DISTNAME => "Config-Perl-V", + AUTHOR => "H.Merijn Brand ", + VERSION_FROM => "V.pm", + ABSTRACT_FROM => "V.pm", + + PREREQ_PM => { "Config" => 0, }, + macro => { TARFLAGS => "--format=ustar -c -v -f", }, + ); +$eummv >= 6.31 and $wm{LICENSE} = "perl"; +my $section = $eummv >= 6.64 ? "TEST_REQUIRES" : "PREREQ_PM"; +$wm{$section}{$_} = 0 for qw( Test::More Test::NoWarnings ); + +-d "xt" and $wm{test}{TESTS} = "t/*.t xt/*.t"; + +my $rv = WriteMakefile (%wm); + +1; + +package MY; + +sub postamble +{ + join "\n" => + 'cover test_cover:', + ' ccache -C', + ' cover -test', + '', + 'spellcheck:', + ' pod-spell-check --aspell', + '', + 'checkmeta: spellcheck', + ' perl sandbox/genMETA.pl -c', + '', + 'fixmeta: distmeta', + ' perl sandbox/genMETA.pl', + ' ls -l */META.yml', + '', + 'tgzdist: checkmeta fixmeta $(DISTVNAME).tar.gz distcheck', + ' -@mv -f $(DISTVNAME).tar.gz $(DISTVNAME).tgz', + ' -@cpants_lint.pl $(DISTVNAME).tgz', + ' -@rm -f Debian_CPANTS.txt', + ''; + } # postamble + +1; diff --git a/README b/README new file mode 100644 index 0000000..337300a --- /dev/null +++ b/README @@ -0,0 +1,44 @@ +Config::Perl::V + + A module that will return you the output of 'perl -V' in a structure. + +DESCRIPTION + + The command 'perl -V' will return you an excerpt from the %Config hash + combined with the output of 'perl -V' that is not stored inside %Config, + but only available to the perl binary itself. + +PREREQUISITES + + A working perl + +BUILDING AND INSTALLATION + + As most perl modules + + $ perl Makefile.PL + $ make test + $ make install UNINST=1 + +SOURCE CODE + + Recent changes can be (re)viewed in the public GIT repository at + http://repo.or.cz/w/Config-Perl-V + Feel free to clone your own copy: + + $ git clone https://github.com/Tux/Config-Perl-V Config-Perl-V + + or get it as a tgz: + + $ wget --output-document=Config-Perl-V.tgz \ + https://github.com/Tux/Config-Perl-V/archive/master.tar.gz + +CHANGES + + See Changelog + +COPYRIGHT AND LICENSE + Copyright (C) 2009-2018 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/V.pm b/V.pm new file mode 100644 index 0000000..4a7a2a5 --- /dev/null +++ b/V.pm @@ -0,0 +1,560 @@ +package Config::Perl::V; + +use strict; +use warnings; + +use Config; +use Exporter; +use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS); +$VERSION = "0.30"; +@ISA = qw( Exporter ); +@EXPORT_OK = qw( plv2hash summary myconfig signature ); +%EXPORT_TAGS = ( + all => [ @EXPORT_OK ], + sig => [ "signature" ], + ); + +# Characteristics of this binary (from libperl): +# Compile-time options: DEBUGGING PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP +# USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO + +# The list are as the perl binary has stored it in PL_bincompat_options +# search for it in +# perl.c line 1643 S_Internals_V () +# 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( + + DEBUGGING + NO_HASH_SEED + NO_MATHOMS + NO_TAINT_SUPPORT + PERL_BOOL_AS_CHAR + PERL_COPY_ON_WRITE + PERL_DISABLE_PMC + PERL_DONT_CREATE_GVSV + PERL_EXTERNAL_GLOB + PERL_HASH_FUNC_DJB2 + PERL_HASH_FUNC_MURMUR3 + PERL_HASH_FUNC_ONE_AT_A_TIME + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_HASH_FUNC_ONE_AT_A_TIME_OLD + PERL_HASH_FUNC_SDBM + PERL_HASH_FUNC_SIPHASH + PERL_HASH_FUNC_SUPERFAST + PERL_IS_MINIPERL + PERL_MALLOC_WRAP + PERL_MEM_LOG + PERL_MEM_LOG_ENV + PERL_MEM_LOG_ENV_FD + PERL_MEM_LOG_NOIMPL + PERL_MEM_LOG_STDERR + PERL_MEM_LOG_TIMESTAMP + PERL_NEW_COPY_ON_WRITE + PERL_OP_PARENT + PERL_PERTURB_KEYS_DETERMINISTIC + PERL_PERTURB_KEYS_DISABLED + PERL_PERTURB_KEYS_RANDOM + PERL_PRESERVE_IVUV + PERL_RELOCATABLE_INCPUSH + PERL_USE_DEVEL + PERL_USE_SAFE_PUTENV + SILENT_NO_TAINT_SUPPORT + UNLINK_ALL_VERSIONS + USE_ATTRIBUTES_FOR_PERLIO + USE_FAST_STDIO + USE_HASH_SEED_EXPLICIT + USE_LOCALE + USE_LOCALE_CTYPE + USE_NO_REGISTRY + USE_PERL_ATOF + USE_SITECUSTOMIZE + + DEBUG_LEAKING_SCALARS + DEBUG_LEAKING_SCALARS_FORK_DUMP + DECCRTL_SOCKETS + FAKE_THREADS + FCRYPT + HAS_TIMES + HAVE_INTERP_INTERN + MULTIPLICITY + MYMALLOC + PERL_DEBUG_READONLY_COW + PERL_DEBUG_READONLY_OPS + PERL_GLOBAL_STRUCT + PERL_GLOBAL_STRUCT_PRIVATE + PERL_IMPLICIT_CONTEXT + PERL_IMPLICIT_SYS + PERLIO_LAYERS + PERL_MAD + PERL_MICRO + PERL_NEED_APPCTX + PERL_NEED_TIMESBASE + PERL_OLD_COPY_ON_WRITE + PERL_POISON + PERL_SAWAMPERSAND + PERL_TRACK_MEMPOOL + PERL_USES_PL_PIDSTATUS + PL_OP_SLAB_ALLOC + THREADS_HAVE_PIDS + USE_64_BIT_ALL + USE_64_BIT_INT + USE_IEEE + USE_ITHREADS + USE_LARGE_FILES + USE_LOCALE_COLLATE + USE_LOCALE_NUMERIC + USE_LOCALE_TIME + USE_LONG_DOUBLE + USE_PERLIO + USE_QUADMATH + USE_REENTRANT_API + USE_SFIO + USE_SOCKS + VMS_DO_SOCKETS + VMS_SHORTEN_LONG_SYMBOLS + VMS_SYMBOL_CASE_AS_IS + ); + +# These are all the keys that are +# 1. Always present in %Config - lib/Config.pm #87 tie %Config +# 2. Reported by 'perl -V' (the rest) +my @config_vars = qw( + + api_subversion + api_version + api_versionstring + archlibexp + dont_use_nlink + d_readlink + d_symlink + exe_ext + inc_version_list + ldlibpthname + patchlevel + path_sep + perl_patchlevel + privlibexp + scriptdir + sitearchexp + sitelibexp + subversion + usevendorprefix + version + + git_commit_id + git_describe + git_branch + git_uncommitted_changes + git_commit_id_title + git_snapshot_date + + package revision version_patchlevel_string + + osname osvers archname + myuname + config_args + hint useposix d_sigaction + useithreads usemultiplicity + useperlio d_sfio uselargefiles usesocks + use64bitint use64bitall uselongdouble + usemymalloc default_inc_excludes_dot bincompat5005 + + cc ccflags + optimize + cppflags + ccversion gccversion gccosandvers + intsize longsize ptrsize doublesize byteorder + d_longlong longlongsize d_longdbl longdblsize + ivtype ivsize nvtype nvsize lseektype lseeksize + alignbytes prototype + + ld ldflags + libpth + libs + perllibs + libc so useshrplib libperl + gnulibc_version + + dlsrc dlext d_dlsymun ccdlflags + cccdlflags lddlflags + ); + +my %empty_build = ( + osname => "", + stamp => 0, + options => { %BTD }, + patches => [], + ); + +sub _make_derived { + my $conf = shift; + + 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}; + } + + 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; + + $vps =~ s{\b version \s+ (\S+) }{}x and + $conf->{config}{api_version} ||= $1; + $vps =~ s{\b subversion \s+ (\S+) }{}x and + $conf->{config}{subversion} ||= $1; + $vps =~ s{\b patch \s+ (\S+) }{}x and + $conf->{config}{perl_patchlevel} ||= $1; + } + + ($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 + + 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; + } # _make_derived + +sub plv2hash { + my %config; + + my $pv = join "\n" => @_; + + 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)}; + my ($vers, $subvers) = $rev =~ m{version\s+(\d+)\s+subversion\s+(\d+)}; + defined $vers && defined $subvers && defined $rel and + $config{version} = "$rel.$vers.$subvers"; + } + + 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 + for my $k (qw( ccflags ldflags lddlflags )) { + $pv =~ s{, \s* $k \s*=\s* (.*) \s*$}{}mx or next; + my $v = $1; + $v =~ s/\s*,\s*$//; + $v =~ s/^(['"])(.*)\1$/$2/; + $config{$k} = $v; + } + + if (my %kv = ($pv =~ m{\b + (\w+) # key + \s*= # assign + ( '\s*[^']*?\s*' # quoted value + | \S+[^=]*?\s*\n # unquoted running till end of line + | \S+ # unquoted value + | \s*\n # empty + ) + (?:,?\s+|\s*\n)? # separator (5.8.x reports did not have a ',' + }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+$//; + $config{$k} = $v; + } + } + + my $build = { %empty_build }; + + $pv =~ m{^\s+Compiled at\s+(.*)}m + 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 ]; + $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; + + $build->{osname} = $config{osname}; + $pv =~ m{^\s+Built under\s+(.*)}m + and $build->{osname} = $1; + $config{osname} ||= $build->{osname}; + + return _make_derived ({ + 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; + + my %info = map { + 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 + uselongdouble usemultiplicity usemymalloc useperlio useshrplib + doublesize intsize ivsize nvsize longdblsize longlongsize lseeksize + default_inc_excludes_dot + ); + $info{$_}++ for grep { $conf->{build}{options}{$_} } keys %{$conf->{build}{options}}; + + return \%info; + } # summary + +sub signature { + my $no_md5 = "0" x 32; + my $conf = summary (shift) or return $no_md5; + + eval { require Digest::MD5 }; + $@ and return $no_md5; + + $conf->{cc} =~ s{.*\bccache\s+}{}; + $conf->{cc} =~ s{.*[/\\]}{}; + + delete $conf->{config_args}; + return Digest::MD5::md5_hex (join "\xFF" => map { + "$_=".(defined $conf->{$_} ? $conf->{$_} : "\xFE"); + } sort keys %$conf); + } # signature + +sub myconfig { + my $args = shift; + my %args = ref $args eq "HASH" ? %$args : + ref $args eq "ARRAY" ? @$args : (); + + my $build = { %empty_build }; + + # 5.14.0 and later provide all the information without shelling out + 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 (); + } + 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 ); + } + + my @KEYS = keys %ENV; + my %env = + map { $_ => $ENV{$_} } grep m/^PERL/ => @KEYS; + $args{env} and + map { $env{$_} = $ENV{$_} } grep m{$args{env}} => @KEYS; + + my %config = map { $_ => $Config{$_} } @config_vars; + + return _make_derived ({ + build => $build, + environment => \%env, + config => \%config, + derived => {}, + inc => \@INC, + }); + } # myconfig + +1; + +__END__ + +=head1 NAME + +Config::Perl::V - Structured data retrieval of perl -V output + +=head1 SYNOPSIS + + use Config::Perl::V; + + my $local_config = Config::Perl::V::myconfig (); + print $local_config->{config}{osname}; + +=head1 DESCRIPTION + +=head2 $conf = myconfig () + +This function will collect the data described in L below, +and return that as a hash reference. It optionally accepts an option to +include more entries from %ENV. See L below. + +Note that this will not work on uninstalled perls when called with +C<-I/path/to/uninstalled/perl/lib>, but it works when that path is in +C<$PERL5LIB> or in C<$PERL5OPT>, as paths passed using C<-I> are not +known when the C<-V> information is collected. + +=head2 $conf = plv2hash ($text [, ...]) + +Convert a sole 'perl -V' text block, or list of lines, to a complete +myconfig hash. All unknown entries are defaulted. + +=head2 $info = summary ([$conf]) + +Return an arbitrary selection of the information. If no C<$conf> is +given, C is used instead. + +=head2 $md5 = signature ([$conf]) + +Return the MD5 of the info returned by C without the +C entry. + +If C is not available, it return a string with only C<0>'s. + +=head2 The hash structure + +The returned hash consists of 4 parts: + +=over 4 + +=item build + +This information is extracted from the second block that is emitted by +C, and usually looks something like + + Characteristics of this binary (from libperl): + Compile-time options: DEBUGGING USE_64_BIT_INT USE_LARGE_FILES + Locally applied patches: + defined-or + MAINT24637 + Built under linux + Compiled at Jun 13 2005 10:44:20 + @INC: + /usr/lib/perl5/5.8.7/i686-linux-64int + /usr/lib/perl5/5.8.7 + /usr/lib/perl5/site_perl/5.8.7/i686-linux-64int + /usr/lib/perl5/site_perl/5.8.7 + /usr/lib/perl5/site_perl + . + +or + + Characteristics of this binary (from libperl): + Compile-time options: DEBUGGING MULTIPLICITY + PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT + PERL_MALLOC_WRAP PERL_TRACK_MEMPOOL + PERL_USE_SAFE_PUTENV USE_ITHREADS + USE_LARGE_FILES USE_PERLIO + USE_REENTRANT_API + Built under linux + Compiled at Jan 28 2009 15:26:59 + +This information is not available anywhere else, including C<%Config>, +but it is the information that is only known to the perl binary. + +The extracted information is stored in 5 entries in the C hash: + +=over 4 + +=item osname + +This is most likely the same as C<$Config{osname}>, and was the name +known when perl was built. It might be different if perl was cross-compiled. + +The default for this field, if it cannot be extracted, is to copy +C<$Config{osname}>. The two may be differing in casing (OpenBSD vs openbsd). + +=item stamp + +This is the time string for which the perl binary was compiled. The default +value is 0. + +=item options + +This is a hash with all the known defines as keys. The value is either 0, +which means unknown or unset, or 1, which means defined. + +=item derived + +As some variables are reported by a different name in the output of C +than their actual name in C<%Config>, I decided to leave the C entry +as close to reality as possible, and put in the entries that might have been +guessed by the printed output in a separate block. + +=item patches + +This is a list of optionally locally applied patches. Default is an empty list. + +=back + +=item environment + +By default this hash is only filled with the environment variables +out of %ENV that start with C, but you can pass the C option +to myconfig to get more + + my $conf = Config::Perl::V::myconfig ({ env => qr/^ORACLE/ }); + my $conf = Config::Perl::V::myconfig ([ env => qr/^ORACLE/ ]); + +=item config + +This hash is filled with the variables that C fills its report +with, and it has the same variables that C returns +from C<%Config>. + +=item inc + +This is the list of default @INC. + +=back + +=head1 REASONING + +This module was written to be able to return the configuration for the +currently used perl as deeply as needed for the CPANTESTERS framework. +Up until now they used the output of myconfig as a single text blob, +and so it was missing the vital binary characteristics of the running +perl and the optional applied patches. + +=head1 BUGS + +Please feedback what is wrong + +=head1 TODO + + * Implement retrieval functions/methods + * Documentation + * Error checking + * Tests + +=head1 AUTHOR + +H.Merijn Brand + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2009-2018 H.Merijn Brand + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/examples/show-v.pl b/examples/show-v.pl new file mode 100755 index 0000000..2fac597 --- /dev/null +++ b/examples/show-v.pl @@ -0,0 +1,12 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +use Data::Peek; +use Config::Perl::V; + +my $conf = Config::Perl::V::myconfig [ @ARGV ]; +DDumper $conf; + +DDumper Config::Perl::V::summary $conf; diff --git a/t/10_base.t b/t/10_base.t new file mode 100644 index 0000000..c4deda0 --- /dev/null +++ b/t/10_base.t @@ -0,0 +1,72 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 42; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + + use_ok ("Config::Perl::V"); + } + +ok (my $conf = Config::Perl::V::myconfig, "Read config"); +ok (exists $conf->{$_}, "Has $_ entry") for qw( build environment config inc ); +is (lc $conf->{build}{osname}, lc $conf->{config}{osname}, "osname"); + +# Test summary +ok (my $info1 = Config::Perl::V::summary ($conf), "Get a summary for \$conf"); +ok (my $info2 = Config::Perl::V::summary, "Get a summary for \$^X"); +is_deeply ($info1, $info2, "Info should match"); + +ok (my $sig = Config::Perl::V::signature, "Get signature"); +like ($sig, qr{^[0-9a-f]{32}$}, "Valid md5"); + +my $no_md5 = "0" x 32; +ok (my $bad = Config::Perl::V::signature ({ cfg => 0 }), "Signature on invalid data"); +is ($bad, $no_md5, "Invalid md5"); +ok ( $bad = Config::Perl::V::signature ({ config => {} }), "Signature on incomplete data"); +is ($bad, $no_md5, "Invalid md5"); +ok ( $bad = Config::Perl::V::signature ({ config => 0, build => {} }), "Signature on invalid data"); +is ($bad, $no_md5, "Invalid md5"); +ok ( $bad = Config::Perl::V::signature ({ config => {}, build => 0 }), "Signature on invalid data"); +is ($bad, $no_md5, "Invalid md5"); + +SKIP: { + # Test that the code that shells out to perl -V and parses the output + # gives the same results as the code that calls Config::* routines directly. + defined &Config::compile_date or + skip "This perl doesn't provide perl -V in the Config module", 2; + eval q{no warnings "redefine"; sub Config::compile_date { return undef }}; + is (Config::compile_date (), undef, "Successfully overriden compile_date"); + is_deeply (Config::Perl::V::myconfig, $conf, + "perl -V parsing code produces same result as the Config module"); + } + +$ENV{CPV_TEST_ENV} = 42; +ok ($conf = Config::Perl::V::myconfig ({ env => qr{^CPV_TEST_ENV$} }), "Read config plus ENV"); +ok (exists $conf->{$_}, "Has $_ entry") for qw( build environment config inc environment ); +ok (my $eh = $conf->{environment}, "Get ENV from conf"); +is ($eh->{CPV_TEST_ENV}, 42, "Valid entry"); + +ok ($conf = Config::Perl::V::myconfig ([ env => qr{^CPV_TEST_ENV$} ]), "Read config plus ENV"); +ok (exists $conf->{$_}, "Has $_ entry") for qw( build environment config inc environment ); +ok ($eh = $conf->{environment}, "Get ENV from conf"); +is ($eh->{CPV_TEST_ENV}, 42, "Valid entry"); + +ok ($conf = Config::Perl::V::myconfig ( env => qr{^CPV_TEST_ENV$} ), "Read config invalid arguments"); +is ($conf->{environment}{CPV_TEST_ENV}, undef, "No entry"); + +delete $INC{"Digest/MD5.pm"}; +delete $INC{"Digest/base.pm"}; +$INC{"Digest/MD5"} = "./flooble/blurgh/Digest/MD5.pm"; +local @INC = ("xyzzy$$"); # Should be unable to find Digest::MD5 +ok ($sig = Config::Perl::V::signature, "Get signature (No Digest::MD5)"); +is ($sig, $no_md5, "Valid md5"); diff --git a/t/20_plv56.t b/t/20_plv56.t new file mode 100644 index 0000000..a7e9f9e --- /dev/null +++ b/t/20_plv56.t @@ -0,0 +1,84 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 99; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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}, "Mar 23 2010 17:34:56", "Build time"); +is ($conf->{config}{"package"}, "perl5", "reconstructed \%Config{package}"); +is ($conf->{config}{version}, "5.6.2", "reconstructed \%Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + DEBUGGING USE_64_BIT_INT USE_LARGE_FILES + )) { + 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 : "9dc187182be100c1713f210a8c6d9f45"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +__END__ +Summary of my perl5 (revision 5.0 version 6 subversion 2) configuration: + Platform: + osname=linux, osvers=2.6.31.12-0.2-default, archname=i686-linux-64int-perlio + uname='linux nb09 2.6.31.12-0.2-default #1 smp 2010-03-16 21:25:39 +0100 i686 i686 i386 gnulinux ' + config_args='-Dusedevel -Duse64bitint -Duseperlio -des -Dusedevel -Uinstallusrbinperl -Dprefix=/media/Tux/perls' + hint=recommended, useposix=true, d_sigaction=define + usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef + useperlio=define d_sfio=undef uselargefiles=define usesocks=undef + use64bitint=define use64bitall=undef uselongdouble=undef + Compiler: + cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', + optimize='-O2', + cppflags='-DDEBUGGING -fno-strict-aliasing -I/pro/local/include' + ccversion='', gccversion='4.4.1 [gcc-4_4-branch revision 150839]', gccosandvers='' + intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 + ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 + alignbytes=4, usemymalloc=n, prototype=define + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib + libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil + perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil + libc=/lib/libc-2.10.1.so, so=so, useshrplib=false, libperl=libperl.a + Dynamic Linking: + dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' + cccdlflags='-fpic', lddlflags='-shared -L/pro/local/lib' + + +Characteristics of this binary (from libperl): + Compile-time options: DEBUGGING USE_64_BIT_INT USE_LARGE_FILES + Built under linux + Compiled at Mar 23 2010 17:34:56 + @INC: + /media/Tux/perls/lib/5.6.2/i686-linux-64int-perlio + /media/Tux/perls/lib/5.6.2 + /media/Tux/perls/lib/site_perl/5.6.2/i686-linux-64int-perlio + /media/Tux/perls/lib/site_perl/5.6.2 + /media/Tux/perls/lib/site_perl + . diff --git a/t/21_plv58.t b/t/21_plv58.t new file mode 100644 index 0000000..a7b797b --- /dev/null +++ b/t/21_plv58.t @@ -0,0 +1,91 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 99; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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}, "Oct 21 2010 14:50:53", "Build time"); +is ($conf->{config}{version}, "5.8.9", "reconstructed \%Config{version}"); +is ($conf->{config}{usethreads}, "define", "This was a threaded perl"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + DEBUGGING MULTIPLICITY PERL_IMPLICIT_CONTEXT + PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_64_BIT_INT + USE_FAST_STDIO USE_ITHREADS USE_LARGE_FILES + USE_LONG_DOUBLE USE_PERLIO 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 : "df48dce1adaaf63855d8acd455c51818"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +__END__ +Summary of my perl5 (revision 5 version 8 subversion 9) configuration: + Platform: + osname=linux, osvers=2.6.34.7-0.4-desktop, archname=i686-linux-thread-multi-64int-ld + uname='linux tux09.procura.nl 2.6.34.7-0.4-desktop #1 smp preempt 2010-10-07 19:07:51 +0200 i686 i686 i386 gnulinux ' + config_args='-Dusedevel -Dusethreads -Duseithreads -Duse64bitint -Duselongdouble -Duseperlio -des -Dusedevel -Uinstallusrbinperl -Dprefix=/media/Tux/perls-t' + hint=recommended, useposix=true, d_sigaction=define + usethreads=define use5005threads=undef useithreads=define usemultiplicity=define + useperlio=define d_sfio=undef uselargefiles=define usesocks=undef + use64bitint=define use64bitall=undef uselongdouble=define + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', + optimize='-O2', + cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -I/pro/local/include' + ccversion='', gccversion='4.5.0 20100604 [gcc-4_5-branch revision 160292]', gccosandvers='' + intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 + ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=8 + alignbytes=4, prototype=define + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib + libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc + perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc + libc=/lib/libc-2.11.2.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.11.2' + Dynamic Linking: + dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' + cccdlflags='-fPIC', lddlflags='-shared -O2 -L/pro/local/lib' + + +Characteristics of this binary (from libperl): + Compile-time options: DEBUGGING MULTIPLICITY PERL_IMPLICIT_CONTEXT + PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_64_BIT_INT + USE_FAST_STDIO USE_ITHREADS USE_LARGE_FILES + USE_LONG_DOUBLE USE_PERLIO USE_REENTRANT_API + Built under linux + Compiled at Oct 21 2010 14:50:53 + @INC: + /media/Tux/perls-t/lib/5.8.9/i686-linux-thread-multi-64int-ld + /media/Tux/perls-t/lib/5.8.9 + /media/Tux/perls-t/lib/site_perl/5.8.9/i686-linux-thread-multi-64int-ld + /media/Tux/perls-t/lib/site_perl/5.8.9 + . diff --git a/t/22_plv510.t b/t/22_plv510.t new file mode 100644 index 0000000..51ba142 --- /dev/null +++ b/t/22_plv510.t @@ -0,0 +1,66 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 98; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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}, 0, "No build time known"); +is ($conf->{config}{version}, "5.10.0", "reconstructed \%Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +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 : "ce0a7871dfddbbed0a6c685c0f52dbf9"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +__END__ +Summary of my perl5 (revision 5 version 10 subversion 0) configuration: + Platform: + osname=linux, osvers=2.6.22.13-0.3-default, archname=i686-linux-64int + uname='linux nb09 2.6.22.13-0.3-default #1 smp 20071119 15:02:58 utc i686 i686 i386 gnulinux ' + config_args='-Duse64bitint -des' + hint=recommended, useposix=true, d_sigaction=define + useithreads=undef, usemultiplicity=undef + useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef + use64bitint=define, use64bitall=undef, uselongdouble=undef + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', + optimize='-O2 -g', + cppflags='-fno-strict-aliasing -pipe -I/pro/local/include' + ccversion='', gccversion='4.2.1 (SUSE Linux)', gccosandvers='' + intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 + ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 + alignbytes=4, prototype=define + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib + libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc + perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.6.1' + Dynamic Linking: + dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' + cccdlflags='-fPIC', lddlflags='-shared -O2 -L/pro/local/lib' diff --git a/t/23_plv512.t b/t/23_plv512.t new file mode 100644 index 0000000..00479ba --- /dev/null +++ b/t/23_plv512.t @@ -0,0 +1,91 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 100; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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}, "Dec 20 2010 12:46:00", "Build time"); +is ($conf->{config}{version}, "5.12.2", "reconstructed \%Config{version}"); +is ($conf->{config}{gccversion}, "", "not built with gcc"); +is ($conf->{config}{ccversion}, "B3910B", "built with HP C-ANSI-C"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL + USE_64_BIT_INT USE_LARGE_FILES USE_LONG_DOUBLE + USE_PERLIO USE_PERL_ATOF + )) { + 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 : "a2c38153cc47d340bc140d0bfe294afb"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +__END__ +Summary of my perl5 (revision 5 version 12 subversion 2) configuration: + + Platform: + osname=hpux, osvers=11.31, archname=IA64.ARCHREV_0-LP64-ld + uname='hp-ux x2 b.11.31 u ia64 2977233888 unlimited-user license ' + config_args='-Duse64bitall -Duselongdouble -des' + hint=recommended, useposix=true, d_sigaction=define + useithreads=undef, usemultiplicity=undef + useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef + use64bitint=define, use64bitall=define, uselongdouble=define + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cc', ccflags =' -Ae -DPERL_DONT_CREATE_GVSV +Z -z -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64 -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ', + optimize='+O2 +Onolimit', + cppflags='-Aa -D__STDC_EXT__ -DPERL_DONT_CREATE_GVSV +Z -z -D_HPUX_SOURCE -Ae -DPERL_DONT_CREATE_GVSV +Z -z -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64 -I/pro/local/include' + ccversion='B3910B', gccversion='', gccosandvers='' + intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 + ivtype='long', ivsize=8, nvtype='long double', nvsize=16, Off_t='off_t', lseeksize=8 + alignbytes=16, prototype=define + Linker and Libraries: + ld='/usr/bin/ld', ldflags ='-L/pro/local/lib +DD64 -L/usr/lib/hpux64' + libpth=/pro/local/lib /usr/lib/hpux64 /lib /usr/lib /usr/ccs/lib /usr/local/lib + libs=-lcl -lpthread -lnsl -lnm -ldb -ldl -ldld -lm -lsec -lc + perllibs=-lcl -lpthread -lnsl -lnm -ldl -ldld -lm -lsec -lc + libc=/usr/lib/hpux64/libc.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='' + Dynamic Linking: + dlsrc=dl_hpux.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred ' + cccdlflags='+Z', lddlflags='-b +vnocompatwarnings -L/pro/local/lib -L/usr/lib/hpux64' + + +Characteristics of this binary (from libperl): + Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL + USE_64_BIT_INT USE_LARGE_FILES USE_LONG_DOUBLE + USE_PERLIO USE_PERL_ATOF + Built under hpux + Compiled at Dec 20 2010 12:46:00 + @INC: + /pro/lib/perl5/site_perl/5.12.2/IA64.ARCHREV_0-LP64-ld + /pro/lib/perl5/site_perl/5.12.2 + /pro/lib/perl5/5.12.2/IA64.ARCHREV_0-LP64-ld + /pro/lib/perl5/5.12.2 + . diff --git a/t/24_plv514.t b/t/24_plv514.t new file mode 100644 index 0000000..db2ac2a --- /dev/null +++ b/t/24_plv514.t @@ -0,0 +1,93 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 100; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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 11 2012 16:36:53", "Build time"); +is ($conf->{config}{version}, "5.14.2", "reconstructed \%Config{version}"); +is ($conf->{config}{gccversion}, "", "not built with gcc"); +is ($conf->{config}{ccversion}, "11.1.0.8", "xlc version"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + DEBUGGING PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP + PERL_PRESERVE_IVUV PERL_USE_DEVEL USE_64_BIT_ALL + USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO + USE_PERL_ATOF + )) { + 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 : "778815a670c0c454738aedf0c88930ba"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +__END__ +Summary of my perl5 (revision 5 version 14 subversion 2) configuration: + + Platform: + osname=aix, osvers=5.3.0.0, archname=aix-64all + uname='aix i3 3 5 0004898ad300 ' + config_args='-Dusedevel -Duse64bitall -Uversiononly -Dinc_version_list=none -des' + hint=recommended, useposix=true, d_sigaction=define + useithreads=undef, usemultiplicity=undef + useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef + use64bitint=define, use64bitall=define, uselongdouble=undef + usemymalloc=n, bincompat5005=undef + Compiler: + cc='xlc -q64', ccflags ='-q64 -DDEBUGGING -qlanglvl=extended -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -qlanglvl=extended -I/pro/local/include -q64 -DUSE_64_BIT_ALL -q64', + optimize='-O', + cppflags='-DDEBUGGING -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -I/pro/local/include' + ccversion='11.1.0.8', gccversion='', gccosandvers='' + intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8 + ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 + alignbytes=8, prototype=define + Linker and Libraries: + ld='ld', ldflags ='-L/usr/local/ppc64/lib64 -b64 -q64 -L/pro/local/lib -brtl -bdynamic -b64' + libpth=/usr/local/ppc64/lib64 /lib /usr/lib /usr/ccs/lib /usr/local/lib /usr/lib64 + libs=-lbind -lnsl -ldbm -ldb -ldl -lld -lm -lcrypt -lc + perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc + libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a + gnulibc_version='' + Dynamic Linking: + dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -bE:/pro/lib/perl5/5.14.2/aix-64all/CORE/perl.exp' + cccdlflags=' ', lddlflags='-b64 -bhalt:4 -G -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -bnoentry -lc -lm -L/usr/local/ppc64/lib64 -L/pro/local/lib' + + +Characteristics of this binary (from libperl): + Compile-time options: DEBUGGING PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP + PERL_PRESERVE_IVUV PERL_USE_DEVEL USE_64_BIT_ALL + USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO + USE_PERL_ATOF + Built under aix + Compiled at May 11 2012 16:36:53 + @INC: + /pro/lib/perl5/site_perl/5.14.2/aix-64all + /pro/lib/perl5/site_perl/5.14.2 + /pro/lib/perl5/5.14.2/aix-64all + /pro/lib/perl5/5.14.2 + . diff --git a/t/25_plv516.t b/t/25_plv516.t new file mode 100644 index 0000000..6315223 --- /dev/null +++ b/t/25_plv516.t @@ -0,0 +1,94 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 99; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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}, "Mar 12 2013 08:36:17", "Build time"); +is ($conf->{config}{version}, "5.16.3", "reconstructed \%Config{version}"); +is ($conf->{config}{ccversion}, "", "Using gcc. non-gcc version should not be defined"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV + PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_INT + USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO + USE_PERL_ATOF + )) { + 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 : "7b00cf3b306d96fa802892e6ad4b070f"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +__END__ +Summary of my perl5 (revision 5 version 16 subversion 3) configuration: + + Platform: + osname=linux, osvers=3.4.33-2.24-desktop, archname=i686-linux-64int + uname='linux lx09 3.4.33-2.24-desktop #1 smp preempt tue feb 26 03:34:33 utc 2013 (5f00a32) i686 i686 i386 gnulinux ' + config_args='-Duse64bitint -Duselongdouble -des' + hint=previous, useposix=true, d_sigaction=define + useithreads=undef, usemultiplicity=undef + useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef + use64bitint=define, use64bitall=undef, uselongdouble=undef + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', + optimize='-O2', + cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' + ccversion='', gccversion='4.7.1 20120723 [gcc-4_7-branch revision 189773]', gccosandvers='' + intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 + ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 + alignbytes=4, prototype=define + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib + libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat + perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.15.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.15' + 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' + + +Characteristics of this binary (from libperl): + Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV + PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_INT + USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO + USE_PERL_ATOF + Built under linux + Compiled at Mar 12 2013 08:36:17 + @INC: + /pro/lib/perl5/site_perl/5.16.3/i686-linux-64int + /pro/lib/perl5/site_perl/5.16.3 + /pro/lib/perl5/5.16.3/i686-linux-64int + /pro/lib/perl5/5.16.3 + . diff --git a/t/25_plv5162.t b/t/25_plv5162.t new file mode 100644 index 0000000..aed85b9 --- /dev/null +++ b/t/25_plv5162.t @@ -0,0 +1,186 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 157; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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}, "Aug 25 2013 01:24:40", "Build time"); +is ($conf->{config}{version}, "5.16.2", "reconstructed \%Config{version}"); +is ($conf->{config}{ccversion}, "", "Using gcc. non-gcc version should not be defined"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + HAS_TIMES MULTIPLICITY PERLIO_LAYERS + PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT + PERL_MALLOC_WRAP 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_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 : "2917ca2a97b6db1ab8fb08798f53c0bb"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [ + "/Library/Perl/Updates/ comes before system perl directories", + "installprivlib and installarchlib points to the Updates directory", + "CVE-2013-1667 hashtable DOS fix", + ], "Local patches"); + +my %check = ( + + archname => "darwin-thread-multi-2level", + bincompat5005 => "undef", + config_args => "-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags= -Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc=cc", + d_sfio => "undef", + d_sigaction => "define", + hint => "recommended", + myuname => "darwin jackson.apple.com 13.0 darwin kernel version 13.0.0: tue jul 30 20:52:22 pdt 2013; root:xnu-2422.1.53~3release_x86_64 x86_64", + use64bitall => "define", + use64bitint => "define", + useithreads => "define", + uselargefiles => "define", + uselongdouble => "undef", + usemultiplicity => "define", + usemymalloc => "n", + useperlio => "define", + useposix => "true", + usesocks => "undef", + + alignbytes => 8, + byteorder => "12345678", + cc => "cc", + ccflags => "-arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include", + ccversion => "", + cppflags => "-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include", + d_longdbl => "define", + d_longlong => "define", + doublesize => 8, + gccosandvers => "", + gccversion => "4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)", + intsize => 4, + ivsize => 8, + ivtype => "long", + longdblsize => 16, + longlongsize => 8, + longsize => 8, + lseeksize => 8, + nvsize => 8, + nvtype => "double", + lseektype => "off_t", + optimize => "-Os", + prototype => "define", + ptrsize => 8, + + gnulibc_version => "", + ld => "cc -mmacosx-version-min=10.9", + ldflags => "-arch x86_64 -arch i386 -fstack-protector -L/usr/local/lib", + libc => "", + libperl => "libperl.dylib", + libpth => "/usr/local/lib /usr/lib", + libs => "", + perllibs => "", + so => "dylib", + useshrplib => "true", + + cccdlflags => "", + ccdlflags => "", + d_dlsymun => "undef", + dlext => "bundle", + dlsrc => "dl_dlopen.xs", + lddlflags => "-arch x86_64 -arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + + +__END__ +Summary of my perl5 (revision 5 version 16 subversion 2) configuration: + + Platform: + osname=darwin, osvers=13.0, archname=darwin-thread-multi-2level + uname='darwin jackson.apple.com 13.0 darwin kernel version 13.0.0: tue jul 30 20:52:22 pdt 2013; root:xnu-2422.1.53~3release_x86_64 x86_64 ' + config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags= -Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc=cc' + hint=recommended, useposix=true, d_sigaction=define + useithreads=define, usemultiplicity=define + useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef + use64bitint=define, use64bitall=define, uselongdouble=undef + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cc', ccflags ='-arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include', + optimize='-Os', + cppflags='-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include' + ccversion='', gccversion='4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)', gccosandvers='' + intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 + ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 + alignbytes=8, prototype=define + Linker and Libraries: + ld='cc -mmacosx-version-min=10.9', ldflags ='-arch x86_64 -arch i386 -fstack-protector -L/usr/local/lib' + libpth=/usr/local/lib /usr/lib + libs= + perllibs= + libc=, so=dylib, useshrplib=true, libperl=libperl.dylib + gnulibc_version='' + Dynamic Linking: + dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' + cccdlflags=' ', lddlflags='-arch x86_64 -arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector' + + +Characteristics of this binary (from libperl): + Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS + PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT + PERL_MALLOC_WRAP 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_PERLIO USE_PERL_ATOF + USE_REENTRANT_API + Locally applied patches: + /Library/Perl/Updates/ comes before system perl directories + installprivlib and installarchlib points to the Updates directory + CVE-2013-1667 hashtable DOS fix + Built under darwin + Compiled at Aug 25 2013 01:24:40 + %ENV: + PERL5LIB="" + PERL5OPT="" + PERL5_CPANPLUS_IS_RUNNING="37393" + PERL5_CPAN_IS_RUNNING="37393" + @INC: + /Library/Perl/5.16/darwin-thread-multi-2level + /Library/Perl/5.16 + /Network/Library/Perl/5.16/darwin-thread-multi-2level + /Network/Library/Perl/5.16 + /Library/Perl/Updates/5.16.2/darwin-thread-multi-2level + /Library/Perl/Updates/5.16.2 + /System/Library/Perl/5.16/darwin-thread-multi-2level + /System/Library/Perl/5.16 + /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level + /System/Library/Perl/Extras/5.16 + . + diff --git a/t/26_plv518.t b/t/26_plv518.t new file mode 100644 index 0000000..cedc734 --- /dev/null +++ b/t/26_plv518.t @@ -0,0 +1,120 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 118; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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 18 2013 17:34:20", "Build time"); +is ($conf->{config}{version}, "5.18.0", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP + PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_INT + USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LONG_DOUBLE + USE_PERLIO USE_PERL_ATOF + )) { + 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 : "8f46b07a7775e6a92347d4cd564b8f03"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [], "No local patches"); + +my %check = ( + alignbytes => 4, + api_version => 18, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-Duse64bitint -Duselongdouble -des", + gccversion => "4.7.2 20130108 [gcc-4_7-branch revision 195012]", + gnulibc_version => "2.17", + ivsize => 8, + ivtype => "long long", + ld => "cc", + lddlflags => "-shared -O3 -L/pro/local/lib -fstack-protector", + ldflags => "-L/pro/local/lib -fstack-protector", + libc => "/lib/libc-2.17.so", + lseektype => "off_t", + osvers => "3.7.10-1.4-desktop", + use64bitint => "define", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + +__END__ +Summary of my perl5 (revision 5 version 18 subversion 0) configuration: + + Platform: + osname=linux, osvers=3.7.10-1.4-desktop, archname=i686-linux-64int-ld + uname='linux test 3.7.10-1.4-desktop #1 smp preempt fri apr 19 12:06:34 utc 2013 (8ef74f8) i686 i686 i386 gnulinux ' + config_args='-Duse64bitint -Duselongdouble -des' + hint=recommended, useposix=true, d_sigaction=define + useithreads=undef, usemultiplicity=undef + useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef + use64bitint=define, use64bitall=undef, uselongdouble=define + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', + optimize='-O3', + cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include' + ccversion='', gccversion='4.7.2 20130108 [gcc-4_7-branch revision 195012]', gccosandvers='' + intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 + ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=8 + alignbytes=4, prototype=define + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib + libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat + perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.17.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.17' + Dynamic Linking: + dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' + cccdlflags='-fPIC', lddlflags='-shared -O3 -L/pro/local/lib -fstack-protector' + + +Characteristics of this binary (from libperl): + Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP + PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_INT + USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LONG_DOUBLE + USE_PERLIO USE_PERL_ATOF + Built under linux + Compiled at May 18 2013 17:34:20 + @INC: + /pro/lib/perl5/site_perl/5.18.0/i686-linux-64int-ld + /pro/lib/perl5/site_perl/5.18.0 + /pro/lib/perl5/5.18.0/i686-linux-64int-ld + /pro/lib/perl5/5.18.0 + . diff --git a/t/26_plv5182.t b/t/26_plv5182.t new file mode 100644 index 0000000..178fb92 --- /dev/null +++ b/t/26_plv5182.t @@ -0,0 +1,120 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 118; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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}, "Jan 9 2014 09:22:04", "Build time"); +is ($conf->{config}{version}, "5.18.2", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP + PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_INT + USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LONG_DOUBLE + USE_PERLIO USE_PERL_ATOF + )) { + 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 : "874325856acfea3dab7e7c944660f398"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [], "No local patches"); + +my %check = ( + alignbytes => 4, + api_version => 18, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-Duse64bitint -Duselongdouble -des", + gccversion => "4.8.1 20130909 [gcc-4_8-branch revision 202388]", + gnulibc_version => "2.18", + ivsize => 8, + ivtype => "long long", + ld => "cc", + lddlflags => "-shared -O2 -L/pro/local/lib -fstack-protector", + ldflags => "-L/pro/local/lib -fstack-protector", + libc => "/lib/libc-2.18.so", + lseektype => "off_t", + osvers => "3.11.6-4-desktop", + use64bitint => "define", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + +__END__ +Summary of my perl5 (revision 5 version 18 subversion 2) configuration: + + Platform: + osname=linux, osvers=3.11.6-4-desktop, archname=i686-linux-64int-ld + uname='linux lx09 3.11.6-4-desktop #1 smp preempt wed oct 30 18:04:56 utc 2013 (e6d4a27) i686 i686 i386 gnulinux ' + config_args='-Duse64bitint -Duselongdouble -des' + hint=recommended, useposix=true, d_sigaction=define + useithreads=undef, usemultiplicity=undef + useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef + use64bitint=define, use64bitall=undef, uselongdouble=define + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', + optimize='-O2', + cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include' + ccversion='', gccversion='4.8.1 20130909 [gcc-4_8-branch revision 202388]', gccosandvers='' + intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 + ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=8 + alignbytes=4, prototype=define + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib + libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat + perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.18.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.18' + 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' + + +Characteristics of this binary (from libperl): + Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP + PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_INT + USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LONG_DOUBLE + USE_PERLIO USE_PERL_ATOF + Built under linux + Compiled at Jan 9 2014 09:22:04 + @INC: + /pro/lib/perl5/site_perl/5.18.2/i686-linux-64int-ld + /pro/lib/perl5/site_perl/5.18.2 + /pro/lib/perl5/5.18.2/i686-linux-64int-ld + /pro/lib/perl5/5.18.2 + . diff --git a/t/27_plv5200.t b/t/27_plv5200.t new file mode 100644 index 0000000..4d9b400 --- /dev/null +++ b/t/27_plv5200.t @@ -0,0 +1,125 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 118; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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 30 2014 15:37:09", "Build time"); +is ($conf->{config}{version}, "5.20.0", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + HAS_TIMES MULTIPLICITY PERLIO_LAYERS + PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV + PERL_USE_DEVEL USE_64_BIT_INT USE_ITHREADS + USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC 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 : "3e7b4513cd80c6ef00fcd77e5e16f8b4"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [], "No local patches"); + +my %check = ( + alignbytes => 4, + api_version => 20, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-Dusedevel -Uversiononly -Dinc_version_list=none -Duse64bitint -Dusethreads -Duseithreads -Duselongdouble -des", + gccversion => "4.8.1 20130909 [gcc-4_8-branch revision 202388]", + gnulibc_version => "2.18", + ivsize => 8, + ivtype => "long long", + ld => "cc", + lddlflags => "-shared -O2 -L/pro/local/lib -fstack-protector", + ldflags => "-L/pro/local/lib -fstack-protector", + libc => "libc-2.18.so", + lseektype => "off_t", + osvers => "3.11.10-17-desktop", + use64bitint => "define", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + +__END__ +Summary of my perl5 (revision 5 version 20 subversion 0) configuration: + + Platform: + osname=linux, osvers=3.11.10-17-desktop, archname=i686-linux-thread-multi-64int-ld + uname='linux lx09 3.11.10-17-desktop #1 smp preempt mon jun 16 15:28:13 utc 2014 (fba7c1f) i686 i686 i386 gnulinux ' + config_args='-Dusedevel -Uversiononly -Dinc_version_list=none -Duse64bitint -Dusethreads -Duseithreads -Duselongdouble -des' + hint=recommended, useposix=true, d_sigaction=define + useithreads=define, usemultiplicity=define + use64bitint=define, use64bitall=undef, uselongdouble=define + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', + optimize='-O2', + cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include' + ccversion='', gccversion='4.8.1 20130909 [gcc-4_8-branch revision 202388]', gccosandvers='' + intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 + ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=8 + alignbytes=4, prototype=define + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib/gcc/i586-suse-linux/4.8/include-fixed /usr/lib/gcc/i586-suse-linux/4.8/../../../../i586-suse-linux/lib /usr/lib /pro/local/lib /lib + libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat + perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc + libc=libc-2.18.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.18' + 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' + + +Characteristics of this binary (from libperl): + Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS + PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV + PERL_USE_DEVEL USE_64_BIT_INT USE_ITHREADS + USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LONG_DOUBLE + USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API + Built under linux + Compiled at Jun 30 2014 15:37:09 + @INC: + /pro/lib/perl5/site_perl/5.20.0/i686-linux-thread-multi-64int-ld + /pro/lib/perl5/site_perl/5.20.0 + /pro/lib/perl5/5.20.0/i686-linux-thread-multi-64int-ld + /pro/lib/perl5/5.20.0 + . diff --git a/t/27_plv5202.t b/t/27_plv5202.t new file mode 100644 index 0000000..33396be --- /dev/null +++ b/t/27_plv5202.t @@ -0,0 +1,127 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 119; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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 19 2015 12:35:54", "Build time"); +is ($conf->{config}{version}, "5.20.2", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + HAS_TIMES MULTIPLICITY PERLIO_LAYERS + PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV + 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_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 : "9f954ebc2be7b1d7e151ab28dbdf7062"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [], "No local patches"); + +my %check = ( + alignbytes => 16, + api_version => 20, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-Dusedevel -Duse64bitall -Dusethreads -Duseithreads -Duselongdouble -des", + gccversion => "4.8.3 20140627 [gcc-4_8-branch revision 212064]", + gnulibc_version => "2.19", + ivsize => 8, + ivtype => "long", + ld => "cc", + lddlflags => "-shared -O2 -L/pro/local/lib -fstack-protector", + ldflags => "-L/pro/local/lib -fstack-protector", + libc => "libc-2.19.so", + lseektype => "off_t", + osvers => "3.16.7-13-desktop", + use64bitall => "define", + use64bitint => "define", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + +__END__ +Summary of my perl5 (revision 5 version 20 subversion 2) configuration: + + Platform: + osname=linux, osvers=3.16.7-13-desktop, archname=x86_64-linux-thread-multi-ld + uname='linux lx09 3.16.7-13-desktop #1 smp preempt wed mar 18 17:31:15 utc 2015 (ba2afab) x86_64 x86_64 x86_64 gnulinux ' + config_args='-Dusedevel -Duse64bitall -Dusethreads -Duseithreads -Duselongdouble -des' + hint=recommended, useposix=true, d_sigaction=define + useithreads=define, usemultiplicity=define + use64bitint=define, use64bitall=define, uselongdouble=define + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', + optimize='-O2', + cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include' + ccversion='', gccversion='4.8.3 20140627 [gcc-4_8-branch revision 212064]', gccosandvers='' + intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 + 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' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 + libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat + perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc + libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.19' + 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' + + +Characteristics of this binary (from libperl): + Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS + PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV + 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_LONG_DOUBLE USE_PERLIO + USE_PERL_ATOF USE_REENTRANT_API + Built under linux + Compiled at Apr 19 2015 12:35:54 + @INC: + /pro/lib/perl5/site_perl/5.20.2/x86_64-linux-thread-multi-ld + /pro/lib/perl5/site_perl/5.20.2 + /pro/lib/perl5/5.20.2/x86_64-linux-thread-multi-ld + /pro/lib/perl5/5.20.2 + . diff --git a/t/28_plv5220.t b/t/28_plv5220.t new file mode 100644 index 0000000..77bc99d --- /dev/null +++ b/t/28_plv5220.t @@ -0,0 +1,127 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 119; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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 4 2015 17:51:24", "Build time"); +is ($conf->{config}{version}, "5.22.0", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + HAS_TIMES MULTIPLICITY PERLIO_LAYERS + PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + PERL_NEW_COPY_ON_WRITE 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 + )) { + 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 : "ddcc2d51e43bf18f5234ba66529068ef"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [], "No local patches"); + +my %check = ( + alignbytes => 16, + api_version => 22, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-Duse64bitall -Duselongdouble -Dusethreads -Duseithreads -des", + gccversion => "4.8.3 20140627 [gcc-4_8-branch revision 212064]", + gnulibc_version => "2.19", + ivsize => 8, + ivtype => "long", + ld => "cc", + lddlflags => "-shared -O2 -L/pro/local/lib -fstack-protector", + ldflags => "-L/pro/local/lib -fstack-protector", + libc => "libc-2.19.so", + lseektype => "off_t", + osvers => "3.16.7-21-desktop", + use64bitall => "define", + use64bitint => "define", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + +__END__ +Summary of my perl5 (revision 5 version 22 subversion 0) configuration: + + Platform: + osname=linux, osvers=3.16.7-21-desktop, archname=x86_64-linux-thread-multi-ld + uname='linux lx09 3.16.7-21-desktop #1 smp preempt tue apr 14 07:11:37 utc 2015 (93c1539) x86_64 x86_64 x86_64 gnulinux ' + config_args='-Duse64bitall -Duselongdouble -Dusethreads -Duseithreads -des' + hint=recommended, useposix=true, d_sigaction=define + useithreads=define, usemultiplicity=define + use64bitint=define, use64bitall=define, uselongdouble=define + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector -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 -I/pro/local/include' + ccversion='', gccversion='4.8.3 20140627 [gcc-4_8-branch revision 212064]', 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' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.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.19.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.19' + 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' + + +Characteristics of this binary (from libperl): + Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS + PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + PERL_NEW_COPY_ON_WRITE 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 + Built under linux + Compiled at Jun 4 2015 17:51:24 + @INC: + /pro/lib/perl5/site_perl/5.22.0/x86_64-linux-thread-multi-ld + /pro/lib/perl5/site_perl/5.22.0 + /pro/lib/perl5/5.22.0/x86_64-linux-thread-multi-ld + /pro/lib/perl5/5.22.0 + . diff --git a/t/28_plv52201w.t b/t/28_plv52201w.t new file mode 100644 index 0000000..1ec81a4 --- /dev/null +++ b/t/28_plv52201w.t @@ -0,0 +1,127 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 119; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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 2 2015 00:03:35", "Build time"); +is ($conf->{config}{version}, "5.22.0", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS + PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP + PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV + 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 + )) { + 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 : "dfb32b8299b66e8bdb2712934f700d94"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [], "No local patches"); + +my %check = ( + alignbytes => 8, + api_version => 22, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "gcc", + cccdlflags => "", + ccdlflags => "", + config_args => "undef", + gccversion => "4.9.2", + gnulibc_version => "", + ivsize => 8, + ivtype => "long long", + ld => "g++", + lddlflags => q{-mdll -s -L"D:\Strawberry\perl\lib\CORE" -L"D:\Strawberry\c\lib"}, + ldflags => q{-s -L"D:\Strawberry\perl\lib\CORE" -L"D:\Strawberry\c\lib"}, + libc => "", + lseektype => "long long", + osvers => "6.3", + use64bitall => "undef", + use64bitint => "define", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + +__END__ +Summary of my perl5 (revision 5 version 22 subversion 0) configuration: + + Platform: + osname=MSWin32, osvers=6.3, archname=MSWin32-x64-multi-thread + uname='Win32 strawberry-perl 5.22.0.1 #1 Mon Jun 1 23:58:39 2015 x64' + config_args='undef' + hint=recommended, useposix=true, d_sigaction=undef + useithreads=define, usemultiplicity=define + use64bitint=define, use64bitall=undef, uselongdouble=undef + usemymalloc=n, bincompat5005=undef + Compiler: + cc='gcc', ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing -mms-bitfields', + optimize='-s -O2', + cppflags='-DWIN32' + ccversion='', gccversion='4.9.2', gccosandvers='' + intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8, longdblkind=3 + ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8 + alignbytes=8, prototype=define + Linker and Libraries: + ld='g++', ldflags ='-s -L"D:\Strawberry\perl\lib\CORE" -L"D:\Strawberry\c\lib"' + libpth=D:\Strawberry\c\lib D:\Strawberry\c\x86_64-w64-mingw32\lib D:\Strawberry\c\lib\gcc\x86_64-w64-mingw32\4.9.2 + libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 + -lcomctl32 + perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbc +cp32 -lcomctl32 + libc=, so=dll, useshrplib=true, libperl=libperl522.a + gnulibc_version='' + Dynamic Linking: + dlsrc=dl_win32.xs, dlext=xs.dll, d_dlsymun=undef, ccdlflags=' ' + cccdlflags=' ', lddlflags='-mdll -s -L"D:\Strawberry\perl\lib\CORE" -L"D:\Strawberry\c\lib"' + + +Characteristics of this binary (from libperl): + Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY + PERLIO_LAYERS PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS + PERL_MALLOC_WRAP PERL_NEW_COPY_ON_WRITE + PERL_PRESERVE_IVUV 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 + Built under MSWin32 + Compiled at Jun 2 2015 00:03:35 + @INC: + D:/Strawberry/perl/site/lib + D:/Strawberry/perl/vendor/lib + D:/Strawberry/perl/lib + . diff --git a/t/29_plv5235w.t b/t/29_plv5235w.t new file mode 100644 index 0000000..26d3281 --- /dev/null +++ b/t/29_plv5235w.t @@ -0,0 +1,123 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 119; + unless ($ENV{PERL_CORE}) { + require Test::NoWarnings; + Test::NoWarnings->import (); + $tests++; + } + + plan tests => $tests; + } + +use Config::Perl::V; + +ok (my $conf = Config::Perl::V::plv2hash (), "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}, "Nov 19 2015 00:18:50", "Build time"); +is ($conf->{config}{version}, "5.23.5", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS + PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP + PERL_PRESERVE_IVUV + USE_ITHREADS + USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME + USE_PERLIO USE_PERL_ATOF + )) { + 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 : "bccd5d78dfebd48b89faf7f1fe711733"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [], "No local patches"); + +my %check = ( + alignbytes => 8, + api_version => 23, + bincompat5005 => "undef", + byteorder => 1234, + cc => "cl", + cccdlflags => "", + ccdlflags => "", + config_args => "undef", + gccversion => "", + gnulibc_version => "", + ivsize => 4, + ivtype => "long", + ld => "link", + lddlflags => q{-dll -nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86 "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'" -subsystem:console,"5.01"}, + ldflags => q{-nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86 "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'" -subsystem:console,"5.01"}, + libc => "msvcrt.lib", + lseektype => "__int64", + osvers => "6.1", + use64bitall => "undef", + use64bitint => "undef", + ); +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; + +__END__ +Summary of my perl5 (revision 5 version 23 subversion 5) configuration: + + Platform: + osname=MSWin32, osvers=6.1, archname=MSWin32-x86-multi-thread + uname='' + config_args='undef' + hint=recommended, useposix=true, d_sigaction=undef + useithreads=define, usemultiplicity=define + use64bitint=undef, use64bitall=undef, uselongdouble=undef + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32 -D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS', + optimize='-O1 -MD -Zi -DNDEBUG -GL', + cppflags='-DWIN32' + ccversion='18.00.31101', gccversion='', gccosandvers='' + intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, doublekind=3 + d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8, longdblkind=0 + ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 + alignbytes=8, prototype=define + Linker and Libraries: + ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86 "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'" -subsystem:console,"5.01"' + libpth=\lib + libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib + perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib + libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl523.lib + gnulibc_version='' + Dynamic Linking: + dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' + cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86 "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'" -subsystem:console,"5.01"' + + +Characteristics of this binary (from libperl): + Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY + PERLIO_LAYERS PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS + PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_ITHREADS + USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME + USE_PERLIO USE_PERL_ATOF + Built under MSWin32 + Compiled at Nov 19 2015 00:18:50 + @INC: + C:/p523/src/lib + . diff --git a/t/30_plv5240.t b/t/30_plv5240.t new file mode 100644 index 0000000..6b717d6 --- /dev/null +++ b/t/30_plv5240.t @@ -0,0 +1,132 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 127; + 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 (), "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 10 2016 15:39:18", "Build time"); +is ($conf->{config}{version}, "5.24.0", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + DEBUGGING HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_TRACK_MEMPOOL PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + 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 + )) { + 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 : "3dffae79f6d2c74073f0d64646709101"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [], "No local patches"); + +my %check = ( + alignbytes => 16, + api_version => 24, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-Duse64bitall -Duselongdouble -Dusethreads -Duseithreads -des", + gccversion => "5.3.1 20160412 [gcc-5-branch revision 234894]", + gnulibc_version => "2.23", + 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.23.so", + lseektype => "off_t", + osvers => "4.5.2-1-default", + use64bitall => "define", + use64bitint => "define", + usemymalloc => "n", + default_inc_excludes_dot + => "undef", + ); +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}, "undef", "This build has . in INC"); + +__END__ +Summary of my perl5 (revision 5 version 24 subversion 0) configuration: + + Platform: + osname=linux, osvers=4.5.2-1-default, archname=x86_64-linux-thread-multi-ld + uname='linux lx09 4.5.2-1-default #1 smp preempt thu apr 21 09:07:52 utc 2016 (0454a6e) x86_64 x86_64 x86_64 gnulinux ' + config_args='-Duse64bitall -Duselongdouble -Dusethreads -Duseithreads -des' + hint=recommended, useposix=true, d_sigaction=define + useithreads=define, usemultiplicity=define + use64bitint=define, use64bitall=define, uselongdouble=define + usemymalloc=n, 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='5.3.1 20160412 [gcc-5-branch revision 234894]', 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/5/include-fixed /usr/lib64/gcc/x86_64-suse-linux/5/../../../../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.23.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.23' + 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_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + PERL_PRESERVE_IVUV PERL_TRACK_MEMPOOL 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 + Built under linux + Compiled at May 10 2016 15:39:18 + @INC: + lib + /pro/lib/perl5/site_perl/5.24.0/x86_64-linux-thread-multi-ld + /pro/lib/perl5/site_perl/5.24.0 + /pro/lib/perl5/5.24.0/x86_64-linux-thread-multi-ld + /pro/lib/perl5/5.24.0 + . diff --git a/t/31_plv52511.t b/t/31_plv52511.t new file mode 100644 index 0000000..762a63d --- /dev/null +++ b/t/31_plv52511.t @@ -0,0 +1,187 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 127; + 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 (), "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}, "Feb 27 2017 15:02:41", "Build time"); +is ($conf->{config}{version}, "5.25.11", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + DEBUGGING HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV PERL_TRACK_MEMPOOL PERL_IMPLICIT_CONTEXT + PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV 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 + )) { + 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 : "f0e463400e40ca35b67cec3834b5b9b7"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, + [ "SMOKEaa9ac6cf00899a6f55881d4ca6c1214215dc83ee" ], "Local patches"); + +my %check = ( + alignbytes => 16, + api_version => 25, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-des -Dusedevel -Duseithreads -Duse64bitall -Duselongdouble -DDEBUGGING", + gccversion => "6.3.1 20170202 [gcc-6-branch revision 245119]", + gnulibc_version => "2.24", + ivsize => 8, + ivtype => "long", + ld => "cc", + lddlflags => "-shared -O2 -g -L/pro/local/lib -fstack-protector-strong", + ldflags => "-L/pro/local/lib -fstack-protector-strong", + libc => "libc-2.24.so", + lseektype => "off_t", + osvers => "4.10.0-1-default", + use64bitall => "define", + use64bitint => "define", + usemymalloc => "n", + default_inc_excludes_dot + => "undef", + ); +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}, "undef", "This build has . in INC"); + +__END__ +Summary of my perl5 (revision 5 version 25 subversion 11) configuration: + Snapshot of: aa9ac6cf00899a6f55881d4ca6c1214215dc83ee + Platform: + osname=linux + osvers=4.10.0-1-default + archname=x86_64-linux-thread-multi-ld + uname='linux lx09 4.10.0-1-default #1 smp preempt mon feb 20 16:47:26 utc 2017 (81ace5a) x86_64 x86_64 x86_64 gnulinux ' + config_args='-des -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=undef + bincompat5005=undef + Compiler: + cc='cc' + 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' + 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='6.3.1 20170202 [gcc-6-branch revision 245119]' + 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/6/include-fixed /usr/lib64/gcc/x86_64-suse-linux/6/../../../../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.24.so + so=so + useshrplib=false + libperl=libperl.a + gnulibc_version='2.24' + 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 + Locally applied patches: + SMOKEaa9ac6cf00899a6f55881d4ca6c1214215dc83ee + Built under linux + Compiled at Feb 27 2017 15:02:41 + @INC: + lib + /pro/lib/perl5/site_perl/5.25.11/x86_64-linux-thread-multi-ld + /pro/lib/perl5/site_perl/5.25.11 + /pro/lib/perl5/5.25.11/x86_64-linux-thread-multi-ld + /pro/lib/perl5/5.25.11 + . diff --git a/t/32_plv5261rc1.t b/t/32_plv5261rc1.t new file mode 100644 index 0000000..9250016 --- /dev/null +++ b/t/32_plv5261rc1.t @@ -0,0 +1,183 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 127; + 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 (), "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}, "Sep 19 2017 11:20:22", "Build time"); +is ($conf->{config}{version}, "5.26.1", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + DEBUGGING HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV PERL_OP_PARENT + PERL_TRACK_MEMPOOL PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + 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 + )) { + 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 : "dd710670fec7d2e260414648dcc94e89"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [ "RC1" ], "No local patches"); + +my %check = ( + alignbytes => 16, + api_version => 26, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "ccache cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-Duse64bitall -Duselongdouble -Dusethreads -Duseithreads -Uversiononly -Dinc_version_list=none -des", + gccversion => "4.8.3 20140627 [gcc-4_8-branch revision 212064]", + gnulibc_version => "2.19", + ivsize => 8, + ivtype => "long", + ld => "ccache cc", + lddlflags => "-shared -O2 -L/pro/local/lib -fstack-protector", + ldflags => "-L/pro/local/lib -fstack-protector", + libc => "libc-2.19.so", + lseektype => "off_t", + osvers => "3.16.7-32-desktop", + 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 . in INC"); + +__END__ +Summary of my perl5 (revision 5 version 26 subversion 1) configuration: + + Platform: + osname=linux + osvers=3.16.7-32-desktop + archname=x86_64-linux-thread-multi-ld + uname='linux sv02 3.16.7-32-desktop #1 smp preempt wed jan 20 14:05:33 utc 2016 (d4df98a) x86_64 x86_64 x86_64 gnulinux ' + config_args='-Duse64bitall -Duselongdouble -Dusethreads -Duseithreads -Uversiononly -Dinc_version_list=none -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='ccache cc' + ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -DDEBUGGING -fwrapv -fno-strict-aliasing -pipe -fstack-protector -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' + ccversion='' + gccversion='4.8.3 20140627 [gcc-4_8-branch revision 212064]' + 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='ccache cc' + ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.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 -ldb -ldl -lm -lcrypt -lutil -lc + perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc + libc=libc-2.19.so + so=so + useshrplib=false + libperl=libperl.a + gnulibc_version='2.19' + 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' + + +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 + 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 + Locally applied patches: + RC1 + Built under linux + Compiled at Sep 19 2017 11:20:22 + @INC: + /pro/lib/perl5/site_perl/5.26.1/x86_64-linux-thread-multi-ld + /pro/lib/perl5/site_perl/5.26.1 + /pro/lib/perl5/5.26.1/x86_64-linux-thread-multi-ld + /pro/lib/perl5/5.26.1 diff --git a/t/33_plv52711r.t b/t/33_plv52711r.t new file mode 100644 index 0000000..851c224 --- /dev/null +++ b/t/33_plv52711r.t @@ -0,0 +1,183 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 127; + 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 (), "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 12 2018 13:37:01", "Build time"); +is ($conf->{config}{version}, "5.27.11", "reconstructed \$Config{version}"); + +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; +foreach my $o (sort qw( + DEBUGGING HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE + PERL_DONT_CREATE_GVSV PERL_TRACK_MEMPOOL PERL_IMPLICIT_CONTEXT + PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV 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 + )) { + 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 : "bd9cf7a142ddbb434adea5b08eaefdc8"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [], "Local patches"); + +my %check = ( + alignbytes => 16, + api_version => 27, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-Dusedevel -Duse64bitall -Dusethreads -Duseithreads -Duselongdouble -des", + gccversion => "7.3.1 20180307 [gcc-7-branch revision 258314]", + gnulibc_version => "2.27", + 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.27.so", + lseektype => "off_t", + osvers => "4.16.0-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 does not have . in INC"); + +__END__ +Summary of my perl5 (revision 5 version 27 subversion 11) configuration: + Snapshot of: 5f6af817add6d2df3603e0e94b6eb27ba5fb3970 + Platform: + osname=linux + osvers=4.16.0-1-default + archname=x86_64-linux-thread-multi-ld + uname='linux lx09 4.16.0-1-default #1 smp preempt wed apr 4 13:35:56 utc 2018 (e16f96d) x86_64 x86_64 x86_64 gnulinux ' + config_args='-Dusedevel -Duse64bitall -Dusethreads -Duseithreads -Duselongdouble -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 -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='7.3.1 20180307 [gcc-7-branch revision 258314]' + 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/7/include-fixed /usr/lib64/gcc/x86_64-suse-linux/7/../../../../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.27.so + so=so + useshrplib=false + libperl=libperl.a + gnulibc_version='2.27' + 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_LONG_DOUBLE + USE_PERLIO + USE_PERL_ATOF + USE_REENTRANT_API + Built under linux + Compiled at Apr 12 2018 13:37:01 + @INC: + lib + /pro/lib/perl5/site_perl/5.27.11/x86_64-linux-thread-multi-ld + /pro/lib/perl5/site_perl/5.27.11 + /pro/lib/perl5/5.27.11/x86_64-linux-thread-multi-ld + /pro/lib/perl5/5.27.11 diff --git a/t/34_plv5280.t b/t/34_plv5280.t new file mode 100644 index 0000000..eb64299 --- /dev/null +++ b/t/34_plv5280.t @@ -0,0 +1,178 @@ +#!/pro/bin/perl + +use strict; +use warnings; + +BEGIN { + use Test::More; + my $tests = 127; + 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 (), "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 26 2018 12:17:32", "Build time"); +is ($conf->{config}{version}, "5.28.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_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 : "4add7fd04b60c2048a46ff47087e6952"; +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); +is ($sig, $md5, "MD5"); + +is_deeply ($conf->{build}{patches}, [], "No local patches"); + +my %check = ( + alignbytes => 16, + api_version => 28, + bincompat5005 => "undef", + byteorder => 12345678, + cc => "cc", + cccdlflags => "-fPIC", + ccdlflags => "-Wl,-E", + config_args => "-Dusethreads -Duseithreads -Duse64bitall -Duselongdouble -des", + gccversion => "8.1.1 20180523 [gcc-8-branch revision 260570]", + gnulibc_version => "2.27", + 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.27.so", + lseektype => "off_t", + osvers => "4.17.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 28 subversion 0) configuration: + + Platform: + osname=linux + osvers=4.17.2-1-default + archname=x86_64-linux-thread-multi-ld + uname='linux lx09 4.17.2-1-default #1 smp preempt sat jun 16 10:58:03 utc 2018 (ddde22d) x86_64 x86_64 x86_64 gnulinux ' + config_args='-Dusethreads -Duseithreads -Duse64bitall -Duselongdouble -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' + optimize='-O2' + cppflags='-D_REENTRANT -D_GNU_SOURCE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include' + ccversion='' + gccversion='8.1.1 20180523 [gcc-8-branch revision 260570]' + 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.27.so + so=so + useshrplib=false + libperl=libperl.a + gnulibc_version='2.27' + 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: + 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 + Built under linux + Compiled at Jun 26 2018 12:17:32 + @INC: + /pro/lib/perl5/site_perl/5.28.0/x86_64-linux-thread-multi-ld + /pro/lib/perl5/site_perl/5.28.0 + /pro/lib/perl5/5.28.0/x86_64-linux-thread-multi-ld + /pro/lib/perl5/5.28.0