This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Further hpux hints simplifying suggested by H.Merijn.
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 24 Jun 2014 13:12:48 +0000 (09:12 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 24 Jun 2014 14:08:18 +0000 (10:08 -0400)
cpan/Digest-SHA/hints/hpux.pl

index e1ad05d..941382f 100644 (file)
@@ -1,25 +1,17 @@
 # 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 was reported also at:
 # https://rt.cpan.org/Ticket/Display.html?id=96498
 # but the ticket was rejected since MSHELOR thinks Digest::SHA
 # is doing nothing wrong.
-if ($Config{ccversion} =~ /^B\.11\.*\./) {
-  if ($Config{cc} eq 'cc') {
-    if (defined $self->{OPTIMIZE}) {
-      $self->{OPTIMIZE} =~ s/\+O[2-9]/+O1/;
-      $self->{OPTIMIZE} =~ s/ \+Onolimit//;
-    } else {
-      $self->{OPTIMIZE} = '+O1';
-    }
-  } elsif ($Config{cc} =~ /gcc/) {
-    if (defined $self->{OPTIMIZE}) {
-      $self->{OPTIMIZE} =~ s/\-O[2-9]*/-O1/;
-    } else {
-      $self->{OPTIMIZE} = '-O1';
-    }
-  }
+if (defined $self->{OPTIMIZE}) {
+  # This will turn -O0 to -O1, but we will burn that bridge when we cross it.
+  $self->{OPTIMIZE} =~ s/[\+\-]O[0-9]*/-O1/;
+  $self->{OPTIMIZE} =~ s/NO_OPT/-O0/;
+  $self->{OPTIMIZE} =~ s/ \+Onolimit//;
+} else {
+  $self->{OPTIMIZE} = '-O1';
 }