diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2013-04-03 14:13:27 +0200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2013-04-26 00:04:56 +0200 |
commit | fe65aed3393cf32efe6158c615e72aea407a4bc6 (patch) | |
tree | a51b0d621ad910b499a1ea5d84e349c8cbf3e4b7 /classes | |
parent | 97738e9d62b613ea46cf8c5edb6accdff0d0b19a (diff) |
qtbase: improve internal build system to support OE way of building qt
* add linux-oe-g++ mkspec directly with patch
* add functions to read and eval OE_QMAKE functions from mkspec and
also export them with QMakeVar to be available also for config.tests
* add external-host-bindir parameter to skip building native tools
even when we're in fact cross-compiling (because we have them from
qtbase-native build already).
* use separated ${B} and ${S} and clean ${B} when reconfiguring
stalled qmake cache can be used when configure is reexecuted
cleaning ${B} prevents that and provide cleaner separation
* OE_QMAKE_AR cqs is added by Makefile, having it here too was causing
issues
* isEmpty(QT_EXTERNAL_HOST_BINS) doesn't work, so lets use exist()
even when it allows to incorrectly set wrong directory and build
native tools again (instead of skipping them)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'classes')
-rw-r--r-- | classes/qmake5_base.bbclass | 61 |
1 files changed, 50 insertions, 11 deletions
diff --git a/classes/qmake5_base.bbclass b/classes/qmake5_base.bbclass index 92b3317f..3e757ab4 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 <<EOF [Paths] +Prefix = ${prefix} Binaries = ${bindir} Libraries = ${libdir} -Prefix = ${prefix} Headers = ${includedir}/${QT_DIR_NAME} Data = ${datadir}/${QT_DIR_NAME} ArchData = ${libdir}/${QT_DIR_NAME} Documentation = ${docdir}/${QT_DIR_NAME} -HostData = ${STAGING_DATADIR}/${QT_DIR_NAME} -HostSpecPath = ${QMAKE_MKSPEC_PATH} -HostBinaries = ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME} +HostData = ${QMAKE_MKSPEC_PATH} EOF } +# ExternalHostBinaries is useful only for target recipes +do_generate_qt_config_file_append_class-target() { + cat >> ${WORKDIR}/qt.conf <<EOF +ExternalHostBinaries = ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME} +# This doesn't work in 5.0.1 (HostData is used in some cases) +#HostSpec = ${QMAKE_MKSPEC_PATH_NATIVE}/mkspecs +#TargetSpec = ${QMAKE_MKSPEC_PATH}/mkspecs +EOF +} + +# Allows to override following values (as in version 5.0.1) +# Prefix The default prefix for all paths. +# Documentation The location for documentation upon install. +# Headers The location for all headers. +# Libraries The location of installed libraries. +# LibraryExecutables The location of installed executables required by libraries at runtime. +# Binaries The location of installed Qt binaries (tools and applications). +# Plugins The location of installed Qt plugins. +# Imports The location of installed QML extensions to import (QML 1.x). +# Qml2Imports The location of installed QML extensions to import (QML 2.x). +# ArchData The location of general architecture-dependent Qt data. +# Data The location of general architecture-independent Qt data. +# Translations The location of translation information for Qt strings. +# Examples The location for examples upon install. +# Tests The location of installed Qt testcases. +# Settings The location for Qt settings. Not applicable on Windows. + +# For bootstrapped +# Sysroot The location of target sysroot +# HostPrefix The prefix for host tools when cross compiling (building tools for both systems) +# HostBinaries The location where to install host tools +# HostData The location where to install host data +# ExternalHostBinaries The location where we already have host tools (when cross compiling, but reusing existing tools) +# TargetSpec The location where to install target mkspec +# HostSpec The location where to install host mkspec addtask generate_qt_config_file after do_patch before do_configure |