summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2013-04-03 14:13:27 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2013-04-26 00:04:56 +0200
commitfe65aed3393cf32efe6158c615e72aea407a4bc6 (patch)
treea51b0d621ad910b499a1ea5d84e349c8cbf3e4b7 /classes
parent97738e9d62b613ea46cf8c5edb6accdff0d0b19a (diff)
downloadmeta-qt5-fe65aed3393cf32efe6158c615e72aea407a4bc6.tar.gz
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.bbclass61
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 @@
1QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_DATADIR_NATIVE}/${QT_DIR_NAME}/mkspecs" 1# This is useful for target recipes to reference native mkspecs
2OE_QMAKE_PLATFORM_NATIVE = "${BUILD_OS}-oe-g++" 2QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/${QT_DIR_NAME}"
3 3
4QMAKE_MKSPEC_PATH = "${STAGING_DATADIR}/${QT_DIR_NAME}/mkspecs" 4QMAKE_MKSPEC_PATH = "${STAGING_DATADIR}/${QT_DIR_NAME}"
5OE_QMAKE_PLATFORM = "${TARGET_OS}-oe-g++" 5QMAKE_MKSPEC_PATH_class-native = "${QMAKE_MKSPEC_PATH_NATIVE}"
6
7# hardcode linux, because that's what 0001-Add-linux-oe-g-platform.patch adds
8OE_QMAKE_PLATFORM_NATIVE = "linux-oe-g++"
9OE_QMAKE_PLATFORM = "linux-oe-g++"
6 10
7EXTRA_OEMAKE = " MAKEFLAGS='${PARALLEL_MAKE}'" 11EXTRA_OEMAKE = " MAKEFLAGS='${PARALLEL_MAKE}'"
8 12
@@ -13,15 +17,17 @@ EXTRA_ENV = 'QMAKE="${OE_QMAKE_QMAKE} -d -after \
13 STRIP="${OE_QMAKE_STRIP}" \ 17 STRIP="${OE_QMAKE_STRIP}" \
14 MAKE="make -e ${PARALLEL_MAKE}"' 18 MAKE="make -e ${PARALLEL_MAKE}"'
15 19
16export OE_QMAKESPEC = "${QMAKE_MKSPEC_PATH_NATIVE}/${OE_QMAKE_PLATFORM_NATIVE}" 20export OE_QMAKESPEC = "${QMAKE_MKSPEC_PATH_NATIVE}/mkspecs/${OE_QMAKE_PLATFORM_NATIVE}"
17export OE_XQMAKESPEC = "${QMAKE_MKSPEC_PATH}/${OE_QMAKE_PLATFORM}" 21export OE_XQMAKESPEC = "${QMAKE_MKSPEC_PATH}/mkspecs/${OE_QMAKE_PLATFORM}"
18export OE_QMAKE_QMAKE = "${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}/qmake" 22export OE_QMAKE_QMAKE = "${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}/qmake"
19export OE_QMAKE_COMPILER = "${CC}" 23export OE_QMAKE_COMPILER = "${CC}"
20export OE_QMAKE_CC = "${CC}" 24export OE_QMAKE_CC = "${CC}"
21export OE_QMAKE_CFLAGS = "${CFLAGS}" 25export OE_QMAKE_CFLAGS = "${CFLAGS}"
22export OE_QMAKE_CXX = "${CXX}" 26export OE_QMAKE_CXX = "${CXX}"
27export OE_QMAKE_CXXFLAGS = "${CXXFLAGS}"
28export OE_QMAKE_LINK = "${CXX}"
23export OE_QMAKE_LDFLAGS = "${LDFLAGS}" 29export OE_QMAKE_LDFLAGS = "${LDFLAGS}"
24export OE_QMAKE_AR = "${AR} cqs" 30export OE_QMAKE_AR = "${AR}"
25export OE_QMAKE_STRIP = "echo" 31export OE_QMAKE_STRIP = "echo"
26export QT_CONF_PATH = "${WORKDIR}/qt.conf" 32export QT_CONF_PATH = "${WORKDIR}/qt.conf"
27export QT_DIR_NAME ?= "qt5" 33export QT_DIR_NAME ?= "qt5"
@@ -32,17 +38,50 @@ STRIP[unexport] = "1"
32do_generate_qt_config_file() { 38do_generate_qt_config_file() {
33 cat > ${WORKDIR}/qt.conf <<EOF 39 cat > ${WORKDIR}/qt.conf <<EOF
34[Paths] 40[Paths]
41Prefix = ${prefix}
35Binaries = ${bindir} 42Binaries = ${bindir}
36Libraries = ${libdir} 43Libraries = ${libdir}
37Prefix = ${prefix}
38Headers = ${includedir}/${QT_DIR_NAME} 44Headers = ${includedir}/${QT_DIR_NAME}
39Data = ${datadir}/${QT_DIR_NAME} 45Data = ${datadir}/${QT_DIR_NAME}
40ArchData = ${libdir}/${QT_DIR_NAME} 46ArchData = ${libdir}/${QT_DIR_NAME}
41Documentation = ${docdir}/${QT_DIR_NAME} 47Documentation = ${docdir}/${QT_DIR_NAME}
42HostData = ${STAGING_DATADIR}/${QT_DIR_NAME} 48HostData = ${QMAKE_MKSPEC_PATH}
43HostSpecPath = ${QMAKE_MKSPEC_PATH}
44HostBinaries = ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}
45EOF 49EOF
46} 50}
51# ExternalHostBinaries is useful only for target recipes
52do_generate_qt_config_file_append_class-target() {
53 cat >> ${WORKDIR}/qt.conf <<EOF
54ExternalHostBinaries = ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}
55# This doesn't work in 5.0.1 (HostData is used in some cases)
56#HostSpec = ${QMAKE_MKSPEC_PATH_NATIVE}/mkspecs
57#TargetSpec = ${QMAKE_MKSPEC_PATH}/mkspecs
58EOF
59}
60
61# Allows to override following values (as in version 5.0.1)
62# Prefix The default prefix for all paths.
63# Documentation The location for documentation upon install.
64# Headers The location for all headers.
65# Libraries The location of installed libraries.
66# LibraryExecutables The location of installed executables required by libraries at runtime.
67# Binaries The location of installed Qt binaries (tools and applications).
68# Plugins The location of installed Qt plugins.
69# Imports The location of installed QML extensions to import (QML 1.x).
70# Qml2Imports The location of installed QML extensions to import (QML 2.x).
71# ArchData The location of general architecture-dependent Qt data.
72# Data The location of general architecture-independent Qt data.
73# Translations The location of translation information for Qt strings.
74# Examples The location for examples upon install.
75# Tests The location of installed Qt testcases.
76# Settings The location for Qt settings. Not applicable on Windows.
77
78# For bootstrapped
79# Sysroot The location of target sysroot
80# HostPrefix The prefix for host tools when cross compiling (building tools for both systems)
81# HostBinaries The location where to install host tools
82# HostData The location where to install host data
83# ExternalHostBinaries The location where we already have host tools (when cross compiling, but reusing existing tools)
84# TargetSpec The location where to install target mkspec
85# HostSpec The location where to install host mkspec
47 86
48addtask generate_qt_config_file after do_patch before do_configure 87addtask generate_qt_config_file after do_patch before do_configure