This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update IPC-SysV to CPAN version 2.04
[perl5.git] / cpan / IPC-SysV / Makefile.PL
CommitLineData
8f85282b
MHM
1################################################################################
2#
dd0df890 3# Version 2.x, Copyright (C) 2007-2013, Marcus Holland-Moritz <mhx@cpan.org>.
8f85282b
MHM
4# Version 1.x, Copyright (C) 1999, Graham Barr <gbarr@pobox.com>.
5#
6# This program is free software; you can redistribute it and/or
7# modify it under the same terms as Perl itself.
8#
9################################################################################
0ade1984 10
8f85282b
MHM
11require 5.004_05;
12
13use strict;
0ade1984
JH
14use ExtUtils::MakeMaker;
15
8f85282b
MHM
16unless ($ENV{'PERL_CORE'}) {
17 $ENV{'PERL_CORE'} = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV;
18}
19
20if ($^O eq 'MSWin32') {
aec08fdf 21 die "OS unsupported\n";
8f85282b
MHM
22}
23
24WriteMakefile(
25 NAME => 'IPC::SysV',
26 VERSION_FROM => 'lib/IPC/SysV.pm',
27 PREREQ_PM => {
28 'Test::More' => 0.45,
29 },
30 CONFIGURE => \&configure,
31);
32
33sub configure
34{
35 my @moreopts;
36 my %depend;
37
38 if (eval $ExtUtils::MakeMaker::VERSION >= 6) {
39 push @moreopts, AUTHOR => 'Marcus Holland-Moritz <mhx@cpan.org>',
40 ABSTRACT_FROM => 'lib/IPC/SysV.pm';
41 }
42
43 if (eval $ExtUtils::MakeMaker::VERSION >= 6.30_01) {
44 print "Setting license tag...\n";
45 push @moreopts, LICENSE => 'perl';
46 }
47
48 if ($ENV{'PERL_CORE'}) {
10613b66
CBW
49 # clean out const-* files in the core
50 push @moreopts, realclean => { FILES => "const-c.inc const-xs.inc" };
8f85282b
MHM
51 }
52 else {
53 # IPC::SysV is in the core since 5.005
dd0df890
CBW
54 # 5.11.0+ has site before perl
55 push @moreopts, INSTALLDIRS => (
56 ($] >= 5.005 and $] < 5.011)
57 ? 'perl'
58 : 'site'
59 );
8f85282b
MHM
60 }
61
62 $depend{'SysV.xs'} = 'const-c.inc const-xs.inc';
63
64 return {
65 depend => \%depend,
66 @moreopts
67 };
68}
69
70
0ade1984
JH
71#--- MY package
72
73sub MY::libscan
74{
3f163fbb
MHM
75 package MY;
76 my($self, $path) = @_;
77 return $path if $self->SUPER::libscan($path) and
78 $path !~ m! [~%]$
79 | \.(cache\.cm|swp|orig|rej)$
80 | regen\.pl$
81 !x;
82 return '';
0ade1984
JH
83}
84
8f85282b
MHM
85sub MY::postamble
86{
87 package MY;
88 my $post = shift->SUPER::postamble(@_);
89 $post .= <<'POSTAMBLE';
90
91purge_all: realclean
92 @$(RM_F) const-c.inc const-xs.inc
93
94regen:
95 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) regen.pl
96
97const-c.inc: lib/IPC/SysV.pm regen.pl
98 @$(MAKE) regen
99
100const-xs.inc: lib/IPC/SysV.pm regen.pl
101 @$(MAKE) regen
102
103POSTAMBLE
104 return $post;
105}
106