summaryrefslogtreecommitdiffstats
path: root/scripts/envsetup.sh
blob: f13256a8c91ca679f391aa79b189df05bb9af429 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash

################################################################################
#
# The MIT License (MIT)
#
# Copyright (c) 2016 Stéphane Desneux <sdx@iot.bzh>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
################################################################################

#################################################################################
#                              IMPORTANT NOTICE
#
# This script is a compatiblity script with previous (AGL 1.0) envsetup script
# It has been replaced by another script named "aglsetup.sh".
# 
################################################################################

# detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594
SOURCED=0
if [ -n "$ZSH_EVAL_CONTEXT" ]; then 
	[[ $ZSH_EVAL_CONTEXT =~ :file$ ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $0) && pwd -P); }
elif [ -n "$KSH_VERSION" ]; then
	[[ "$(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); }
elif [ -n "$BASH_VERSION" ]; then
	[[ $0 != "$BASH_SOURCE" ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $BASH_SOURCE) && pwd -P); }
fi

if [ $SOURCED -ne 1 ]; then
	unset SOURCED
	unset SOURCEDIR
	echo "Error: this script needs to be sourced in a supported shell" >&2
	echo "Please check that the current shell is bash, zsh or ksh and run this script as '. $0 <args>'" >&2
	return 1
else
	unset SOURCED
	if [ -z $1 ]; then
        echo -e "Usage: source envsetup.sh <board/device> [build dir]"
        return 1
	fi
	if [ -n "$2" ]; then
		BUILD_DIR="$2"
	else
		BUILD_DIR=build
	fi
	# echo "DEPRECATED..." | figlet -f big -w 80 -c
	cat <<'EOF' >&2
 ------------------------------------------------------------------------------
| using this script is...                                                      |
|   _____  ______ _____  _____  ______ _____       _______ ______ _____        |
|  |  __ \|  ____|  __ \|  __ \|  ____/ ____|   /\|__   __|  ____|  __ \       |
|  | |  | | |__  | |__) | |__) | |__ | |       /  \  | |  | |__  | |  | |      |
|  | |  | |  __| |  ___/|  _  /|  __|| |      / /\ \ | |  |  __| | |  | |      |
|  | |__| | |____| |    | | \ \| |___| |____ / ____ \| |  | |____| |__| | _ _  |
|  |_____/|______|_|    |_|  \_\______\_____/_/    \_\_|  |______|_____(_|_|_) |
|                                                                              |
| To support the newest/upcoming features, please use the script aglsetup.sh.  |
 ------------------------------------------------------------------------------
EOF
	. $SOURCEDIR/aglsetup.sh -m $1 -b $BUILD_DIR agl-devel agl-netboot agl-demo
	rc=$?
	unset SOURCEDIR
	unset BUILD_DIR
	return $rc
fi
ot;, "fi-foundation", "fi-graph-bar", "fi-graph-horizontal", "fi-graph-pie", "fi-graph-trend", "fi-guide-dog", "fi-hearing-aid", "fi-heart", "fi-home", "fi-html5", "fi-indent-less", "fi-indent-more", "fi-info", "fi-italic", "fi-key", "fi-laptop", "fi-layout", "fi-lightbulb", "fi-like", "fi-link", "fi-list-bullet", "fi-list-number", "fi-list-thumbnails", "fi-list", "fi-lock", "fi-loop", "fi-magnifying-glass", "fi-mail", "fi-male-female", "fi-male-symbol", "fi-male", "fi-map", "fi-marker", "fi-megaphone", "fi-microphone", "fi-minus-circle", "fi-minus", "fi-mobile-signal", "fi-mobile", "fi-monitor", "fi-mountains", "fi-music", "fi-next", "fi-no-dogs", "fi-no-smoking", "fi-page-add", "fi-page-copy", "fi-page-csv", "fi-page-delete", "fi-page-doc", "fi-page-edit", "fi-page-export-csv", "fi-page-export-doc", "fi-page-export-pdf", "fi-page-export", "fi-page-filled", "fi-page-multiple", "fi-page-pdf", "fi-page-remove", "fi-page-search", "fi-page", "fi-paint-bucket", "fi-paperclip", "fi-pause", "fi-paw", "fi-paypal", "fi-pencil", "fi-photo", "fi-play-circle", "fi-play-video", "fi-play", "fi-plus", "fi-pound", "fi-power", "fi-previous", "fi-price-tag", "fi-pricetag-multiple", "fi-print", "fi-prohibited", "fi-projection-screen", "fi-puzzle", "fi-quote", "fi-record", "fi-refresh", "fi-results-demographics", "fi-results", "fi-rewind-ten", "fi-rewind", "fi-rss", "fi-safety-cone", "fi-save", "fi-share", "fi-sheriff-badge", "fi-shield", "fi-shopping-bag", "fi-shopping-cart", "fi-shuffle", "fi-skull", "fi-social-500px", "fi-social-adobe", "fi-social-amazon", "fi-social-android", "fi-social-apple", "fi-social-behance", "fi-social-bing", "fi-social-blogger", "fi-social-delicious", "fi-social-designer-news", "fi-social-deviant-art", "fi-social-digg", "fi-social-dribbble", "fi-social-drive", "fi-social-dropbox", "fi-social-evernote", "fi-social-facebook", "fi-social-flickr", "fi-social-forrst", "fi-social-foursquare", "fi-social-game-center", "fi-social-github", "fi-social-google-plus", "fi-social-hacker-news", "fi-social-hi5", "fi-social-instagram", "fi-social-joomla", "fi-social-lastfm", "fi-social-linkedin", "fi-social-medium", "fi-social-myspace", "fi-social-orkut", "fi-social-path", "fi-social-picasa", "fi-social-pinterest", "fi-social-rdio", "fi-social-reddit", "fi-social-skillshare", "fi-social-skype", "fi-social-smashing-mag", "fi-social-snapchat", "fi-social-spotify", "fi-social-squidoo", "fi-social-stack-overflow", "fi-social-steam", "fi-social-stumbleupon", "fi-social-treehouse", "fi-social-tumblr", "fi-social-twitter", "fi-social-vimeo", "fi-social-windows", "fi-social-xbox-20", "fi-social-yahoo", "fi-social-yelp", "fi-social-youtube", "fi-social-zerply", "fi-social-zurb", "fi-sound", "fi-star", "fi-stop", "fi-strikethrough", "fi-subscript", "fi-superscript", "fi-tablet-landscape", "fi-tablet-portrait", "fi-target-two", "fi-target", "fi-telephone-accessible", "fi-telephone", "fi-text-color", "fi-thumbnails", "fi-ticket", "fi-torso-business", "fi-torso-female", "fi-torso", "fi-torsos-all-female", "fi-torsos-all", "fi-torsos-female-male", "fi-torsos-male-female", "fi-torsos", "fi-trash", "fi-trees", "fi-trophy", "fi-underline", "fi-universal-access", "fi-unlink", "fi-unlock", "fi-upload-cloud", "fi-upload", "fi-usb", "fi-video", "fi-volume-none", "fi-volume-strike", "fi-volume", "fi-web", "fi-wheelchair", "fi-widget", "fi-wrench", "fi-x-circle", "fi-x", "fi-yen", "fi-zoom-in", "fi-zoom-out" ] }