From 95fc94d91fca50d35f4458dce89cbd6a0248bf50 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Tue, 19 Apr 2016 17:02:33 +0300 Subject: Make ABI selection more robust in configure-qtcreator.sh Map current TARGET_ARCH to the ABI used by qtcreator. Currently mapping was done by kernel-arch.bbclass and it worked by accident, but it's now broken in jethro. Change-Id: I15c5b60a1bc1dd560685fedac9b61048a1e89266 Reviewed-by: Risto Avila Reviewed-by: Teemu Holappa --- classes/abi-arch.bbclass | 41 +++++++++++++++++++++++++++++++++++ classes/populate_b2qt_qt5_sdk.bbclass | 4 ++-- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 classes/abi-arch.bbclass diff --git a/classes/abi-arch.bbclass b/classes/abi-arch.bbclass new file mode 100644 index 0000000..826fed4 --- /dev/null +++ b/classes/abi-arch.bbclass @@ -0,0 +1,41 @@ +############################################################################## +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: http://www.qt.io/licensing/ +## +## This file is part of the Boot to Qt meta layer. +## +## $QT_BEGIN_LICENSE:COMM$ +## +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see http://www.qt.io/terms-conditions. For further +## information use the contact form at http://www.qt.io/contact-us. +## +## $QT_END_LICENSE$ +## +############################################################################## + +# map target architecture to abi architectures used by Qt Creator +valid_archs = "arm x86 itanium mips ppc sh" + +def map_abi_arch(a, d): + import re + + valid_archs = d.getVar('valid_archs', True).split() + + if re.match('i.86$', a): return 'x86' + elif re.match('x86.64$', a): return 'x86' + elif re.match('armeb$', a): return 'arm' + elif re.match('aarch64', a): return 'arm' + elif re.match('mips(el|64|64el)$', a): return 'mips' + elif re.match('p(pc|owerpc)(|64)', a): return 'ppc' + elif re.match('sh(3|4)$', a): return 'sh' + elif a in valid_archs: return a + else: + bb.error("cannot map '%s' to a abi architecture" % a) + +ABI = "${@map_abi_arch(d.getVar('TARGET_ARCH', True), d)}" diff --git a/classes/populate_b2qt_qt5_sdk.bbclass b/classes/populate_b2qt_qt5_sdk.bbclass index d6b2b10..ae88685 100644 --- a/classes/populate_b2qt_qt5_sdk.bbclass +++ b/classes/populate_b2qt_qt5_sdk.bbclass @@ -19,7 +19,7 @@ ## ############################################################################## -inherit populate_b2qt_sdk populate_sdk_qt5_base +inherit populate_b2qt_sdk populate_sdk_qt5_base abi-arch siteinfo SDK_MKSPEC_DIR = "${SDK_OUTPUT}${SDKTARGETSYSROOT}${libdir}/${QT_DIR_NAME}/mkspecs" SDK_MKSPEC = "devices/linux-oe-generic-g++" @@ -65,7 +65,7 @@ create_qtcreator_configure_script () { # add qtcreator configuration script install -m 0755 ${B2QTBASE}/scripts/configure-qtcreator.sh ${SDK_OUTPUT}/${SDKPATH} sed -i -e '/^CONFIG=/c\CONFIG="${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}"' ${SDK_OUTPUT}/${SDKPATH}/configure-qtcreator.sh - sed -i -e '/^ABI=/c\ABI="${ARCH}-linux-generic-elf-${SITEINFO_BITS}bit"' ${SDK_OUTPUT}/${SDKPATH}/configure-qtcreator.sh + sed -i -e '/^ABI=/c\ABI="${ABI}-linux-generic-elf-${SITEINFO_BITS}bit"' ${SDK_OUTPUT}/${SDKPATH}/configure-qtcreator.sh } create_qtcreator_configure_script_mingw32 () { -- cgit v1.2.3-54-g00ecf