summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2018-03-02 13:08:39 +0200
committerSamuli Piippo <samuli.piippo@qt.io>2018-03-12 14:12:31 +0000
commit344c2f97025c6504ec986600498121bb83aaeb8f (patch)
tree3d7ec602603cb083b7c8e998eddca543ce17e57c /scripts
parentd9985542d7617b43ec7180c7ade0c4f64db82b42 (diff)
downloadmeta-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 'scripts')
-rwxr-xr-xscripts/configure-qtcreator.sh173
-rwxr-xr-xscripts/setup-environment.sh4
2 files changed, 2 insertions, 175 deletions
diff --git a/scripts/configure-qtcreator.sh b/scripts/configure-qtcreator.sh
deleted file mode 100755
index 7386f70..0000000
--- a/scripts/configure-qtcreator.sh
+++ /dev/null
@@ -1,173 +0,0 @@
1#!/bin/bash
2############################################################################
3##
4## Copyright (C) 2016 The Qt Company Ltd.
5## Contact: https://www.qt.io/licensing/
6##
7## This file is part of the Boot to Qt meta layer.
8##
9## $QT_BEGIN_LICENSE:GPL$
10## Commercial License Usage
11## Licensees holding valid commercial Qt licenses may use this file in
12## accordance with the commercial license agreement provided with the
13## Software or, alternatively, in accordance with the terms contained in
14## a written agreement between you and The Qt Company. For licensing terms
15## and conditions see https://www.qt.io/terms-conditions. For further
16## information use the contact form at https://www.qt.io/contact-us.
17##
18## GNU General Public License Usage
19## Alternatively, this file may be used under the terms of the GNU
20## General Public License version 3 or (at your option) any later version
21## approved by the KDE Free Qt Foundation. The licenses are as published by
22## the Free Software Foundation and appearing in the file LICENSE.GPL3
23## included in the packaging of this file. Please review the following
24## information to ensure the GNU General Public License requirements will
25## be met: https://www.gnu.org/licenses/gpl-3.0.html.
26##
27## $QT_END_LICENSE$
28##
29############################################################################
30
31set -e
32
33ABI="arm-linux-generic-elf-32bit"
34CONFIG=""
35
36printUsage ()
37{
38 echo "Usage: $0 --config <environment-setup-file> [--remove] [--qtcreator <path>] [--name <basename>] [--appman]"
39}
40
41while test -n "$1"; do
42 case "$1" in
43 "--remove")
44 REMOVEONLY=1
45 ;;
46 "--appman")
47 APPMAN=1
48 ;;
49 "--qtcreator")
50 shift
51 QTCREATOR=$1
52 ;;
53 "--config")
54 shift
55 CONFIG=$1
56 ;;
57 "--name")
58 shift
59 NAME=$1
60 ;;
61 *)
62 printUsage
63 exit 0
64 ;;
65 esac
66 shift
67done
68
69if [ ! -f "$CONFIG" ]; then
70 printUsage
71 exit 1
72fi
73
74if [ -z "${QTCREATOR}" ]; then
75 SDKTOOL="${HOME}/Qt/Tools/QtCreator/libexec/qtcreator/sdktool"
76else
77 SDKTOOL="${QTCREATOR}/libexec/qtcreator/sdktool"
78fi
79if [ ! -x ${SDKTOOL} ]; then
80 echo "Cannot find 'sdktool' from QtCreator"
81 printUsage
82 exit 1
83fi
84
85source $CONFIG
86
87MKSPEC="devices/linux-oe-generic-g++"
88MKSPECPATH=$(find ${OECORE_TARGET_SYSROOT} -name $(basename ${MKSPEC}) 2>/dev/null || true)
89if [ ! -d "${MKSPECPATH}" ]; then
90 echo "Error: could not find mkspec ${MKSPEC} from the toolchain"
91 exit 1
92fi
93
94MACHINE=$(grep '^MACHINE' ${MKSPECPATH}/../../qdevice.pri | cut -d'=' -f2 | tr -d ' ')
95
96RELEASE=$(qmake -query QT_VERSION)
97
98NAME=${NAME:-"Custom Qt ${RELEASE} ${MACHINE}"}
99BASEID="byos.${RELEASE}.${MACHINE}"
100
101${SDKTOOL} rmKit --id ${BASEID}.kit 2>/dev/null || true
102${SDKTOOL} rmKit --id ${BASEID}.am.kit 2>/dev/null || true
103${SDKTOOL} rmQt --id ${BASEID}.qt || true
104${SDKTOOL} rmQt --id ${BASEID}.am.qt || true
105${SDKTOOL} rmTC --id ProjectExplorer.ToolChain.Gcc:${BASEID}.gcc || true
106${SDKTOOL} rmTC --id ProjectExplorer.ToolChain.Gcc:${BASEID}.g++ || true
107${SDKTOOL} rmDebugger --id ${BASEID}.gdb 2>/dev/null || true
108
109if [ -n "${REMOVEONLY}" ]; then
110 echo "Kit removed: ${NAME}"
111 exit 0
112fi
113
114${SDKTOOL} addTC \
115 --id "ProjectExplorer.ToolChain.Gcc:${BASEID}.gcc" \
116 --name "GCC (${NAME})" \
117 --path "$(type -p ${CC})" \
118 --abi "${ABI}" \
119 --language 1
120
121${SDKTOOL} addTC \
122 --id "ProjectExplorer.ToolChain.Gcc:${BASEID}.g++" \
123 --name "G++ (${NAME})" \
124 --path "$(type -p ${CXX})" \
125 --abi "${ABI}" \
126 --language 2
127
128${SDKTOOL} addDebugger \
129 --id "${BASEID}.gdb" \
130 --name "GDB (${NAME})" \
131 --engine 1 \
132 --binary "$(type -p ${GDB})" \
133 --abis "${ABI}"
134
135${SDKTOOL} addQt \
136 --id "${BASEID}.qt" \
137 --name "${NAME}" \
138 --type "Qdb.EmbeddedLinuxQt" \
139 --qmake "$(type -p qmake)"
140
141${SDKTOOL} addKit \
142 --id "${BASEID}.kit" \
143 --name "${NAME}" \
144 --qt "${BASEID}.qt" \
145 --debuggerid "${BASEID}.gdb" \
146 --sysroot "${SDKTARGETSYSROOT}" \
147 --devicetype "QdbLinuxOsType" \
148 --Ctoolchain "ProjectExplorer.ToolChain.Gcc:${BASEID}.gcc" \
149 --Cxxtoolchain "ProjectExplorer.ToolChain.Gcc:${BASEID}.g++" \
150 --icon ":/boot2qt/images/B2Qt_QtC_icon.png" \
151 --mkspec "${MKSPEC}"
152
153if [ -n "${APPMAN}" ]; then
154 ${SDKTOOL} addQt \
155 --id "${BASEID}.am.qt" \
156 --name "${NAME} [Application Manager]" \
157 --type "AM.Qt" \
158 --qmake "$(type -p qmake)"
159
160 ${SDKTOOL} addKit \
161 --id "${BASEID}.am.kit" \
162 --name "${NAME} [Application Manager]" \
163 --qt "${BASEID}.am.qt" \
164 --debuggerid "${BASEID}.gdb" \
165 --sysroot "${SDKTARGETSYSROOT}" \
166 --devicetype "AM.Device.Type" \
167 --Ctoolchain "ProjectExplorer.ToolChain.Gcc:${BASEID}.gcc" \
168 --Cxxtoolchain "ProjectExplorer.ToolChain.Gcc:${BASEID}.g++" \
169 --icon ":/boot2qt/images/B2Qt_QtC_icon.png" \
170 --mkspec "${MKSPEC}"
171fi
172
173echo "Configured Qt Creator with new kit: ${NAME}"
diff --git a/scripts/setup-environment.sh b/scripts/setup-environment.sh
index 1fa2014..f948ba0 100755
--- a/scripts/setup-environment.sh
+++ b/scripts/setup-environment.sh
@@ -96,14 +96,14 @@ if [ ! -f ${PWD}/${BUILDDIRECTORY}/conf/bblayers.conf ]; then
96 esac 96 esac
97 97
98 mkdir -p ${PWD}/${BUILDDIRECTORY}/conf 98 mkdir -p ${PWD}/${BUILDDIRECTORY}/conf
99 cp ${PWD}/sources/meta-boot2qt/conf/${LAYERSCONF} ${PWD}/${BUILDDIRECTORY}/conf/bblayers.conf 99 cp ${PWD}/sources/meta-boot2qt/meta-boot2qt-distro/conf/${LAYERSCONF} ${PWD}/${BUILDDIRECTORY}/conf/bblayers.conf
100 100
101 if [ ! -d ${PWD}/sources/meta-boot2qt/.git ]; then 101 if [ ! -d ${PWD}/sources/meta-boot2qt/.git ]; then
102 QT_SDK_PATH=$(readlink -f ${PWD}/sources/meta-boot2qt/../../../../) 102 QT_SDK_PATH=$(readlink -f ${PWD}/sources/meta-boot2qt/../../../../)
103 fi 103 fi
104fi 104fi
105 105
106export TEMPLATECONF="${PWD}/sources/meta-boot2qt/conf" 106export TEMPLATECONF="${PWD}/sources/meta-boot2qt/meta-boot2qt-distro/conf"
107. sources/poky/oe-init-build-env ${BUILDDIRECTORY} 107. sources/poky/oe-init-build-env ${BUILDDIRECTORY}
108 108
109# use sources from Qt SDK if that is available 109# use sources from Qt SDK if that is available