diff options
Diffstat (limited to 'scripts/setup-environment.sh')
-rwxr-xr-x | scripts/setup-environment.sh | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/scripts/setup-environment.sh b/scripts/setup-environment.sh new file mode 100755 index 0000000..2ff9e29 --- /dev/null +++ b/scripts/setup-environment.sh | |||
@@ -0,0 +1,85 @@ | |||
1 | #!/bin/sh | ||
2 | ############################################################################# | ||
3 | ## | ||
4 | ## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). | ||
5 | ## | ||
6 | ## This file is part of the Qt Enterprise Embedded Scripts of the Qt | ||
7 | ## framework. | ||
8 | ## | ||
9 | ## $QT_BEGIN_LICENSE$ | ||
10 | ## Commercial License Usage Only | ||
11 | ## Licensees holding valid commercial Qt license agreements with Digia | ||
12 | ## with an appropriate addendum covering the Qt Enterprise Embedded Scripts, | ||
13 | ## may use this file in accordance with the terms contained in said license | ||
14 | ## agreement. | ||
15 | ## | ||
16 | ## For further information use the contact form at | ||
17 | ## http://qt.digia.com/contact-us. | ||
18 | ## | ||
19 | ## | ||
20 | ## $QT_END_LICENSE$ | ||
21 | ## | ||
22 | ############################################################################# | ||
23 | |||
24 | while test -n "$1"; do | ||
25 | case "$1" in | ||
26 | "--help" | "-h") | ||
27 | echo "Usage: . $0 [build directory]" | ||
28 | return 0 | ||
29 | ;; | ||
30 | *) | ||
31 | BUILDDIR=$1 | ||
32 | ;; | ||
33 | esac | ||
34 | shift | ||
35 | done | ||
36 | |||
37 | THIS_SCRIPT="setup-environment.sh" | ||
38 | if [ "$(basename $0)" = "${THIS_SCRIPT}" ]; then | ||
39 | echo "Error: This script needs to be sourced. Please run as '. $0'" | ||
40 | exit 1 | ||
41 | fi | ||
42 | |||
43 | BUILDDIR=${BUILDDIR:-build-${MACHINE}} | ||
44 | |||
45 | if [ -z "$MACHINE" ]; then | ||
46 | echo "Error: MACHINE environment variable not defined" | ||
47 | return 1 | ||
48 | fi | ||
49 | |||
50 | if [ ! -f ${PWD}/${BUILDDIR}/conf/bblayers.conf ]; then | ||
51 | case ${MACHINE} in | ||
52 | apalis-imx6) | ||
53 | LAYERSCONF="bblayers.conf.toradex.sample" | ||
54 | ;; | ||
55 | imx53qsb|imx6qsabresd|nitrogen6x) | ||
56 | LAYERSCONF="bblayers.conf.fsl.sample" | ||
57 | ;; | ||
58 | beagleboard|am335x-evm) | ||
59 | LAYERSCONF="bblayers.conf.ti.sample" | ||
60 | ;; | ||
61 | beaglebone) | ||
62 | LAYERSCONF="bblayers.conf.bbb.sample" | ||
63 | ;; | ||
64 | raspberrypi) | ||
65 | LAYERSCONF="bblayers.conf.rpi.sample" | ||
66 | ;; | ||
67 | emulator) | ||
68 | LAYERSCONF="bblayers.conf.emulator.sample" | ||
69 | ;; | ||
70 | *) | ||
71 | LAYERSCONF="bblayers.conf.sample" | ||
72 | echo "Unknown MACHINE, bblayers.conf might need manual editing" | ||
73 | ;; | ||
74 | esac | ||
75 | |||
76 | mkdir -p ${PWD}/${BUILDDIR}/conf | ||
77 | cp ${PWD}/sources/meta-b2qt/conf/${LAYERSCONF} ${PWD}/${BUILDDIR}/conf/bblayers.conf | ||
78 | fi | ||
79 | |||
80 | export TEMPLATECONF="${PWD}/sources/meta-b2qt/conf" | ||
81 | . sources/poky/oe-init-build-env ${BUILDDIR} | ||
82 | |||
83 | unset BUILDDIR | ||
84 | unset TEMPLATECONF | ||
85 | unset LAYERSCONF | ||