summaryrefslogtreecommitdiffstats
path: root/config.tests/unix/arch.test
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2011-12-31 20:40:49 -0200
committerQt by Nokia <qt-info@nokia.com>2012-05-30 17:28:07 +0200
commit735f7e6248fb7725ce952eede17117ca6dc3ee42 (patch)
treef8f1144aefd75993f4180d796c70d88f43ddd84c /config.tests/unix/arch.test
parent1533bfc5fcc4ec5865c1de606504b6aba8a5f6fe (diff)
Record the sub-architecture (CPU features enabled in the compiler)
If the system's compiler has extra features on top of the base settings enabled or if the mkspec or $CXXFLAGS variable included some, record them. This will allow us to choose whether or not to use our own special compilers, based on whether the system default compiler contains it or not. Change-Id: I87cada9fab4cfa58846a831d0a7c7b50d8fa87fd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'config.tests/unix/arch.test')
-rwxr-xr-xconfig.tests/unix/arch.test16
1 files changed, 9 insertions, 7 deletions
diff --git a/config.tests/unix/arch.test b/config.tests/unix/arch.test
index 2a6e12de56..939b49cea0 100755
--- a/config.tests/unix/arch.test
+++ b/config.tests/unix/arch.test
@@ -5,6 +5,7 @@ VERBOSE=$2
SRCDIR=$3
OUTDIR=$4
RESULTFILE=$5
+VARPREFIX=$6
# debuggery
[ "$VERBOSE" = "yes" ] && echo "Determining architecture... ($*)"
@@ -28,14 +29,15 @@ else
exit 2
fi
-ARCH=`strings - $binary 2>/dev/null | awk -F: '/==Qt=magic=Qt==/ { print $2 }'` ||
-{
+if strings - $binary 2>/dev/null | \
+ awk -F: '/==Qt=magic=Qt== Architecture/ { print "'$VARPREFIX'_ARCH=\"" $2 "\"" }
+ /==Qt=magic=Qt== Sub-architecture/ { print "'$VARPREFIX'_CPUFEATURES=\"" $2 "\"" }' > "$RESULTFILE"
+then
+ [ "$VERBOSE" = "yes" ] && echo " Found architecture in binary" && \
+ cat "$RESULTFILE"
+else
[ "$VERBOSE" = "yes" ] && echo "Unable to determine architecture!"
exit 2
-}
+fi
$MAKE distclean >/dev/null 2>&1
-
-[ "$VERBOSE" = "yes" ] && echo " Found '$ARCH' in binary"
-
-echo "$ARCH" > $5