From 735f7e6248fb7725ce952eede17117ca6dc3ee42 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 31 Dec 2011 20:40:49 -0200 Subject: 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 --- config.tests/unix/arch.test | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'config.tests/unix') 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 -- cgit v1.2.3