summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch
blob: 130c5890d4eecda9e5c3dcc1128c3635d4fc6094 (plain)
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
From a77e7c2996ca25cc59b04b165a24575440dd7efa Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Mon, 15 Apr 2013 04:29:32 +0200
Subject: [PATCH] Add linux-oe-g++ platform

* This qmake.conf unlike other platforms reads most variables from
  shell environment, because it's easier for qt recipes to export
  *FLAGS or CC specific for given recipe

* configure: extend setBootstrapVariable to convert $$(...) operator
  to $(...) operator to work in qmake's Makefiles

* configure.prf: Allow to add extra arguments to make
  sometimes we would like to add -e or define some variable and respect it from both
  Makefiles used in configure tests and also Makefiles to build the application

Upstream-Status: Inappropriate [embedded specific]
                 too OE specific, probably cannot be upstreamed

Change-Id: I0591ed5da0d61d7cf1509d420e6b293582f1863c
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 configure                            |  2 +-
 mkspecs/features/configure.prf       |  4 ++--
 mkspecs/features/qt_functions.prf    |  2 +-
 mkspecs/linux-oe-g++/qmake.conf      | 42 ++++++++++++++++++++++++++++++++++++
 mkspecs/linux-oe-g++/qplatformdefs.h |  1 +
 5 files changed, 47 insertions(+), 4 deletions(-)
 create mode 100644 mkspecs/linux-oe-g++/qmake.conf
 create mode 100644 mkspecs/linux-oe-g++/qplatformdefs.h

diff --git a/configure b/configure
index 08b49a8..5876721 100755
--- a/configure
+++ b/configure
@@ -712,7 +712,7 @@ fi
 # is where the resulting variable is written to
 setBootstrapVariable()
 {
-    getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
+    getQMakeConf "$1" | sed 's:\$\$(:\$(:' | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
 }
 
 # build qmake
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index 934a18a..0f5b1b6 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -46,14 +46,14 @@ defineTest(qtCompileTest) {
     }
 
     # Clean up after previous run
-    exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")
+    exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE $$(QMAKE_MAKE_ARGS) distclean")
 
     mkpath($$test_out_dir)|error()
 
     !isEmpty (QMAKE_QTCONF): qtconfarg = -qtconf $$QMAKE_QTCONF
 
     qtRunLoggedCommand("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$qtconfarg -spec $$QMAKESPEC $$qmake_configs $$shell_quote($$test_dir)") {
-        qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE") {
+        qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE $$(QMAKE_MAKE_ARGS)") {
             log("yes$$escape_expand(\\n)")
             msg = "test $$1 succeeded"
             write_file($$QMAKE_CONFIG_LOG, msg, append)
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 1903e50..c093dd4 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -69,7 +69,7 @@ defineTest(qtHaveModule) {
 defineTest(qtPrepareTool) {
     cmd = $$eval(QT_TOOL.$${2}.binary)
     isEmpty(cmd) {
-        cmd = $$[QT_HOST_BINS]/$$2
+        cmd = $$[QT_HOST_BINS/get]/$$2
         exists($${cmd}.pl) {
             $${1}_EXE = $${cmd}.pl
             cmd = perl -w $$system_path($${cmd}.pl)
diff --git a/mkspecs/linux-oe-g++/qmake.conf b/mkspecs/linux-oe-g++/qmake.conf
new file mode 100644
index 0000000..30d31ed
--- /dev/null
+++ b/mkspecs/linux-oe-g++/qmake.conf
@@ -0,0 +1,42 @@
+#
+# qmake configuration for linux-g++ with modifications for building with OpenEmbedded
+#
+
+MAKEFILE_GENERATOR = UNIX
+CONFIG += incremental
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(../common/linux.conf)
+
+# QMAKE_<TOOL> (moc, uic, rcc) are gone, overwrite only ar and strip
+QMAKE_AR              = $$(OE_QMAKE_AR) cqs
+QMAKE_STRIP           = $$(OE_QMAKE_STRIP)
+
+include(../common/gcc-base-unix.conf)
+
+# *FLAGS from gcc-base.conf
+QMAKE_CFLAGS                += $$(OE_QMAKE_CFLAGS)
+QMAKE_CXXFLAGS              += $$(OE_QMAKE_CXXFLAGS)
+QMAKE_LFLAGS                += $$(OE_QMAKE_LDFLAGS)
+
+include(../common/g++-unix.conf)
+
+# tc settings from g++-base.conf
+QMAKE_COMPILER = $$(OE_QMAKE_COMPILER) gcc
+QMAKE_CC       = $$(OE_QMAKE_CC)
+QMAKE_CXX      = $$(OE_QMAKE_CXX)
+
+QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$(OE_QMAKE_CFLAGS)
+
+QMAKE_LINK         = $$(OE_QMAKE_LINK)
+QMAKE_LINK_SHLIB   = $$(OE_QMAKE_LINK)
+QMAKE_LINK_C       = $$(OE_QMAKE_LINK)
+QMAKE_LINK_C_SHLIB = $$(OE_QMAKE_LINK)
+
+# for the SDK
+isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$(OE_QMAKE_QT_CONFIG)
+
+include(../oe-device-extra.pri)
+
+load(device_config)
+load(qt_config)
diff --git a/mkspecs/linux-oe-g++/qplatformdefs.h b/mkspecs/linux-oe-g++/qplatformdefs.h
new file mode 100644
index 0000000..5d22fb4
--- /dev/null
+++ b/mkspecs/linux-oe-g++/qplatformdefs.h
@@ -0,0 +1 @@
+#include "../linux-g++/qplatformdefs.h"