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) | |
download | meta-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.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 @@ | |||
1 | QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_DATADIR_NATIVE}/${QT_DIR_NAME}/mkspecs" | 1 | # This is useful for target recipes to reference native mkspecs |
2 | OE_QMAKE_PLATFORM_NATIVE = "${BUILD_OS}-oe-g++" | 2 | QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/${QT_DIR_NAME}" |
3 | 3 | ||
4 | QMAKE_MKSPEC_PATH = "${STAGING_DATADIR}/${QT_DIR_NAME}/mkspecs" | 4 | QMAKE_MKSPEC_PATH = "${STAGING_DATADIR}/${QT_DIR_NAME}" |
5 | OE_QMAKE_PLATFORM = "${TARGET_OS}-oe-g++" | 5 | QMAKE_MKSPEC_PATH_class-native = "${QMAKE_MKSPEC_PATH_NATIVE}" |
6 | |||
7 | # hardcode linux, because that's what 0001-Add-linux-oe-g-platform.patch adds | ||
8 | OE_QMAKE_PLATFORM_NATIVE = "linux-oe-g++" | ||
9 | OE_QMAKE_PLATFORM = "linux-oe-g++" | ||
6 | 10 | ||
7 | EXTRA_OEMAKE = " MAKEFLAGS='${PARALLEL_MAKE}'" | 11 | EXTRA_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 | ||
16 | export OE_QMAKESPEC = "${QMAKE_MKSPEC_PATH_NATIVE}/${OE_QMAKE_PLATFORM_NATIVE}" | 20 | export OE_QMAKESPEC = "${QMAKE_MKSPEC_PATH_NATIVE}/mkspecs/${OE_QMAKE_PLATFORM_NATIVE}" |
17 | export OE_XQMAKESPEC = "${QMAKE_MKSPEC_PATH}/${OE_QMAKE_PLATFORM}" | 21 | export OE_XQMAKESPEC = "${QMAKE_MKSPEC_PATH}/mkspecs/${OE_QMAKE_PLATFORM}" |
18 | export OE_QMAKE_QMAKE = "${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}/qmake" | 22 | export OE_QMAKE_QMAKE = "${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}/qmake" |
19 | export OE_QMAKE_COMPILER = "${CC}" | 23 | export OE_QMAKE_COMPILER = "${CC}" |
20 | export OE_QMAKE_CC = "${CC}" | 24 | export OE_QMAKE_CC = "${CC}" |
21 | export OE_QMAKE_CFLAGS = "${CFLAGS}" | 25 | export OE_QMAKE_CFLAGS = "${CFLAGS}" |
22 | export OE_QMAKE_CXX = "${CXX}" | 26 | export OE_QMAKE_CXX = "${CXX}" |
27 | export OE_QMAKE_CXXFLAGS = "${CXXFLAGS}" | ||
28 | export OE_QMAKE_LINK = "${CXX}" | ||
23 | export OE_QMAKE_LDFLAGS = "${LDFLAGS}" | 29 | export OE_QMAKE_LDFLAGS = "${LDFLAGS}" |
24 | export OE_QMAKE_AR = "${AR} cqs" | 30 | export OE_QMAKE_AR = "${AR}" |
25 | export OE_QMAKE_STRIP = "echo" | 31 | export OE_QMAKE_STRIP = "echo" |
26 | export QT_CONF_PATH = "${WORKDIR}/qt.conf" | 32 | export QT_CONF_PATH = "${WORKDIR}/qt.conf" |
27 | export QT_DIR_NAME ?= "qt5" | 33 | export QT_DIR_NAME ?= "qt5" |
@@ -32,17 +38,50 @@ STRIP[unexport] = "1" | |||
32 | do_generate_qt_config_file() { | 38 | do_generate_qt_config_file() { |
33 | cat > ${WORKDIR}/qt.conf <<EOF | 39 | cat > ${WORKDIR}/qt.conf <<EOF |
34 | [Paths] | 40 | [Paths] |
41 | Prefix = ${prefix} | ||
35 | Binaries = ${bindir} | 42 | Binaries = ${bindir} |
36 | Libraries = ${libdir} | 43 | Libraries = ${libdir} |
37 | Prefix = ${prefix} | ||
38 | Headers = ${includedir}/${QT_DIR_NAME} | 44 | Headers = ${includedir}/${QT_DIR_NAME} |
39 | Data = ${datadir}/${QT_DIR_NAME} | 45 | Data = ${datadir}/${QT_DIR_NAME} |
40 | ArchData = ${libdir}/${QT_DIR_NAME} | 46 | ArchData = ${libdir}/${QT_DIR_NAME} |
41 | Documentation = ${docdir}/${QT_DIR_NAME} | 47 | Documentation = ${docdir}/${QT_DIR_NAME} |
42 | HostData = ${STAGING_DATADIR}/${QT_DIR_NAME} | 48 | HostData = ${QMAKE_MKSPEC_PATH} |
43 | HostSpecPath = ${QMAKE_MKSPEC_PATH} | ||
44 | HostBinaries = ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME} | ||
45 | EOF | 49 | EOF |
46 | } | 50 | } |
51 | # ExternalHostBinaries is useful only for target recipes | ||
52 | do_generate_qt_config_file_append_class-target() { | ||
53 | cat >> ${WORKDIR}/qt.conf <<EOF | ||
54 | ExternalHostBinaries = ${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 | ||
58 | EOF | ||
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 | ||
48 | addtask generate_qt_config_file after do_patch before do_configure | 87 | addtask generate_qt_config_file after do_patch before do_configure |