X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FBuildEnv;h=275f4c5901aa59b4726dc1ff57ff0b47ada05d1b;hp=f74881111c8e56f0e476a62ca7cfdb0479cff2e3;hb=HEAD;hpb=b4dc05e854736c8f353a0f6e18ca85faa4d3785e
diff --git a/BaseTools/BuildEnv b/BaseTools/BuildEnv
index f74881111c..275f4c5901 100755
--- a/BaseTools/BuildEnv
+++ b/BaseTools/BuildEnv
@@ -4,13 +4,7 @@
#
# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
# Copyright (c) 2016, Linaro Ltd. 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
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
#
SetWorkspace() {
@@ -52,7 +46,7 @@ RestorePreviousConfiguration() {
done
fi
fi
-
+
PREVIOUS_CONF_FILE=$CONF_PATH/BuildEnv.sh
if [ -e $PREVIOUS_CONF_FILE ]
then
@@ -90,7 +84,7 @@ StoreCurrentConfiguration() {
#
OUTPUT_FILE=$CONF_PATH/BuildEnv.sh
#echo Storing current configuration into $OUTPUT_FILE
- echo "# Auto-generated by ${BASH_SOURCE[0]}" > $OUTPUT_FILE
+ echo "# Auto-generated by ${BASH_SOURCE[0]}" >| $OUTPUT_FILE
GenerateShellCodeToSetVariable WORKSPACE $OUTPUT_FILE
GenerateShellCodeToSetVariable EDK_TOOLS_PATH $OUTPUT_FILE
GenerateShellCodeToUpdatePath $OUTPUT_FILE
@@ -204,7 +198,17 @@ AddEdkToolsToPath() {
EDK_TOOLS_PATH_BIN=`GetEdkToolsPathBinDirectory`
- AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike
+ # check if the edk2basetools pip package is available
+ if $PYTHON_COMMAND -c "import edk2basetools" &> /dev/null; then
+ # if it is, use the pip version of the wrappers
+ echo "Using Pip Basetools"
+ AddDirToStartOfPath $EDK_TOOLS_PATH/BinPipWrappers/PosixLike
+ else
+ echo "Using EDK2 in-source Basetools"
+ AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike
+ fi
+
+
AddDirToStartOfPath $EDK_TOOLS_PATH_BIN
}