summaryrefslogtreecommitdiff
path: root/hints
diff options
context:
space:
mode:
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>