summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase-git/0001-Add-linux-oe-g-platform.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-qt/qt5/qtbase-git/0001-Add-linux-oe-g-platform.patch')
-rw-r--r--recipes-qt/qt5/qtbase-git/0001-Add-linux-oe-g-platform.patch344
1 files changed, 344 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtbase-git/0001-Add-linux-oe-g-platform.patch b/recipes-qt/qt5/qtbase-git/0001-Add-linux-oe-g-platform.patch
new file mode 100644
index 00000000..828f5ea5
--- /dev/null
+++ b/recipes-qt/qt5/qtbase-git/0001-Add-linux-oe-g-platform.patch
@@ -0,0 +1,344 @@
1From 237a4b0143d91c0573ecf6f9ff5e37827a14a75d 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 01/10] 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: add getQEvalMakeConf and getXQEvalMakeConf
11 Allow expansion of $(...) references from qmake.conf to generate
12 qmake environment from shell environment as exported by qmake5_base
13
14* configure: don't export SYSTEM_VARIABLES to .qmake.vars
15 linux-oe-g++ should handle this correctly and exporting LD as QMAKE_LINK is
16 causing issues as we need g++ to be used as linker
17
18* configure.prf: Allow to add extra arguments to make
19 sometimes we would like to add -e or define some variable and respect it from both
20 Makefiles used in configure tests and also Makefiles to build the application
21
22* OE_QMAKE_CXX in order to allow compiler version check to succeed
23 which allows WebKit to be enabled.
24
25* Other variables in order to let config.tests to use our -platform
26 settings
27
28* Add setBootstrapEvalVariable to bootstrap qmake with our environment
29 too, this allows us to use -platform linux-oe-g++ also for native
30 recipe
31
32* disable gdb_dwarf_index
33 * qmake is trying to call native gdb and we don't depend on gdb-native
34 (or even provide gdb-native)
35 * fixes errors like this:
36 /bin/sh: gdb: command not found
37 /bin/sh: line 0: test: -gt: unary operator expected
38 which are not fatal, but still misleading in do_configure output
39
40Upstream-Status: Inappropriate [embedded specific]
41 too OE specific, probably cannot be upstreamed
42
43Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
44---
45 configure | 60 +++++++++++++++------
46 mkspecs/features/configure.prf | 4 +-
47 mkspecs/linux-oe-g++/qmake.conf | 40 ++++++++++++++
48 mkspecs/linux-oe-g++/qplatformdefs.h | 100 +++++++++++++++++++++++++++++++++++
49 4 files changed, 185 insertions(+), 19 deletions(-)
50 create mode 100644 mkspecs/linux-oe-g++/qmake.conf
51 create mode 100644 mkspecs/linux-oe-g++/qplatformdefs.h
52
53diff --git a/configure b/configure
54index 55d68ef..bb24a9c 100755
55--- a/configure
56+++ b/configure
57@@ -324,6 +324,16 @@ getQMakeConf()
58 getSingleQMakeVariable "$1" "$specvals"
59 }
60
61+# OE qmake.conf is reading some variables from shell env
62+# read them from qmake.conf, replace qmake () syntax with shell and eval
63+getQEvalMakeConf()
64+{
65+ VAL=`getQMakeConf "$1" | sed -n 's/$[(]\([0-9a-zA-Z_]*\)[)]/$\1/pg'`
66+ EVAL=`eval "echo ${VAL}"`
67+# echo "Running getQEvalMakeConf: var='$1', val='`getQMakeConf \"$1\"`, val-sed='$VAL', eval='$EVAL'" >&2
68+ eval "echo ${VAL}"
69+}
70+
71 getXQMakeConf()
72 {
73 if [ -z "$xspecvals" ]; then
74@@ -333,6 +343,16 @@ getXQMakeConf()
75 getSingleQMakeVariable "$1" "$xspecvals"
76 }
77
78+# OE qmake.conf is reading some variables from shell env
79+# read them from qmake.conf, replace qmake () syntax with shell and eval
80+getXQEvalMakeConf()
81+{
82+ VAL=`getXQMakeConf "$1" | sed -n 's/$[(]\([0-9a-zA-Z_]*\)[)]/$\1/pg'`
83+ EVAL=`eval "echo ${VAL}"`
84+# echo "Running getXQEvalMakeConf: var='$1', val='`getXQMakeConf \"$1\"`, val-sed='$VAL', eval='$EVAL'" >&2
85+ eval "echo ${VAL}"
86+}
87+
88 compilerSupportsFlag()
89 {
90 cat >conftest.cpp <<EOF
91@@ -548,21 +568,19 @@ fi
92 # initalize variables
93 #-------------------------------------------------------------------------------
94
95-SYSTEM_VARIABLES="RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS"
96-for varname in $SYSTEM_VARIABLES; do
97+# Export all OE variables for qmake.conf from shell env to QMakeVars
98+OE_VARIABLES="AR CC CFLAGS COMPILER CXX CXXFLAGS LDFLAGS LINK QT_CONFIG STRIP"
99+for varname in $OE_VARIABLES; do
100 qmakevarname="${varname}"
101- # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
102- if [ "${varname}" = "LDFLAGS" ]; then
103- qmakevarname="LFLAGS"
104- elif [ "${varname}" = "LD" ]; then
105- qmakevarname="LINK"
106- fi
107 cmd=`echo \
108-'if [ -n "\$'${varname}'" ]; then
109- QMakeVar set QMAKE_'${qmakevarname}' "\$'${varname}'"
110+'if [ -n "\$OE_QMAKE_'${varname}'" ]; then
111+ QMakeVar set OE_QMAKE_'${qmakevarname}' "\$OE_QMAKE_'${varname}'"
112+# echo "Exporting OE_QMAKE_'${qmakevarname}' value=\"\$OE_QMAKE_'${varname}'\"" >&2
113 fi'`
114 eval "$cmd"
115 done
116+
117+SYSTEM_VARIABLES="RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS"
118 # Use CC/CXX to run config.tests
119 mkdir -p "$outpath/config.tests"
120 rm -f "$outpath/config.tests/.qmake.cache"
121@@ -3139,7 +3157,7 @@ if [ "$XPLATFORM_MAC" = "yes" ]; then
122 [ "$CFG_QGTKSTYLE" = "auto" ] && CFG_QGTKSTYLE=no
123 fi
124
125-QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`
126+QMAKE_CONF_COMPILER=`getXQEvalMakeConf QMAKE_CXX`
127
128 TEST_COMPILER=$QMAKE_CONF_COMPILER
129
130@@ -3174,7 +3192,7 @@ if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
131 exit 1
132 fi
133 fi
134-TEST_COMPILER_CXXFLAGS=`getXQMakeConf QMAKE_CXXFLAGS`
135+TEST_COMPILER_CXXFLAGS=`getXQEvalMakeConf QMAKE_CXXFLAGS`
136
137 GCC_MACHINE_DUMP=
138 case "$TEST_COMPILER" in *g++) GCC_MACHINE_DUMP=$($TEST_COMPILER -dumpmachine);; esac
139@@ -3632,6 +3650,14 @@ setBootstrapVariable()
140 getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
141 }
142
143+# OE qmake.conf is reading some variables from shell env
144+# read them from qmake.conf, replace qmake () syntax with shell and eval
145+setBootstrapEvalVariable()
146+{
147+ getQEvalMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
148+}
149+
150+
151 # build qmake
152 if true; then ###[ '!' -f "$outpath/bin/qmake" ];
153 echo "Creating qmake..."
154@@ -3670,11 +3696,11 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
155 fi
156
157 [ "$CFG_SILENT" = "yes" ] && CC_TRANSFORM='s,^,\@,' || CC_TRANSFORM=
158- setBootstrapVariable QMAKE_CC CC "$CC_TRANSFORM"
159- setBootstrapVariable QMAKE_CXX CXX "$CC_TRANSFORM"
160- setBootstrapVariable QMAKE_CFLAGS
161- setBootstrapVariable QMAKE_CXXFLAGS
162- setBootstrapVariable QMAKE_LFLAGS
163+ setBootstrapEvalVariable QMAKE_CC CC "$CC_TRANSFORM"
164+ setBootstrapEvalVariable QMAKE_CXX CXX "$CC_TRANSFORM"
165+ setBootstrapEvalVariable QMAKE_CFLAGS
166+ setBootstrapEvalVariable QMAKE_CXXFLAGS
167+ setBootstrapEvalVariable QMAKE_LFLAGS
168
169 if [ "$CFG_RELEASE_QMAKE" = "yes" ]; then
170 setBootstrapVariable QMAKE_CFLAGS_RELEASE
171diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
172index fe41c54..e2db923 100644
173--- a/mkspecs/features/configure.prf
174+++ b/mkspecs/features/configure.prf
175@@ -60,12 +60,12 @@ defineTest(qtCompileTest) {
176 }
177
178 # Clean up after previous run
179- exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")
180+ exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE $$(QMAKE_MAKE_ARGS) distclean")
181
182 mkpath($$test_out_dir)|error("Aborting.")
183
184 qtRunLoggedCommand("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$qmake_configs $$shell_quote($$test_dir)") {
185- qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE") {
186+ qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE $$(QMAKE_MAKE_ARGS)") {
187 log("yes$$escape_expand(\\n)")
188 msg = "test $$1 succeeded"
189 write_file($$QMAKE_CONFIG_LOG, msg, append)
190diff --git a/mkspecs/linux-oe-g++/qmake.conf b/mkspecs/linux-oe-g++/qmake.conf
191new file mode 100644
192index 0000000..ca26b10
193--- /dev/null
194+++ b/mkspecs/linux-oe-g++/qmake.conf
195@@ -0,0 +1,40 @@
196+#
197+# qmake configuration for linux-g++ with modifications for building with OpenEmbedded
198+#
199+
200+MAKEFILE_GENERATOR = UNIX
201+CONFIG += incremental
202+QMAKE_INCREMENTAL_STYLE = sublib
203+
204+include(../common/linux.conf)
205+
206+# QMAKE_<TOOL> (moc, uic, rcc) are gone, overwrite only ar and strip
207+QMAKE_AR = $(OE_QMAKE_AR) cqs
208+QMAKE_STRIP = $(OE_QMAKE_STRIP)
209+QMAKE_WAYLAND_SCANNER = $(OE_QMAKE_WAYLAND_SCANNER)
210+
211+include(../common/gcc-base-unix.conf)
212+
213+# *FLAGS from gcc-base.conf
214+QMAKE_CFLAGS += $(OE_QMAKE_CFLAGS)
215+QMAKE_CXXFLAGS += $(OE_QMAKE_CXXFLAGS)
216+QMAKE_LFLAGS += $(OE_QMAKE_LDFLAGS)
217+
218+include(../common/g++-unix.conf)
219+
220+# tc settings from g++-base.conf
221+QMAKE_COMPILER = $(OE_QMAKE_COMPILER)
222+QMAKE_CC = $(OE_QMAKE_CC)
223+QMAKE_CXX = $(OE_QMAKE_CXX)
224+
225+QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $(OE_QMAKE_CFLAGS)
226+
227+QMAKE_LINK = $(OE_QMAKE_LINK)
228+QMAKE_LINK_SHLIB = $(OE_QMAKE_LINK)
229+QMAKE_LINK_C = $(OE_QMAKE_LINK)
230+QMAKE_LINK_C_SHLIB = $(OE_QMAKE_LINK)
231+
232+# for the SDK
233+isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $(OE_QMAKE_QT_CONFIG)
234+
235+load(qt_config)
236diff --git a/mkspecs/linux-oe-g++/qplatformdefs.h b/mkspecs/linux-oe-g++/qplatformdefs.h
237new file mode 100644
238index 0000000..dd12003
239--- /dev/null
240+++ b/mkspecs/linux-oe-g++/qplatformdefs.h
241@@ -0,0 +1,100 @@
242+/****************************************************************************
243+**
244+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
245+** Contact: http://www.qt-project.org/legal
246+**
247+** This file is part of the qmake spec of the Qt Toolkit.
248+**
249+** $QT_BEGIN_LICENSE:LGPL$
250+** Commercial License Usage
251+** Licensees holding valid commercial Qt licenses may use this file in
252+** accordance with the commercial license agreement provided with the
253+** Software or, alternatively, in accordance with the terms contained in
254+** a written agreement between you and Digia. For licensing terms and
255+** conditions see http://qt.digia.com/licensing. For further information
256+** use the contact form at http://qt.digia.com/contact-us.
257+**
258+** GNU Lesser General Public License Usage
259+** Alternatively, this file may be used under the terms of the GNU Lesser
260+** General Public License version 2.1 as published by the Free Software
261+** Foundation and appearing in the file LICENSE.LGPL included in the
262+** packaging of this file. Please review the following information to
263+** ensure the GNU Lesser General Public License version 2.1 requirements
264+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
265+**
266+** In addition, as a special exception, Digia gives you certain additional
267+** rights. These rights are described in the Digia Qt LGPL Exception
268+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
269+**
270+** GNU General Public License Usage
271+** Alternatively, this file may be used under the terms of the GNU
272+** General Public License version 3.0 as published by the Free Software
273+** Foundation and appearing in the file LICENSE.GPL included in the
274+** packaging of this file. Please review the following information to
275+** ensure the GNU General Public License version 3.0 requirements will be
276+** met: http://www.gnu.org/copyleft/gpl.html.
277+**
278+**
279+** $QT_END_LICENSE$
280+**
281+****************************************************************************/
282+
283+#ifndef QPLATFORMDEFS_H
284+#define QPLATFORMDEFS_H
285+
286+// Get Qt defines/settings
287+
288+#include "qglobal.h"
289+
290+// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
291+
292+// 1) need to reset default environment if _BSD_SOURCE is defined
293+// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0
294+// 3) it seems older glibc need this to include the X/Open stuff
295+#ifndef _GNU_SOURCE
296+# define _GNU_SOURCE
297+#endif
298+
299+#include <unistd.h>
300+
301+
302+// We are hot - unistd.h should have turned on the specific APIs we requested
303+
304+#include <features.h>
305+#include <pthread.h>
306+#include <dirent.h>
307+#include <fcntl.h>
308+#include <grp.h>
309+#include <pwd.h>
310+#include <signal.h>
311+
312+#include <sys/types.h>
313+#include <sys/ioctl.h>
314+#include <sys/ipc.h>
315+#include <sys/time.h>
316+#include <sys/shm.h>
317+#include <sys/socket.h>
318+#include <sys/stat.h>
319+#include <sys/wait.h>
320+#include <netinet/in.h>
321+#ifndef QT_NO_IPV6IFNAME
322+#include <net/if.h>
323+#endif
324+
325+#define QT_USE_XOPEN_LFS_EXTENSIONS
326+#include "../common/posix/qplatformdefs.h"
327+
328+#undef QT_SOCKLEN_T
329+
330+#if defined(__GLIBC__) && (__GLIBC__ >= 2)
331+#define QT_SOCKLEN_T socklen_t
332+#else
333+#define QT_SOCKLEN_T int
334+#endif
335+
336+#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
337+#define QT_SNPRINTF ::snprintf
338+#define QT_VSNPRINTF ::vsnprintf
339+#endif
340+
341+#endif // QPLATFORMDEFS_H
342--
3431.9.1
344