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