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