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
index e48609e..16e062f 100644 (file)
@@ -1,15 +1,16 @@
 # With +O2 this HP-UX cc compiler creates code which coredumps (Bus error)
 # when running t/woodbury.t, but dropping to +O1 seems to dodge that.
 # With +O2 this HP-UX cc compiler creates code which coredumps (Bus error)
 # when running t/woodbury.t, but dropping to +O1 seems to dodge that.
+# Also gcc seems to have similar issues, so drop the opt also there.
+# Modern HP-UX cc:s understand -On, so our task is easier.
 #
 #
-# This might turn out to be temporary, see:
+# This was reported also at:
 # https://rt.cpan.org/Ticket/Display.html?id=96498
 # https://rt.cpan.org/Ticket/Display.html?id=96498
-if ($Config{cc} eq 'cc' &&
-    $Config{archname} eq 'PA-RISC2.0' &&
-    $Config{ccversion} =~ /^B\.11\.11\./) {
-  if (defined $self->{OPTIMIZE}) {
-    $self->{OPTIMIZE} =~ s/\+O[2-9]/+O1/;
-    $self->{OPTIMIZE} =~ s/ \+Onolimit//;
-  } else {
-    $self->{OPTIMIZE} = '+O1';
-  }
+# but the ticket was rejected since MSHELOR thinks Digest::SHA
+# is doing nothing wrong.
+if (defined $self->{OPTIMIZE}) {
+  $self->{OPTIMIZE} =~ s/ \+O[a-z_]+(?:=[\w,]+)?//; # Drop HP-UX +Onolimit etc.
+  # This will turn -O0 to -O1, but we will burn that bridge when we cross it.
+  $self->{OPTIMIZE} =~ s/[\+\-]O[0-9]*/-O1/;
+} else {
+  $self->{OPTIMIZE} = '-O1';
 }
 }