From 8839109abe672107e763ebaceeaaa16d5bd6eefc Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Fri, 8 Jun 2012 14:20:45 +0200 Subject: Fix arch detection when cross compiling on Windows When trying to detect the target architecture, configure.exe will look for a file called 'arch.exe'. However, in some situations such as when cross-compiling on a Windows host to a Unix host, and depending on the toolchain being used, the output file generated by config.tests/arch may simply be called "arch" instead of "arch.exe", causing configure.exe to fail. This patches configure.exe to handle both naming schemes. Change-Id: I5798f716d732388c707564d4d45c4887ab3d3d9f Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 45c9f5c063..8c06a158cf 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2603,9 +2603,12 @@ void Configure::detectArch() // find the executable that was generated QFile exe("arch.exe"); if (!exe.open(QFile::ReadOnly)) { // no Text, this is binary - cout << "Could not find output file: " << qPrintable(exe.errorString()) << endl; - dictionary["DONE"] = "error"; - return; + exe.setFileName("arch"); + if (!exe.open(QFile::ReadOnly)) { + cout << "Could not find output file: " << qPrintable(exe.errorString()) << endl; + dictionary["DONE"] = "error"; + return; + } } QByteArray exeContents = exe.readAll(); exe.close(); -- cgit v1.2.3