summaryrefslogtreecommitdiffstats
path: root/tools/configure/configureapp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/configure/configureapp.cpp')
-rw-r--r--tools/configure/configureapp.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 23b19ecf6e..d3084e19a7 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -47,6 +47,7 @@
#include <QDate>
#include <qdir.h>
+#include <qdiriterator.h>
#include <qtemporaryfile.h>
#include <qstack.h>
#include <qdebug.h>
@@ -80,7 +81,7 @@ bool writeToFile(const char* text, const QString &filename)
QDir dir(QFileInfo(file).absoluteDir());
if (!dir.exists())
dir.mkpath(dir.absolutePath());
- if (!file.open(QFile::WriteOnly)) {
+ if (!file.open(QFile::WriteOnly | QFile::Text)) {
cout << "Couldn't write to " << qPrintable(filename) << ": " << qPrintable(file.errorString())
<< endl;
return false;
@@ -144,13 +145,14 @@ Configure::Configure(int& argc, char** argv)
{ //make a syncqt script(s) that can be used in the shadow
QFile syncqt(buildPath + "/bin/syncqt");
+ // no QFile::Text, just in case the perl interpreter can't cope with them (unlikely)
if (syncqt.open(QFile::WriteOnly)) {
QTextStream stream(&syncqt);
stream << "#!/usr/bin/perl -w" << endl
<< "require \"" << sourcePath + "/bin/syncqt\";" << endl;
}
QFile syncqt_bat(buildPath + "/bin/syncqt.bat");
- if (syncqt_bat.open(QFile::WriteOnly)) {
+ if (syncqt_bat.open(QFile::WriteOnly | QFile::Text)) {
QTextStream stream(&syncqt_bat);
stream << "@echo off" << endl
<< "call " << fixSeparators(sourcePath) << fixSeparators("/bin/syncqt.bat -qtdir \"") << fixSeparators(buildPath) << "\" %*" << endl;
@@ -159,6 +161,7 @@ Configure::Configure(int& argc, char** argv)
}
QFile configtests(buildPath + "/bin/qtmodule-configtests");
+ // no QFile::Text, just in case the perl interpreter can't cope with them (unlikely)
if (configtests.open(QFile::WriteOnly)) {
QTextStream stream(&configtests);
stream << "#!/usr/bin/perl -w" << endl
@@ -353,7 +356,6 @@ QString Configure::firstLicensePath()
return QString();
}
-
// #### somehow I get a compiler error about vc++ reaching the nesting limit without
// undefining the ansi for scoping.
#ifdef for
@@ -1081,8 +1083,16 @@ void Configure::parseCmdLine()
}
// Ensure that QMAKESPEC exists in the mkspecs folder
- QDir mkspec_dir = fixSeparators(sourcePath + "/mkspecs");
- QStringList mkspecs = mkspec_dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
+ const QString mkspecPath = fixSeparators(sourcePath + "/mkspecs");
+ QDirIterator itMkspecs(mkspecPath, QDir::AllDirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
+ QStringList mkspecs;
+
+ while (itMkspecs.hasNext()) {
+ QString mkspec = itMkspecs.next();
+ // Remove base PATH
+ mkspec.remove(0, mkspecPath.length() + 1);
+ mkspecs << mkspec;
+ }
if (dictionary["QMAKESPEC"].toLower() == "features"
|| !mkspecs.contains(dictionary["QMAKESPEC"], Qt::CaseInsensitive)) {
@@ -2859,6 +2869,8 @@ void Configure::generateConfigfiles()
if (dictionary[ "QT_SXE" ] == "no")
tmpStream<<"#define QT_NO_SXE"<<endl;
+ tmpStream<<"#define QT_QPA_DEFAULT_PLATFORM_NAME \"windows\""<<endl;
+
tmpStream.flush();
tmpFile.flush();
@@ -3397,6 +3409,9 @@ void Configure::generateMakefiles()
for (i=0; i<3; i++) {
for (int j=0; j<makeList[i].size(); ++j) {
MakeItem *it=makeList[i][j];
+ if (it->directory == "tools/configure")
+ continue; // don't overwrite our own Makefile
+
QString dirPath = fixSeparators(it->directory + "/");
QString projectName = it->proFile;
QString makefileName = buildPath + "/" + dirPath + it->target;
@@ -3423,7 +3438,7 @@ void Configure::generateMakefiles()
QDir::setCurrent(fixSeparators(dirPath));
QFile file(makefileName);
- if (!file.open(QFile::WriteOnly)) {
+ if (!file.open(QFile::WriteOnly | QFile::Text)) {
printf("failed on dirPath=%s, makefile=%s\n",
qPrintable(dirPath), qPrintable(makefileName));
continue;