]>
Commit | Line | Data |
---|---|---|
b9e16a84 | 1 | # |
92063c4e | 2 | # Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> |
24542fb2 | 3 | # This program and the accompanying materials |
b9e16a84 | 4 | # are licensed and made available under the terms and conditions of the BSD License |
5 | # which accompanies this distribution. The full text of the license may be found at | |
6 | # http://opensource.org/licenses/bsd-license.php | |
7 | # | |
8 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | |
9 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | |
2b1473c1 | 10 | # |
11 | # In *inux environment, the build tools's source is required and need to be compiled | |
12 | # firstly, please reference https://edk2.tianocore.org/unix-getting-started.html to | |
13 | # to get how to setup build tool. | |
14 | # | |
15 | # After build tool is downloaded and compiled, a soft symbol linker need to be created | |
16 | # at <workspace>/Conf. For example: ln -s /work/BaseTools /work/edk2/Conf/BaseToolsSource. | |
17 | # | |
b9e16a84 | 18 | # Setup the environment for unix-like systems running a bash-like shell. |
6dbea978 | 19 | # This file must be "sourced" not merely executed. For example: ". edksetup.sh" |
2b1473c1 | 20 | # |
6dbea978 | 21 | # CYGWIN users: Your path and filename related environment variables should be |
22 | # set up in the unix style. This script will make the necessary conversions to | |
23 | # windows style. | |
2b1473c1 | 24 | # |
25 | # Please reference edk2 user manual for more detail descriptions at https://edk2.tianocore.org/files/documents/64/494/EDKII_UserManual.pdf | |
26 | # | |
b9e16a84 | 27 | |
729220ea PP |
28 | function HelpMsg() |
29 | { | |
30 | echo Please note: This script must be \'sourced\' so the environment can be changed. | |
31 | echo ". edksetup.sh" | |
32 | echo "source edksetup.sh" | |
1bb6bfaa | 33 | return 1 |
729220ea PP |
34 | } |
35 | ||
36 | function SetupEnv() | |
37 | { | |
38 | if [ -z "$WORKSPACE" ] | |
39 | then | |
40 | . BaseTools/BuildEnv $* | |
41 | else | |
42 | . $WORKSPACE/BaseTools/BuildEnv $* | |
43 | fi | |
44 | } | |
45 | ||
46 | function SourceEnv() | |
47 | { | |
ef9086c3 JJ |
48 | if [ \ |
49 | "$1" = "-?" -o \ | |
50 | "$1" = "-h" -o \ | |
51 | "$1" = "--help" \ | |
52 | ] | |
53 | then | |
54 | HelpMsg | |
ef9086c3 JJ |
55 | else |
56 | SetupEnv "$*" | |
57 | fi | |
729220ea | 58 | } |
ef9086c3 JJ |
59 | |
60 | if [ $# -gt 1 ] | |
729220ea PP |
61 | then |
62 | HelpMsg | |
1bb6bfaa | 63 | elif [ $# -eq 1 ] && [ "$1" != "BaseTools" ] |
729220ea PP |
64 | then |
65 | HelpMsg | |
1bb6bfaa LL |
66 | fi |
67 | ||
68 | RETVAL=$? | |
69 | if [ $RETVAL -ne 0 ] | |
70 | then | |
71 | return $RETVAL | |
ef9086c3 JJ |
72 | fi |
73 | ||
729220ea | 74 | SourceEnv "$*" |
b9e16a84 | 75 |