blob: 7661297d09128e2cb2495b1fe59d2b5fb15bda82 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#!/bin/bash
#############################################################################
##
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
##
## This file is part of the Qt Enterprise Embedded Scripts of the Qt
## framework.
##
## $QT_BEGIN_LICENSE$
## Commercial License Usage Only
## Licensees holding valid commercial Qt license agreements with Digia
## with an appropriate addendum covering the Qt Enterprise Embedded Scripts,
## may use this file in accordance with the terms contained in said license
## agreement.
##
## For further information use the contact form at
## http://www.qt.io/contact-us.
##
##
## $QT_END_LICENSE$
##
#############################################################################
set -e
MKSPEC="devices/linux-oe-generic-g++"
ABI="arm-linux-generic-elf-32bit"
### TBD: detect ABI
printUsage ()
{
echo "Usage: $0 <toolchain-environment-setup-file> [--remove] [--sdktool <path>]"
}
while test -n "$1"; do
case "$1" in
"--help" | "-h")
printUsage
exit 0
;;
"--remove")
REMOVEONLY=1
;;
"--sdktool")
shift
SDKTOOL=$1
;;
*)
CONFIG=$1
;;
esac
shift
done
if [ ! -f "$CONFIG" ]; then
printUsage
exit 1
fi
if [ -z "${SDKTOOL}" ]; then
SDKTOOL="${HOME}/Qt/Tools/QtCreator/bin/sdktool"
fi
if [ ! -x ${SDKTOOL} ]; then
echo "Cannot find 'sdktool'"
exit 1
fi
source $CONFIG
MKSPECPATH=$(find ${OECORE_TARGET_SYSROOT} -name $(basename ${MKSPEC}))
if [ ! -d "${MKSPECPATH}" ]; then
echo "Error: could not find mkspec ${MKSPEC} from the toolchain"
exit 1
fi
MACHINE=$(grep '^MACHINE' ${MKSPECPATH}/../../qdevice.pri | cut -d'=' -f2 | tr -d ' ')
RELEASE=$(qmake -query QT_VERSION)
BASEID="byos.${RELEASE}.${MACHINE}"
BASENAME="Custom Qt Embedded"
TOOLCHAINNAME="GCC (${BASENAME} ${RELEASE} ${MACHINE})"
QTNAME="${BASENAME} ${RELEASE} ${MACHINE}"
KITNAME="${BASENAME} ${RELEASE} ${MACHINE} Kit"
${SDKTOOL} rmKit --id ${BASEID}.kit 2>/dev/null || true
${SDKTOOL} rmQt --id ${BASEID}.qt || true
${SDKTOOL} rmTC --id ProjectExplorer.ToolChain.Gcc:${BASEID}.tc || true
if [ -n "${REMOVEONLY}" ]; then
echo "Kit removed: ${KITNAME}"
exit 0
fi
${SDKTOOL} addTC \
--id "ProjectExplorer.ToolChain.Gcc:${BASEID}.tc" \
--name "${TOOLCHAINNAME}" \
--path "$(type -p ${OE_QMAKE_CXX})" \
--abi "${ABI}"
${SDKTOOL} addQt \
--id "${BASEID}.qt" \
--name "${QTNAME}" \
--type "Boot2Qt.QtVersionType" \
--qmake "$(type -p qmake)"
${SDKTOOL} addKit \
--id "${BASEID}.kit" \
--name "${KITNAME}" \
--qt "${BASEID}.qt" \
--debuggerengine "1" \
--debugger "$(type -p ${GDB})" \
--sysroot "${SDKTARGETSYSROOT}" \
--devicetype "Boot2Qt.HwDevice" \
--toolchain "ProjectExplorer.ToolChain.Gcc:${BASEID}.tc" \
--icon ":/boot2qt/images/B2Qt_QtC_icon.png" \
--mkspec "${MKSPEC}"
echo "Configured Qt Creator with new kit:"
echo " ${KITNAME}"
|