From 515fd562d87290c3fc0eb45817434dd0744d346e Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 15 Nov 2010 14:15:25 +0200 Subject: Use include(original mkspec) instead of copying of mkspec to default Having QMAKESPEC_ORIGINAL at the end of the default qmake.conf sets the mkspec too late for scope checks in symbian-mmp.conf and related files. Fixed by changing how default mkspec is handled: it is no longer simply copied over to mkspecs/default by configure but rather included with include statement in the generated mkspecs/default/qmake.conf after setting of QMAKESPEC_ORIGINAL value. This should also fix any issues with relative includes in mkspecs used as default that are not on same level as mkspecs/default folder. Task-number: QTBUG-15159 Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 3808c4e..3c12eb9 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3227,7 +3227,8 @@ void Configure::generateConfigfiles() } // Copy configured mkspec to default directory, but remove the old one first, if there is any - QString defSpec = buildPath + "/mkspecs/default"; + QString mkspecsPath = buildPath + "/mkspecs"; + QString defSpec = mkspecsPath + "/default"; QFileInfo defSpecInfo(defSpec); if (defSpecInfo.exists()) { if (!Environment::rmdir(defSpec)) { @@ -3237,21 +3238,22 @@ void Configure::generateConfigfiles() } } - QString spec = dictionary.contains("XQMAKESPEC") ? dictionary["XQMAKESPEC"] : dictionary["QMAKESPEC"]; - QString pltSpec = sourcePath + "/mkspecs/" + spec; - if (!Environment::cpdir(pltSpec, defSpec)) { - cout << "Couldn't update default mkspec! Does " << qPrintable(pltSpec) << " exist?" << endl; + QDir mkspecsDir(mkspecsPath); + if (!mkspecsDir.mkdir("default")) { + cout << "Couldn't create default mkspec dir!" << endl; dictionary["DONE"] = "error"; return; } + QString spec = dictionary.contains("XQMAKESPEC") ? dictionary["XQMAKESPEC"] : dictionary["QMAKESPEC"]; + QString pltSpec = sourcePath + "/mkspecs/" + spec; outName = defSpec + "/qmake.conf"; - ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL); QFile qmakeConfFile(outName); - if (qmakeConfFile.open(QFile::Append | QFile::WriteOnly | QFile::Text)) { + if (qmakeConfFile.open(QFile::WriteOnly | QFile::Text)) { QTextStream qmakeConfStream; qmakeConfStream.setDevice(&qmakeConfFile); - qmakeConfStream << endl << "QMAKESPEC_ORIGINAL=" << pltSpec << endl; + qmakeConfStream << "QMAKESPEC_ORIGINAL=" << pltSpec << endl << endl; + qmakeConfStream << "include(" << pltSpec << "/qmake.conf)" << endl; qmakeConfStream.flush(); qmakeConfFile.close(); } -- cgit v0.12