In Linux if we have modern enough gcc and supported
Jarkko Hietaniemi [Wed, 28 Nov 2001 14:15:25 +0000 (14:15 +0000)]
enough CPU, crank up the optimization level to -O3.

p4raw-id: //depot/perl@13342

hints/linux.sh

index bbd88be..9837ee8 100644 (file)
@@ -97,7 +97,19 @@ case "$usemymalloc" in
 esac
 
 case "$optimize" in
-'') optimize='-O2' ;;
+'') # If we have modern enough gcc and well-supported enough CPU,
+    # crank up the optimization level.
+    case "`${cc:-gcc} -v 2>&1`" in
+    *gcc-2.95*|*gcc-3.*)
+        case "`arch 2>&1`" in
+        i?86|ppc) optimize='-O3' ;;
+        esac
+        ;;
+    esac
+    case "$optimize" in
+    '') optimize='-O2' ;;
+    esac
+    ;;
 esac
 
 # Are we using ELF?  Thanks to Kenneth Albanowski <kjahds@kjahds.com>