This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Bump Devel::PPPort in Changes file
[perl5.git] / dist / Storable / Makefile.PL
1 #
2 #  Copyright (c) 1995-2000, Raphael Manfredi
3 #  Copyright (c) 2017, Reini Urban
4 #  
5 #  You may redistribute only under the same terms as Perl 5, as specified
6 #  in the README file that comes with the distribution.
7 #
8
9 use strict;
10 use warnings;
11 use ExtUtils::MakeMaker 6.31;
12 use Config;
13 use File::Copy qw(move copy);
14 use File::Spec;
15
16 unlink "lib/Storable/Limit.pm";
17
18 my $limit_pm = File::Spec->catfile('lib', 'Storable', 'Limit.pm');
19
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
23     $pm->{$limit_pm} = '$(INST_ARCHLIB)/Storable/Limit.pm';
24 }
25
26 WriteMakefile(
27     NAME                => 'Storable',
28     AUTHOR              => 'Perl 5 Porters',
29     LICENSE             => 'perl',
30     DISTNAME            => "Storable",
31 # We now ship this in t/
32 #    PREREQ_PM           => { 'Test::More' => '0.41' },
33     PL_FILES        => { }, # prevent default behaviour
34     PM              => $pm,
35     PREREQ_PM           => { XSLoader => 0 },
36     INSTALLDIRS => ($] >= 5.007 && $] < 5.012) ? 'perl' : 'site',
37     VERSION_FROM    => '__Storable__.pm',
38     ABSTRACT_FROM   => '__Storable__.pm',
39     ($ExtUtils::MakeMaker::VERSION > 6.45 ?
40      (META_MERGE        => { resources =>
41                                { bugtracker => 'http://rt.perl.org/perlbug/' },
42                             provides    => {
43                                 'Storable'  => {
44                                     file        => '__Storable__.pm',
45                                     version     => MM->parse_version('__Storable__.pm'),
46                                 },
47                             },
48
49                            },
50     ) : ()),
51     dist                => { SUFFIX => 'gz', COMPRESS => 'gzip -f' },
52     clean               => { FILES => 'Storable-* Storable.pm lib' },
53 );
54
55 # Unlink the .pm file included with the distribution
56 1 while unlink "Storable.pm";
57
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 }
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)
82 sub xlinkext {
83     my $s = shift->SUPER::linkext(@_);
84     $s =~ s|( :: .*)| $1 FORCE stacksize|;
85     $s
86 }
87
88 sub depend {
89     my $extra_deps = "";
90     my $options = "";
91     if ($ENV{PERL_CORE}) {
92         $options = "--core";
93     }
94     else {
95         # blib.pm needs arch/lib
96         $extra_deps = ' Storable.pm';
97     }
98     my $whichperl;
99     if ($Config::Config{usecrosscompile}) {
100         $whichperl = '$(PERLRUN)';
101     }
102     else {
103         $whichperl = '$(FULLPERLRUNINST)';
104     }
105     my $linktype = uc($_[0]->{LINKTYPE});
106     "
107 $limit_pm : stacksize \$(INST_$linktype)$extra_deps
108         \$(MKPATH) \$(INST_LIB)
109         $whichperl stacksize $options
110
111 release : dist
112         git tag \$(VERSION)
113         cpan-upload \$(DISTVNAME).tar\$(SUFFIX)
114         git push
115         git push --tags
116 "
117 }
118
119 sub test {
120     my ($self, %attr) = @_;
121
122     my $out = $self->SUPER::test(%attr);
123
124     if ($ENV{PERL_CORE}) {
125         $out =~ s!^(test(?:db)?_(?:static|dynamic)\b.*)!$1 $limit_pm!gm;
126     }
127
128     $out;
129 }
130
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 }