Pull PathTools 3.30 (which was just a blead sync.)
[p5sagit/p5-mst-13.2.git] / ext / re / Makefile.PL
1 use ExtUtils::MakeMaker;
2 use File::Spec;
3 use Config;
4
5 my $object = 're_exec$(OBJ_EXT) re_comp$(OBJ_EXT) re$(OBJ_EXT)';
6
7 my $defines = '-DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT';
8
9 WriteMakefile(
10     NAME                => 're',
11     VERSION_FROM        => 're.pm',
12     XSPROTOARG          => '-noprototypes',
13     OBJECT              => $object,
14     DEFINE             => $defines,
15     clean               => { FILES => '*$(OBJ_EXT) *.c ../../lib/re.pm' },
16 );
17
18 package MY;
19
20 sub upupfile {
21     File::Spec->catfile(File::Spec->updir, File::Spec->updir, $_[0]);
22 }
23
24 sub postamble {
25     my $regcomp_c = upupfile('regcomp.c');
26     my $regexec_c = upupfile('regexec.c');
27
28     <<EOF;
29 re_comp.c : $regcomp_c
30         - \$(RM_F) re_comp.c
31         \$(CP) $regcomp_c re_comp.c
32
33 re_comp\$(OBJ_EXT) : re_comp.c
34
35 re_exec.c : $regexec_c
36         - \$(RM_F) re_exec.c
37         \$(CP) $regexec_c re_exec.c
38
39 re_exec\$(OBJ_EXT) : re_exec.c
40
41 EOF
42 }
43
44 sub MY::c_o {
45     my($self) = @_;
46     package MY; # so that "SUPER" works right
47     my $inh = $self->SUPER::c_o(@_);
48     use Config;
49     if ($Config{osname} eq 'aix' && $Config{ccversion} eq '5.0.1.0') {
50         # Known buggy optimizer.
51         my $cccmd = $self->const_cccmd;
52         $cccmd =~ s/^CCCMD\s*=\s*//;
53         $cccmd =~ s/\s\$\(OPTIMIZE\)\s/ /;
54         $inh .= qq{
55
56 re_comp\$\(OBJ_EXT\): re_comp.c
57 \t$cccmd \$(CCCDLFLAGS) -I\$(PERL_INC) \$(DEFINE) \$*.c
58 };
59     }
60     $inh;
61 }