This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
SvRX() and SvRXOK() macros
[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',
69158f75 12 MAN3PODS => {}, # Pods will be built by installman.
56953603 13 XSPROTOARG => '-noprototypes',
8d4151d3 14 OBJECT => $object,
fd3cca25 15 DEFINE => $defines,
782f0963 16 clean => { FILES => '*$(OBJ_EXT) *.c ../../lib/re.pm' },
56953603
IZ
17);
18
472390e1 19package MY;
778ddebd 20
472390e1
JH
21sub upupfile {
22 File::Spec->catfile(File::Spec->updir, File::Spec->updir, $_[0]);
23}
778ddebd 24
472390e1
JH
25sub postamble {
26 my $regcomp_c = upupfile('regcomp.c');
27 my $regexec_c = upupfile('regexec.c');
778ddebd 28
472390e1
JH
29 <<EOF;
30re_comp.c : $regcomp_c
31 - \$(RM_F) re_comp.c
32 \$(CP) $regcomp_c re_comp.c
778ddebd 33
472390e1 34re_comp\$(OBJ_EXT) : re_comp.c
778ddebd 35
472390e1
JH
36re_exec.c : $regexec_c
37 - \$(RM_F) re_exec.c
38 \$(CP) $regexec_c re_exec.c
56953603 39
472390e1 40re_exec\$(OBJ_EXT) : re_exec.c
56953603
IZ
41
42EOF
43}
b7a20417
JH
44
45sub MY::c_o {
46 my($self) = @_;
47 package MY; # so that "SUPER" works right
48 my $inh = $self->SUPER::c_o(@_);
49 use Config;
50 if ($Config{osname} eq 'aix' && $Config{ccversion} eq '5.0.1.0') {
51 # Known buggy optimizer.
52 my $cccmd = $self->const_cccmd;
53 $cccmd =~ s/^CCCMD\s*=\s*//;
54 $cccmd =~ s/\s\$\(OPTIMIZE\)\s/ /;
55 $inh .= qq{
56
57re_comp\$\(OBJ_EXT\): re_comp.c
58\t$cccmd \$(CCCDLFLAGS) -I\$(PERL_INC) \$(DEFINE) \$*.c
59};
60 }
61 $inh;
62}