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>
bb10
Thiago Macieira 2012-04-24 19:14:10 +02:00 committed by Qt by Nokia
parent 5a09e71fc3
commit 8da57f3732
1 changed files with 5 additions and 3 deletions

View File

@ -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;