Skip to content

Commit

Permalink
Sync the files in root dirctory from main trunk r19027.
Browse files Browse the repository at this point in the history
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <[email protected]>


git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19081 6f19259b-4bc3-4df7-8a09-765794883524
  • Loading branch information
vanjeff authored and vanjeff committed Dec 1, 2015
1 parent 955b2d2 commit 76c0925
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 25 deletions.
64 changes: 47 additions & 17 deletions Edk2Setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,33 @@

@if not defined ORIGINAL_PATH set "ORIGINAL_PATH=%PATH%"
@REM Always set the WORKSPACE environment variable to the current directory
@set "WORKSPACE=%CD%"
@if exist "%WORKSPACE%\BaseTools" @set "BASE_TOOLS_PATH=%WORKSPACE%\BaseTools"
@if not defined WORKSPACE (
@set "WORKSPACE=%CD%"
)
@if not exist "%BASE_TOOLS_PATH%" (
@if exist "%WORKSPACE%\BaseTools" (
set "BASE_TOOLS_PATH=%WORKSPACE%\BaseTools"
) else (
@if defined PACKAGES_PATH (
@for %%i IN (%PACKAGES_PATH%) DO (
@if exist %%~fi\BaseTools (
@set BASE_TOOLS_PATH=%%~fi\BaseTools
@goto checkBaseTools
)
)
)
)
)
:checkBaseTools
@if not defined BASE_TOOLS_PATH (
@echo.
@echo !!! ERROR !!! The BaseTools Package was not found !!!
@echo.
@goto ExitFailure
)
@if not exist "%WORKSPACE%\Conf" @mkdir "%WORKSPACE%\Conf"

@@if not defined EDK_TOOLS_PATH @set "EDK_TOOLS_PATH=%WORKSPACE%\BaseTools"
@rem @set "PATH=%WORKSPACE%\BaseTools\Bin\Win32;%PATH%"
@rem @set WORKSPACE_TOOLS_PATH=%WORKSPACE%\BaseTools
@rem )
@@if not defined EDK_TOOLS_PATH @set "EDK_TOOLS_PATH=%BASE_TOOLS_PATH%"

@REM Keep the existing EDK_TOOLS_PATH value, the --reset flag will set it
@REM back to WORKSPACE\BaseTools while the --location DIRECTORY flag will
Expand Down Expand Up @@ -259,7 +278,7 @@
@echo %SCRIPT_NAME% Version: %SCRIPT_VERSION%%SVN_REVISION:~11,-1%
@echo Copyright(c) 2014, Intel Corporation. All rights reserved.
@set HIDE_PATH=TRUE
@call "%WORKSPACE%\BaseTools\Scripts\ShowEnvironment.bat"
@call "%BASE_TOOLS_PATH%\Scripts\ShowEnvironment.bat"
@set HIDE_PATH=
@goto ExitSuccess

