diff options
| author | Samuli Piippo <samuli.piippo@theqtcompany.com> | 2016-01-26 14:31:26 +0200 |
|---|---|---|
| committer | Samuli Piippo <samuli.piippo@theqtcompany.com> | 2016-02-01 11:41:11 +0000 |
| commit | 6f87a493623e7ef70bd43f2eac235c36a455c5e5 (patch) | |
| tree | 1549a1864d729f52d31ede77df6cc3b4c76bdd31 /classes | |
| parent | 4cee85ecd6cf356f9cef28cf042065204ad5baff (diff) | |
| download | meta-boot2qt-6f87a493623e7ef70bd43f2eac235c36a455c5e5.tar.gz | |
Move qt5 sdk creation bits to new bbclass
Change-Id: I6d00c21fa04e77db60c7c48ad6ba10eacad00b42
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Teemu Holappa <teemu.holappa@theqtcompany.com>
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/populate_b2qt_qt5_sdk.bbclass | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/classes/populate_b2qt_qt5_sdk.bbclass b/classes/populate_b2qt_qt5_sdk.bbclass new file mode 100644 index 0000000..78ad457 --- /dev/null +++ b/classes/populate_b2qt_qt5_sdk.bbclass | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | ############################################################################# | ||
| 2 | ## | ||
| 3 | ## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). | ||
| 4 | ## | ||
| 5 | ## This file is part of the Qt Enterprise Embedded Scripts of the Qt | ||
| 6 | ## framework. | ||
| 7 | ## | ||
| 8 | ## $QT_BEGIN_LICENSE$ | ||
| 9 | ## Commercial License Usage Only | ||
| 10 | ## Licensees holding valid commercial Qt license agreements with Digia | ||
| 11 | ## with an appropriate addendum covering the Qt Enterprise Embedded Scripts, | ||
| 12 | ## may use this file in accordance with the terms contained in said license | ||
| 13 | ## agreement. | ||
| 14 | ## | ||
| 15 | ## For further information use the contact form at | ||
| 16 | ## http://www.qt.io/contact-us. | ||
| 17 | ## | ||
| 18 | ## | ||
| 19 | ## $QT_END_LICENSE$ | ||
| 20 | ## | ||
| 21 | ############################################################################# | ||
| 22 | |||
| 23 | inherit populate_b2qt_sdk populate_sdk_qt5_base | ||
| 24 | |||
| 25 | SDK_MKSPEC_DIR = "${SDK_OUTPUT}${SDKTARGETSYSROOT}${libdir}/${QT_DIR_NAME}/mkspecs" | ||
| 26 | SDK_MKSPEC = "devices/linux-oe-generic-g++" | ||
| 27 | SDK_DEVICE_PRI = "${SDK_MKSPEC_DIR}/qdevice.pri" | ||
| 28 | SDK_DYNAMIC_FLAGS = "-O. -pipe -g" | ||
| 29 | |||
| 30 | create_sdk_files_append () { | ||
| 31 | # Create the toolchain user's generic device mkspec | ||
| 32 | install -d ${SDK_MKSPEC_DIR}/${SDK_MKSPEC} | ||
| 33 | cat > ${SDK_MKSPEC_DIR}/${SDK_MKSPEC}/qmake.conf <<EOF | ||
| 34 | include(../common/linux_device_pre.conf) | ||
| 35 | exists(../../oe-device-extra.pri):include(../../oe-device-extra.pri) | ||
| 36 | include(../common/linux_device_post.conf) | ||
| 37 | load(qt_config) | ||
| 38 | EOF | ||
| 39 | |||
| 40 | cat > ${SDK_MKSPEC_DIR}/${SDK_MKSPEC}/qplatformdefs.h <<EOF | ||
| 41 | #include "../../linux-g++/qplatformdefs.h" | ||
| 42 | EOF | ||
| 43 | |||
| 44 | # Fill in the qdevice.pri file which will be used by the device mksspec | ||
| 45 | static_cflags="${TARGET_CFLAGS}" | ||
| 46 | static_cxxflags="${TARGET_CXXFLAGS}" | ||
| 47 | for i in ${SDK_DYNAMIC_FLAGS}; do | ||
| 48 | static_cflags=$(echo $static_cflags | sed -e "s/$i //") | ||
| 49 | static_cxxflags=$(echo $static_cxxflags | sed -e "s/$i //") | ||
| 50 | done | ||
| 51 | echo "MACHINE = ${MACHINE}" > ${SDK_DEVICE_PRI} | ||
| 52 | echo "CROSS_COMPILE = \$\$[QT_HOST_PREFIX]${bindir_nativesdk}/${TARGET_SYS}/${TARGET_PREFIX}" >> ${SDK_DEVICE_PRI} | ||
| 53 | echo "QMAKE_CFLAGS *= ${TARGET_CC_ARCH} --sysroot=\$\$[QT_SYSROOT] ${static_cflags}" >> ${SDK_DEVICE_PRI} | ||
| 54 | echo "QMAKE_CXXFLAGS *= ${TARGET_CC_ARCH} --sysroot=\$\$[QT_SYSROOT] ${static_cxxflags}" >> ${SDK_DEVICE_PRI} | ||
| 55 | echo "QMAKE_LFLAGS *= ${TARGET_CC_ARCH} --sysroot=\$\$[QT_SYSROOT] ${TARGET_LDFLAGS}" >> ${SDK_DEVICE_PRI} | ||
| 56 | |||
| 57 | # Setup qt.conf to point at the device mkspec by default | ||
| 58 | qtconf=${SDK_OUTPUT}/${SDKPATHNATIVE}${OE_QMAKE_PATH_HOST_BINS}/qt.conf | ||
| 59 | echo 'HostSpec = linux-g++' >> $qtconf | ||
| 60 | echo 'TargetSpec = devices/linux-oe-generic-g++' >> $qtconf | ||
| 61 | } | ||
