From 1533bfc5fcc4ec5865c1de606504b6aba8a5f6fe Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 27 Mar 2012 14:43:45 -0300 Subject: 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 Reviewed-by: Girish Ramakrishnan --- configure | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'configure') 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'" -- cgit v1.2.3