3 ################################################################################
5 # The MIT License (MIT)
7 # Copyright (c) 2016 Stéphane Desneux <sdx@iot.bzh>
9 # Permission is hereby granted, free of charge, to any person obtaining a copy
10 # of this software and associated documentation files (the "Software"), to deal
11 # in the Software without restriction, including without limitation the rights
12 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 # copies of the Software, and to permit persons to whom the Software is
14 # furnished to do so, subject to the following conditions:
16 # The above copyright notice and this permission notice shall be included in
17 # all copies or substantial portions of the Software.
19 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 ################################################################################
29 #################################################################################
32 # This script is a compatiblity script with previous (AGL 1.0) envsetup script
33 # It has been replaced by another script named "aglsetup.sh".
35 ################################################################################
37 # detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594
39 if [ -n "$ZSH_EVAL_CONTEXT" ]; then
40 [[ $ZSH_EVAL_CONTEXT =~ :file$ ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $0) && pwd -P); }
41 elif [ -n "$KSH_VERSION" ]; then
42 [[ "$(cd $(dirname -- $0) && pwd -P)/$(basename -- $0)" != "$(cd $(dirname -- ${.sh.file}) && pwd -P)/$(basename -- ${.sh.file})" ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- ${.sh.file}) && pwd -P); }
43 elif [ -n "$BASH_VERSION" ]; then
44 [[ $0 != "$BASH_SOURCE" ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $BASH_SOURCE) && pwd -P); }
47 if [ $SOURCED -ne 1 ]; then
50 echo "Error: this script needs to be sourced in a supported shell" >&2
51 echo "Please check that the current shell is bash, zsh or ksh and run this script as '. $0 <args>'" >&2
56 echo -e "Usage: source envsetup.sh <board/device> [build dir]"
64 # echo "DEPRECATED..." | figlet -f big -w 80 -c
66 ------------------------------------------------------------------------------
67 | using this script is... |
68 | _____ ______ _____ _____ ______ _____ _______ ______ _____ |
69 | | __ \| ____| __ \| __ \| ____/ ____| /\|__ __| ____| __ \ |
70 | | | | | |__ | |__) | |__) | |__ | | / \ | | | |__ | | | | |
71 | | | | | __| | ___/| _ /| __|| | / /\ \ | | | __| | | | | |
72 | | |__| | |____| | | | \ \| |___| |____ / ____ \| | | |____| |__| | _ _ |
73 | |_____/|______|_| |_| \_\______\_____/_/ \_\_| |______|_____(_|_|_) |
75 | To support the newest/upcoming features, please use the script aglsetup.sh. |
76 ------------------------------------------------------------------------------
78 . $SOURCEDIR/aglsetup.sh -m $1 -b $BUILD_DIR agl-devel agl-netboot agl-demo