diff options
Diffstat (limited to 'files/qbsp/toolchain_installscript.qs')
-rw-r--r-- | files/qbsp/toolchain_installscript.qs | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/files/qbsp/toolchain_installscript.qs b/files/qbsp/toolchain_installscript.qs new file mode 100644 index 0000000..bcf9cd1 --- /dev/null +++ b/files/qbsp/toolchain_installscript.qs | |||
@@ -0,0 +1,107 @@ | |||
1 | /**************************************************************************** | ||
2 | ** | ||
3 | ** Copyright (C) 2016 The Qt Company Ltd. | ||
4 | ** Contact: https://www.qt.io/licensing/ | ||
5 | ** | ||
6 | ** This file is part of the Boot to Qt meta layer. | ||
7 | ** | ||
8 | ** $QT_BEGIN_LICENSE:GPL$ | ||
9 | ** Commercial License Usage | ||
10 | ** Licensees holding valid commercial Qt licenses may use this file in | ||
11 | ** accordance with the commercial license agreement provided with the | ||
12 | ** Software or, alternatively, in accordance with the terms contained in | ||
13 | ** a written agreement between you and The Qt Company. For licensing terms | ||
14 | ** and conditions see https://www.qt.io/terms-conditions. For further | ||
15 | ** information use the contact form at https://www.qt.io/contact-us. | ||
16 | ** | ||
17 | ** GNU General Public License Usage | ||
18 | ** Alternatively, this file may be used under the terms of the GNU | ||
19 | ** General Public License version 3 or (at your option) any later version | ||
20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by | ||
21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 | ||
22 | ** included in the packaging of this file. Please review the following | ||
23 | ** information to ensure the GNU General Public License requirements will | ||
24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. | ||
25 | ** | ||
26 | ** $QT_END_LICENSE$ | ||
27 | ** | ||
28 | ****************************************************************************/ | ||
29 | |||
30 | function Component() | ||
31 | { | ||
32 | } | ||
33 | |||
34 | Component.prototype.createOperations = function() | ||
35 | { | ||
36 | component.createOperations(); | ||
37 | |||
38 | var device = "@MACHINE@" | ||
39 | var platform = "@NAME@" | ||
40 | var sysroot = "@SYSROOT@" | ||
41 | var target = "@TARGET@" | ||
42 | var abi = "@ABI@" | ||
43 | var installPath = "@INSTALLPATH@/toolchain" | ||
44 | var sdkPath = "@SDKPATH@" | ||
45 | var sdkFile = "@SDKFILE@" | ||
46 | |||
47 | var path = installer.value("TargetDir") + installPath; | ||
48 | if (systemInfo.kernelType !== "winnt") { | ||
49 | var script = path + "/" + sdkFile; | ||
50 | component.addOperation("Execute", "{0}", "chmod", "+x", script); | ||
51 | component.addOperation("Execute", "{0}", script, "-y", "-d", path, "UNDOEXECUTE", "rm", "-rf", path); | ||
52 | component.addOperation("Execute", "{0}", "/bin/rm", script); | ||
53 | } else { | ||
54 | var search = sdkPath; | ||
55 | path = path.replace(/\\/g,"/"); | ||
56 | component.addOperation("Replace", | ||
57 | path + "/sysroots/i686-pokysdk-mingw32/usr/bin/qt.conf", | ||
58 | search, path); | ||
59 | } | ||
60 | // qt.embedded.b2qt.xx | ||
61 | var baseid = component.name.substring(17,19); | ||
62 | var basecomponent = component.name.substring(0, component.name.lastIndexOf(".")); | ||
63 | var toolchainId = "ProjectExplorer.ToolChain.Gcc:" + component.name; | ||
64 | var qtId = basecomponent + ".qt"; | ||
65 | var icon = installer.value("B2QtDeviceIcon"); | ||
66 | var executableExt = ""; | ||
67 | var hostSysroot = "x86_64-pokysdk-linux"; | ||
68 | if (systemInfo.kernelType === "winnt") { | ||
69 | executableExt = ".exe"; | ||
70 | hostSysroot = "i686-pokysdk-mingw32"; | ||
71 | } | ||
72 | var deviceType = "Boot2Qt.HwDevice" | ||
73 | |||
74 | component.addOperation("Execute", | ||
75 | ["@SDKToolBinary@", "addTC", | ||
76 | "--id", toolchainId, | ||
77 | "--name", "GCC (Boot2Qt " + platform + ")", | ||
78 | "--path", path + "/sysroots/" + hostSysroot + "/usr/bin/" + target + "/" + target + "-g++" + executableExt, | ||
79 | "--abi", abi, | ||
80 | "UNDOEXECUTE", | ||
81 | "@SDKToolBinary@", "rmTC", "--id", toolchainId]); | ||
82 | |||
83 | component.addOperation("Execute", | ||
84 | ["@SDKToolBinary@", "addQt", | ||
85 | "--id", qtId, | ||
86 | "--name", "Boot2Qt %{Qt:Version} " + platform, | ||
87 | "--type", "Boot2Qt.QtVersionType", | ||
88 | "--qmake", path + "/sysroots/" + hostSysroot + "/usr/bin/qmake" + executableExt, | ||
89 | "UNDOEXECUTE", | ||
90 | "@SDKToolBinary@", "rmQt", "--id", qtId]); | ||
91 | |||
92 | var addKitOperations = ["@SDKToolBinary@", "addKit", | ||
93 | "--id", basecomponent, | ||
94 | "--name", "Boot2Qt %{Qt:Version} " + platform, | ||
95 | "--mkspec", "devices/linux-oe-generic-g++", | ||
96 | "--qt", qtId, | ||
97 | "--debuggerengine", "1", | ||
98 | "--debugger", path + "/sysroots/" + hostSysroot + "/usr/bin/" + target + "/" + target + "-gdb" + executableExt, | ||
99 | "--sysroot", path + "/sysroots/" + sysroot, | ||
100 | "--devicetype", deviceType, | ||
101 | "--toolchain", toolchainId, | ||
102 | "--icon", icon]; | ||
103 | |||
104 | addKitOperations.push("UNDOEXECUTE", "@SDKToolBinary@", "rmKit", "--id", basecomponent); | ||
105 | |||
106 | component.addOperation("Execute", addKitOperations); | ||
107 | } | ||