2 # Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
3 # This program and the accompanying materials
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
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.
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.
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.
18 # Setup the environment for unix-like systems running a bash-like shell.
19 # This file must be "sourced" not merely executed. For example: ". edksetup.sh"
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
25 # Please reference edk2 user manual for more detail descriptions at https://edk2.tianocore.org/files/documents/64/494/EDKII_UserManual.pdf
30 echo Please note
: This
script must be
\'sourced
\' so the environment can be changed.
32 echo "source edksetup.sh"
36 function SetWorkspace
()
39 # If WORKSPACE is already set, then we can return right now
41 if [ -n "$WORKSPACE" ]
46 if [ ! ${BASH_SOURCE[0]} -ef .
/edksetup.sh
]
48 echo Run this
script from the base of your tree. For example
:
49 echo " cd /Path/To/Edk/Root"
55 # Check for BaseTools/BuildEnv before dirtying the user's environment.
57 if [ ! -f BaseTools
/BuildEnv
] && [ -z "$EDK_TOOLS_PATH" ]
59 echo BaseTools not found
in your tree
, and EDK_TOOLS_PATH is not
set.
60 echo Please point EDK_TOOLS_PATH
at the directory that contains
61 echo the EDK2 BuildEnv
script.
68 export WORKSPACE
=`pwd`
75 if [ -n "$EDK_TOOLS_PATH" ]
77 .
$EDK_TOOLS_PATH/BuildEnv $
*
78 elif [ -f "$WORKSPACE/BaseTools/BuildEnv" ]
80 .
$WORKSPACE/BaseTools
/BuildEnv $
*
81 elif [ -n "$PACKAGES_PATH" ]
83 PATH_LIST
=$PACKAGES_PATH
84 PATH_LIST
=${PATH_LIST//:/ }
87 if [ -f "$DIR/BaseTools/BuildEnv" ]
89 export EDK_TOOLS_PATH
=$DIR/BaseTools
90 .
$DIR/BaseTools
/BuildEnv $
*
95 echo BaseTools not found
in your tree
, and EDK_TOOLS_PATH is not
set.
96 echo Please check that WORKSPACE or PACKAGES_PATH is not
set incorrectly
97 echo in your shell
, or point EDK_TOOLS_PATH
at the directory that contains
98 echo the EDK2 BuildEnv
script.
121 elif [ $# -eq 1 ] && [ "$1" != "BaseTools" ]