]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/BuildEnv
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / BaseTools / BuildEnv
index f74881111c8e56f0e476a62ca7cfdb0479cff2e3..275f4c5901aa59b4726dc1ff57ff0b47ada05d1b 100755 (executable)
@@ -4,13 +4,7 @@
 #
 # Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
 # Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-# 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
 
 }