xref: /openbsd-src/gnu/usr.bin/perl/cpan/Config-Perl-V/t/25_plv5162.t (revision e068048151d29f2562a32185e21a8ba885482260)
1#!/pro/bin/perl
2
3use strict;
4use warnings;
5
6BEGIN {
7    use Test::More;
8    my $tests = 164;
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}, "Aug 25 2013 01:24:40", "Build time");
25is ($conf->{config}{version}, "5.16.2", "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 MULTIPLICITY PERLIO_LAYERS
31	PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
32	PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL
33	USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
34	USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
35	USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
36	USE_REENTRANT_API
37	)) {
38    is ($conf->{build}{options}{$o}, 1, "Runtime option $o set");
39    delete $opt->{$o};
40    }
41foreach my $o (sort keys %$opt) {
42    is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset");
43    }
44
45eval { require Digest::MD5; };
46my $md5 = $@ ? "0" x 32 : "2917ca2a97b6db1ab8fb08798f53c0bb";
47ok (my $sig = Config::Perl::V::signature ($conf), "Get signature");
48
49SKIP: {
50    ord "A" == 65 or skip "ASCII-centric test", 1;
51    is ($sig, $md5, "MD5");
52    }
53
54is_deeply ($conf->{build}{patches}, [
55    "/Library/Perl/Updates/<version> comes before system perl directories",
56    "installprivlib and installarchlib points to the Updates directory",
57    "CVE-2013-1667 hashtable DOS fix",
58    ], "Local patches");
59
60my %check = (
61
62    archname        => "darwin-thread-multi-2level",
63    bincompat5005   => "undef",
64    config_args     => "-ds -e -Dprefix=/usr -Dccflags=-g  -pipe  -Dldflags= -Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc=cc",
65    d_sfio          => "undef",
66    d_sigaction     => "define",
67    hint            => "recommended",
68    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",
69    use64bitall     => "define",
70    use64bitint     => "define",
71    useithreads     => "define",
72    uselargefiles   => "define",
73    uselongdouble   => "undef",
74    usemultiplicity => "define",
75    usemymalloc     => "n",
76    useperlio       => "define",
77    useposix        => "true",
78    usesocks        => "undef",
79
80    alignbytes      => 8,
81    byteorder       => "12345678",
82    cc              => "cc",
83    ccflags         => "-arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include",
84    ccversion       => "",
85    cppflags        => "-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include",
86    d_longdbl       => "define",
87    d_longlong      => "define",
88    doublesize      => 8,
89    gccosandvers    => "",
90    gccversion      => "4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)",
91    intsize         => 4,
92    ivsize          => 8,
93    ivtype          => "long",
94    longdblsize     => 16,
95    longlongsize    => 8,
96    longsize        => 8,
97    lseeksize       => 8,
98    nvsize          => 8,
99    nvtype          => "double",
100    lseektype       => "off_t",
101    optimize        => "-Os",
102    prototype       => "define",
103    ptrsize         => 8,
104
105    gnulibc_version => "",
106    ld              => "cc -mmacosx-version-min=10.9",
107    ldflags         => "-arch x86_64 -arch i386 -fstack-protector -L/usr/local/lib",
108    libc            => "",
109    libperl         => "libperl.dylib",
110    libpth          => "/usr/local/lib /usr/lib",
111    libs            => "",
112    perllibs        => "",
113    so              => "dylib",
114    useshrplib      => "true",
115
116    cccdlflags      => "",
117    ccdlflags       => "",
118    d_dlsymun       => "undef",
119    dlext           => "bundle",
120    dlsrc           => "dl_dlopen.xs",
121    lddlflags       => "-arch x86_64 -arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector",
122    );
123is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check;
124
125
126__END__
127Summary of my perl5 (revision 5 version 16 subversion 2) configuration:
128
129  Platform:
130    osname=darwin, osvers=13.0, archname=darwin-thread-multi-2level
131    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 '
132    config_args='-ds -e -Dprefix=/usr -Dccflags=-g  -pipe  -Dldflags= -Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc=cc'
133    hint=recommended, useposix=true, d_sigaction=define
134    useithreads=define, usemultiplicity=define
135    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
136    use64bitint=define, use64bitall=define, uselongdouble=undef
137    usemymalloc=n, bincompat5005=undef
138  Compiler:
139    cc='cc', ccflags ='-arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include',
140    optimize='-Os',
141    cppflags='-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include'
142    ccversion='', gccversion='4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)', gccosandvers=''
143    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
144    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
145    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
146    alignbytes=8, prototype=define
147  Linker and Libraries:
148    ld='cc -mmacosx-version-min=10.9', ldflags ='-arch x86_64 -arch i386 -fstack-protector -L/usr/local/lib'
149    libpth=/usr/local/lib /usr/lib
150    libs=
151    perllibs=
152    libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
153    gnulibc_version=''
154  Dynamic Linking:
155    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
156    cccdlflags=' ', lddlflags='-arch x86_64 -arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'
157
158
159Characteristics of this binary (from libperl):
160  Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
161                        PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
162                        PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL
163                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
164                        USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
165                        USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
166                        USE_REENTRANT_API
167  Locally applied patches:
168	/Library/Perl/Updates/<version> comes before system perl directories
169	installprivlib and installarchlib points to the Updates directory
170	CVE-2013-1667 hashtable DOS fix
171  Built under darwin
172  Compiled at Aug 25 2013 01:24:40
173  %ENV:
174    PERL5LIB=""
175    PERL5OPT=""
176    PERL5_CPANPLUS_IS_RUNNING="37393"
177    PERL5_CPAN_IS_RUNNING="37393"
178  @INC:
179    /Library/Perl/5.16/darwin-thread-multi-2level
180    /Library/Perl/5.16
181    /Network/Library/Perl/5.16/darwin-thread-multi-2level
182    /Network/Library/Perl/5.16
183    /Library/Perl/Updates/5.16.2/darwin-thread-multi-2level
184    /Library/Perl/Updates/5.16.2
185    /System/Library/Perl/5.16/darwin-thread-multi-2level
186    /System/Library/Perl/5.16
187    /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level
188    /System/Library/Perl/Extras/5.16
189    .
190
191