enable -mtune=native only on gcc 4.3 upwards
authorRudolf Polzer <divVerent@xonotic.org>
Sun, 14 Nov 2010 16:00:23 +0000 (17:00 +0100)
committerRudolf Polzer <divVerent@xonotic.org>
Sun, 14 Nov 2010 16:00:23 +0000 (17:00 +0100)
all

diff --git a/all b/all
index 15704071284f798394e08ff5e1f241e4c23ce6ad..d022eb0d31b0801ffdf9c0ba4f07936e1b40769e 100755 (executable)
--- a/all
+++ b/all
@@ -800,7 +800,14 @@ case "$cmd" in
                                        ;;
                                -r)
                                        debug=release
                                        ;;
                                -r)
                                        debug=release
-                                       export CC="$CC -g -mtune=native -march=native"
+                                       export CC="$CC -g"
+                                       case "`$CC -dumpversion`" in
+                                               [5-9]*|[1-9][0-9]*|4.[3-9]*|4.[1-9][0-9]*)
+                                                       # gcc 4.3 or higher
+                                                       # -march=native is broken < 4.3
+                                                       export CC="$CC -mtune=native -march=native"
+                                                       ;;
+                                       esac
                                        if [ -n "$WE_HATE_OUR_USERS" ]; then
                                                export CC="$CC -fno-common"
                                        fi
                                        if [ -n "$WE_HATE_OUR_USERS" ]; then
                                                export CC="$CC -fno-common"
                                        fi