summaryrefslogtreecommitdiffstats
path: root/scripts/setup_environment.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/setup_environment.sh')
-rwxr-xr-xscripts/setup_environment.sh98
1 files changed, 98 insertions, 0 deletions
diff --git a/scripts/setup_environment.sh b/scripts/setup_environment.sh
new file mode 100755
index 0000000..63f59cf
--- /dev/null
+++ b/scripts/setup_environment.sh
@@ -0,0 +1,98 @@
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
24usage() {
25 echo "source setup-environment <build-dir>"
26}
27
28clean() {
29 unset BUILDDIR
30 unset NEWBUILD
31 unset TEMPLATECONF
32}
33
34CWD=`pwd`
35
36while test -n "$1"; do
37 case "$1" in
38 "--help" | "-h")
39 usage
40 return 0
41 ;;
42 *)
43 BUILDDIR=$1
44 ;;
45 esac
46 shift
47done
48
49if [ -z "${BUILDDIR}" ]; then
50 usage
51 return 1
52fi
53
54if [ -z "$MACHINE" ]; then
55 echo "MACHINE environment variable not defined"
56 clean
57 return 1
58fi
59
60if [ ! -d ${CWD}/${BUILDDIR} ]; then
61 NEWBUILD=1
62fi
63
64export TEMPLATECONF=${CWD}/sources/meta-b2qt/conf
65cd sources/poky
66. ./oe-init-build-env ${CWD}/${BUILDDIR}
67
68if [ -n "${NEWBUILD}" ]; then
69 case ${MACHINE} in
70 apalis-imx6)
71 LAYERS="meta-raspberrypi meta-beagleboard meta-ti"
72 ;;
73 imx53qsb|imx6qsabresd|nitrogen6x)
74 LAYERS="meta-raspberrypi meta-beagleboard meta-toradex meta-ti"
75 ;;
76 beagleboard|am335x-evm)
77 LAYERS="meta-raspberrypi meta-beagleboard meta-toradex meta-fsl"
78 ;;
79 beaglebone)
80 LAYERS="meta-raspberrypi meta-toradex meta-fsl"
81 ;;
82 raspberrypi)
83 LAYERS="meta-beagleboard meta-toradex meta-ti meta-fsl"
84 ;;
85 emulator)
86 LAYERS="meta-raspberrypi meta-beagleboard meta-toradex meta-ti meta-fsl"
87 ;;
88 *)
89 echo "Unknown MACHINE, bblayer.conf might need manual editing"
90 ;;
91 esac
92
93 for layer in ${LAYERS}; do
94 sed -i -e "/${layer}/d" conf/bblayers.conf
95 done
96fi
97
98clean