Commit | Line | Data |
---|---|---|
7a6a85bf RG |
1 | # |
2 | # Copyright (c) 1995-2000, Raphael Manfredi | |
dd7f75e0 | 3 | # Copyright (c) 2017, Reini Urban |
7a6a85bf | 4 | # |
9e21b3d0 JH |
5 | # You may redistribute only under the same terms as Perl 5, as specified |
6 | # in the README file that comes with the distribution. | |
7a6a85bf | 7 | # |
7a6a85bf | 8 | |
43f5a3f5 | 9 | use strict; |
b4aba31b | 10 | use warnings; |
27ccd1ac | 11 | use ExtUtils::MakeMaker 6.31; |
7a6a85bf | 12 | use Config; |
dd7f75e0 | 13 | use File::Copy qw(move copy); |
83be7caa | 14 | use File::Spec; |
dd7f75e0 | 15 | |
c16e7f98 | 16 | unlink "lib/Storable/Limit.pm"; |
7a6a85bf | 17 | |
3f4cad1b S |
18 | my $limit_pm = File::Spec->catfile('lib', 'Storable', 'Limit.pm'); |
19 | ||
c0e3b4b5 TC |
20 | my $pm = { 'Storable.pm' => '$(INST_ARCHLIB)/Storable.pm' }; |
21 | unless ($ENV{PERL_CORE}) { | |
22 | # the core Makefile takes care of this for core builds | |
3f4cad1b | 23 | $pm->{$limit_pm} = '$(INST_ARCHLIB)/Storable/Limit.pm'; |
c0e3b4b5 TC |
24 | } |
25 | ||
7a6a85bf | 26 | WriteMakefile( |
527f7b64 | 27 | NAME => 'Storable', |
b4aba31b | 28 | AUTHOR => 'Perl 5 Porters', |
4a010442 | 29 | LICENSE => 'perl', |
527f7b64 | 30 | DISTNAME => "Storable", |
a2307be4 NC |
31 | # We now ship this in t/ |
32 | # PREREQ_PM => { 'Test::More' => '0.41' }, | |
369143e7 | 33 | PL_FILES => { }, # prevent default behaviour |
c0e3b4b5 | 34 | PM => $pm, |
70e1279a | 35 | PREREQ_PM => { XSLoader => 0 }, |
262731ee | 36 | INSTALLDIRS => ($] >= 5.007 && $] < 5.012) ? 'perl' : 'site', |
ad2ec6b5 N |
37 | VERSION_FROM => '__Storable__.pm', |
38 | ABSTRACT_FROM => '__Storable__.pm', | |
70e1279a NC |
39 | ($ExtUtils::MakeMaker::VERSION > 6.45 ? |
40 | (META_MERGE => { resources => | |
ad2ec6b5 N |
41 | { bugtracker => 'http://rt.perl.org/perlbug/' }, |
42 | provides => { | |
43 | 'Storable' => { | |
36738a86 | 44 | file => '__Storable__.pm', |
43f5a3f5 | 45 | version => MM->parse_version('__Storable__.pm'), |
ad2ec6b5 N |
46 | }, |
47 | }, | |
48 | ||
99295a74 | 49 | }, |
70e1279a | 50 | ) : ()), |
527f7b64 | 51 | dist => { SUFFIX => 'gz', COMPRESS => 'gzip -f' }, |
f4e3105b | 52 | clean => { FILES => 'Storable-* Storable.pm lib' }, |
7a6a85bf | 53 | ); |
ee0f7aac | 54 | |
ad2ec6b5 N |
55 | # Unlink the .pm file included with the distribution |
56 | 1 while unlink "Storable.pm"; | |
57 | ||
ee0f7aac NC |
58 | my $ivtype = $Config{ivtype}; |
59 | ||
60 | # I don't know if the VMS folks ever supported long long on 5.6.x | |
61 | if ($ivtype and $ivtype eq 'long long' and $^O !~ /^MSWin/) { | |
62 | print <<'EOM'; | |
63 | ||
64 | You appear to have a perl configured to use 64 bit integers in its scalar | |
65 | variables. If you have existing data written with an earlier version of | |
66 | Storable which this version of Storable refuses to load with a | |
67 | ||
68 | Byte order is not compatible | |
69 | ||
70 | error, then please read the section "64 bit data in perl 5.6.0 and 5.6.1" | |
71 | in the Storable documentation for instructions on how to read your data. | |
72 | ||
73 | (You can find the documentation at the end of Storable.pm in POD format) | |
74 | ||
75 | EOM | |
76 | } | |
dd7f75e0 RU |
77 | |
78 | # compute the maximum stacksize, before and after linking | |
79 | package MY; | |
80 | ||
81 | # FORCE finish of INST_DYNAMIC, avoid loading the old Storable (failed XS_VERSION check) | |
c0e3b4b5 | 82 | sub xlinkext { |
dd7f75e0 RU |
83 | my $s = shift->SUPER::linkext(@_); |
84 | $s =~ s|( :: .*)| $1 FORCE stacksize|; | |
85 | $s | |
86 | } | |
87 | ||
88 | sub depend { | |
c0e3b4b5 | 89 | my $extra_deps = ""; |
8175eebc TC |
90 | my $options = ""; |
91 | if ($ENV{PERL_CORE}) { | |
92 | $options = "--core"; | |
93 | } | |
94 | else { | |
c0e3b4b5 TC |
95 | # blib.pm needs arch/lib |
96 | $extra_deps = ' Storable.pm'; | |
97 | } | |
edf639fc TC |
98 | my $whichperl; |
99 | if ($Config::Config{usecrosscompile}) { | |
100 | $whichperl = '$(PERLRUN)'; | |
101 | } | |
102 | else { | |
103 | $whichperl = '$(FULLPERLRUNINST)'; | |
104 | } | |
f4e3105b | 105 | my $linktype = uc($_[0]->{LINKTYPE}); |
dd7f75e0 | 106 | " |
f4e3105b | 107 | $limit_pm : stacksize \$(INST_$linktype)$extra_deps |
c0e3b4b5 | 108 | \$(MKPATH) \$(INST_LIB) |
edf639fc | 109 | $whichperl stacksize $options |
dd7f75e0 | 110 | |
dab4d2bf RU |
111 | release : dist |
112 | git tag \$(VERSION) | |
113 | cpan-upload \$(DISTVNAME).tar\$(SUFFIX) | |
114 | git push | |
115 | git push --tags | |
dd7f75e0 RU |
116 | " |
117 | } | |
369143e7 | 118 | |
c0e3b4b5 TC |
119 | sub test { |
120 | my ($self, %attr) = @_; | |
121 | ||
122 | my $out = $self->SUPER::test(%attr); | |
123 | ||
124 | if ($ENV{PERL_CORE}) { | |
3f4cad1b | 125 | $out =~ s!^(test(?:db)?_(?:static|dynamic)\b.*)!$1 $limit_pm!gm; |
c0e3b4b5 TC |
126 | } |
127 | ||
128 | $out; | |
129 | } | |
130 | ||
369143e7 TC |
131 | sub postamble { |
132 | ' | |
133 | all :: Storable.pm | |
134 | $(NOECHO) $(NOOP) | |
135 | ||
136 | Storable.pm :: Storable.pm.PL __Storable__.pm | |
137 | $(PERLRUN) Storable.pm.PL | |
138 | ' | |
139 | } |