diff options
| author | Samuli Piippo <samuli.piippo@digia.com> | 2014-10-07 13:51:03 +0300 |
|---|---|---|
| committer | Samuli Piippo <samuli.piippo@digia.com> | 2014-10-14 08:16:18 +0300 |
| commit | eb498abc47e8f01c77d27506fa430ac1fdbf6f44 (patch) | |
| tree | 8dfa4f76dcc9af65f9fbb40428e0eb12e5decba5 /scripts/setup-environment.sh | |
| parent | abd189a666802ad8c1c6315eef9ef292169edcbd (diff) | |
| download | meta-boot2qt-eb498abc47e8f01c77d27506fa430ac1fdbf6f44.tar.gz | |
Improvements to setup scripts
- use the already fetched .repo/repo as a workaround for repo tool's
mandatory -u argument
- rename environment-setup.sh script
- Add notice about correctly sourcing the environment-setup.sh script
Change-Id: I4ac3cf26ca30ae1c14474cf9fb15e65ebc0be3ac
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
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 | ||
