X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FBuildEnv;h=8ab5089bbee6d17703a630d994c663fe8736e6f6;hb=537bc124007a852b2c3b00cda91bad43f4045692;hp=768e2d5603ecea4c9f52c464f247a535147484e6;hpb=a709adfaf0bebbaf3d989f56b500e3985687d0e3;p=mirror_edk2.git diff --git a/BaseTools/BuildEnv b/BaseTools/BuildEnv index 768e2d5603..8ab5089bbe 100755 --- a/BaseTools/BuildEnv +++ b/BaseTools/BuildEnv @@ -1,6 +1,6 @@ # -# Copyright (c) 2006 - 2007, Intel Corporation -# All rights reserved. This program and the accompanying materials +# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at # http://opensource.org/licenses/bsd-license.php @@ -23,14 +23,6 @@ SetWorkspace() { return 0 fi - if [ ! ${BASH_SOURCE[0]} -ef ./BaseTools/BuildEnv ] - then - echo Run this script from the base of your tree. For example: - echo " cd /Path/To/Edk/Root" - echo " . BaseTools/BuildEnv" - return -1 - fi - # # Set $WORKSPACE # @@ -98,13 +90,6 @@ SetEdkToolsPath() { return 0 fi - # - # Figure out a uniq directory name from the uname command - # - UNAME_DIRNAME=`uname -sm` - UNAME_DIRNAME=${UNAME_DIRNAME// /-} - UNAME_DIRNAME=${UNAME_DIRNAME//\//-} - # # Try $WORKSPACE/Conf/EdkTools # @@ -124,9 +109,9 @@ SetEdkToolsPath() { fi # - # Try $WORKSPACE/BaseTools/Bin/$UNAME_DIRNAME + # Try $WORKSPACE/BaseTools # - if [ -e $WORKSPACE/BaseTools/Bin/$UNAME_DIRNAME ] + if [ -e $WORKSPACE/BaseTools ] then export EDK_TOOLS_PATH=$WORKSPACE/BaseTools return 0 @@ -167,6 +152,14 @@ GetEdkToolsPathBinDirectory() { echo $EDK_TOOLS_PATH_BIN } +AddDirToStartOfPath() { + DIRNAME=$1 + PATH=$DIRNAME:$DIRNAME:$DIRNAME:$PATH + PATH=${PATH//$DIRNAME:/} + PATH=$DIRNAME:$PATH + export PATH +} + AddEdkToolsToPath() { # @@ -174,23 +167,13 @@ AddEdkToolsToPath() { # if [ -z "$EDK_TOOLS_PATH" ] then - return -1 + return 1 fi EDK_TOOLS_PATH_BIN=`GetEdkToolsPathBinDirectory` - if [ ! -e $EDK_TOOLS_PATH_BIN ] - then - echo "Unable to find expected bin path under \$EDK_TOOLS_PATH!" - echo "> $EDK_TOOLS_PATH_BIN" - return -1 - fi - - if [ "${PATH/$EDK_TOOLS_PATH_BIN/}" == "$PATH" ] - then - export PATH=$EDK_TOOLS_PATH_BIN:$PATH - return 0 - fi + AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike + AddDirToStartOfPath $EDK_TOOLS_PATH_BIN } @@ -215,7 +198,6 @@ CopySingleTemplateFile() { CopyTemplateFiles() { CopySingleTemplateFile build_rule - CopySingleTemplateFile FrameworkDatabase CopySingleTemplateFile tools_def CopySingleTemplateFile target @@ -227,7 +209,7 @@ ScriptMain() { if [ -z $WORKSPACE ] then echo "Failure setting WORKSPACE" - return -1 + return 1 fi RestorePreviousConfiguration @@ -235,14 +217,14 @@ ScriptMain() { SetEdkToolsPath if [ -z $EDK_TOOLS_PATH ] then - return -1 + return 1 fi AddEdkToolsToPath if [ $? -ne 0 ] then echo "Failure adding EDK Tools into PATH!" - return -1 + return 1 fi StoreCurrentConfiguration