|
| 1 | +#!/pro/bin/perl |
| 2 | + |
| 3 | +use strict; |
| 4 | +use warnings; |
| 5 | + |
| 6 | +BEGIN { |
| 7 | + use Test::More; |
| 8 | + my $tests = 127 + 9; |
| 9 | + unless ($ENV{PERL_CORE}) { |
| 10 | + require Test::NoWarnings; |
| 11 | + Test::NoWarnings->import (); |
| 12 | + $tests++; |
| 13 | + } |
| 14 | + |
| 15 | + plan tests => $tests; |
| 16 | + } |
| 17 | + |
| 18 | +use Config::Perl::V qw( summary ); |
| 19 | + |
| 20 | +ok (my $conf = Config::Perl::V::plv2hash (<DATA>), "Read perl -v block"); |
| 21 | +ok (exists $conf->{$_}, "Has $_ entry") for qw( build environment config inc ); |
| 22 | + |
| 23 | +is ($conf->{build}{osname}, $conf->{config}{osname}, "osname"); |
| 24 | +is ($conf->{build}{stamp}, "Apr 12 2018 13:37:01", "Build time"); |
| 25 | +is ($conf->{config}{version}, "5.27.11", "reconstructed \$Config{version}"); |
| 26 | + |
| 27 | +my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; |
| 28 | +foreach my $o (sort qw( |
| 29 | + DEBUGGING HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE |
| 30 | + PERL_DONT_CREATE_GVSV PERL_TRACK_MEMPOOL PERL_IMPLICIT_CONTEXT |
| 31 | + PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV PERL_USE_DEVEL |
| 32 | + USE_64_BIT_ALL |
| 33 | + USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE |
| 34 | + USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME |
| 35 | + USE_LONG_DOUBLE USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API |
| 36 | + )) { |
| 37 | + is ($conf->{build}{options}{$o}, 1, "Runtime option $o set"); |
| 38 | + delete $opt->{$o}; |
| 39 | + } |
| 40 | +foreach my $o (sort keys %$opt) { |
| 41 | + is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset"); |
| 42 | + } |
| 43 | + |
| 44 | +eval { require Digest::MD5; }; |
| 45 | +my $md5 = $@ ? "0" x 32 : "bd9cf7a142ddbb434adea5b08eaefdc8"; |
| 46 | +ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); |
| 47 | +is ($sig, $md5, "MD5"); |
| 48 | + |
| 49 | +is_deeply ($conf->{build}{patches}, [], "Local patches"); |
| 50 | + |
| 51 | +my %check = ( |
| 52 | + alignbytes => 16, |
| 53 | + api_version => 27, |
| 54 | + bincompat5005 => "undef", |
| 55 | + byteorder => 12345678, |
| 56 | + cc => "cc", |
| 57 | + cccdlflags => "-fPIC", |
| 58 | + ccdlflags => "-Wl,-E", |
| 59 | + config_args => "-Dusedevel -Duse64bitall -Dusethreads -Duseithreads -Duselongdouble -des", |
| 60 | + gccversion => "7.3.1 20180307 [gcc-7-branch revision 258314]", |
| 61 | + gnulibc_version => "2.27", |
| 62 | + ivsize => 8, |
| 63 | + ivtype => "long", |
| 64 | + ld => "cc", |
| 65 | + lddlflags => "-shared -O2 -L/pro/local/lib -fstack-protector-strong", |
| 66 | + ldflags => "-L/pro/local/lib -fstack-protector-strong", |
| 67 | + libc => "libc-2.27.so", |
| 68 | + lseektype => "off_t", |
| 69 | + osvers => "4.16.0-1-default", |
| 70 | + use64bitall => "define", |
| 71 | + use64bitint => "define", |
| 72 | + usemymalloc => "n", |
| 73 | + default_inc_excludes_dot |
| 74 | + => "define", |
| 75 | + ); |
| 76 | +is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; |
| 77 | + |
| 78 | +ok (my $info = summary ($conf), "A summary"); |
| 79 | +ok (exists $info->{$_}, "Summary has $_") for qw( cc config_args usemymalloc default_inc_excludes_dot ); |
| 80 | +is ($info->{default_inc_excludes_dot}, "define", "This build does not have . in INC"); |
| 81 | + |
| 82 | +__END__ |
| 83 | +Summary of my perl5 (revision 5 version 27 subversion 11) configuration: |
| 84 | + Snapshot of: 5f6af817add6d2df3603e0e94b6eb27ba5fb3970 |
| 85 | + Platform: |
| 86 | + osname=linux |
| 87 | + osvers=4.16.0-1-default |
| 88 | + archname=x86_64-linux-thread-multi-ld |
| 89 | + 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 ' |
| 90 | + config_args='-Dusedevel -Duse64bitall -Dusethreads -Duseithreads -Duselongdouble -des' |
| 91 | + hint=recommended |
| 92 | + useposix=true |
| 93 | + d_sigaction=define |
| 94 | + useithreads=define |
| 95 | + usemultiplicity=define |
| 96 | + use64bitint=define |
| 97 | + use64bitall=define |
| 98 | + uselongdouble=define |
| 99 | + usemymalloc=n |
| 100 | + default_inc_excludes_dot=define |
| 101 | + bincompat5005=undef |
| 102 | + Compiler: |
| 103 | + cc='cc' |
| 104 | + 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' |
| 105 | + optimize='-O2' |
| 106 | + cppflags='-D_REENTRANT -D_GNU_SOURCE -fPIC -DDEBUGGING -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include' |
| 107 | + ccversion='' |
| 108 | + gccversion='7.3.1 20180307 [gcc-7-branch revision 258314]' |
| 109 | + gccosandvers='' |
| 110 | + intsize=4 |
| 111 | + longsize=8 |
| 112 | + ptrsize=8 |
| 113 | + doublesize=8 |
| 114 | + byteorder=12345678 |
| 115 | + doublekind=3 |
| 116 | + d_longlong=define |
| 117 | + longlongsize=8 |
| 118 | + d_longdbl=define |
| 119 | + longdblsize=16 |
| 120 | + longdblkind=3 |
| 121 | + ivtype='long' |
| 122 | + ivsize=8 |
| 123 | + nvtype='long double' |
| 124 | + nvsize=16 |
| 125 | + Off_t='off_t' |
| 126 | + lseeksize=8 |
| 127 | + alignbytes=16 |
| 128 | + prototype=define |
| 129 | + Linker and Libraries: |
| 130 | + ld='cc' |
| 131 | + ldflags ='-L/pro/local/lib -fstack-protector-strong' |
| 132 | + 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 |
| 133 | + libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat |
| 134 | + perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc |
| 135 | + libc=libc-2.27.so |
| 136 | + so=so |
| 137 | + useshrplib=false |
| 138 | + libperl=libperl.a |
| 139 | + gnulibc_version='2.27' |
| 140 | + Dynamic Linking: |
| 141 | + dlsrc=dl_dlopen.xs |
| 142 | + dlext=so |
| 143 | + d_dlsymun=undef |
| 144 | + ccdlflags='-Wl,-E' |
| 145 | + cccdlflags='-fPIC' |
| 146 | + lddlflags='-shared -O2 -L/pro/local/lib -fstack-protector-strong' |
| 147 | +
|
| 148 | +
|
| 149 | +Characteristics of this binary (from libperl): |
| 150 | + Compile-time options: |
| 151 | + DEBUGGING |
| 152 | + HAS_TIMES |
| 153 | + MULTIPLICITY |
| 154 | + PERLIO_LAYERS |
| 155 | + PERL_COPY_ON_WRITE |
| 156 | + PERL_DONT_CREATE_GVSV |
| 157 | + PERL_IMPLICIT_CONTEXT |
| 158 | + PERL_MALLOC_WRAP |
| 159 | + PERL_OP_PARENT |
| 160 | + PERL_PRESERVE_IVUV |
| 161 | + PERL_TRACK_MEMPOOL |
| 162 | + PERL_USE_DEVEL |
| 163 | + USE_64_BIT_ALL |
| 164 | + USE_64_BIT_INT |
| 165 | + USE_ITHREADS |
| 166 | + USE_LARGE_FILES |
| 167 | + USE_LOCALE |
| 168 | + USE_LOCALE_COLLATE |
| 169 | + USE_LOCALE_CTYPE |
| 170 | + USE_LOCALE_NUMERIC |
| 171 | + USE_LOCALE_TIME |
| 172 | + USE_LONG_DOUBLE |
| 173 | + USE_PERLIO |
| 174 | + USE_PERL_ATOF |
| 175 | + USE_REENTRANT_API |
| 176 | + Built under linux |
| 177 | + Compiled at Apr 12 2018 13:37:01 |
| 178 | + @INC: |
| 179 | + lib |
| 180 | + /pro/lib/perl5/site_perl/5.27.11/x86_64-linux-thread-multi-ld |
| 181 | + /pro/lib/perl5/site_perl/5.27.11 |
| 182 | + /pro/lib/perl5/5.27.11/x86_64-linux-thread-multi-ld |
| 183 | + /pro/lib/perl5/5.27.11 |
0 commit comments