From f9da2c2c365f437fbf66763232dc24ea272986a7 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Tue, 10 Mar 2015 10:25:57 -0300 Subject: [PATCH] configure: take XQMAKESPEC into account when looking for files. When cross-compiling, locateFile() needs to look into the XQMAKESPEC directories instead. Otherwise, this will cause checkAvailability()/findFile() to report wrong results. Change-Id: Ia1b566b70cff039d8fd540bde3c7b4707338348a Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 88930cd6c7c..04909525d11 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2037,16 +2037,18 @@ bool Configure::displayHelp() // Locate a file and return its containing directory. QString Configure::locateFile(const QString &fileName) const { + const QString mkspec = dictionary.contains(QStringLiteral("XQMAKESPEC")) + ? dictionary[QStringLiteral("XQMAKESPEC")] : dictionary[QStringLiteral("QMAKESPEC")]; const QString file = fileName.toLower(); QStringList pathList; if (file.endsWith(".h")) { static const QStringList headerPaths = - Environment::headerPaths(Environment::compilerFromQMakeSpec(dictionary[QStringLiteral("QMAKESPEC")])); + Environment::headerPaths(Environment::compilerFromQMakeSpec(mkspec)); pathList = qmakeIncludes; pathList += headerPaths; } else if (file.endsWith(".lib") || file.endsWith(".a")) { static const QStringList libPaths = - Environment::libraryPaths(Environment::compilerFromQMakeSpec(dictionary[QStringLiteral("QMAKESPEC")])); + Environment::libraryPaths(Environment::compilerFromQMakeSpec(mkspec)); pathList = libPaths; } else { // Fallback for .exe and .dll (latter are not covered by QStandardPaths).