1#!/pro/bin/perl 2 3use strict; 4use warnings; 5 6BEGIN { 7 use Test::More; 8 my $tests = 100; 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; 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}, "Mar 12 2013 08:36:17", "Build time"); 25is ($conf->{config}{version}, "5.16.3", "reconstructed \%Config{version}"); 26is ($conf->{config}{ccversion}, "", "Using gcc. non-gcc version should not be defined"); 27 28my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; 29foreach my $o (sort qw( 30 HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV 31 PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_INT 32 USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE 33 USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO 34 USE_PERL_ATOF 35 )) { 36 is ($conf->{build}{options}{$o}, 1, "Runtime option $o set"); 37 delete $opt->{$o}; 38 } 39foreach my $o (sort keys %$opt) { 40 is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset"); 41 } 42 43eval { require Digest::MD5; }; 44my $md5 = $@ ? "0" x 32 : "7b00cf3b306d96fa802892e6ad4b070f"; 45ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); 46is ($sig, $md5, "MD5"); 47 48__END__ 49Summary of my perl5 (revision 5 version 16 subversion 3) configuration: 50 51 Platform: 52 osname=linux, osvers=3.4.33-2.24-desktop, archname=i686-linux-64int 53 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 ' 54 config_args='-Duse64bitint -Duselongdouble -des' 55 hint=previous, useposix=true, d_sigaction=define 56 useithreads=undef, usemultiplicity=undef 57 useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef 58 use64bitint=define, use64bitall=undef, uselongdouble=undef 59 usemymalloc=n, bincompat5005=undef 60 Compiler: 61 cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', 62 optimize='-O2', 63 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' 64 ccversion='', gccversion='4.7.1 20120723 [gcc-4_7-branch revision 189773]', gccosandvers='' 65 intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 66 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 67 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 68 alignbytes=4, prototype=define 69 Linker and Libraries: 70 ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' 71 libpth=/pro/local/lib /lib /usr/lib /usr/local/lib 72 libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat 73 perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc 74 libc=/lib/libc-2.15.so, so=so, useshrplib=false, libperl=libperl.a 75 gnulibc_version='2.15' 76 Dynamic Linking: 77 dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' 78 cccdlflags='-fPIC', lddlflags='-shared -O2 -L/pro/local/lib -fstack-protector' 79 80 81Characteristics of this binary (from libperl): 82 Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV 83 PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_INT 84 USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE 85 USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO 86 USE_PERL_ATOF 87 Built under linux 88 Compiled at Mar 12 2013 08:36:17 89 @INC: 90 /pro/lib/perl5/site_perl/5.16.3/i686-linux-64int 91 /pro/lib/perl5/site_perl/5.16.3 92 /pro/lib/perl5/5.16.3/i686-linux-64int 93 /pro/lib/perl5/5.16.3 94 . 95