diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-04-24 19:14:10 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-25 12:43:25 +0200 |
commit | 8da57f37320478e1ae6094410ff230aa4580689b (patch) | |
tree | 5666d702ff94c34d78dcf4ef2583cdb897f85526 /tools | |
parent | 5a09e71fc38205574a9f1b3b6775845108c3ab1c (diff) |
Make configure.exe create files with Windows line-endings
Except for the perl sources, just in case.
This helps if you need to open the output files in, say, notepad.exe.
Change-Id: Ibf46b74af2efd6936586650e1405750bfef17952
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/configure/configureapp.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 27b4fabf09..7151f3e119 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -80,7 +80,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 +144,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 +160,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 @@ -3425,7 +3427,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; |