summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-03-27 14:43:45 -0300
committerQt by Nokia <qt-info@nokia.com>2012-05-30 17:27:56 +0200
commit1533bfc5fcc4ec5865c1de606504b6aba8a5f6fe (patch)
tree01fcdf5c915e19be1fc79363fda08c8b6d6a2750 /configure
parentd17cf14185eb84863549e0119c8b7bd20db78580 (diff)
Improve the architecture-detection mechanism
For the Unix part, this now obeys the -v option, printing the full command-line it used to compile, allowing testers to identify why something went wrong. Unfortunately, it requires a full compilation cycle, instead of just preprocessing. Just one more among the many on Unix, but maybe a noticeable slow-down on Windows. Change-Id: I654b70d99887e04c96731a5b91be9ad555e4d8fe Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure24
1 files changed, 21 insertions, 3 deletions
diff --git a/configure b/configure
index 7f9ea8a860..52413f12fe 100755
--- a/configure
+++ b/configure
@@ -3667,17 +3667,35 @@ fi
#-------------------------------------------------------------------------------
# Use config.tests/arch/arch.pro to has the compiler tell us what the target architecture is
-CFG_ARCH=`OUTDIR="$outpath" "$outpath/bin/qmake" -spec "$XQMAKESPEC" -o /dev/null "$relpath/config.tests/arch/arch.pro" 2>&1 | sed -n -e 's,^Project MESSAGE:.*Architecture: \([a-zA-Z0-9_]*\).*,\1,p'`
-
+OUTFILE=$outpath/arch.result
+"$unixtests/arch.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath" "$OUTFILE"
+if [ $? -eq 0 ]; then
+ CFG_ARCH=`cat "$OUTFILE"`
+else
+ echo
+ echo "Could not determine the target architecture!"
+ echo "Turn on verbose messaging (-v) to see the final report."
+fi
+rm -f "$OUTFILE" 2>/dev/null
[ -z "$CFG_ARCH" ] && CFG_ARCH="unknown"
+
if [ "$QMAKESPEC" != "$XQMAKESPEC" ]; then
# Do the same test again, using the host compiler
- CFG_HOST_ARCH=`OUTDIR="$outpath" "$outpath/bin/qmake" -spec "$QMAKESPEC" -o /dev/null "$relpath/config.tests/arch/arch.pro" 2>&1 | sed -n -e 's,^Project MESSAGE:.*Architecture: \([a-zA-Z0-9_]*\).*,\1,p'`
+ SYSROOT_FLAG= "$unixtests/arch.test" "$QMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath" "$OUTFILE"
+ if [ $? -eq 0 ]; then
+ CFG_HOST_ARCH=`cat "$OUTFILE"`
+ else
+ echo
+ echo "Could not determine the host architecture!"
+ echo "Turn on verbose messaging (-v) to see the final report."
+ fi
+ rm -f "$OUTFILE" 2>/dev/null
[ -z "$CFG_HOST_ARCH" ] && CFG_HOST_ARCH="unknown"
else
# not cross compiling, host == target
CFG_HOST_ARCH="$CFG_ARCH"
fi
+unset OUTFILE
if [ "$OPT_VERBOSE" = "yes" ]; then
echo "System architecture: '$CFG_ARCH'"