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