This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
b992490d copied wrong for ext re.
[perl5.git] / ext / re / Makefile.PL
CommitLineData
56953603 1use ExtUtils::MakeMaker;
472390e1 2use File::Spec;
8d4151d3
PP
3use Config;
4
5my $object = 're_exec$(OBJ_EXT) re_comp$(OBJ_EXT) re$(OBJ_EXT)';
6
de37762f 7my $defines = '-DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT';
fd3cca25 8
56953603
IZ
9WriteMakefile(
10 NAME => 're',
11 VERSION_FROM => 're.pm',
56953603 12 XSPROTOARG => '-noprototypes',
8d4151d3 13 OBJECT => $object,
fd3cca25 14 DEFINE => $defines,
782f0963 15 clean => { FILES => '*$(OBJ_EXT) *.c ../../lib/re.pm' },
56953603
IZ
16);
17
472390e1 18package MY;
778ddebd 19
472390e1
JH
20sub upupfile {
21 File::Spec->catfile(File::Spec->updir, File::Spec->updir, $_[0]);
22}
778ddebd 23
472390e1
JH
24sub postamble {
25 my $regcomp_c = upupfile('regcomp.c');
26 my $regexec_c = upupfile('regexec.c');
a55c5245 27 my $dquote_c = upupfile('dquote.c');
b992490d 28 my $invlist_inline_h = upupfile('invlist_inline.h');
778ddebd 29
472390e1
JH
30 <<EOF;
31re_comp.c : $regcomp_c
32 - \$(RM_F) re_comp.c
33 \$(CP) $regcomp_c re_comp.c
778ddebd 34
ceab18aa 35re_comp\$(OBJ_EXT) : re_comp.c dquote.c invlist_inline.h
778ddebd 36
472390e1
JH
37re_exec.c : $regexec_c
38 - \$(RM_F) re_exec.c
39 \$(CP) $regexec_c re_exec.c
56953603 40
ceab18aa 41re_exec\$(OBJ_EXT) : re_exec.c invlist_inline.h
56953603 42
a55c5245
JH
43dquote.c : $dquote_c
44 - \$(RM_F) dquote.c
45 \$(CP) $dquote_c dquote.c
60666776 46
ceab18aa
JH
47invlist_inline.h : $invlist_inline_h
48 - \$(RM_F) invlist_inline.h
49 \$(CP) $invlist_inline_h invlist_inline.h
81e983c1 50
56953603
IZ
51EOF
52}
b7a20417
JH
53
54sub MY::c_o {
55 my($self) = @_;
56 package MY; # so that "SUPER" works right
57 my $inh = $self->SUPER::c_o(@_);
58 use Config;
59 if ($Config{osname} eq 'aix' && $Config{ccversion} eq '5.0.1.0') {
60 # Known buggy optimizer.
61 my $cccmd = $self->const_cccmd;
62 $cccmd =~ s/^CCCMD\s*=\s*//;
63 $cccmd =~ s/\s\$\(OPTIMIZE\)\s/ /;
64 $inh .= qq{
65
66re_comp\$\(OBJ_EXT\): re_comp.c
67\t$cccmd \$(CCCDLFLAGS) -I\$(PERL_INC) \$(DEFINE) \$*.c
68};
69 }
70 $inh;
71}