From 4cc9523a3153a0e7b012de3919e0c4f4ccb96265 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 20 Mar 2012 21:01:20 -0700 Subject: Make architecture detection more robust. Any message/error in mkspecs or qmake feature files ends up confusing the current arch detection logic. Instead, search for "Project MESSAGE: .* Architecture: ". Change-Id: I308932a5b75f3a1fcbc4fe30c74faf2e83b2d752 Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) (limited to 'tools/configure') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 0c9907f6d5..58ffd28ff3 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2584,32 +2584,9 @@ void Configure::detectArch() if (output.isEmpty()) continue; - // strip everything up to and including 'Project MESSAGE: ' - QString ProjectMESSAGE = QStringLiteral("Project MESSAGE: "); - int at = output.indexOf(ProjectMESSAGE); - if (at != -1) - output = output.mid(at + ProjectMESSAGE.length()); - - // strip lines beginning with a # - at = 0; - while ((at = output.indexOf('#', at)) != -1) { - if (at > 0 && output.at(at - 1) != '\n') { - // # isnt' at the beginning of a line, skip it - ++at; - continue; - } - - int eol = output.indexOf('\n', at); - if (eol == -1) { - // end of string - output.remove(at, output.length() - at); - break; - } - - output.remove(at, eol - at + 1); - } - - dictionary[key] = output.simplified(); + QRegExp re("Project MESSAGE:.*Architecture: ([a-zA-Z0-9]*)"); + if (re.indexIn(output) != -1) + dictionary[key] = re.cap(1); } if (!dictionary.contains("QT_HOST_ARCH")) -- cgit v1.2.3