Expand Down Expand Up @@ -352,8 +371,8 @@
@REM copied or replaced from the WORKSPACE\BaseTools\Conf directories' template files.
:SetConf
@if not exist "%EDK_TOOLS_PATH%\Conf" (
@if exist "%WORKSPACE%\BaseTools\Conf" (
@set "SRC_CONF=%WORKSPACE%\BaseTools\Conf"
@if exist "%BASE_TOOLS_PATH%\Conf" (
@set "SRC_CONF=%BASE_TOOLS_PATH%\Conf"
)
) else (
@set "SRC_CONF=%EDK_TOOLS_PATH%\Conf"
Expand All @@ -365,7 +384,7 @@

@REM The script will test to see if the files exist, and also use the RESET_ENVIRONMENT flag
@REM to overwrite the WORKSPACE\Conf *.txt files.
@call "%WORKSPACE%\BaseTools\Scripts\ShowEnvironment.bat"
@call "%BASE_TOOLS_PATH%\Scripts\ShowEnvironment.bat"
@if errorlevel 1 (
@echo Unable to copy the template files from "%SRC_CONF%" to "%WORKSPACE%\Conf"
@goto ExitFailure
Expand All @@ -375,22 +394,34 @@
@REM Set up Visual Studio if required to build the Nt32Pkg/Nt32Pkg.dsc emulator
@if "%NT32PKG%"=="TRUE" (
@if not defined VSINSTALLDIR @set "PATH=%ORIGINAL_PATH%"
@if not defined NT32_X64 @call "%WORKSPACE%\BaseTools\get_vsvars.bat"
@if defined NT32_X64 call "%WORKSPACE%\BaseTools\Scripts\SetVisualStudio.bat"
@if not defined NT32_X64 @call "%BASE_TOOLS_PATH%\get_vsvars.bat"
@if defined NT32_X64 call "%BASE_TOOLS_PATH%\Scripts\SetVisualStudio.bat"
)
@if "%NT32PKG%"=="TRUE" (
@if not defined VS_PATH set "VS_PATH=%PATH%"
)
@if defined VS_PATH @set "PATH=%VS_PATH%"
@if not defined VS_PATH @set "PATH=%ORIGINAL_PATH%"
@set "PATH=%EDK_TOOLS_PATH%\Bin\Win32;%PATH%"
@if not defined EDK_TOOLS_BIN (
@if exist %EDK_TOOLS_PATH%\Bin\Win32 (
@set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32
) else (
@echo.
@echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
@echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32
@echo Or configure EDK_TOOLS_BIN env to point Win32 directory.
@echo.
@goto ExitFailure
)
)
@set "PATH=%EDK_TOOLS_BIN%;%PATH%"

@if "%REBUILD_TOOLS%"=="TRUE" @goto Rebuild
@if "%SVN_PULL%"== "TRUE" (
if defined PYTHONHOME (
@REM Use the python script if possible to test is the svn command is available, if it fails, the user may be
@REM able to rebuild the Win32 binaries
@call "%WORKSPACE%\BaseTools\Scripts\UpdateBuildVersions.py" --svn-test -v
@call "%BASE_TOOLS_PATH%\Scripts\UpdateBuildVersions.py" --svn-test -v
@if errorlevel 1 (
@echo ERROR : The command-line svn tool is not available and the Win32 binaries do not exist
@echo Please re-run this script again with the --rebuild option to attempt to build
Expand All @@ -417,7 +448,6 @@

@REM The following code is used to rebuild the Win32 BaseTools binaries - check that required tools are available
:Rebuild
@if not defined BASE_TOOLS_PATH @set "BASE_TOOLS_PATH=%WORKSPACE%\BaseTools"
@if not exist "%BASE_TOOLS_PATH%\Source" @goto NoBaseTools
@endlocal
@if not defined VCINSTALLDIR @goto NoVisualStudio
Expand All @@ -430,11 +460,11 @@
@if not exist "%PYTHONHOME%\Scripts\cxfreeze.bat" @goto NoCxFreeze
@set "PYTHON_FREEZER_PATH=%PYTHONHOME%\Scripts"
)
@call "%WORKSPACE%\BaseTools\Scripts\SetVisualStudio.bat"
@call "%BASE_TOOLS_PATH%\Scripts\SetVisualStudio.bat"
@if errorlevel 1 @goto ExitFailure

:ShowAndExit
@call "%WORKSPACE%\BaseTools\Scripts\ShowEnvironment.bat"
@call "%BASE_TOOLS_PATH%\Scripts\ShowEnvironment.bat"

@REM #########################################################################################
@REM EXIT ROUTINES
Expand Down
3 changes: 2 additions & 1 deletion Maintainers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ M: Ard Biesheuvel <[email protected]>

BaseTools
W: https://github.com/tianocore/tianocore.github.io/wiki/BaseTools
M: Yingke D Liu <[email protected]>
M: Yonghong Zhu <[email protected]>
M: Liming Gao <[email protected]>

BeagleBoardPkg
W: https://github.com/tianocore/tianocore.github.io/wiki/BeagleBoardPkg
Expand Down
30 changes: 26 additions & 4 deletions edksetup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ if %WORKSPACE% == %CD% (
:SetWorkSpace
@REM set new workspace
@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace
set WORKSPACE=%CD%
set EFI_SOURCE=
set EDK_SOURCE=
if not defined WORKSPACE (
set WORKSPACE=%CD%
set EFI_SOURCE=
set EDK_SOURCE=
)

:ParseArgs
if /I "%1"=="-h" goto Usage
Expand Down Expand Up @@ -92,8 +94,28 @@ if not defined VCINSTALLDIR (
shift

:no_nt32

if /I "%1"=="NewBuild" shift
set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
if exist %WORKSPACE%\BaseTools (
set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
) else (
if defined PACKAGES_PATH (
for %%i IN (%PACKAGES_PATH%) DO (
if exist %%~fi\BaseTools (
set EDK_TOOLS_PATH=%%~fi\BaseTools
goto checkBaseTools
)
)
) else (
echo.
echo !!! ERROR !!! Cannot find BaseTools !!!
echo.
goto BadBaseTools
)
)
if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%

:checkBaseTools
IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
call %EDK_TOOLS_PATH%\toolsetup.bat %*
if /I "%1"=="Reconfig" shift
Expand Down
19 changes: 16 additions & 3 deletions edksetup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2006 - 2015, Intel Corporation. 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
Expand Down Expand Up @@ -78,10 +78,23 @@ function SetupEnv()
elif [ -f "$WORKSPACE/BaseTools/BuildEnv" ]
then
. $WORKSPACE/BaseTools/BuildEnv $*
elif [ -n "$PACKAGES_PATH" ]
then
PATH_LIST=$PACKAGES_PATH
PATH_LIST=${PATH_LIST//:/ }
for DIR in $PATH_LIST
do
if [ -f "$DIR/BaseTools/BuildEnv" ]
then
export EDK_TOOLS_PATH=$DIR/BaseTools
. $DIR/BaseTools/BuildEnv $*
break
fi
done
else
echo BaseTools not found in your tree, and EDK_TOOLS_PATH is not set.
echo Please check that WORKSPACE is not set incorrectly in your
echo shell, or point EDK_TOOLS_PATH at the directory that contains
echo Please check that WORKSPACE or PACKAGES_PATH is not set incorrectly
echo in your shell, or point EDK_TOOLS_PATH at the directory that contains
echo the EDK2 BuildEnv script.
return 1
fi
Expand Down

0 comments on commit 76c0925

Please sign in to comment.