diff --git a/classes/qmake5_base.bbclass b/classes/qmake5_base.bbclass index 92b3317fbe..3e757ab4ed 100644 --- a/classes/qmake5_base.bbclass +++ b/classes/qmake5_base.bbclass @@ -1,8 +1,12 @@ -QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_DATADIR_NATIVE}/${QT_DIR_NAME}/mkspecs" -OE_QMAKE_PLATFORM_NATIVE = "${BUILD_OS}-oe-g++" +# This is useful for target recipes to reference native mkspecs +QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/${QT_DIR_NAME}" -QMAKE_MKSPEC_PATH = "${STAGING_DATADIR}/${QT_DIR_NAME}/mkspecs" -OE_QMAKE_PLATFORM = "${TARGET_OS}-oe-g++" +QMAKE_MKSPEC_PATH = "${STAGING_DATADIR}/${QT_DIR_NAME}" +QMAKE_MKSPEC_PATH_class-native = "${QMAKE_MKSPEC_PATH_NATIVE}" + +# hardcode linux, because that's what 0001-Add-linux-oe-g-platform.patch adds +OE_QMAKE_PLATFORM_NATIVE = "linux-oe-g++" +OE_QMAKE_PLATFORM = "linux-oe-g++" EXTRA_OEMAKE = " MAKEFLAGS='${PARALLEL_MAKE}'" @@ -13,15 +17,17 @@ EXTRA_ENV = 'QMAKE="${OE_QMAKE_QMAKE} -d -after \ STRIP="${OE_QMAKE_STRIP}" \ MAKE="make -e ${PARALLEL_MAKE}"' -export OE_QMAKESPEC = "${QMAKE_MKSPEC_PATH_NATIVE}/${OE_QMAKE_PLATFORM_NATIVE}" -export OE_XQMAKESPEC = "${QMAKE_MKSPEC_PATH}/${OE_QMAKE_PLATFORM}" +export OE_QMAKESPEC = "${QMAKE_MKSPEC_PATH_NATIVE}/mkspecs/${OE_QMAKE_PLATFORM_NATIVE}" +export OE_XQMAKESPEC = "${QMAKE_MKSPEC_PATH}/mkspecs/${OE_QMAKE_PLATFORM}" export OE_QMAKE_QMAKE = "${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}/qmake" export OE_QMAKE_COMPILER = "${CC}" export OE_QMAKE_CC = "${CC}" export OE_QMAKE_CFLAGS = "${CFLAGS}" export OE_QMAKE_CXX = "${CXX}" +export OE_QMAKE_CXXFLAGS = "${CXXFLAGS}" +export OE_QMAKE_LINK = "${CXX}" export OE_QMAKE_LDFLAGS = "${LDFLAGS}" -export OE_QMAKE_AR = "${AR} cqs" +export OE_QMAKE_AR = "${AR}" export OE_QMAKE_STRIP = "echo" export QT_CONF_PATH = "${WORKDIR}/qt.conf" export QT_DIR_NAME ?= "qt5" @@ -32,17 +38,50 @@ STRIP[unexport] = "1" do_generate_qt_config_file() { cat > ${WORKDIR}/qt.conf <> ${WORKDIR}/qt.conf <> ${WORKDIR}/qt.conf +} + +#-dont-process EXTRA_OECONF = " \ -prefix ${prefix} \ - -L ${STAGING_LIBDIR_NATIVE} \ - -I ${STAGING_INCDIR_NATIVE} \ + -sysroot ${STAGING_DIR_NATIVE} \ + -no-gcc-sysroot \ -system-zlib \ -no-libjpeg \ -no-libpng \ @@ -39,15 +51,14 @@ EXTRA_OECONF = " \ -no-opengl \ -no-openssl \ -no-xcb \ - -verbose -release \ + -verbose \ + -release \ -prefix ${prefix} \ -bindir ${bindir}/${QT_DIR_NAME} \ -headerdir ${includedir}/${QT_DIR_NAME} \ -archdatadir ${libdir}/${QT_DIR_NAME} \ -datadir ${datadir}/${QT_DIR_NAME} \ -docdir ${docdir}/${QT_DIR_NAME} \ - -hostdatadir ${datadir}/${QT_DIR_NAME} \ - -hostbindir ${bindir}/${QT_DIR_NAME} \ -no-glib \ -no-iconv \ -silent \ @@ -55,27 +66,21 @@ EXTRA_OECONF = " \ -nomake tests \ -nomake demos \ -no-rpath \ + -platform linux-oe-g++ \ " -# qtbase is exception, we need to use mkspecs from ${S} -QMAKE_MKSPEC_PATH_NATIVE = "${S}/mkspecs" - do_configure_prepend() { - if [ ! -e ${OE_QMAKESPEC} ]; then - mkdir -p ${OE_QMAKESPEC} - fi - # use default qplatformdefs.h from linux-g++ - cp -va ${QMAKE_MKSPEC_PATH_NATIVE}/linux-g++/qplatformdefs.h ${OE_QMAKESPEC}/ - # use modified qmake.conf which is using OE_QMAKE_* shell variables - # exported from qmake5_base.bbclass to define toolchain and flags - cp -va ${WORKDIR}/qmake.conf ${OE_QMAKESPEC}/ -} + # Similar logic is in autotools.bbclass + if [ -d ${B} -a "${S}" != "${B}" ] ; then + # Existing separate build directory, exists, remove + rm -rf "${B}/*" + fi -do_configure() { # Avoid setting QMAKE_LINK from LD (since we want the linker to be g++) unset LD - (echo o; echo yes) | ./configure ${EXTRA_OECONF} || die "Configuring qt failed. EXTRA_OECONF was ${EXTRA_OECONF}" + (echo o; echo yes) | ${S}/configure ${EXTRA_OECONF} || die "Configuring qt failed. EXTRA_OECONF was ${EXTRA_OECONF}" +# bin/qmake -r -d ${S} || die "Configuring qt with qmake failed. EXTRA_OECONF was ${EXTRA_OECONF}" } do_install() { diff --git a/recipes-qt/qt5/qtbase.inc b/recipes-qt/qt5/qtbase.inc index ad5599627f..f4462977ae 100644 --- a/recipes-qt/qt5/qtbase.inc +++ b/recipes-qt/qt5/qtbase.inc @@ -1,11 +1,12 @@ require qt5.inc SRC_URI += " \ - file://0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \ - file://0002-qmake-is-already-built-in-qt5-tools-native.patch \ - file://0003-Allow-building-a-separate-qmake-for-the-target.patch \ - file://0004-configure-eval-QMAKE_CXX.patch \ - file://qmake.conf \ + file://0001-Add-linux-oe-g-platform.patch \ + file://0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \ + file://0003-Add-external-hostbindir-option.patch \ + file://0004-qmake-is-already-built-in-qtbase-native.patch \ + file://0005-Allow-building-a-separate-qmake-for-the-target.patch \ + file://0006-qt_functions-temporary-remove-isEmpty-check.patch \ " DEPENDS += "qtbase-native virtual/libgl freetype jpeg libpng zlib openssl glib-2.0 ${ICU} udev" @@ -30,44 +31,42 @@ ARM_INSTRUCTION_SET = "arm" inherit qmake5 -do_generate_qt_config_file() { - : - cat > ${WORKDIR}/qt.conf < ${WORKDIR}/qt.conf < +Date: Mon, 15 Apr 2013 04:29:32 +0200 +Subject: [PATCH 1/6] 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: add getQEvalMakeConf and getXQEvalMakeConf + Allow expansion of $(...) references from qmake.conf to generate + qmake environment from shell environment as exported by qmake5_base + +* 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 + +Upstream-Status: Pending + +Signed-off-by: Martin Jansa +--- + configure | 54 ++++++++++++++++--- + mkspecs/linux-oe-g++/qmake.conf | 39 ++++++++++++++ + mkspecs/linux-oe-g++/qplatformdefs.h | 100 +++++++++++++++++++++++++++++++++++ + 3 files changed, 186 insertions(+), 7 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 89246c8..0ab8eee 100755 +--- a/configure ++++ b/configure +@@ -216,6 +216,16 @@ getQMakeConf() + getQMakeConf3 "$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() + { + if [ -z "$xspecvals" ]; then +@@ -224,6 +234,16 @@ getXQMakeConf() + getQMakeConf3 "$1" "$xspecvals" + } + ++# 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 <&2 ++fi'` ++ eval "$cmd" ++done ++ + SYSTEM_VARIABLES="RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS" + for varname in $SYSTEM_VARIABLES; do + qmakevarname="${varname}" +@@ -2623,7 +2655,7 @@ else + CFG_FRAMEWORK=no + fi + +-QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX` ++QMAKE_CONF_COMPILER=`getXQEvalMakeConf QMAKE_CXX` + + TEST_COMPILER=$QMAKE_CONF_COMPILER + if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then +@@ -2632,7 +2664,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 +@@ -3587,6 +3619,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. Please wait..." +@@ -3625,11 +3665,11 @@ 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_CXXFLAGS +- setBootstrapVariable QMAKE_LFLAGS ++ setBootstrapEvalVariable QMAKE_CC CC "$CC_TRANSFORM" ++ setBootstrapEvalVariable QMAKE_CXX CXX "$CC_TRANSFORM" ++ setBootstrapEvalVariable QMAKE_CFLAGS ++ setBootstrapEvalVariable QMAKE_CXXFLAGS ++ setBootstrapEvalVariable QMAKE_LFLAGS + + if [ $QT_EDITION = "QT_EDITION_OPENSOURCE" ]; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -DQMAKE_OPENSOURCE_EDITION" +diff --git a/mkspecs/linux-oe-g++/qmake.conf b/mkspecs/linux-oe-g++/qmake.conf +new file mode 100644 +index 0000000..42966fe +--- /dev/null ++++ b/mkspecs/linux-oe-g++/qmake.conf +@@ -0,0 +1,39 @@ ++# ++# 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_ (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) ++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) ++ ++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..dd12003 +--- /dev/null ++++ b/mkspecs/linux-oe-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 ++ ++ ++// We are hot - unistd.h should have turned on the specific APIs we requested ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#ifndef QT_NO_IPV6IFNAME ++#include ++#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 +-- +1.8.2.1 + diff --git a/recipes-qt/qt5/qtbase/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch b/recipes-qt/qt5/qtbase/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch deleted file mode 100644 index 857d5e84e7..0000000000 --- a/recipes-qt/qt5/qtbase/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 2af433da710aff74445cb5148d369427bdd501de Mon Sep 17 00:00:00 2001 -From: Holger Freyther -Date: Wed, 26 Sep 2012 17:22:30 +0200 -Subject: [PATCH] qlibraryinfo: allow to set qt.conf from the outside using the - environment - -Allow to set a qt.conf from the outside using the environment. This allows -to inject new prefixes and other paths into qmake. This is needed when using -the same qmake binary to build qt/x11 and qt/embedded - -Upstream-Status: Pending - -Signed-off-by: Martin Jansa ---- - src/corelib/global/qlibraryinfo.cpp | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp -index 747fd87..c9f8170 100644 ---- a/src/corelib/global/qlibraryinfo.cpp -+++ b/src/corelib/global/qlibraryinfo.cpp -@@ -140,6 +140,10 @@ QSettings *QLibraryInfoPrivate::findConfiguration() - { - QString qtconfig = QStringLiteral(":/qt/etc/qt.conf"); - #ifdef QT_BOOTSTRAPPED -+ if (!QFile::exists(qtconfig)) { -+ QByteArray config = getenv("QT_CONF_PATH"); -+ qtconfig = QFile::decodeName(config); -+ } - if(!QFile::exists(qtconfig)) - qtconfig = qt_libraryInfoFile(); - #else -@@ -164,6 +168,10 @@ QSettings *QLibraryInfoPrivate::findConfiguration() - } - } - #endif -+ if (!QFile::exists(qtconfig)) { -+ QByteArray config = getenv("QT_CONF_PATH"); -+ qtconfig = QFile::decodeName(config); -+ } - if (QFile::exists(qtconfig)) - return new QSettings(qtconfig, QSettings::IniFormat); - return 0; //no luck --- -1.8.1.5 - diff --git a/recipes-qt/qt5/qtbase/0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch b/recipes-qt/qt5/qtbase/0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch new file mode 100644 index 0000000000..f2a6efcaac --- /dev/null +++ b/recipes-qt/qt5/qtbase/0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch @@ -0,0 +1,46 @@ +From 29812cee9589dedd10a94b66ed5279549ed62f36 Mon Sep 17 00:00:00 2001 +From: Holger Freyther +Date: Wed, 26 Sep 2012 17:22:30 +0200 +Subject: [PATCH 2/6] qlibraryinfo: allow to set qt.conf from the outside using + the environment + +Allow to set a qt.conf from the outside using the environment. This allows +to inject new prefixes and other paths into qmake. This is needed when using +the same qmake binary to build qt/x11 and qt/embedded + +Upstream-Status: Pending + +Signed-off-by: Martin Jansa +--- + src/corelib/global/qlibraryinfo.cpp | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp +index a8dc086..c16dfcb 100644 +--- a/src/corelib/global/qlibraryinfo.cpp ++++ b/src/corelib/global/qlibraryinfo.cpp +@@ -138,7 +138,10 @@ QLibrarySettings::QLibrarySettings() + + QSettings *QLibraryInfoPrivate::findConfiguration() + { +- QString qtconfig = QStringLiteral(":/qt/etc/qt.conf"); ++ QByteArray config = getenv("QT_CONF_PATH"); ++ QString qtconfig = QFile::decodeName(config); ++ if(!QFile::exists(qtconfig)) ++ qtconfig = QStringLiteral(":/qt/etc/qt.conf"); + #ifdef QT_BOOTSTRAPPED + if(!QFile::exists(qtconfig)) + qtconfig = qt_libraryInfoFile(); +@@ -165,7 +168,9 @@ QSettings *QLibraryInfoPrivate::findConfiguration() + } + #endif + if (QFile::exists(qtconfig)) ++ printf("Using qt.conf from: %s\n", qtconfig.toLatin1().data()); + return new QSettings(qtconfig, QSettings::IniFormat); ++ printf("qt.conf wasn't found!!\n"); + return 0; //no luck + } + +-- +1.8.2.1 + diff --git a/recipes-qt/qt5/qtbase/0003-Add-external-hostbindir-option.patch b/recipes-qt/qt5/qtbase/0003-Add-external-hostbindir-option.patch new file mode 100644 index 0000000000..ba4badca12 --- /dev/null +++ b/recipes-qt/qt5/qtbase/0003-Add-external-hostbindir-option.patch @@ -0,0 +1,219 @@ +From 72d8aaf00e3d722b56b66bd5fa1f1f3d3e8a8552 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Sat, 6 Apr 2013 13:15:07 +0200 +Subject: [PATCH 3/6] Add -external-hostbindir option + +* when cross-compiling it's sometimes useful to use existing tools from machine + (or in OpenEmbedded built with separate native recipe) when building for target + +* this way we can skip bootstraping tools we already have + +Signed-off-by: Martin Jansa +--- + configure | 15 ++++++++++++++- + mkspecs/features/qt_functions.prf | 5 ++++- + mkspecs/features/qt_tool.prf | 2 +- + qmake/property.cpp | 1 + + qtbase.pro | 15 +++++++++++---- + src/corelib/global/qlibraryinfo.cpp | 3 ++- + src/corelib/global/qlibraryinfo.h | 1 + + tools/configure/configureapp.cpp | 8 ++++++++ + 8 files changed, 42 insertions(+), 8 deletions(-) + +diff --git a/configure b/configure +index 0ab8eee..50f1ef2 100755 +--- a/configure ++++ b/configure +@@ -928,6 +928,7 @@ CFG_GCC_SYSROOT="yes" + QT_HOST_PREFIX= + QT_HOST_BINS= + QT_HOST_DATA= ++QT_EXTERNAL_HOST_BINS= + + #flags for SQL drivers + QT_CFLAGS_PSQL= +@@ -1026,7 +1027,7 @@ while [ "$#" -gt 0 ]; do + VAL=no + ;; + #Qt style options that pass an argument +- -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig) ++ -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig|-external-hostbindir) + VAR=`echo $1 | sed "s,^-\(.*\),\1,"` + shift + VAL="$1" +@@ -1223,6 +1224,9 @@ while [ "$#" -gt 0 ]; do + hostbindir) + QT_HOST_BINS="$VAL" + ;; ++ external-hostbindir) ++ QT_EXTERNAL_HOST_BINS="$VAL" ++ ;; + pkg-config) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_PKGCONFIG="$VAL" +@@ -2921,6 +2925,11 @@ else + QT_HOST_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_DATA"` + fi + ++# default is empty, don't call makeabs if it is empty ++if [ ! -z "$QT_EXTERNAL_HOST_BINS" ]; then ++ QT_EXTERNAL_HOST_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_EXTERNAL_HOST_BINS"` ++fi ++ + #------------------------------------------------------------------------------- + # help - interactive parts of the script _after_ this section please + #------------------------------------------------------------------------------- +@@ -3087,6 +3096,9 @@ Installation options: + -hostdatadir . Data used by qmake will be installed to + (default HOSTPREFIX) + ++ -external-hostbindir Use external host executables instead of building them ++ (not used by defaut) ++ + Configure options: + + The defaults (*) are usually acceptable. A plus (+) denotes a default value +@@ -3558,6 +3570,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = { + "qt_hpfxpath=$QT_HOST_PREFIX", + "qt_hbinpath=$QT_HOST_BINS", + "qt_hdatpath=$QT_HOST_DATA", ++ "qt_ebinpath=$QT_EXTERNAL_HOST_BINS", + "qt_targspec=$shortxspec", + "qt_hostspec=$shortspec", + #endif +diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf +index 389f241..e249960 100644 +--- a/mkspecs/features/qt_functions.prf ++++ b/mkspecs/features/qt_functions.prf +@@ -194,7 +194,10 @@ defineTest(qtAddModules) { + defineTest(qtPrepareTool) { + $$1 = $$eval(QT_TOOL.$${2}.command) + isEmpty($$1) { +- $$1 = $$[QT_HOST_BINS/get]/$$2 ++ $$1 = $$[QT_EXTERNAL_HOST_BINS]/$$2 ++ isEmpty($$[QT_EXTERNAL_HOST_BINS]) { ++ $$1 = $$[QT_HOST_BINS/get]/$$2 ++ } + contains(QMAKE_HOST.os, Windows):!contains($$1, .*\\.(exe|bat)$) { + exists($$eval($$1).bat) { + $$1 = $$eval($$1).bat +diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf +index 16db6c7..5518933 100644 +--- a/mkspecs/features/qt_tool.prf ++++ b/mkspecs/features/qt_tool.prf +@@ -31,7 +31,7 @@ load(qt_targets) + + # If we are doing a prefix build, create a "module" pri which enables + # qtPrepareTool() to work with the non-installed build. +-!build_pass:!exists($$[QT_INSTALL_PREFIX]/.qmake.cache) { ++!build_pass:!exists($$[QT_INSTALL_PREFIX]/.qmake.cache):isEmpty($$[QT_EXTERNAL_HOST_BINS]) { + + isEmpty(MODULE):MODULE = $$TARGET + +diff --git a/qmake/property.cpp b/qmake/property.cpp +index bbd4734..dca0c58 100644 +--- a/qmake/property.cpp ++++ b/qmake/property.cpp +@@ -74,6 +74,7 @@ static const struct { + { "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true }, + { "QT_HOST_DATA", QLibraryInfo::HostDataPath, true }, + { "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true }, ++ { "QT_EXTERNAL_HOST_BINS", QLibraryInfo::ExternalHostBinariesPath, true }, + { "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true }, + { "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true }, + }; +diff --git a/qtbase.pro b/qtbase.pro +index e66d9fb..a6ae763 100644 +--- a/qtbase.pro ++++ b/qtbase.pro +@@ -68,17 +68,24 @@ CONFIG -= qt + + #qmake + qmake.path = $$[QT_HOST_BINS] ++qmake.files = $$OUT_PWD/bin/qmake ++!isEmpty($$[QT_EXTERNAL_HOST_BINS]) { ++ qmake.files = $$[QT_EXTERNAL_HOST_BINS]/bin/qmake ++} + equals(QMAKE_HOST.os, Windows) { +- qmake.files = $$OUT_PWD/bin/qmake.exe +-} else { +- qmake.files = $$OUT_PWD/bin/qmake ++ qmake.files = $${qmake.files}.exe + } + INSTALLS += qmake + + #syncqt + syncqt.path = $$[QT_HOST_BINS] + syncqt.files = $$PWD/bin/syncqt +-equals(QMAKE_HOST.os, Windows):syncqt.files += $$PWD/bin/syncqt.bat ++!isEmpty($$[QT_EXTERNAL_HOST_BINS]) { ++ syncqt.files = $$[QT_EXTERNAL_HOST_BINS]/bin/syncqt ++} ++equals(QMAKE_HOST.os, Windows) { ++ syncqt.files = $${syncqt.files}.bat ++} + INSTALLS += syncqt + + #mkspecs +diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp +index c16dfcb..56a269f 100644 +--- a/src/corelib/global/qlibraryinfo.cpp ++++ b/src/corelib/global/qlibraryinfo.cpp +@@ -272,7 +272,7 @@ QLibraryInfo::isDebugBuild() + */ + + static const struct { +- char key[19], value[13]; ++ char key[21], value[13]; + } qtConfEntries[] = { + { "Prefix", "." }, + { "Documentation", "doc" }, // should be ${Data}/doc +@@ -293,6 +293,7 @@ static const struct { + { "HostPrefix", "" }, + { "HostBinaries", "bin" }, + { "HostData", "." }, ++ { "ExternalHostBinaries", "" }, + { "TargetSpec", "" }, + { "HostSpec", "" }, + #endif +diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h +index a574b4b..1535d20 100644 +--- a/src/corelib/global/qlibraryinfo.h ++++ b/src/corelib/global/qlibraryinfo.h +@@ -85,6 +85,7 @@ public: + HostPrefixPath, + HostBinariesPath, + HostDataPath, ++ ExternalHostBinariesPath, + TargetSpecPath, + HostSpecPath, + LastHostPath = HostSpecPath, +diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp +index 126643e..0e01ab5 100644 +--- a/tools/configure/configureapp.cpp ++++ b/tools/configure/configureapp.cpp +@@ -1143,6 +1143,13 @@ void Configure::parseCmdLine() + dictionary[ "QT_HOST_DATA" ] = configCmdLine.at(i); + } + ++ else if (configCmdLine.at(i) == "-external-hostbindir") { ++ ++i; ++ if (i == argCount) ++ break; ++ dictionary[ "QT_EXTERNAL_HOST_BINS" ] = configCmdLine.at(i); ++ } ++ + else if (configCmdLine.at(i) == "-make-tool") { + ++i; + if (i == argCount) +@@ -3627,6 +3634,7 @@ void Configure::generateQConfigCpp() + << " \"qt_hpfxpath=" << formatPath(dictionary["QT_HOST_PREFIX"]) << "\"," << endl + << " \"qt_hbinpath=" << formatPath(dictionary["QT_HOST_BINS"]) << "\"," << endl + << " \"qt_hdatpath=" << formatPath(dictionary["QT_HOST_DATA"]) << "\"," << endl ++ << " \"qt_ebinpath=" << formatPath(dictionary["QT_EXTERNAL_HOST_BINS"]) << "\"," << endl + << " \"qt_targspec=" << targSpec << "\"," << endl + << " \"qt_hostspec=" << hostSpec << "\"," << endl + << "#endif" << endl +-- +1.8.2.1 + diff --git a/recipes-qt/qt5/qtbase/0004-configure-eval-QMAKE_CXX.patch b/recipes-qt/qt5/qtbase/0004-configure-eval-QMAKE_CXX.patch deleted file mode 100644 index 06fa486297..0000000000 --- a/recipes-qt/qt5/qtbase/0004-configure-eval-QMAKE_CXX.patch +++ /dev/null @@ -1,35 +0,0 @@ -From bc6f13a50ad1c69e728062375d979796977d2b73 Mon Sep 17 00:00:00 2001 -From: Paul Eggleton -Date: Wed, 26 Sep 2012 20:47:08 +0200 -Subject: [PATCH] configure: eval QMAKE_CXX - -Allow expansion of $(...) references in QMAKE_CXX (currently its value -is $(OE_QMAKE_CXX)) in order to allow compiler version check to succeed -which allows WebKit to be enabled. - -Upstream-Status: Pending - -Signed-off-by: Paul Eggleton -Signed-off-by: Martin Jansa ---- - configure | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/configure b/configure -index e23ea22..d83cf74 100755 ---- a/configure -+++ b/configure -@@ -2623,7 +2623,9 @@ else - CFG_FRAMEWORK=no - fi - --QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX` -+QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX | sed -n 's/$[(]\([0-9a-zA-Z_]*\)[)]/$\1/pg'` -+QMAKE_CONF_COMPILER=`eval "echo $QMAKE_CONF_COMPILER"` -+ - - TEST_COMPILER=$QMAKE_CONF_COMPILER - if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then --- -1.8.1.5 - diff --git a/recipes-qt/qt5/qtbase/0002-qmake-is-already-built-in-qt5-tools-native.patch b/recipes-qt/qt5/qtbase/0004-qmake-is-already-built-in-qtbase-native.patch similarity index 55% rename from recipes-qt/qt5/qtbase/0002-qmake-is-already-built-in-qt5-tools-native.patch rename to recipes-qt/qt5/qtbase/0004-qmake-is-already-built-in-qtbase-native.patch index 0c1f63c69e..91709741c2 100644 --- a/recipes-qt/qt5/qtbase/0002-qmake-is-already-built-in-qt5-tools-native.patch +++ b/recipes-qt/qt5/qtbase/0004-qmake-is-already-built-in-qtbase-native.patch @@ -1,29 +1,30 @@ -From aab01049543f4508f1dc92fb62b980d1d0c3bcc0 Mon Sep 17 00:00:00 2001 +From 956195c897287787b545e570ee976d1d2917eca8 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Mon, 29 Oct 2012 20:07:49 -0700 -Subject: [PATCH] qmake is already built in qt5-tools-native +Subject: [PATCH 4/6] qmake is already built in qtbase-native Ported from OE by: Yu Ke Upstream-Status: Inappropriate [configuration] Signed-off-by: Mikko Levonmaa +Signed-off-by: Martin Jansa --- - configure | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure -index c3e61d6..5e43a19 100755 +index 50f1ef2..8710c28 100755 --- a/configure +++ b/configure -@@ -3594,7 +3594,7 @@ setBootstrapVariable() - } +@@ -3641,7 +3641,7 @@ setBootstrapEvalVariable() + # build qmake -if true; then ###[ '!' -f "$outpath/bin/qmake" ]; +if false; then ###[ '!' -f "$outpath/bin/qmake" ]; echo "Creating qmake. Please wait..." - #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured + mkdir -p "$outpath/qmake" || exit -- -1.7.4.1 +1.8.2.1 diff --git a/recipes-qt/qt5/qtbase/0003-Allow-building-a-separate-qmake-for-the-target.patch b/recipes-qt/qt5/qtbase/0005-Allow-building-a-separate-qmake-for-the-target.patch similarity index 65% rename from recipes-qt/qt5/qtbase/0003-Allow-building-a-separate-qmake-for-the-target.patch rename to recipes-qt/qt5/qtbase/0005-Allow-building-a-separate-qmake-for-the-target.patch index 781d6e549b..4d16344383 100644 --- a/recipes-qt/qt5/qtbase/0003-Allow-building-a-separate-qmake-for-the-target.patch +++ b/recipes-qt/qt5/qtbase/0005-Allow-building-a-separate-qmake-for-the-target.patch @@ -1,28 +1,29 @@ -From a2a01e1fd975e8e616b580423c3bf30db9c11b6d Mon Sep 17 00:00:00 2001 +From d33f33aed6744b5c4c561e6c6527d784481604f5 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 29 Oct 2012 20:26:36 -0700 -Subject: [PATCH] Allow building a separate qmake for the target +Subject: [PATCH 5/6] Allow building a separate qmake for the target Upstream-Status: Inappropriate [config] Signed-off-by: Paul Eggleton Signed-off-by: Mikko Levonmaa +Signed-off-by: Martin Jansa --- - qmake/qmake.pro | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) + qmake/qmake.pro | 1 + + 1 file changed, 1 insertion(+) diff --git a/qmake/qmake.pro b/qmake/qmake.pro -index 0d92ac2..07fa80e 100644 +index 0d92ac2..9be0e9b 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -9,6 +9,7 @@ CONFIG -= qt shared app_bundle uic DEFINES += QT_BUILD_QMAKE QT_BOOTSTRAPPED \ PROEVALUATOR_FULL PROEVALUATOR_DEBUG DESTDIR = ../bin/ -+TARGET = qmake2 ++TARGET = qmake OBJECTS_DIR = . MOC_DIR = . -- -1.7.4.1 +1.8.2.1 diff --git a/recipes-qt/qt5/qtbase/0006-qt_functions-temporary-remove-isEmpty-check.patch b/recipes-qt/qt5/qtbase/0006-qt_functions-temporary-remove-isEmpty-check.patch new file mode 100644 index 0000000000..d1cacd3efe --- /dev/null +++ b/recipes-qt/qt5/qtbase/0006-qt_functions-temporary-remove-isEmpty-check.patch @@ -0,0 +1,46 @@ +From 5856e25a0653313b8f80a5a92a7817fe8eb39dc8 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Wed, 17 Apr 2013 18:06:25 +0200 +Subject: [PATCH 6/6] qt_functions: temporary remove isEmpty check + +* now we assume that every build will provide QT_EXTERNAL_HOST_BINS value + +Signed-off-by: Martin Jansa +--- + mkspecs/features/qt_functions.prf | 6 +++++- + mkspecs/features/qt_tool.prf | 2 +- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf +index e249960..105ba4c 100644 +--- a/mkspecs/features/qt_functions.prf ++++ b/mkspecs/features/qt_functions.prf +@@ -195,7 +195,11 @@ defineTest(qtPrepareTool) { + $$1 = $$eval(QT_TOOL.$${2}.command) + isEmpty($$1) { + $$1 = $$[QT_EXTERNAL_HOST_BINS]/$$2 +- isEmpty($$[QT_EXTERNAL_HOST_BINS]) { ++ # for some reason isEmpty does not work here, FIXME before submitting upstream ++ # DEBUG 1: mkspecs/features/qt_functions.prf:198: calling built-in isEmpty(/OE/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/qt5) ++ # DEBUG 1: mkspecs/features/qt_functions.prf:198: test function returned true ++ # DEBUG 1: mkspecs/features/qt_functions.prf:198: taking 'then' branch ++ !exists($$[QT_EXTERNAL_HOST_BINS]/$$2) { + $$1 = $$[QT_HOST_BINS/get]/$$2 + } + contains(QMAKE_HOST.os, Windows):!contains($$1, .*\\.(exe|bat)$) { +diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf +index 5518933..b0e4f28 100644 +--- a/mkspecs/features/qt_tool.prf ++++ b/mkspecs/features/qt_tool.prf +@@ -31,7 +31,7 @@ load(qt_targets) + + # If we are doing a prefix build, create a "module" pri which enables + # qtPrepareTool() to work with the non-installed build. +-!build_pass:!exists($$[QT_INSTALL_PREFIX]/.qmake.cache):isEmpty($$[QT_EXTERNAL_HOST_BINS]) { ++!build_pass:!exists($$[QT_INSTALL_PREFIX]/.qmake.cache):!exists($$[QT_EXTERNAL_HOST_BINS]) { + + isEmpty(MODULE):MODULE = $$TARGET + +-- +1.8.2.1 + diff --git a/recipes-qt/qt5/qtbase/qmake.conf b/recipes-qt/qt5/qtbase/qmake.conf deleted file mode 100644 index 42966fe55e..0000000000 --- a/recipes-qt/qt5/qtbase/qmake.conf +++ /dev/null @@ -1,39 +0,0 @@ -# -# 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_ (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) -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) - -load(qt_config)