diff options
author | Samuli Piippo <samuli.piippo@theqtcompany.com> | 2016-02-02 15:00:29 +0200 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@theqtcompany.com> | 2016-02-05 10:30:20 +0000 |
commit | 3bf89974cee602602d98769010d79db2af5d6154 (patch) | |
tree | 25fd99a02381910ffae4086015f77b370ffa8d27 | |
parent | 17e03213cd50ffd5caed3e912b149cfbee7355a5 (diff) | |
download | meta-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>
-rw-r--r-- | classes/populate_b2qt_qt5_sdk.bbclass | 12 | ||||
-rw-r--r-- | conf/layer.conf | 1 | ||||
-rwxr-xr-x | scripts/configure-qtcreator.sh | 51 |
3 files changed, 40 insertions, 24 deletions
diff --git a/classes/populate_b2qt_qt5_sdk.bbclass b/classes/populate_b2qt_qt5_sdk.bbclass index 78ad457..8a14084 100644 --- a/classes/populate_b2qt_qt5_sdk.bbclass +++ b/classes/populate_b2qt_qt5_sdk.bbclass | |||
@@ -58,4 +58,16 @@ EOF | |||
58 | qtconf=${SDK_OUTPUT}/${SDKPATHNATIVE}${OE_QMAKE_PATH_HOST_BINS}/qt.conf | 58 | qtconf=${SDK_OUTPUT}/${SDKPATHNATIVE}${OE_QMAKE_PATH_HOST_BINS}/qt.conf |
59 | echo 'HostSpec = linux-g++' >> $qtconf | 59 | echo 'HostSpec = linux-g++' >> $qtconf |
60 | echo 'TargetSpec = devices/linux-oe-generic-g++' >> $qtconf | 60 | echo 'TargetSpec = devices/linux-oe-generic-g++' >> $qtconf |
61 | |||
62 | create_qtcreator_configure_script | ||
63 | } | ||
64 | |||
65 | create_qtcreator_configure_script () { | ||
66 | # add qtcreator configuration script | ||
67 | install -m 0755 ${B2QTBASE}/scripts/configure-qtcreator.sh ${SDK_OUTPUT}/${SDKPATH} | ||
68 | sed -i -e '/^CONFIG=/c\CONFIG="${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}"' ${SDK_OUTPUT}/${SDKPATH}/configure-qtcreator.sh | ||
69 | sed -i -e '/^ABI=/c\ABI="${ARCH}-linux-generic-elf-${SITEINFO_BITS}bit"' ${SDK_OUTPUT}/${SDKPATH}/configure-qtcreator.sh | ||
70 | } | ||
71 | |||
72 | create_qtcreator_configure_script_mingw32 () { | ||
61 | } | 73 | } |
diff --git a/conf/layer.conf b/conf/layer.conf index 404957f..0c0468b 100644 --- a/conf/layer.conf +++ b/conf/layer.conf | |||
@@ -35,3 +35,4 @@ BBFILE_PRIORITY_b2qt = "20" | |||
35 | 35 | ||
36 | LICENSE_PATH += "${LAYERDIR}/licenses" | 36 | LICENSE_PATH += "${LAYERDIR}/licenses" |
37 | QT_LICENCE = "${LAYERDIR}/licenses/QtEnterprise" | 37 | QT_LICENCE = "${LAYERDIR}/licenses/QtEnterprise" |
38 | B2QTBASE = "${LAYERDIR}" | ||
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 | ||
24 | set -e | 24 | set -e |
25 | 25 | ||
26 | MKSPEC="devices/linux-oe-generic-g++" | ||
27 | ABI="arm-linux-generic-elf-32bit" | 26 | ABI="arm-linux-generic-elf-32bit" |
28 | ### TBD: detect ABI | 27 | CONFIG="" |
29 | 28 | ||
30 | printUsage () | 29 | printUsage () |
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 | ||
35 | while test -n "$1"; do | 34 | while 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 |
53 | done | 57 | done |
@@ -57,16 +61,20 @@ if [ ! -f "$CONFIG" ]; then | |||
57 | exit 1 | 61 | exit 1 |
58 | fi | 62 | fi |
59 | 63 | ||
60 | if [ -z "${SDKTOOL}" ]; then | 64 | if [ -z "${QTCREATOR}" ]; then |
61 | SDKTOOL="${HOME}/Qt/Tools/QtCreator/bin/sdktool" | 65 | SDKTOOL="${HOME}/Qt/Tools/QtCreator/libexec/qtcreator/sdktool" |
66 | else | ||
67 | SDKTOOL="${QTCREATOR}/libexec/qtcreator/sdktool" | ||
62 | fi | 68 | fi |
63 | if [ ! -x ${SDKTOOL} ]; then | 69 | if [ ! -x ${SDKTOOL} ]; then |
64 | echo "Cannot find 'sdktool'" | 70 | echo "Cannot find 'sdktool' from QtCreator" |
71 | printUsage | ||
65 | exit 1 | 72 | exit 1 |
66 | fi | 73 | fi |
67 | 74 | ||
68 | source $CONFIG | 75 | source $CONFIG |
69 | 76 | ||
77 | MKSPEC="devices/linux-oe-generic-g++" | ||
70 | MKSPECPATH=$(find ${OECORE_TARGET_SYSROOT} -name $(basename ${MKSPEC})) | 78 | MKSPECPATH=$(find ${OECORE_TARGET_SYSROOT} -name $(basename ${MKSPEC})) |
71 | if [ ! -d "${MKSPECPATH}" ]; then | 79 | if [ ! -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 | ||
78 | RELEASE=$(qmake -query QT_VERSION) | 86 | RELEASE=$(qmake -query QT_VERSION) |
79 | 87 | ||
88 | NAME=${NAME:-"Custom Qt ${RELEASE} ${MACHINE}"} | ||
80 | BASEID="byos.${RELEASE}.${MACHINE}" | 89 | BASEID="byos.${RELEASE}.${MACHINE}" |
81 | 90 | ||
82 | BASENAME="Custom Qt Embedded" | ||
83 | TOOLCHAINNAME="GCC (${BASENAME} ${RELEASE} ${MACHINE})" | ||
84 | QTNAME="${BASENAME} ${RELEASE} ${MACHINE}" | ||
85 | KITNAME="${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 | ||
91 | if [ -n "${REMOVEONLY}" ]; then | 95 | if [ -n "${REMOVEONLY}" ]; then |
92 | echo "Kit removed: ${KITNAME}" | 96 | echo "Kit removed: ${NAME}" |
93 | exit 0 | 97 | exit 0 |
94 | fi | 98 | fi |
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 | ||
120 | echo "Configured Qt Creator with new kit:" | 124 | echo "Configured Qt Creator with new kit: ${NAME}" |
121 | echo " ${KITNAME}" | ||