summaryrefslogtreecommitdiffstats
path: root/meta/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch')
-rw-r--r--meta/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch338
1 files changed, 284 insertions, 54 deletions
diff --git a/meta/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch b/meta/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch
index 07fc2f77b7..37ed1e6522 100644
--- a/meta/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch
+++ b/meta/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch
@@ -1,4 +1,4 @@
-From 1ed7a2e9a883fe1240d89b7b70fb0f296bb2b54f Mon Sep 17 00:00:00 2001
+From 5d1bf6c3e826af7282b858c192c62aad77095fc0 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
@@ -7,78 +7,209 @@ Subject: [PATCH] Add linux-oe-g++ platform
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: add getQEvalMakeConf and getXQEvalMakeConf
+ Allow expansion of $(...) references from qmake.conf to generate
+ qmake environment from shell environment as exported by qmake5_base
+
+* configure: don't export SYSTEM_VARIABLES to .qmake.vars
+ linux-oe-g++ should handle this correctly and exporting LD as QMAKE_LINK is
+ causing issues as we need g++ to be used as linker
* 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
+* OE_QMAKE_CXX in order to allow compiler version check to succeed
+ which allows WebKit to be enabled.
+
+* Other variables in order to let config.tests to use our -platform
+ settings
+
+* Add setBootstrapEvalVariable to bootstrap qmake with our environment
+ too, this allows us to use -platform linux-oe-g++ also for native
+ recipe
+
+* disable gdb_dwarf_index
+ * qmake is trying to call native gdb and we don't depend on gdb-native
+ (or even provide gdb-native)
+ * fixes errors like this:
+ /bin/sh: gdb: command not found
+ /bin/sh: line 0: test: -gt: unary operator expected
+ which are not fatal, but still misleading in do_configure output
+
+* add -target suffix to qmake built in qtbase configure, this way we can
+ use qmake from qtbase-native, but then include qmake built for target
+ in qtbase-tools package (smilarly for nativesdk-qtbase).
+
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(-)
+ configure | 71 ++++++++++++++++---------
+ mkspecs/features/configure.prf | 4 +-
+ mkspecs/linux-oe-g++/qmake.conf | 42 +++++++++++++++
+ mkspecs/linux-oe-g++/qplatformdefs.h | 100 +++++++++++++++++++++++++++++++++++
+ 4 files changed, 189 insertions(+), 28 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
+index 6ebeab3..9e552c6 100755
--- a/configure
+++ b/configure
-@@ -712,7 +712,7 @@ fi
- # is where the resulting variable is written to
- setBootstrapVariable()
+@@ -343,6 +343,16 @@ getQMakeConf()
+ getSingleQMakeVariable "$1" "$specvals"
+ }
+
++# OE qmake.conf is reading some variables from shell env
++# read them from qmake.conf, replace qmake () syntax with shell and eval
++getQEvalMakeConf()
++{
++ VAL=`getQMakeConf "$1" | sed -n 's/$[(]\([0-9a-zA-Z_]*\)[)]/$\1/pg'`
++ EVAL=`eval "echo ${VAL}"`
++# echo "Running getQEvalMakeConf: var='$1', val='`getQMakeConf \"$1\"`, val-sed='$VAL', eval='$EVAL'" >&2
++ eval "echo ${VAL}"
++}
++
+ getXQMakeConf()
{
-- 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"
+ if [ -z "$xspecvals" ]; then
+@@ -367,6 +377,16 @@ testXConfig()
+ esac
}
++# OE qmake.conf is reading some variables from shell env
++# read them from qmake.conf, replace qmake () syntax with shell and eval
++getXQEvalMakeConf()
++{
++ VAL=`getXQMakeConf "$1" | sed -n 's/$[(]\([0-9a-zA-Z_]*\)[)]/$\1/pg'`
++ EVAL=`eval "echo ${VAL}"`
++# echo "Running getXQEvalMakeConf: var='$1', val='`getXQMakeConf \"$1\"`, val-sed='$VAL', eval='$EVAL'" >&2
++ eval "echo ${VAL}"
++}
++
+ compilerSupportsFlag()
+ {
+ cat >conftest.cpp <<EOF
+@@ -573,24 +593,14 @@ fi
+ # initalize variables
+ #-------------------------------------------------------------------------------
+
+-SYSTEM_VARIABLES="AR RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS"
+-for varname in $SYSTEM_VARIABLES; do
++# Export all OE variables for qmake.conf from shell env to QMakeVars
++OE_VARIABLES="AR CC CFLAGS COMPILER CXX CXXFLAGS LDFLAGS LINK QT_CONFIG STRIP"
++for varname in $OE_VARIABLES; do
+ qmakevarname="${varname}"
+- qmakecmdargs=""
+- # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
+- if [ "${varname}" = "LDFLAGS" ]; then
+- qmakevarname="LFLAGS"
+- elif [ "${varname}" = "LD" ]; then
+- qmakevarname="LINK"
+- elif [ "${varname}" = "AR" ]; then
+- # QMAKE_AR needs to be set to "/path/to/ar cqs" but the
+- # environment variable will be set to the command only so we
+- # need to append " cqs" for autoconf compatibility
+- qmakecmdargs=" cqs"
+- fi
+ cmd=`echo \
+-'if [ -n "\$'${varname}'" ]; then
+- QMakeVar set QMAKE_'${qmakevarname}' "\$'${varname}${qmakecmdargs}'"
++'if [ -n "\$OE_QMAKE_'${varname}'" ]; then
++ QMakeVar set OE_QMAKE_'${qmakevarname}' "\$OE_QMAKE_'${varname}'"
++# echo "Exporting OE_QMAKE_'${qmakevarname}' value=\"\$OE_QMAKE_'${varname}'\"" >&2
+ fi'`
+ eval "$cmd"
+ done
+@@ -3443,7 +3453,7 @@ if [ "$XPLATFORM_MAC" = "yes" ]; then
+ [ "$CFG_QGTKSTYLE" = "auto" ] && CFG_QGTKSTYLE=no
+ fi
+
+-QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`
++QMAKE_CONF_COMPILER=`getXQEvalMakeConf QMAKE_CXX`
+
+ TEST_COMPILER=$QMAKE_CONF_COMPILER
+
+@@ -3504,7 +3514,7 @@ if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
+ exit 1
+ fi
+ fi
+-TEST_COMPILER_CXXFLAGS=`getXQMakeConf QMAKE_CXXFLAGS`
++TEST_COMPILER_CXXFLAGS=`getXQEvalMakeConf QMAKE_CXXFLAGS`
+
+ GCC_MACHINE_DUMP=
+ case "$TEST_COMPILER" in *g++) GCC_MACHINE_DUMP=$($TEST_COMPILER -dumpmachine);; esac
+@@ -4005,6 +4015,14 @@ setBootstrapVariable()
+ getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
+ }
+
++# OE qmake.conf is reading some variables from shell env
++# read them from qmake.conf, replace qmake () syntax with shell and eval
++setBootstrapEvalVariable()
++{
++ getQEvalMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
++}
++
++
# build qmake
+ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
+ echo "Creating qmake..."
+@@ -4043,14 +4061,14 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
+ fi
+
+ [ "$CFG_SILENT" = "yes" ] && CC_TRANSFORM='s,^,\@,' || CC_TRANSFORM=
+- setBootstrapVariable QMAKE_CC CC "$CC_TRANSFORM"
+- setBootstrapVariable QMAKE_CXX CXX "$CC_TRANSFORM"
+- setBootstrapVariable QMAKE_CFLAGS
+- setBootstrapVariable QMAKE_CFLAGS_SPLIT_SECTIONS
+- setBootstrapVariable QMAKE_CXXFLAGS
+- setBootstrapVariable QMAKE_CXXFLAGS_SPLIT_SECTIONS
+- setBootstrapVariable QMAKE_LFLAGS
+- setBootstrapVariable QMAKE_LFLAGS_GCSECTIONS
++ setBootstrapEvalVariable QMAKE_CC CC "$CC_TRANSFORM"
++ setBootstrapEvalVariable QMAKE_CXX CXX "$CC_TRANSFORM"
++ setBootstrapEvalVariable QMAKE_CFLAGS
++ setBootstrapEvalVariable QMAKE_CFLAGS_SPLIT_SECTIONS
++ setBootstrapEvalVariable QMAKE_CXXFLAGS
++ setBootstrapEvalVariable QMAKE_CXXFLAGS_SPLIT_SECTIONS
++ setBootstrapEvalVariable QMAKE_LFLAGS
++ setBootstrapEvalVariable QMAKE_LFLAGS_GCSECTIONS
+
+ if [ "$CFG_DEBUG" = "no" ] || [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
+ setBootstrapVariable QMAKE_CFLAGS_RELEASE
+@@ -4093,6 +4111,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
+ \"\$(SOURCE_PATH)/src/corelib/io/qfsfileengine_unix.cpp\" \
+ \"\$(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp\""
+ EXEEXT=
++ [ "$QT_CROSS_COMPILE" = "yes" ] && EXEEXT=-target
+ fi
+ if [ "$BUILD_ON_MAC" = "yes" ]; then
+ echo "COCOA_LFLAGS =-framework Foundation -framework CoreServices" >>"$mkfile"
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
-index 934a18a..0f5b1b6 100644
+index a3ec227..eef6006 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
-@@ -46,14 +46,14 @@ defineTest(qtCompileTest) {
+@@ -71,12 +71,12 @@ 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()
+ mkpath($$test_out_dir)|error("Aborting.")
- !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 $$system_quote($$system_path($$QMAKE_QMAKE)) -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
+index 0000000..311ba04
--- /dev/null
+++ b/mkspecs/linux-oe-g++/qmake.conf
@@ -0,0 +1,42 @@
@@ -86,48 +217,147 @@ index 0000000..30d31ed
+# qmake configuration for linux-g++ with modifications for building with OpenEmbedded
+#
+
-+MAKEFILE_GENERATOR = UNIX
++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)
++QMAKE_AR = $(OE_QMAKE_AR) cqs
++QMAKE_STRIP = $(OE_QMAKE_STRIP)
++QMAKE_WAYLAND_SCANNER = $(OE_QMAKE_WAYLAND_SCANNER)
+
+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)
++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_COMPILER = $(OE_QMAKE_COMPILER) gcc
++QMAKE_CC = $(OE_QMAKE_CC)
++QMAKE_CXX = $(OE_QMAKE_CXX)
+
-+QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$(OE_QMAKE_CFLAGS)
++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)
++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)
++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
+index 0000000..dd12003
--- /dev/null
+++ b/mkspecs/linux-oe-g++/qplatformdefs.h
-@@ -0,0 +1 @@
-+#include "../linux-g++/qplatformdefs.h"
+@@ -0,0 +1,100 @@
++/****************************************************************************
++**
++** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
++** Contact: http://www.qt-project.org/legal
++**
++** This file is part of the qmake spec of the Qt Toolkit.
++**
++** $QT_BEGIN_LICENSE:LGPL$
++** Commercial License Usage
++** Licensees holding valid commercial Qt licenses may use this file in
++** accordance with the commercial license agreement provided with the
++** Software or, alternatively, in accordance with the terms contained in
++** a written agreement between you and Digia. For licensing terms and
++** conditions see http://qt.digia.com/licensing. For further information
++** use the contact form at http://qt.digia.com/contact-us.
++**
++** GNU Lesser General Public License Usage
++** Alternatively, this file may be used under the terms of the GNU Lesser
++** General Public License version 2.1 as published by the Free Software
++** Foundation and appearing in the file LICENSE.LGPL included in the
++** packaging of this file. Please review the following information to
++** ensure the GNU Lesser General Public License version 2.1 requirements
++** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
++**
++** In addition, as a special exception, Digia gives you certain additional
++** rights. These rights are described in the Digia Qt LGPL Exception
++** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
++**
++** GNU General Public License Usage
++** Alternatively, this file may be used under the terms of the GNU
++** General Public License version 3.0 as published by the Free Software
++** Foundation and appearing in the file LICENSE.GPL included in the
++** packaging of this file. Please review the following information to
++** ensure the GNU General Public License version 3.0 requirements will be
++** met: http://www.gnu.org/copyleft/gpl.html.
++**
++**
++** $QT_END_LICENSE$
++**
++****************************************************************************/
++
++#ifndef QPLATFORMDEFS_H
++#define QPLATFORMDEFS_H
++
++// Get Qt defines/settings
++
++#include "qglobal.h"
++
++// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
++
++// 1) need to reset default environment if _BSD_SOURCE is defined
++// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0
++// 3) it seems older glibc need this to include the X/Open stuff
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE
++#endif
++
++#include <unistd.h>
++
++
++// We are hot - unistd.h should have turned on the specific APIs we requested
++
++#include <features.h>
++#include <pthread.h>
++#include <dirent.h>
++#include <fcntl.h>
++#include <grp.h>
++#include <pwd.h>
++#include <signal.h>
++
++#include <sys/types.h>
++#include <sys/ioctl.h>
++#include <sys/ipc.h>
++#include <sys/time.h>
++#include <sys/shm.h>
++#include <sys/socket.h>
++#include <sys/stat.h>
++#include <sys/wait.h>
++#include <netinet/in.h>
++#ifndef QT_NO_IPV6IFNAME
++#include <net/if.h>
++#endif
++
++#define QT_USE_XOPEN_LFS_EXTENSIONS
++#include "../common/posix/qplatformdefs.h"
++
++#undef QT_SOCKLEN_T
++
++#if defined(__GLIBC__) && (__GLIBC__ >= 2)
++#define QT_SOCKLEN_T socklen_t
++#else
++#define QT_SOCKLEN_T int
++#endif
++
++#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
++#define QT_SNPRINTF ::snprintf
++#define QT_VSNPRINTF ::vsnprintf
++#endif
++
++#endif // QPLATFORMDEFS_H