summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@theqtcompany.com>2016-02-02 15:00:29 +0200
committerSamuli Piippo <samuli.piippo@theqtcompany.com>2016-02-05 10:30:20 +0000
commit3bf89974cee602602d98769010d79db2af5d6154 (patch)
tree25fd99a02381910ffae4086015f77b370ffa8d27 /scripts
parent17e03213cd50ffd5caed3e912b149cfbee7355a5 (diff)
downloadmeta-boot2qt-3bf89974cee602602d98769010d79db2af5d6154.tar.gz
Include configure-qtcreator.sh script in the toolchain
ABI and default CONFIG file are set during build, so the script can be called from installed toolchain without any arguments. Change-Id: I533d79864133822f0ea86a39b8c9549280db4c38 Reviewed-by: Teemu Holappa <teemu.holappa@theqtcompany.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/configure-qtcreator.sh51
1 files changed, 27 insertions, 24 deletions
diff --git a/scripts/configure-qtcreator.sh b/scripts/configure-qtcreator.sh
index 7661297..526d86f 100755
--- a/scripts/configure-qtcreator.sh
+++ b/scripts/configure-qtcreator.sh
@@ -23,31 +23,35 @@
23 23
24set -e 24set -e
25 25
26MKSPEC="devices/linux-oe-generic-g++"
27ABI="arm-linux-generic-elf-32bit" 26ABI="arm-linux-generic-elf-32bit"
28### TBD: detect ABI 27CONFIG=""
29 28
30printUsage () 29printUsage ()
31{ 30{
32 echo "Usage: $0 <toolchain-environment-setup-file> [--remove] [--sdktool <path>]" 31 echo "Usage: $0 --config <environment-setup-file> [--remove] [--qtcreator <path>] [--name <basename>]"
33} 32}
34 33
35while test -n "$1"; do 34while test -n "$1"; do
36 case "$1" in 35 case "$1" in
37 "--help" | "-h")
38 printUsage
39 exit 0
40 ;;
41 "--remove") 36 "--remove")
42 REMOVEONLY=1 37 REMOVEONLY=1
43 ;; 38 ;;
44 "--sdktool") 39 "--qtcreator")
45 shift 40 shift
46 SDKTOOL=$1 41 QTCREATOR=$1
47 ;; 42 ;;
48 *) 43 "--config")
44 shift
49 CONFIG=$1 45 CONFIG=$1
50 ;; 46 ;;
47 "--name")
48 shift
49 NAME=$1
50 ;;
51 *)
52 printUsage
53 exit 0
54 ;;
51 esac 55 esac
52 shift 56 shift
53done 57done
@@ -57,16 +61,20 @@ if [ ! -f "$CONFIG" ]; then
57 exit 1 61 exit 1
58fi 62fi
59 63
60if [ -z "${SDKTOOL}" ]; then 64if [ -z "${QTCREATOR}" ]; then
61 SDKTOOL="${HOME}/Qt/Tools/QtCreator/bin/sdktool" 65 SDKTOOL="${HOME}/Qt/Tools/QtCreator/libexec/qtcreator/sdktool"
66else
67 SDKTOOL="${QTCREATOR}/libexec/qtcreator/sdktool"
62fi 68fi
63if [ ! -x ${SDKTOOL} ]; then 69if [ ! -x ${SDKTOOL} ]; then
64 echo "Cannot find 'sdktool'" 70 echo "Cannot find 'sdktool' from QtCreator"
71 printUsage
65 exit 1 72 exit 1
66fi 73fi
67 74
68source $CONFIG 75source $CONFIG
69 76
77MKSPEC="devices/linux-oe-generic-g++"
70MKSPECPATH=$(find ${OECORE_TARGET_SYSROOT} -name $(basename ${MKSPEC})) 78MKSPECPATH=$(find ${OECORE_TARGET_SYSROOT} -name $(basename ${MKSPEC}))
71if [ ! -d "${MKSPECPATH}" ]; then 79if [ ! -d "${MKSPECPATH}" ]; then
72 echo "Error: could not find mkspec ${MKSPEC} from the toolchain" 80 echo "Error: could not find mkspec ${MKSPEC} from the toolchain"
@@ -77,37 +85,33 @@ MACHINE=$(grep '^MACHINE' ${MKSPECPATH}/../../qdevice.pri | cut -d'=' -f2 | tr -
77 85
78RELEASE=$(qmake -query QT_VERSION) 86RELEASE=$(qmake -query QT_VERSION)
79 87
88NAME=${NAME:-"Custom Qt ${RELEASE} ${MACHINE}"}
80BASEID="byos.${RELEASE}.${MACHINE}" 89BASEID="byos.${RELEASE}.${MACHINE}"
81 90
82BASENAME="Custom Qt Embedded"
83TOOLCHAINNAME="GCC (${BASENAME} ${RELEASE} ${MACHINE})"
84QTNAME="${BASENAME} ${RELEASE} ${MACHINE}"
85KITNAME="${BASENAME} ${RELEASE} ${MACHINE} Kit"
86
87${SDKTOOL} rmKit --id ${BASEID}.kit 2>/dev/null || true 91${SDKTOOL} rmKit --id ${BASEID}.kit 2>/dev/null || true
88${SDKTOOL} rmQt --id ${BASEID}.qt || true 92${SDKTOOL} rmQt --id ${BASEID}.qt || true
89${SDKTOOL} rmTC --id ProjectExplorer.ToolChain.Gcc:${BASEID}.tc || true 93${SDKTOOL} rmTC --id ProjectExplorer.ToolChain.Gcc:${BASEID}.tc || true
90 94
91if [ -n "${REMOVEONLY}" ]; then 95if [ -n "${REMOVEONLY}" ]; then
92 echo "Kit removed: ${KITNAME}" 96 echo "Kit removed: ${NAME}"
93 exit 0 97 exit 0
94fi 98fi
95 99
96${SDKTOOL} addTC \ 100${SDKTOOL} addTC \
97 --id "ProjectExplorer.ToolChain.Gcc:${BASEID}.tc" \ 101 --id "ProjectExplorer.ToolChain.Gcc:${BASEID}.tc" \
98 --name "${TOOLCHAINNAME}" \ 102 --name "GCC (${NAME})" \
99 --path "$(type -p ${OE_QMAKE_CXX})" \ 103 --path "$(type -p ${OE_QMAKE_CXX})" \
100 --abi "${ABI}" 104 --abi "${ABI}"
101 105
102${SDKTOOL} addQt \ 106${SDKTOOL} addQt \
103 --id "${BASEID}.qt" \ 107 --id "${BASEID}.qt" \
104 --name "${QTNAME}" \ 108 --name "${NAME}" \
105 --type "Boot2Qt.QtVersionType" \ 109 --type "Boot2Qt.QtVersionType" \
106 --qmake "$(type -p qmake)" 110 --qmake "$(type -p qmake)"
107 111
108${SDKTOOL} addKit \ 112${SDKTOOL} addKit \
109 --id "${BASEID}.kit" \ 113 --id "${BASEID}.kit" \
110 --name "${KITNAME}" \ 114 --name "${NAME}" \
111 --qt "${BASEID}.qt" \ 115 --qt "${BASEID}.qt" \
112 --debuggerengine "1" \ 116 --debuggerengine "1" \
113 --debugger "$(type -p ${GDB})" \ 117 --debugger "$(type -p ${GDB})" \
@@ -117,5 +121,4 @@ ${SDKTOOL} addKit \
117 --icon ":/boot2qt/images/B2Qt_QtC_icon.png" \ 121 --icon ":/boot2qt/images/B2Qt_QtC_icon.png" \
118 --mkspec "${MKSPEC}" 122 --mkspec "${MKSPEC}"
119 123
120echo "Configured Qt Creator with new kit:" 124echo "Configured Qt Creator with new kit: ${NAME}"
121echo " ${KITNAME}"