summaryrefslogtreecommitdiff
path: root/hints
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-11-28 14:15:25 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-28 14:15:25 +0000
commiteb782340ac189f87a9572b63a1fcb9dd8bc50473 (patch)
treeca74f5fa388ddfdd215d391ea403b889d018aa9c /hints
parent34babc168865edbd6963528152c3c3b68680b55f (diff)
downloadperl-eb782340ac189f87a9572b63a1fcb9dd8bc50473.tar.gz
In Linux if we have modern enough gcc and supported
enough CPU, crank up the optimization level to -O3. p4raw-id: //depot/perl@13342
Diffstat (limited to 'hints')
-rw-r--r--hints/linux.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/hints/linux.sh b/hints/linux.sh
index bbd88be00a..9837ee8031 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -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>