This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Drop debugging, and handle HP-UX opt flags.
[perl5.git] / cpan / Digest-SHA / hints / hpux.pl
1 # With +O2 this HP-UX cc compiler creates code which coredumps (Bus error)
2 # when running t/woodbury.t, but dropping to +O1 seems to dodge that.
3 # Also gcc seems to have similar issues, so drop the opt also there.
4 # Modern HP-UX cc:s understand -On, so our task is easier.
5 #
6 # This was reported also at:
7 # https://rt.cpan.org/Ticket/Display.html?id=96498
8 # but the ticket was rejected since MSHELOR thinks Digest::SHA
9 # is doing nothing wrong.
10 if (defined $self->{OPTIMIZE}) {
11   $self->{OPTIMIZE} =~ s/ \+O[a-z_]+(?:=[\w,]+)?//; # Drop HP-UX +Onolimit etc.
12   # This will turn -O0 to -O1, but we will burn that bridge when we cross it.
13   $self->{OPTIMIZE} =~ s/[\+\-]O[0-9]*/-O1/;
14 } else {
15   $self->{OPTIMIZE} = '-O1';
16 }