xref: /OK3568_Linux_fs/yocto/meta-qt5/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 8f7ac021d483eca1b181fd9f0551f317aa7c5965 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Mon, 15 Apr 2013 04:29:32 +0200
4Subject: [PATCH] Add linux-oe-g++ platform
5
6* This qmake.conf unlike other platforms reads most variables from
7  shell environment, because it's easier for qt recipes to export
8  *FLAGS or CC specific for given recipe
9
10* configure: extend setBootstrapVariable to convert $$(...) operator
11  to $(...) operator to work in qmake's Makefiles
12
13* configure.prf: Allow to add extra arguments to make
14  sometimes we would like to add -e or define some variable and respect it from both
15  Makefiles used in configure tests and also Makefiles to build the application
16
17Upstream-Status: Inappropriate [embedded specific]
18                 too OE specific, probably cannot be upstreamed
19
20Change-Id: I0591ed5da0d61d7cf1509d420e6b293582f1863c
21Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
22
23---
24 configure                            |  2 +-
25 mkspecs/features/configure.prf       |  4 +--
26 mkspecs/features/qt.prf              |  6 ++---
27 mkspecs/features/qt_functions.prf    |  2 +-
28 mkspecs/linux-oe-g++/qmake.conf      | 40 ++++++++++++++++++++++++++++
29 mkspecs/linux-oe-g++/qplatformdefs.h |  1 +
30 6 files changed, 48 insertions(+), 7 deletions(-)
31 create mode 100644 mkspecs/linux-oe-g++/qmake.conf
32 create mode 100644 mkspecs/linux-oe-g++/qplatformdefs.h
33
34diff --git a/configure b/configure
35index b6c9b462f2..4e3fcd41d1 100755
36--- a/configure
37+++ b/configure
38@@ -708,7 +708,7 @@ fi
39 # is where the resulting variable is written to
40 setBootstrapVariable()
41 {
42-    getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
43+    getQMakeConf "$1" | sed 's:\$\$(:\$(:' | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
44 }
45
46 # build qmake
47diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
48index 934a18a924..0f5b1b6333 100644
49--- a/mkspecs/features/configure.prf
50+++ b/mkspecs/features/configure.prf
51@@ -46,14 +46,14 @@ defineTest(qtCompileTest) {
52     }
53
54     # Clean up after previous run
55-    exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")
56+    exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE $$(QMAKE_MAKE_ARGS) distclean")
57
58     mkpath($$test_out_dir)|error()
59
60     !isEmpty (QMAKE_QTCONF): qtconfarg = -qtconf $$QMAKE_QTCONF
61
62     qtRunLoggedCommand("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$qtconfarg -spec $$QMAKESPEC $$qmake_configs $$shell_quote($$test_dir)") {
63-        qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE") {
64+        qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE $$(QMAKE_MAKE_ARGS)") {
65             log("yes$$escape_expand(\\n)")
66             msg = "test $$1 succeeded"
67             write_file($$QMAKE_CONFIG_LOG, msg, append)
68diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
69index 69d1954306..37f7c9c4a2 100644
70--- a/mkspecs/features/qt.prf
71+++ b/mkspecs/features/qt.prf
72@@ -151,7 +151,7 @@ import_plugins:qtConfig(static) {
73             plug_name = $$QMAKE_PREFIX_STATICLIB$${plug}$$qtPlatformTargetSuffix().$$QMAKE_EXTENSION_STATICLIB
74             plug_path = $$eval(QT_PLUGIN.$${plug}.PATH)
75             isEmpty(plug_path): \
76-                plug_path = $$[QT_INSTALL_PLUGINS/get]
77+                plug_path = $$[QT_INSTALL_PLUGINS]
78             LIBS += $$plug_path/$$plug_type/$$plug_name
79         } else {
80             LIBS += -l$${plug}$$qtPlatformTargetSuffix()
81@@ -274,8 +274,8 @@ for(ever) {
82 # static builds: link qml import plugins into the target.
83 contains(all_qt_module_deps, qml): \
84         qtConfig(static):import_plugins:!host_build:!no_import_scan {
85-    exists($$[QT_INSTALL_QML/get]): \
86-        QMLPATHS *= $$[QT_INSTALL_QML/get]
87+    exists($$[QT_INSTALL_QML]): \
88+        QMLPATHS *= $$[QT_INSTALL_QML]
89
90     # run qmlimportscanner
91     qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner, , system)
92diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
93index 7777e615bd..8d792fa70a 100644
94--- a/mkspecs/features/qt_functions.prf
95+++ b/mkspecs/features/qt_functions.prf
96@@ -87,7 +87,7 @@ defineTest(qtHaveModule) {
97 defineTest(qtPrepareTool) {
98     cmd = $$eval(QT_TOOL.$${2}.binary)
99     isEmpty(cmd) {
100-        cmd = $$[QT_HOST_BINS]/$$2
101+        cmd = $$[QT_HOST_BINS/get]/$$2
102         exists($${cmd}.pl) {
103             $${1}_EXE = $${cmd}.pl
104             cmd = perl -w $$system_path($${cmd}.pl)
105diff --git a/mkspecs/linux-oe-g++/qmake.conf b/mkspecs/linux-oe-g++/qmake.conf
106new file mode 100644
107index 0000000000..087e13bb91
108--- /dev/null
109+++ b/mkspecs/linux-oe-g++/qmake.conf
110@@ -0,0 +1,40 @@
111+#
112+# qmake configuration for linux-g++ with modifications for building with OpenEmbedded
113+#
114+
115+MAKEFILE_GENERATOR = UNIX
116+CONFIG += incremental
117+QMAKE_INCREMENTAL_STYLE = sublib
118+
119+include(../common/linux.conf)
120+
121+# QMAKE_<TOOL> (moc, uic, rcc) are gone, overwrite only ar, objcopy and strip
122+QMAKE_AR              = $$(OE_QMAKE_AR) cqs
123+QMAKE_OBJCOPY         = $$(OE_QMAKE_OBJCOPY)
124+QMAKE_STRIP           = $$(OE_QMAKE_STRIP)
125+
126+include(../common/gcc-base-unix.conf)
127+
128+# *FLAGS from gcc-base.conf
129+QMAKE_CFLAGS                += $$(OE_QMAKE_CFLAGS)
130+QMAKE_CXXFLAGS              += $$(OE_QMAKE_CXXFLAGS)
131+QMAKE_LFLAGS                += $$(OE_QMAKE_LDFLAGS)
132+
133+include(../common/g++-unix.conf)
134+
135+# tc settings from g++-base.conf
136+QMAKE_CC       = $$(OE_QMAKE_CC)
137+QMAKE_CXX      = $$(OE_QMAKE_CXX)
138+
139+QMAKE_LINK         = $$(OE_QMAKE_LINK)
140+QMAKE_LINK_SHLIB   = $$(OE_QMAKE_LINK)
141+QMAKE_LINK_C       = $$(OE_QMAKE_LINK)
142+QMAKE_LINK_C_SHLIB = $$(OE_QMAKE_LINK)
143+QMAKE_CFLAGS_ISYSTEM =
144+# for the SDK
145+isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$(OE_QMAKE_QT_CONFIG)
146+
147+include(../oe-device-extra.pri)
148+
149+load(device_config)
150+load(qt_config)
151diff --git a/mkspecs/linux-oe-g++/qplatformdefs.h b/mkspecs/linux-oe-g++/qplatformdefs.h
152new file mode 100644
153index 0000000000..5d22fb4101
154--- /dev/null
155+++ b/mkspecs/linux-oe-g++/qplatformdefs.h
156@@ -0,0 +1 @@
157+#include "../linux-g++/qplatformdefs.h"
158