diff options
author | Samuli Piippo <samuli.piippo@qt.io> | 2018-03-02 13:08:39 +0200 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@qt.io> | 2018-03-12 14:12:31 +0000 |
commit | 344c2f97025c6504ec986600498121bb83aaeb8f (patch) | |
tree | 3d7ec602603cb083b7c8e998eddca543ce17e57c /meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass | |
parent | d9985542d7617b43ec7180c7ade0c4f64db82b42 (diff) | |
download | meta-boot2qt-344c2f97025c6504ec986600498121bb83aaeb8f.tar.gz |
Split meta-boot2qt layer
Move distro specific recipes to own layer and leave only new recipes
and bbclasses to meta-boot2qt layer. This makes it easier to include
meta-boot2qt to your own distro layer to get access e.g., QDB and
QBSP recipes that might be useful even without boot2qt distro.
Task-number: QTBUG-65871
Change-Id: I6c353774dd1668b00f2d05aa262ad866b90bdef6
Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io>
Diffstat (limited to 'meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass')
-rw-r--r-- | meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass b/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass new file mode 100644 index 0000000..e98565c --- /dev/null +++ b/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass | |||
@@ -0,0 +1,92 @@ | |||
1 | ############################################################################ | ||
2 | ## | ||
3 | ## Copyright (C) 2016 The Qt Company Ltd. | ||
4 | ## Contact: https://www.qt.io/licensing/ | ||
5 | ## | ||
6 | ## This file is part of the Boot to Qt meta layer. | ||
7 | ## | ||
8 | ## $QT_BEGIN_LICENSE:GPL$ | ||
9 | ## Commercial License Usage | ||
10 | ## Licensees holding valid commercial Qt licenses may use this file in | ||
11 | ## accordance with the commercial license agreement provided with the | ||
12 | ## Software or, alternatively, in accordance with the terms contained in | ||
13 | ## a written agreement between you and The Qt Company. For licensing terms | ||
14 | ## and conditions see https://www.qt.io/terms-conditions. For further | ||
15 | ## information use the contact form at https://www.qt.io/contact-us. | ||
16 | ## | ||
17 | ## GNU General Public License Usage | ||
18 | ## Alternatively, this file may be used under the terms of the GNU | ||
19 | ## General Public License version 3 or (at your option) any later version | ||
20 | ## approved by the KDE Free Qt Foundation. The licenses are as published by | ||
21 | ## the Free Software Foundation and appearing in the file LICENSE.GPL3 | ||
22 | ## included in the packaging of this file. Please review the following | ||
23 | ## information to ensure the GNU General Public License requirements will | ||
24 | ## be met: https://www.gnu.org/licenses/gpl-3.0.html. | ||
25 | ## | ||
26 | ## $QT_END_LICENSE$ | ||
27 | ## | ||
28 | ############################################################################ | ||
29 | |||
30 | inherit populate_b2qt_sdk populate_sdk_qt5_base abi-arch siteinfo | ||
31 | |||
32 | SDK_MKSPEC_DIR = "${SDK_OUTPUT}${SDKTARGETSYSROOT}${libdir}/${QT_DIR_NAME}/mkspecs" | ||
33 | NATIVE_SDK_MKSPEC_DIR = "${SDK_OUTPUT}${SDKPATHNATIVE}${libdir}/${QT_DIR_NAME}/mkspecs" | ||
34 | SDK_MKSPEC = "devices/linux-oe-generic-g++" | ||
35 | SDK_DEVICE_PRI = "${SDK_MKSPEC_DIR}/qdevice.pri" | ||
36 | SDK_DYNAMIC_FLAGS = "-O. -pipe -g" | ||
37 | |||
38 | create_sdk_files_append () { | ||
39 | # Create the toolchain user's generic device mkspec | ||
40 | install -d ${SDK_MKSPEC_DIR}/${SDK_MKSPEC} | ||
41 | cat > ${SDK_MKSPEC_DIR}/${SDK_MKSPEC}/qmake.conf <<EOF | ||
42 | include(../common/linux_device_pre.conf) | ||
43 | exists(../../oe-device-extra.pri):include(../../oe-device-extra.pri) | ||
44 | include(../common/linux_device_post.conf) | ||
45 | load(qt_config) | ||
46 | EOF | ||
47 | |||
48 | cat > ${SDK_MKSPEC_DIR}/${SDK_MKSPEC}/qplatformdefs.h <<EOF | ||
49 | #include "../../linux-g++/qplatformdefs.h" | ||
50 | EOF | ||
51 | |||
52 | # Fill in the qdevice.pri file which will be used by the device mksspec | ||
53 | static_cflags="${TARGET_CFLAGS}" | ||
54 | static_cxxflags="${TARGET_CXXFLAGS}" | ||
55 | for i in ${SDK_DYNAMIC_FLAGS}; do | ||
56 | static_cflags=$(echo $static_cflags | sed -e "s/$i //") | ||
57 | static_cxxflags=$(echo $static_cxxflags | sed -e "s/$i //") | ||
58 | done | ||
59 | echo "MACHINE = ${MACHINE}" > ${SDK_DEVICE_PRI} | ||
60 | echo "CROSS_COMPILE = \$\$[QT_HOST_PREFIX]${bindir_nativesdk}/${TARGET_SYS}/${TARGET_PREFIX}" >> ${SDK_DEVICE_PRI} | ||
61 | echo "QMAKE_CFLAGS *= ${TARGET_CC_ARCH} ${static_cflags}" >> ${SDK_DEVICE_PRI} | ||
62 | echo "QMAKE_CXXFLAGS *= ${TARGET_CC_ARCH} ${static_cxxflags}" >> ${SDK_DEVICE_PRI} | ||
63 | echo "QMAKE_LFLAGS *= ${TARGET_CC_ARCH} ${TARGET_LDFLAGS}" >> ${SDK_DEVICE_PRI} | ||
64 | |||
65 | # Setup qt.conf to point at the device mkspec by default | ||
66 | qtconf=${SDK_OUTPUT}/${SDKPATHNATIVE}${OE_QMAKE_PATH_HOST_BINS}/qt.conf | ||
67 | echo 'HostSpec = linux-g++' >> $qtconf | ||
68 | echo 'TargetSpec = devices/linux-oe-generic-g++' >> $qtconf | ||
69 | |||
70 | # Update correct host_build ARCH and ABI to mkspecs/qconfig.pri | ||
71 | QT_ARCH=$(grep QT_ARCH ${NATIVE_SDK_MKSPEC_DIR}/qconfig.pri | tail -1) | ||
72 | QT_BUILDABI=$(grep QT_BUILDABI ${NATIVE_SDK_MKSPEC_DIR}/qconfig.pri | tail -1) | ||
73 | |||
74 | sed -e "0,/QT_ARCH/s/^.*QT_ARCH.*/$QT_ARCH/" \ | ||
75 | -e "0,/QT_BUILDABI/s/^.*QT_BUILDABI.*/$QT_BUILDABI/" \ | ||
76 | -i ${SDK_MKSPEC_DIR}/qconfig.pri | ||
77 | |||
78 | create_qtcreator_configure_script | ||
79 | |||
80 | # Link /etc/resolv.conf is broken in the toolchain sysroot, remove it | ||
81 | rm -f ${SDK_OUTPUT}${SDKTARGETSYSROOT}${sysconfdir}/resolv.conf | ||
82 | } | ||
83 | |||
84 | create_qtcreator_configure_script () { | ||
85 | # add qtcreator configuration script | ||
86 | install -m 0755 ${B2QTBASE}/files/configure-qtcreator.sh ${SDK_OUTPUT}/${SDKPATH} | ||
87 | sed -i -e '/^CONFIG=/c\CONFIG="${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}"' ${SDK_OUTPUT}/${SDKPATH}/configure-qtcreator.sh | ||
88 | sed -i -e '/^ABI=/c\ABI="${ABI}-linux-generic-elf-${SITEINFO_BITS}bit"' ${SDK_OUTPUT}/${SDKPATH}/configure-qtcreator.sh | ||
89 | } | ||
90 | |||
91 | create_qtcreator_configure_script_mingw32 () { | ||
92 | } | ||