Move hv_name, hv_eiter and hv_riter into a new aux structure.
[p5sagit/p5-mst-13.2.git] / ext / Devel / PPPort / Makefile.PL
1 ################################################################################
2 #
3 #  Makefile.PL -- generate Makefile
4 #
5 ################################################################################
6 #
7 #  $Revision: 15 $
8 #  $Author: mhx $
9 #  $Date: 2005/01/31 08:10:50 +0100 $
10 #
11 ################################################################################
12 #
13 #  Version 3.x, Copyright (C) 2004-2005, Marcus Holland-Moritz.
14 #  Version 2.x, Copyright (C) 2001, Paul Marquess.
15 #  Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
16 #
17 #  This program is free software; you can redistribute it and/or
18 #  modify it under the same terms as Perl itself.
19 #
20 ################################################################################
21
22 use ExtUtils::MakeMaker;
23 require 5.003;
24
25 unless ($ENV{'PERL_CORE'}) {
26   $ENV{'PERL_CORE'} = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV;
27 }
28
29 if ($ENV{'PERL_CORE'}) {
30   # Pods will be built by installman.
31   @coreopts = ( MAN3PODS => {} );
32 }
33 else {
34   # Devel::PPPort is in the core since 5.7.3
35   @coreopts = ( INSTALLDIRS => ($] >= 5.007003 ? 'perl' : 'site') );
36 }
37
38 @ARGV = map { /^--with-(.*)/ && ++$opt{$1} ? () : $_ } @ARGV;
39
40 %PL_FILES = ( 'ppport_h.PL'  => 'ppport.h' ),
41
42 @C_FILES  = qw{ module2.c module3.c };
43
44 @clean    = qw{ $(H_FILES) PPPort.c };
45
46 if ($opt{'apicheck'}) {
47   $PL_FILES{'apicheck_c.PL'} = 'apicheck.c';
48   push @C_FILES, qw{ apicheck.c };
49   push @clean,   qw{ apicheck.c };
50 }
51
52 WriteMakefile(
53   NAME          => 'Devel::PPPort',
54   VERSION_FROM  => 'PPPort_pm.PL',
55   PL_FILES      => \%PL_FILES,
56   PM            => { 'PPPort.pm' => '$(INST_LIBDIR)/PPPort.pm' },
57   C             => \@C_FILES,
58   H             => [ qw(ppport.h) ],
59   OBJECT        => '$(BASEEXT)$(OBJ_EXT) $(O_FILES)',
60   XSPROTOARG    => '-noprototypes',
61   clean         => { FILES => "@clean" },
62   depend        => { '$(OBJECT)' => '$(H_FILES)' },
63   @coreopts,
64 );
65
66 sub MY::postamble {
67   package MY;
68   my $post = shift->SUPER::postamble(@_);
69   $post .= <<'POSTAMBLE';
70
71 purge_all: realclean
72         @$(RM_F) PPPort.pm PPPort.xs t/*.t
73
74 regen:
75         $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) PPPort_pm.PL
76         $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) PPPort_xs.PL
77         $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) mktests.PL
78         $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) ppport_h.PL
79
80 POSTAMBLE
81   return $post;
82 }
83