1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
|
This file is part of MXE.
See index.html for further information.
From 990c4a3ec111502fcb4738a6772e90d294cce2cd Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Fri, 11 Jan 2013 00:30:41 +0100
Subject: [PATCH 1/8] consolidate generation of metafile install targets
Metafiles such as .prl and .pc files contain paths that have to be
adjusted during installation. The same code is used for unix and
windows so move it into the base class.
Change-Id: I82db89ec83820a4fa0214ba15e7cd63438f6dc91
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from commit d089ecb711afcd13a32e24103e270ba000cdc68c)
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 9d85205..b687f04 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3285,4 +3285,25 @@ MakefileGenerator::writePkgConfigFile()
t << endl;
}
+QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst)
+{
+ QString ret;
+ if (project->isEmpty(replace_rule)
+ || project->isActiveConfig("no_sed_meta_install")
+ || project->isEmpty("QMAKE_STREAM_EDITOR")) {
+ ret += "-$(INSTALL_FILE) \"" + src + "\" \"" + dst + "\"";
+ } else {
+ ret += "-$(SED)";
+ const ProStringList &replace_rules = project->values(replace_rule);
+ for (int r = 0; r < replace_rules.size(); ++r) {
+ const ProString match = project->first(ProKey(replace_rules.at(r) + ".match")),
+ replace = project->first(ProKey(replace_rules.at(r) + ".replace"));
+ if (!match.isEmpty() /*&& match != replace*/)
+ ret += " -e \"s," + match + "," + replace + ",g\"";
+ }
+ ret += " \"" + src + "\" >\"" + dst + "\"";
+ }
+ return ret;
+}
+
QT_END_NAMESPACE
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 0b471d0..a686d8f 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -248,6 +248,8 @@ protected:
inline QStringList fileFixify(const QStringList& files, FileFixifyType fix, bool canon=true) const
{ return fileFixify(files, QString(), QString(), fix, canon); }
+ QString installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst);
+
public:
MakefileGenerator();
virtual ~MakefileGenerator();
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 8a1a29c..28c4fba 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -868,32 +868,15 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) \"" + dst_meta + "\"");
- const ProKey replace_rule("QMAKE_" + type.toUpper() + "_INSTALL_REPLACE");
const QString dst_meta_dir = fileInfo(dst_meta).path();
if(!dst_meta_dir.isEmpty()) {
if(!ret.isEmpty())
ret += "\n\t";
ret += mkdir_p_asstring(dst_meta_dir, true);
}
- QString install_meta = "$(INSTALL_FILE) \"" + src_meta + "\" \"" + dst_meta + "\"";
- if(project->isEmpty(replace_rule) || project->isActiveConfig("no_sed_meta_install")) {
- if(!ret.isEmpty())
- ret += "\n\t";
- ret += "-" + install_meta;
- } else {
- if(!ret.isEmpty())
- ret += "\n\t";
- ret += "-$(SED)";
- const ProStringList &replace_rules = project->values(replace_rule);
- for(int r = 0; r < replace_rules.size(); ++r) {
- const ProString &match = project->first(ProKey(replace_rules.at(r) + ".match")),
- &replace = project->first(ProKey(replace_rules.at(r) + ".replace"));
- if(!match.isEmpty() /*&& match != replace*/)
- ret += " -e \"s," + match + "," + replace + ",g\"";
- }
- ret += " \"" + src_meta + "\" >\"" + dst_meta + "\"";
- //ret += " || " + install_meta;
- }
+ if (!ret.isEmpty())
+ ret += "\n\t";
+ ret += installMetaFile(ProKey("QMAKE_" + type.toUpper() + "_INSTALL_REPLACE"), src_meta, dst_meta);
}
}
}
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index bda035e..3b2c620 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -842,22 +842,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
}
if(!ret.isEmpty())
ret += "\n\t";
- const ProKey replace_rule("QMAKE_PKGCONFIG_INSTALL_REPLACE");
- if (project->isEmpty(replace_rule)
- || project->isActiveConfig("no_sed_meta_install")
- || project->isEmpty("QMAKE_STREAM_EDITOR")) {
- ret += "-$(INSTALL_FILE) \"" + pkgConfigFileName(true) + "\" \"" + dst_pc + "\"";
- } else {
- ret += "-$(SED)";
- const ProStringList &replace_rules = project->values(replace_rule);
- for (int r = 0; r < replace_rules.size(); ++r) {
- const ProString match = project->first(ProKey(replace_rules.at(r) + ".match")),
- replace = project->first(ProKey(replace_rules.at(r) + ".replace"));
- if (!match.isEmpty() /*&& match != replace*/)
- ret += " -e \"s," + match + "," + replace + ",g\"";
- }
- ret += " \"" + pkgConfigFileName(true) + "\" >\"" + dst_pc + "\"";
- }
+ ret += installMetaFile(ProKey("QMAKE_PKGCONFIG_INSTALL_REPLACE"), pkgConfigFileName(true), dst_pc);
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) \"" + dst_pc + "\"");
--
1.7.10.4
From 569deb7d1a39e17fb5635411a68d374233f74818 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Sun, 27 Jan 2013 14:03:16 +0100
Subject: [PATCH 2/8] don't prematurely reduce LIBS when adding sql link lists
It's possible that different database libraries share dependencies.
We need to keep their link lists intact here so that QtSql's .prl and
.pc files will have them in the right order. Particularly important
when building the drivers into QtSql and using static linking.
Change-Id: Id371b127099f2790fe7cccd0c7059607600f447d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from commit 9ef48277f959ff759bd9fba36c907ef5ed67f5b1)
diff --git a/src/sql/drivers/mysql/qsql_mysql.pri b/src/sql/drivers/mysql/qsql_mysql.pri
index c9ec257..0423eb4 100644
--- a/src/sql/drivers/mysql/qsql_mysql.pri
+++ b/src/sql/drivers/mysql/qsql_mysql.pri
@@ -13,7 +13,7 @@ unix {
else:LIBS += -lmysqlclient
}
} else {
- LIBS *= $$QT_LFLAGS_MYSQL
+ LIBS += $$QT_LFLAGS_MYSQL
QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
}
} else {
diff --git a/src/sql/drivers/psql/qsql_psql.pri b/src/sql/drivers/psql/qsql_psql.pri
index 6da3540..9b647d8 100644
--- a/src/sql/drivers/psql/qsql_psql.pri
+++ b/src/sql/drivers/psql/qsql_psql.pri
@@ -2,7 +2,7 @@ HEADERS += $$PWD/qsql_psql.h
SOURCES += $$PWD/qsql_psql.cpp
unix|win32-g++* {
- LIBS *= $$QT_LFLAGS_PSQL
+ LIBS += $$QT_LFLAGS_PSQL
!contains(LIBS, .*pq.*):LIBS += -lpq
QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
} else {
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.pri b/src/sql/drivers/sqlite/qsql_sqlite.pri
index 7ad5936..a2e80d4 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.pri
+++ b/src/sql/drivers/sqlite/qsql_sqlite.pri
@@ -4,6 +4,6 @@ SOURCES += $$PWD/qsql_sqlite.cpp
!system-sqlite:!contains(LIBS, .*sqlite3.*) {
include($$PWD/../../../3rdparty/sqlite.pri)
} else {
- LIBS *= $$QT_LFLAGS_SQLITE
+ LIBS += $$QT_LFLAGS_SQLITE
QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
}
diff --git a/src/sql/drivers/tds/qsql_tds.pri b/src/sql/drivers/tds/qsql_tds.pri
index 3b5a689..38aab2f 100644
--- a/src/sql/drivers/tds/qsql_tds.pri
+++ b/src/sql/drivers/tds/qsql_tds.pri
@@ -2,7 +2,7 @@ HEADERS += $$PWD/qsql_tds.h
SOURCES += $$PWD/qsql_tds.cpp
unix|win32-g++*: {
- LIBS *= $$QT_LFLAGS_TDS
+ LIBS += $$QT_LFLAGS_TDS
!contains(LIBS, .*sybdb.*):LIBS += -lsybdb
QMAKE_CXXFLAGS *= $$QT_CFLAGS_TDS
} else {
--
1.7.10.4
From a541a0a510b148b684cdb15da4e6a276e3c6ef83 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Tue, 29 Jan 2013 21:56:24 +0100
Subject: [PATCH 3/8] adjust paths in installed module metafiles from modular
build
Fully modular prefix build now puts the includes and libs into each
module's own builddir, so the else branch was simply bogus. Replaced
the else branch with the real base for modular builds. This allows
the paths to be successfully replaced when installing metafiles.
Change-Id: I056a923288965b560a4e9b0ba7add1aac912199f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from commit 0e1427b0a6c3d304aabecd3d33708ecb0544fdba)
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 50e9469..3ade5a9 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -190,7 +190,7 @@ unix|win32-g++* {
!isEmpty(_QMAKE_SUPER_CACHE_): \
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
else: \
- rplbase = $$[QT_INSTALL_PREFIX/get]
+ rplbase = $$MODULE_QMAKE_OUTDIR
include_replace.match = $$rplbase/include
include_replace.replace = $$[QT_INSTALL_HEADERS/raw]
lib_replace.match = $$rplbase/lib
--
1.7.10.4
From facc35e0c2f6b51ad4cbcdfe79475db155ba52e5 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Fri, 11 Jan 2013 00:30:25 +0100
Subject: [PATCH 4/8] adjust paths in installed prl files for mingw
Curiously, qmake could fix .prl and .pc files for unix, but only .pc
files for MinGW. qt_module.prf seems to have known this.
Task-number: QTBUG-28902
Change-Id: Ice9983a69813690c0d4b96ca11589440182569a0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from commit 6d90c2e9cbfeeb560ffaeed94d908997f90d0877)
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 3ade5a9..98e4b1a 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -196,11 +196,11 @@ unix|win32-g++* {
lib_replace.match = $$rplbase/lib
lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace
+ QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
}
unix {
CONFIG += create_libtool explicitlib
- QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS/raw]
QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace
}
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 3b2c620..2270a00 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -825,7 +825,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
if(slsh != -1)
dst_prl = dst_prl.right(dst_prl.length() - slsh - 1);
dst_prl = filePrefixRoot(root, targetdir + dst_prl);
- ret += "-$(INSTALL_FILE) \"" + project->first("QMAKE_INTERNAL_PRL_FILE") + "\" \"" + dst_prl + "\"";
+ ret += installMetaFile(ProKey("QMAKE_PRL_INSTALL_REPLACE"), project->first("QMAKE_INTERNAL_PRL_FILE").toQString(), dst_prl);
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) \"" + dst_prl + "\"");
--
1.7.10.4
From d6a4dcb0dd88fa6fb4c352d48bf0445341e7de35 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Tue, 29 Jan 2013 21:51:31 +0100
Subject: [PATCH 5/8] fix path adjustments in installed metafiles
Task-number: QTBUG-28902
Change-Id: Ia70da8f0f0b7abb4ea2a46cb4068c0827888b322
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from commit 2be4d6ba022e1349b1b231ae852235f557c6fc20)
diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
index 7abd372..f9beabd 100644
--- a/mkspecs/features/qml_plugin.prf
+++ b/mkspecs/features/qml_plugin.prf
@@ -89,3 +89,12 @@ load(qt_targets)
}
load(qml_module)
+
+unix|win32-g++* {
+ !isEmpty(_QMAKE_SUPER_CACHE_): \
+ lib_replace.match = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*/lib
+ else: \
+ lib_replace.match = $$eval(QT.$${CXX_MODULE}.libs)
+ lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
+ QMAKE_PRL_INSTALL_REPLACE += lib_replace
+}
diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
index 4861576..2ec523d 100644
--- a/mkspecs/features/qt_plugin.prf
+++ b/mkspecs/features/qt_plugin.prf
@@ -58,3 +58,13 @@ load(qt_targets)
wince*:LIBS += $$QMAKE_LIBS_GUI
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
+
+unix|win32-g++* {
+ !isEmpty(_QMAKE_SUPER_CACHE_): \
+ rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
+ else: \
+ rplbase = $$MODULE_QMAKE_OUTDIR
+ lib_replace.match = $$rplbase/lib
+ lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
+ QMAKE_PRL_INSTALL_REPLACE += lib_replace
+}
diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro
index 32eae0b..b8c920b 100644
--- a/src/winmain/winmain.pro
+++ b/src/winmain/winmain.pro
@@ -25,3 +25,9 @@ TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end
load(qt_targets)
wince*:QMAKE_POST_LINK =
+
+unix|win32-g++* {
+ lib_replace.match = $$[QT_INSTALL_LIBS/get]
+ lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
+ QMAKE_PRL_INSTALL_REPLACE += lib_replace
+}
--
1.7.10.4
From fca2cfc4dd5495246a29b229d98ee0b545ed6242 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Mon, 24 Sep 2012 19:53:55 +0200
Subject: [PATCH 6/8] use pkg-config for freetype
Change-Id: Id0b048b44bcebf066c21efeb89f9c1781023a593
diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro
index 7f73465..1de1d74 100644
--- a/src/plugins/platforms/windows/windows.pro
+++ b/src/plugins/platforms/windows/windows.pro
@@ -169,6 +169,10 @@ contains(QT_CONFIG, freetype) {
qwindowsfontdatabase_ft.h
SOURCES += \
qwindowsfontdatabase_ft.cpp
+ static {
+ CONFIG += link_pkgconfig
+ PKGCONFIG += freetype2
+ }
}
OTHER_FILES += windows.json
--
1.7.10.4
From 09426fcce6676ae7952106e3ade04cea38d9a684 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Sat, 22 Dec 2012 17:45:34 +0100
Subject: [PATCH 7/8] WIP: qmake writeFile(): work around concurrent
QDir::mkpath() failure
This actually happened when building qtimageformats with make -j4.
Failure in mkspecs/features/qt_plugin.prf:
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.") with make -j4.
Change-Id: Ibc685f613d721e178e6aff408905d77b0ce1740a
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index bafa867..d8b03f7 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -310,9 +310,17 @@ QMakeEvaluator::writeFile(const QString &ctx, const QString &fn, QIODevice::Open
{
QFileInfo qfi(fn);
if (!QDir::current().mkpath(qfi.path())) {
- evalError(fL1S("Cannot create %1directory %2.")
- .arg(ctx, QDir::toNativeSeparators(qfi.path())));
- return ReturnFalse;
+ // could have failed due to concurrent mkpath attempt
+#ifdef Q_OS_WIN
+ Sleep(1000);
+#else
+ sleep(1);
+#endif
+ if (!qfi.dir().exists()) {
+ evalError(fL1S("Cannot create %1directory %2.")
+ .arg(ctx, QDir::toNativeSeparators(qfi.path())));
+ return ReturnFalse;
+ }
}
QString errStr;
if (!doWriteFile(qfi.filePath(), mode, contents, &errStr)) {
--
1.7.10.4
From 93da132789ebb2988867838fe6373dbfba52e101 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Thu, 31 Jan 2013 17:24:50 +0100
Subject: [PATCH 8/8] fix buld failure on mingw
See also 2cc9a9a51d6742708b1ea41c7338755e2a0ee9e9
Change-Id: I802d5c673b544fb3a17e9273030876928faa5c46
diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h
index 386078d..27ffee2 100644
--- a/src/dbus/qdbusmessage.h
+++ b/src/dbus/qdbusmessage.h
@@ -49,6 +49,10 @@
#ifndef QT_NO_DBUS
+#if defined(Q_OS_WIN) && defined(interface)
+#undef interface
+#endif
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
--
1.7.10.4
|