Revision: 18784
          http://sourceforge.net/p/edk2/code/18784
Author:   vanjeff
Date:     2015-11-16 05:29:49 +0000 (Mon, 16 Nov 2015)
Log Message:
-----------
Update BaseTools from main trunk r18767.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18767

Modified Paths:
--------------
    branches/UDK2015/BaseTools/Bin/externals.txt
    branches/UDK2015/BaseTools/BuildEnv
    branches/UDK2015/BaseTools/Conf/tools_def.template
    branches/UDK2015/BaseTools/Scripts/SetVisualStudio.bat
    branches/UDK2015/BaseTools/Scripts/ShowEnvironment.bat
    branches/UDK2015/BaseTools/Source/C/Common/PeCoffLoaderEx.c
    branches/UDK2015/BaseTools/Source/C/GenFw/Elf32Convert.c
    branches/UDK2015/BaseTools/Source/C/GenFw/Elf64Convert.c
    branches/UDK2015/BaseTools/Source/C/GenFw/GenFw.c
    branches/UDK2015/BaseTools/Source/C/Split/Split.c
    branches/UDK2015/BaseTools/Source/C/VfrCompile/VfrSyntax.g
    branches/UDK2015/BaseTools/Source/Python/AutoGen/AutoGen.py
    branches/UDK2015/BaseTools/Source/Python/AutoGen/GenC.py
    branches/UDK2015/BaseTools/Source/Python/AutoGen/GenMake.py
    branches/UDK2015/BaseTools/Source/Python/Common/EdkIIWorkspace.py
    branches/UDK2015/BaseTools/Source/Python/Common/FdfParserLite.py
    branches/UDK2015/BaseTools/Source/Python/Common/LongFilePathOsPath.py
    branches/UDK2015/BaseTools/Source/Python/Common/Misc.py
    branches/UDK2015/BaseTools/Source/Python/Common/String.py
    branches/UDK2015/BaseTools/Source/Python/Ecc/Check.py
    branches/UDK2015/BaseTools/Source/Python/Ecc/Ecc.py
    branches/UDK2015/BaseTools/Source/Python/Ecc/MetaDataParser.py
    branches/UDK2015/BaseTools/Source/Python/Ecc/c.py
    branches/UDK2015/BaseTools/Source/Python/GenFds/FfsInfStatement.py
    branches/UDK2015/BaseTools/Source/Python/GenFds/GenFds.py
    branches/UDK2015/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
    branches/UDK2015/BaseTools/Source/Python/GenFds/Region.py
    branches/UDK2015/BaseTools/Source/Python/Makefile
    
branches/UDK2015/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py
    branches/UDK2015/BaseTools/Source/Python/UPT/Core/PackageFile.py
    branches/UDK2015/BaseTools/Source/Python/UPT/Library/GlobalData.py
    branches/UDK2015/BaseTools/Source/Python/UPT/Library/Misc.py
    branches/UDK2015/BaseTools/Source/Python/UPT/Library/ParserValidate.py
    branches/UDK2015/BaseTools/Source/Python/UPT/Library/Parsing.py
    branches/UDK2015/BaseTools/Source/Python/UPT/MkPkg.py
    branches/UDK2015/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py
    branches/UDK2015/BaseTools/Source/Python/UPT/UPT.py
    branches/UDK2015/BaseTools/Source/Python/Workspace/MetaFileParser.py
    branches/UDK2015/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
    branches/UDK2015/BaseTools/toolsetup.bat

Property Changed:
----------------
    branches/UDK2015/BaseTools/Bin/

Index: branches/UDK2015/BaseTools/Bin
===================================================================
--- branches/UDK2015/BaseTools/Bin      2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Bin      2015-11-16 05:29:49 UTC (rev 18784)

Property changes on: branches/UDK2015/BaseTools/Bin
___________________________________________________________________
Modified: svn:externals
## -1 +1 ##
-Win32  -r92 https://svn.code.sf.net/p/edk2-toolbinaries/code/trunk/Win32
+Win32   https://svn.code.sf.net/p/edk2-toolbinaries/code/trunk/Win32
Modified: branches/UDK2015/BaseTools/Bin/externals.txt
===================================================================
--- branches/UDK2015/BaseTools/Bin/externals.txt        2015-11-13 09:35:54 UTC 
(rev 18783)
+++ branches/UDK2015/BaseTools/Bin/externals.txt        2015-11-16 05:29:49 UTC 
(rev 18784)
@@ -1 +1 @@
-Win32  -r92 https://svn.code.sf.net/p/edk2-toolbinaries/code/trunk/Win32
+Win32  https://svn.code.sf.net/p/edk2-toolbinaries/code/trunk/Win32

Modified: branches/UDK2015/BaseTools/BuildEnv
===================================================================
--- branches/UDK2015/BaseTools/BuildEnv 2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/BuildEnv 2015-11-16 05:29:49 UTC (rev 18784)
@@ -2,7 +2,7 @@
 # Setup the environment for unix-like systems running a bash-like shell.
 # This file must be "sourced" not merely executed. For example: ". edksetup.sh"
 #
-# Copyright (c) 2006 - 2014, 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
@@ -35,11 +35,28 @@
   #
   # Restore previous configuration
   #
-  PREVIOUS_CONF_FILE=Conf/BuildEnv.sh
+  if [ -z "$CONF_PATH" ]
+  then
+    export CONF_PATH=$WORKSPACE/Conf
+    if [ ! -d $WORKSPACE/Conf ] && [ -n "$PACKAGES_PATH" ]
+    then
+      PACKAGES_PATH=${PACKAGES_PATH//:/ }
+      for DIR in $PACKAGES_PATH
+      do
+        if [ -d $DIR/Conf ]
+        then
+          export CONF_PATH=$DIR/Conf
+          break
+        fi
+      done
+    fi
+  fi
+  
+  PREVIOUS_CONF_FILE=$CONF_PATH/BuildEnv.sh
   if [ -e $PREVIOUS_CONF_FILE ]
   then
-    echo Loading previous configuration from \$WORKSPACE/$PREVIOUS_CONF_FILE
-    . $WORKSPACE/$PREVIOUS_CONF_FILE
+    echo Loading previous configuration from $PREVIOUS_CONF_FILE
+    . $PREVIOUS_CONF_FILE
   fi
 }
 
@@ -70,9 +87,8 @@
   # Write configuration to a shell script to allow for configuration to be
   # easily reloaded.
   #
-  OUTPUT_FILE=Conf/BuildEnv.sh
-  #echo Storing current configuration into \$WORKSPACE/$OUTPUT_FILE
-  OUTPUT_FILE=$WORKSPACE/$OUTPUT_FILE
+  OUTPUT_FILE=$CONF_PATH/BuildEnv.sh
+  #echo Storing current configuration into $OUTPUT_FILE
   echo "# Auto-generated by ${BASH_SOURCE[0]}" > $OUTPUT_FILE
   GenerateShellCodeToSetVariable WORKSPACE $OUTPUT_FILE
   GenerateShellCodeToSetVariable EDK_TOOLS_PATH $OUTPUT_FILE
@@ -90,20 +106,20 @@
   fi
 
   #
-  # Try $WORKSPACE/Conf/EdkTools
+  # Try $CONF_PATH/EdkTools
   #
-  if [ -e $WORKSPACE/Conf/EdkTools ]
+  if [ -e $CONF_PATH/EdkTools ]
   then
-    export EDK_TOOLS_PATH=$WORKSPACE/Conf/EdkTools
+    export EDK_TOOLS_PATH=$CONF_PATH/EdkTools
     return 0
   fi
 
   #
-  # Try $WORKSPACE/Conf/BaseToolsSource
+  # Try $CONF_PATH/BaseToolsSource
   #
-  if [ -e $WORKSPACE/Conf/BaseToolsSource ]
+  if [ -e $CONF_PATH/BaseToolsSource ]
   then
-    export EDK_TOOLS_PATH=$WORKSPACE/Conf/BaseToolsSource
+    export EDK_TOOLS_PATH=$CONF_PATH/BaseToolsSource
     return 0
   fi
 
@@ -116,6 +132,22 @@
     return 0
   fi
 
+  #
+  # Try $PACKAGES_PATH
+  #
+  if [ -n "$PACKAGES_PATH"]
+  then
+    PACKAGES_PATH=${PACKAGES_PATH//:/ }
+    for DIR in $PACKAGES_PATH
+    do
+      if [ -d $DIR/BaseTools ]
+      then
+        export EDK_TOOLS_PATH=$DIR/BaseTools
+        return 0
+      fi
+    done
+  fi
+
   echo "Unable to determine EDK_TOOLS_PATH"
   echo
   echo "You may need to download the 'BaseTools' from 
buildtools.tianocore.org."
@@ -179,17 +211,16 @@
 CopySingleTemplateFile() {
 
   SRC_FILENAME=Conf/$1.template
-  DST_FILENAME=Conf/$1.txt
+  DST_FILENAME=$CONF_PATH/$1.txt
 
-  if [ -e $WORKSPACE/$DST_FILENAME ]
+  if [ -e $DST_FILENAME ]
   then
     return
   fi
 
   echo "Copying \$EDK_TOOLS_PATH/$SRC_FILENAME"
-  echo "     to \$WORKSPACE/$DST_FILENAME"
+  echo "     to $DST_FILENAME"
   SRC_FILENAME=$EDK_TOOLS_PATH/$SRC_FILENAME
-  DST_FILENAME=$WORKSPACE/$DST_FILENAME
   cp $SRC_FILENAME $DST_FILENAME
 
 }
@@ -230,6 +261,7 @@
 
   echo WORKSPACE: $WORKSPACE
   echo EDK_TOOLS_PATH: $EDK_TOOLS_PATH
+  echo CONF_PATH: $CONF_PATH
 
   CopyTemplateFiles
 

Modified: branches/UDK2015/BaseTools/Conf/tools_def.template
===================================================================
--- branches/UDK2015/BaseTools/Conf/tools_def.template  2015-11-13 09:35:54 UTC 
(rev 18783)
+++ branches/UDK2015/BaseTools/Conf/tools_def.template  2015-11-16 05:29:49 UTC 
(rev 18784)
@@ -3812,12 +3812,12 @@
 DEFINE GCC_X64_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone 
-Wno-address -mno-stack-arg-probe
 DEFINE GCC_IPF_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) 
-minline-int-divide-min-latency
 DEFINE GCC_ARM_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mword-relocations 
-mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char 
-ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb 
-mfloat-abi=soft
-DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mcmodel=tiny 
-mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char  
-ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin 
-Wno-address -fno-asynchronous-unwind-tables
+DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian 
-fno-short-enums -save-temps -fverbose-asm -fsigned-char  -ffunction-sections 
-fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address 
-fno-asynchronous-unwind-tables
 DEFINE GCC_DLINK_FLAGS_COMMON      = -nostdlib --pie
 DEFINE GCC_DLINK2_FLAGS_COMMON     = 
--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
 DEFINE GCC_IA32_X64_DLINK_COMMON   = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
 DEFINE GCC_ARM_AARCH64_DLINK_COMMON= --emit-relocs -nostdlib --gc-sections -u 
$(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map 
$(DEST_DIR_DEBUG)/$(BASE_NAME).map
-DEFINE GCC_ARM_DLINK_FLAGS         = DEF(GCC_ARM_AARCH64_DLINK_COMMON) 
-Ttext=0x0
+DEFINE GCC_ARM_DLINK_FLAGS         = DEF(GCC_ARM_AARCH64_DLINK_COMMON) -z 
common-page-size=0x20
 DEFINE GCC_AARCH64_DLINK_FLAGS     = DEF(GCC_ARM_AARCH64_DLINK_COMMON) -z 
common-page-size=0x20
 DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry 
_ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)
 DEFINE GCC_ARM_ASLDLINK_FLAGS      = DEF(GCC_ARM_DLINK_FLAGS) --entry 
ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)
@@ -3844,9 +3844,9 @@
 DEFINE GCC44_IA32_X64_DLINK_COMMON   = -nostdlib -n -q --gc-sections -z 
common-page-size=0x20
 DEFINE GCC44_IA32_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) 
--entry ReferenceAcpiTable -u ReferenceAcpiTable
 DEFINE GCC44_IA32_X64_DLINK_FLAGS    = DEF(GCC44_IA32_X64_DLINK_COMMON) 
--entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map 
$(DEST_DIR_DEBUG)/$(BASE_NAME).map
-DEFINE GCC44_IA32_DLINK2_FLAGS       = DEF(GCC_DLINK2_FLAGS_COMMON) 
--defsym=PECOFF_HEADER_SIZE=0x220
+DEFINE GCC44_IA32_DLINK2_FLAGS       = --defsym=PECOFF_HEADER_SIZE=0x220 
DEF(GCC_DLINK2_FLAGS_COMMON)
 DEFINE GCC44_X64_DLINK_FLAGS         = DEF(GCC44_IA32_X64_DLINK_FLAGS)  
-melf_x86_64 --oformat=elf64-x86-64
-DEFINE GCC44_X64_DLINK2_FLAGS        = DEF(GCC_DLINK2_FLAGS_COMMON) 
--defsym=PECOFF_HEADER_SIZE=0x228
+DEFINE GCC44_X64_DLINK2_FLAGS        = --defsym=PECOFF_HEADER_SIZE=0x228 
DEF(GCC_DLINK2_FLAGS_COMMON)
 DEFINE GCC44_ASM_FLAGS               = DEF(GCC_ASM_FLAGS)
 
 DEFINE GCC45_IA32_CC_FLAGS           = DEF(GCC44_IA32_CC_FLAGS)
@@ -3871,6 +3871,7 @@
 DEFINE GCC46_ARM_ASM_FLAGS           = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) 
DEF(GCC_ASM_FLAGS) -mlittle-endian
 DEFINE GCC46_ARM_CC_FLAGS            = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) 
DEF(GCC44_ALL_CC_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fstack-protector
 DEFINE GCC46_ARM_DLINK_FLAGS         = DEF(GCC_ARM_DLINK_FLAGS) 
--oformat=elf32-littlearm
+DEFINE GCC46_ARM_DLINK2_FLAGS        = DEF(GCC_DLINK2_FLAGS_COMMON) 
--defsym=PECOFF_HEADER_SIZE=0x220
 DEFINE GCC46_ARM_ASLDLINK_FLAGS      = DEF(GCC_ARM_ASLDLINK_FLAGS) 
--oformat=elf32-littlearm
 
 DEFINE GCC47_IA32_CC_FLAGS           = DEF(GCC46_IA32_CC_FLAGS)
@@ -3885,8 +3886,9 @@
 DEFINE GCC47_ARM_ASM_FLAGS           = DEF(GCC46_ARM_ASM_FLAGS)
 DEFINE GCC47_AARCH64_ASM_FLAGS       = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) 
DEF(GCC_ASM_FLAGS) -mlittle-endian
 DEFINE GCC47_ARM_CC_FLAGS            = DEF(GCC46_ARM_CC_FLAGS) 
-mno-unaligned-access
-DEFINE GCC47_AARCH64_CC_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) 
DEF(GCC44_ALL_CC_FLAGS) DEF(GCC_AARCH64_CC_FLAGS)
+DEFINE GCC47_AARCH64_CC_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) 
DEF(GCC44_ALL_CC_FLAGS) -mcmodel=large DEF(GCC_AARCH64_CC_FLAGS)
 DEFINE GCC47_ARM_DLINK_FLAGS         = DEF(GCC46_ARM_DLINK_FLAGS)
+DEFINE GCC47_ARM_DLINK2_FLAGS        = DEF(GCC46_ARM_DLINK2_FLAGS)
 DEFINE GCC47_AARCH64_DLINK_FLAGS     = DEF(GCC_AARCH64_DLINK_FLAGS)
 DEFINE GCC47_AARCH64_DLINK2_FLAGS    = DEF(GCC_DLINK2_FLAGS_COMMON) 
--defsym=PECOFF_HEADER_SIZE=0x228
 DEFINE GCC47_ARM_ASLDLINK_FLAGS      = DEF(GCC46_ARM_ASLDLINK_FLAGS)
@@ -3906,6 +3908,7 @@
 DEFINE GCC48_ARM_CC_FLAGS            = DEF(GCC47_ARM_CC_FLAGS)
 DEFINE GCC48_AARCH64_CC_FLAGS        = DEF(GCC47_AARCH64_CC_FLAGS)
 DEFINE GCC48_ARM_DLINK_FLAGS         = DEF(GCC47_ARM_DLINK_FLAGS)
+DEFINE GCC48_ARM_DLINK2_FLAGS        = DEF(GCC47_ARM_DLINK2_FLAGS)
 DEFINE GCC48_AARCH64_DLINK_FLAGS     = DEF(GCC47_AARCH64_DLINK_FLAGS)
 DEFINE GCC48_AARCH64_DLINK2_FLAGS    = DEF(GCC47_AARCH64_DLINK2_FLAGS)
 DEFINE GCC48_ARM_ASLDLINK_FLAGS      = DEF(GCC47_ARM_ASLDLINK_FLAGS)
@@ -3923,8 +3926,9 @@
 DEFINE GCC49_ARM_ASM_FLAGS           = DEF(GCC48_ARM_ASM_FLAGS)
 DEFINE GCC49_AARCH64_ASM_FLAGS       = DEF(GCC48_AARCH64_ASM_FLAGS)
 DEFINE GCC49_ARM_CC_FLAGS            = DEF(GCC48_ARM_CC_FLAGS)
-DEFINE GCC49_AARCH64_CC_FLAGS        = DEF(GCC48_AARCH64_CC_FLAGS)
+DEFINE GCC49_AARCH64_CC_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) 
DEF(GCC44_ALL_CC_FLAGS) -mcmodel=tiny DEF(GCC_AARCH64_CC_FLAGS)
 DEFINE GCC49_ARM_DLINK_FLAGS         = DEF(GCC48_ARM_DLINK_FLAGS)
+DEFINE GCC49_ARM_DLINK2_FLAGS        = DEF(GCC48_ARM_DLINK2_FLAGS)
 DEFINE GCC49_AARCH64_DLINK_FLAGS     = DEF(GCC48_AARCH64_DLINK_FLAGS)
 DEFINE GCC49_AARCH64_DLINK2_FLAGS    = DEF(GCC48_AARCH64_DLINK2_FLAGS)
 DEFINE GCC49_ARM_ASLDLINK_FLAGS      = DEF(GCC48_ARM_ASLDLINK_FLAGS)
@@ -4250,6 +4254,7 @@
 *_GCC46_ARM_ASLDLINK_FLAGS       = DEF(GCC46_ARM_ASLDLINK_FLAGS)
 *_GCC46_ARM_ASM_FLAGS            = DEF(GCC46_ARM_ASM_FLAGS)
 *_GCC46_ARM_DLINK_FLAGS          = DEF(GCC46_ARM_DLINK_FLAGS)
+*_GCC46_ARM_DLINK2_FLAGS         = DEF(GCC46_ARM_DLINK2_FLAGS)
 *_GCC46_ARM_PLATFORM_FLAGS       = -march=armv7-a
 *_GCC46_ARM_PP_FLAGS             = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) 
DEF(GCC_PP_FLAGS)
 *_GCC46_ARM_RC_FLAGS             = DEF(GCC_ARM_RC_FLAGS)
@@ -4349,6 +4354,7 @@
 *_GCC47_ARM_ASLDLINK_FLAGS       = DEF(GCC47_ARM_ASLDLINK_FLAGS)
 *_GCC47_ARM_ASM_FLAGS            = DEF(GCC47_ARM_ASM_FLAGS)
 *_GCC47_ARM_DLINK_FLAGS          = DEF(GCC47_ARM_DLINK_FLAGS)
+*_GCC47_ARM_DLINK2_FLAGS         = DEF(GCC47_ARM_DLINK2_FLAGS)
 *_GCC47_ARM_PLATFORM_FLAGS       = -march=armv7-a
 *_GCC47_ARM_PP_FLAGS             = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) 
DEF(GCC_PP_FLAGS)
 *_GCC47_ARM_RC_FLAGS             = DEF(GCC_ARM_RC_FLAGS)
@@ -4475,6 +4481,7 @@
 *_GCC48_ARM_ASLDLINK_FLAGS       = DEF(GCC48_ARM_ASLDLINK_FLAGS)
 *_GCC48_ARM_ASM_FLAGS            = DEF(GCC48_ARM_ASM_FLAGS)
 *_GCC48_ARM_DLINK_FLAGS          = DEF(GCC48_ARM_DLINK_FLAGS)
+*_GCC48_ARM_DLINK2_FLAGS         = DEF(GCC48_ARM_DLINK2_FLAGS)
 *_GCC48_ARM_PLATFORM_FLAGS       = -march=armv7-a
 *_GCC48_ARM_PP_FLAGS             = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) 
DEF(GCC_PP_FLAGS)
 *_GCC48_ARM_RC_FLAGS             = DEF(GCC_ARM_RC_FLAGS)
@@ -4601,6 +4608,7 @@
 *_GCC49_ARM_ASLDLINK_FLAGS       = DEF(GCC49_ARM_ASLDLINK_FLAGS)
 *_GCC49_ARM_ASM_FLAGS            = DEF(GCC49_ARM_ASM_FLAGS)
 *_GCC49_ARM_DLINK_FLAGS          = DEF(GCC49_ARM_DLINK_FLAGS)
+*_GCC49_ARM_DLINK2_FLAGS         = DEF(GCC49_ARM_DLINK2_FLAGS)
 *_GCC49_ARM_PLATFORM_FLAGS       = -march=armv7-a
 *_GCC49_ARM_PP_FLAGS             = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) 
DEF(GCC_PP_FLAGS)
 *_GCC49_ARM_RC_FLAGS             = DEF(GCC_ARM_RC_FLAGS)
@@ -6609,7 +6617,7 @@
 
 DEFINE RVCT_ALL_ASM_FLAGS   = --diag_suppress=1786 --diag_error=warning --apcs 
/interwork
 DEFINE RVCT_ALL_CC_FLAGS    = --c90 -c --no_autoinline --asm --gnu --apcs 
/interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int 
--preinclude AutoGen.h --diag_suppress=186 --diag_warning 167 
--diag_error=warning --diag_style=ide --protect_stack
-DEFINE RVCT_ALL_DLINK_FLAGS = --ro-base 0 --no_scanlib --reloc --no_exceptions 
--datacompressor off --strict --symbols --diag_style=ide
+DEFINE RVCT_ALL_DLINK_FLAGS = --ro-base 0 --no_scanlib --reloc --no_exceptions 
--datacompressor off --strict --symbols --diag_style=ide --no_legacyalign
 
 
####################################################################################
 #

Modified: branches/UDK2015/BaseTools/Scripts/SetVisualStudio.bat
===================================================================
--- branches/UDK2015/BaseTools/Scripts/SetVisualStudio.bat      2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Scripts/SetVisualStudio.bat      2015-11-16 
05:29:49 UTC (rev 18784)
@@ -68,7 +68,7 @@
 @goto End
 
 :RebuildTools
-@call python "%WORKSPACE%\BaseTools\Scripts\UpdateBuildVersions.py"
+@call python "%BASE_TOOLS_PATH%\Scripts\UpdateBuildVersions.py"
 @set "BIN_DIR=%EDK_TOOLS_PATH%\Bin\Win32"
 if not exist "%BIN_DIR%" @mkdir "%BIN_DIR%"
 @echo Removing temporary and binary files

Modified: branches/UDK2015/BaseTools/Scripts/ShowEnvironment.bat
===================================================================
--- branches/UDK2015/BaseTools/Scripts/ShowEnvironment.bat      2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Scripts/ShowEnvironment.bat      2015-11-16 
05:29:49 UTC (rev 18784)
@@ -47,9 +47,11 @@
 @echo 
#############################################################################
 @if defined WORKSPACE @echo     WORKSPACE            = %WORKSPACE%
 @if not defined WORKSPACE @echo     WORKSPACE            = Not Set
+@if defined PACKAGES_PATH @echo     PACKAGES_PATH        = %PACKAGES_PATH%
 @if defined EDK_TOOLS_PATH @echo     EDK_TOOLS_PATH       = %EDK_TOOLS_PATH%
 @if not defined EDK_TOOLS_PATH @echo     EDK_TOOLS_PATH       = Not Set
 @if defined BASE_TOOLS_PATH @echo     BASE_TOOLS_PATH      = %BASE_TOOLS_PATH%
+@if defined EDK_TOOLS_BIN @echo     EDK_TOOLS_BIN        = %EDK_TOOLS_BIN%
 @if defined PYTHON_FREEZER_PATH @echo     PYTHON_FREEZER_PATH  = 
%PYTHON_FREEZER_PATH%
 @if "%NT32PKG%"=="TRUE" (
     @echo.

Modified: branches/UDK2015/BaseTools/Source/C/Common/PeCoffLoaderEx.c
===================================================================
--- branches/UDK2015/BaseTools/Source/C/Common/PeCoffLoaderEx.c 2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/C/Common/PeCoffLoaderEx.c 2015-11-16 
05:29:49 UTC (rev 18784)
@@ -402,8 +402,8 @@
     
     if (*FixupData != NULL) {
       *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));
-      *(UINT64 *)(*FixupData) = *Fixup16;
       CopyMem (*FixupData, Fixup16, sizeof (UINT64));
+      *FixupData = *FixupData + sizeof(UINT64);
     }
     break;
   

Modified: branches/UDK2015/BaseTools/Source/C/GenFw/Elf32Convert.c
===================================================================
--- branches/UDK2015/BaseTools/Source/C/GenFw/Elf32Convert.c    2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/C/GenFw/Elf32Convert.c    2015-11-16 
05:29:49 UTC (rev 18784)
@@ -218,6 +218,15 @@
   return (Offset + mCoffAlignment - 1) & ~(mCoffAlignment - 1);
 }
 
+STATIC
+UINT32
+DebugRvaAlign (
+  UINT32 Offset
+  )
+{
+  return (Offset + 3) & ~3;
+}
+
 //
 // filter functions
 //
@@ -331,12 +340,8 @@
         if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
           // if the section address is aligned we must align PE/COFF
           mCoffOffset = (mCoffOffset + shdr->sh_addralign - 1) & 
~(shdr->sh_addralign - 1);
-        } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % 
shdr->sh_addralign)) {
-          // ARM RVCT tools have behavior outside of the ELF specification to 
try
-          // and make images smaller.  If sh_addr is not aligned to 
sh_addralign
-          // then the section needs to preserve sh_addr MOD sh_addralign.
-          // Normally doing nothing here works great.
-          Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
+        } else {
+          Error (NULL, 0, 3000, "Invalid", "Section address not aligned to its 
own alignment.");
         }
       }
 
@@ -365,12 +370,9 @@
     assert (FALSE);
   }
 
-  mDebugOffset = mCoffOffset;
+  mDebugOffset = DebugRvaAlign(mCoffOffset);
+  mCoffOffset = CoffAlign(mCoffOffset);
 
-  if (mEhdr->e_machine != EM_ARM) {
-    mCoffOffset = CoffAlign(mCoffOffset);
-  }
-
   if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
     Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 text 
section. Source level debug might not work correctly.", mInImageName);
   }
@@ -389,12 +391,8 @@
         if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
           // if the section address is aligned we must align PE/COFF
           mCoffOffset = (mCoffOffset + shdr->sh_addralign - 1) & 
~(shdr->sh_addralign - 1);
-        } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % 
shdr->sh_addralign)) {
-          // ARM RVCT tools have behavior outside of the ELF specification to 
try
-          // and make images smaller.  If sh_addr is not aligned to 
sh_addralign
-          // then the section needs to preserve sh_addr MOD sh_addralign.
-          // Normally doing nothing here works great.
-          Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
+        } else {
+          Error (NULL, 0, 3000, "Invalid", "Section address not aligned to its 
own alignment.");
         }
       }
 
@@ -423,7 +421,7 @@
   // section alignment.
   //
   if (SectionCount > 0) {
-    mDebugOffset = mCoffOffset;
+    mDebugOffset = DebugRvaAlign(mCoffOffset);
   }
   mCoffOffset = mDebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY) +
                 sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) +
@@ -446,12 +444,8 @@
         if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
           // if the section address is aligned we must align PE/COFF
           mCoffOffset = (mCoffOffset + shdr->sh_addralign - 1) & 
~(shdr->sh_addralign - 1);
-        } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % 
shdr->sh_addralign)) {
-          // ARM RVCT tools have behavior outside of the ELF specification to 
try
-          // and make images smaller.  If sh_addr is not aligned to 
sh_addralign
-          // then the section needs to preserve sh_addr MOD sh_addralign.
-          // Normally doing nothing here works great.
-          Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
+        } else {
+          Error (NULL, 0, 3000, "Invalid", "Section address not aligned to its 
own alignment.");
         }
       }
       if (shdr->sh_size != 0) {

Modified: branches/UDK2015/BaseTools/Source/C/GenFw/Elf64Convert.c
===================================================================
--- branches/UDK2015/BaseTools/Source/C/GenFw/Elf64Convert.c    2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/C/GenFw/Elf64Convert.c    2015-11-16 
05:29:49 UTC (rev 18784)
@@ -211,6 +211,15 @@
   return (Offset + mCoffAlignment - 1) & ~(mCoffAlignment - 1);
 }
 
+STATIC
+UINT32
+DebugRvaAlign (
+  UINT32 Offset
+  )
+{
+  return (Offset + 3) & ~3;
+}
+
 //
 // filter functions
 //
@@ -325,12 +334,8 @@
         if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
           // if the section address is aligned we must align PE/COFF
           mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & 
~(shdr->sh_addralign - 1));
-        } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % 
shdr->sh_addralign)) {
-          // ARM RVCT tools have behavior outside of the ELF specification to 
try
-          // and make images smaller.  If sh_addr is not aligned to 
sh_addralign
-          // then the section needs to preserve sh_addr MOD sh_addralign.
-          // Normally doing nothing here works great.
-          Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
+        } else {
+          Error (NULL, 0, 3000, "Invalid", "Section address not aligned to its 
own alignment.");
         }
       }
 
@@ -359,12 +364,9 @@
     assert (FALSE);
   }
 
-  mDebugOffset = mCoffOffset;
+  mDebugOffset = DebugRvaAlign(mCoffOffset);
+  mCoffOffset = CoffAlign(mCoffOffset);
 
-  if (mEhdr->e_machine != EM_ARM) {
-    mCoffOffset = CoffAlign(mCoffOffset);
-  }
-
   if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
     Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 text 
section. Source level debug might not work correctly.", mInImageName);
   }
@@ -383,12 +385,8 @@
         if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
           // if the section address is aligned we must align PE/COFF
           mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & 
~(shdr->sh_addralign - 1));
-        } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % 
shdr->sh_addralign)) {
-          // ARM RVCT tools have behavior outside of the ELF specification to 
try
-          // and make images smaller.  If sh_addr is not aligned to 
sh_addralign
-          // then the section needs to preserve sh_addr MOD sh_addralign.
-          // Normally doing nothing here works great.
-          Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
+        } else {
+          Error (NULL, 0, 3000, "Invalid", "Section address not aligned to its 
own alignment.");
         }
       }
 
@@ -412,7 +410,7 @@
   // section alignment.
   //
   if (SectionCount > 0) {
-    mDebugOffset = mCoffOffset;
+    mDebugOffset = DebugRvaAlign(mCoffOffset);
   }
   mCoffOffset = mDebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY) +
                 sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) +
@@ -439,12 +437,8 @@
         if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
           // if the section address is aligned we must align PE/COFF
           mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & 
~(shdr->sh_addralign - 1));
-        } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % 
shdr->sh_addralign)) {
-          // ARM RVCT tools have behavior outside of the ELF specification to 
try
-          // and make images smaller.  If sh_addr is not aligned to 
sh_addralign
-          // then the section needs to preserve sh_addr MOD sh_addralign.
-          // Normally doing nothing here works great.
-          Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
+        } else {
+          Error (NULL, 0, 3000, "Invalid", "Section address not aligned to its 
own alignment.");
         }
       }
       if (shdr->sh_size != 0) {

Modified: branches/UDK2015/BaseTools/Source/C/GenFw/GenFw.c
===================================================================
--- branches/UDK2015/BaseTools/Source/C/GenFw/GenFw.c   2015-11-13 09:35:54 UTC 
(rev 18783)
+++ branches/UDK2015/BaseTools/Source/C/GenFw/GenFw.c   2015-11-16 05:29:49 UTC 
(rev 18784)
@@ -1,7 +1,7 @@
 /** @file
 Converts a pe32+ image to an FW, Te image type, or other specific image.
 
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 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
@@ -168,7 +168,7 @@
   //
   // Copyright declaration
   //
-  fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights 
reserved.\n\n");
+  fprintf (stdout, "Copyright (c) 2007 - 2015, Intel Corporation. All rights 
reserved.\n\n");
 
   //
   // Details Option
@@ -184,9 +184,9 @@
                         PIC_PEIM, RELOCATABLE_PEIM, BS_DRIVER, RT_DRIVER,\n\
                         APPLICATION, SAL_RT_DRIVER to support all module 
types\n\
                         It can only be used together with 
--keepexceptiontable,\n\
-                        --keepzeropending, -r, -o option.It is a action 
option.\n\
-                        If it is combined with other action options, the 
later\n\
-                        input action option will override the previous 
one.\n");
+                        --keepzeropending, --keepoptionalheader, -r, -o 
option.\n\
+                        It is a action option. If it is combined with other 
action options,\n\
+                        the later input action option will override the 
previous one.\n");
   fprintf (stdout, "  -c, --acpi            Create Acpi table.\n\
                         It can't be combined with other action options\n\
                         except for -o, -r option. It is a action option.\n\
@@ -194,9 +194,9 @@
                         input action option will override the previous 
one.\n");
   fprintf (stdout, "  -t, --terse           Create Te Image.\n\
                         It can only be used together with 
--keepexceptiontable,\n\
-                        --keepzeropending, -r, -o option.It is a action 
option.\n\
-                        If it is combined with other action options, the 
later\n\
-                        input action option will override the previous 
one.\n");
+                        --keepzeropending, --keepoptionalheader, -r, -o 
option.\n\
+                        It is a action option. If it is combined with other 
action options,\n\
+                        the later input action option will override the 
previous one.\n");
   fprintf (stdout, "  -u, --dump            Dump TeImage Header.\n\
                         It can't be combined with other action options\n\
                         except for -o, -r option. It is a action option.\n\
@@ -246,6 +246,9 @@
   fprintf (stdout, "  --keepexceptiontable  Don't clear exception table.\n\
                         This option can be used together with -e or -t.\n\
                         It doesn't work for other options.\n");
+  fprintf (stdout, "  --keepoptionalheader  Don't zero PE/COFF optional header 
fields.\n\
+                        This option can be used together with -e or -t.\n\
+                        It doesn't work for other options.\n");
   fprintf (stdout, "  --keepzeropending     Don't strip zero pending of 
.reloc.\n\
                         This option can be used together with -e or -t.\n\
                         It doesn't work for other options.\n");
@@ -1079,6 +1082,7 @@
   STATUS                           Status;
   BOOLEAN                          ReplaceFlag;
   BOOLEAN                          KeepExceptionTableFlag;
+  BOOLEAN                          KeepOptionalHeaderFlag;
   BOOLEAN                          KeepZeroPendingFlag;
   UINT64                           LogLevel;
   EFI_TE_IMAGE_HEADER              TEImageHeader;
@@ -1141,6 +1145,7 @@
   Optional32        = NULL;
   Optional64        = NULL;
   KeepExceptionTableFlag = FALSE;
+  KeepOptionalHeaderFlag = FALSE;
   KeepZeroPendingFlag    = FALSE;
   NumberOfFormPacakge    = 0;
   HiiPackageListBuffer   = NULL;
@@ -1269,6 +1274,13 @@
       continue;
     }
 
+    if (stricmp(argv[0], "--keepoptionalheader") == 0) {
+      KeepOptionalHeaderFlag = TRUE;
+      argc--;
+      argv++;
+      continue;
+    }
+
     if (stricmp (argv[0], "--keepzeropending") == 0) {
       KeepZeroPendingFlag = TRUE;
       argc --;
@@ -2303,19 +2315,20 @@
 
   if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
     Optional32 = (EFI_IMAGE_OPTIONAL_HEADER32 *)&PeHdr->Pe32.OptionalHeader;
-    Optional32->MajorOperatingSystemVersion = 0;
-    Optional32->MinorOperatingSystemVersion = 0;
-    Optional32->MajorImageVersion           = 0;
-    Optional32->MinorImageVersion           = 0;
-    Optional32->MajorSubsystemVersion       = 0;
-    Optional32->MinorSubsystemVersion       = 0;
-    Optional32->Win32VersionValue           = 0;
-    Optional32->CheckSum                    = 0;
-    Optional32->SizeOfStackReserve = 0;
-    Optional32->SizeOfStackCommit  = 0;
-    Optional32->SizeOfHeapReserve  = 0;
-    Optional32->SizeOfHeapCommit   = 0;
-
+    if (!KeepOptionalHeaderFlag) {
+      Optional32->MajorOperatingSystemVersion = 0;
+      Optional32->MinorOperatingSystemVersion = 0;
+      Optional32->MajorImageVersion = 0;
+      Optional32->MinorImageVersion = 0;
+      Optional32->MajorSubsystemVersion = 0;
+      Optional32->MinorSubsystemVersion = 0;
+      Optional32->Win32VersionValue = 0;
+      Optional32->CheckSum = 0;
+      Optional32->SizeOfStackReserve = 0;
+      Optional32->SizeOfStackCommit = 0;
+      Optional32->SizeOfHeapReserve = 0;
+      Optional32->SizeOfHeapCommit = 0;
+    }
     TEImageHeader.AddressOfEntryPoint = Optional32->AddressOfEntryPoint;
     TEImageHeader.BaseOfCode          = Optional32->BaseOfCode;
     TEImageHeader.ImageBase           = (UINT64) (Optional32->ImageBase);
@@ -2395,19 +2408,20 @@
     }
   } else if (PeHdr->Pe32.OptionalHeader.Magic == 
EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
     Optional64 = (EFI_IMAGE_OPTIONAL_HEADER64 *)&PeHdr->Pe32.OptionalHeader;
-    Optional64->MajorOperatingSystemVersion = 0;
-    Optional64->MinorOperatingSystemVersion = 0;
-    Optional64->MajorImageVersion           = 0;
-    Optional64->MinorImageVersion           = 0;
-    Optional64->MajorSubsystemVersion       = 0;
-    Optional64->MinorSubsystemVersion       = 0;
-    Optional64->Win32VersionValue           = 0;
-    Optional64->CheckSum                    = 0;
-    Optional64->SizeOfStackReserve = 0;
-    Optional64->SizeOfStackCommit  = 0;
-    Optional64->SizeOfHeapReserve  = 0;
-    Optional64->SizeOfHeapCommit   = 0;
-
+    if (!KeepOptionalHeaderFlag) {
+      Optional64->MajorOperatingSystemVersion = 0;
+      Optional64->MinorOperatingSystemVersion = 0;
+      Optional64->MajorImageVersion = 0;
+      Optional64->MinorImageVersion = 0;
+      Optional64->MajorSubsystemVersion = 0;
+      Optional64->MinorSubsystemVersion = 0;
+      Optional64->Win32VersionValue = 0;
+      Optional64->CheckSum = 0;
+      Optional64->SizeOfStackReserve = 0;
+      Optional64->SizeOfStackCommit = 0;
+      Optional64->SizeOfHeapReserve = 0;
+      Optional64->SizeOfHeapCommit = 0;
+    }
     TEImageHeader.AddressOfEntryPoint = Optional64->AddressOfEntryPoint;
     TEImageHeader.BaseOfCode          = Optional64->BaseOfCode;
     TEImageHeader.ImageBase           = (UINT64) (Optional64->ImageBase);

Modified: branches/UDK2015/BaseTools/Source/C/Split/Split.c
===================================================================
--- branches/UDK2015/BaseTools/Source/C/Split/Split.c   2015-11-13 09:35:54 UTC 
(rev 18783)
+++ branches/UDK2015/BaseTools/Source/C/Split/Split.c   2015-11-16 05:29:49 UTC 
(rev 18784)
@@ -2,7 +2,7 @@
 
   Split a file into two pieces at the request offset.
 
-Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 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
@@ -58,7 +58,7 @@
 --*/
 {
   printf ("%s Version %d.%d %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, 
UTILITY_MINOR_VERSION, __BUILD_VERSION);
-  printf ("Copyright (c) 1999-2014 Intel Corporation. All rights reserved.\n");
+  printf ("Copyright (c) 1999-2015 Intel Corporation. All rights reserved.\n");
   printf ("\n  SplitFile creates two Binary files either in the same directory 
as the current working\n");
   printf ("  directory or in the specified directory.\n");
 }
@@ -176,21 +176,26 @@
 {
   CHAR8* temp = *FullFileName;
   CHAR8* start = temp;
+  CHAR8  tempchar;
   UINT64 index = 0;
 
   for (;index < strlen(temp); ++index) {
     if (temp[index] == '\\' || temp[index] == '/') {
-      temp[index] = 0;
-      if (chdir(start)) {
-        if (mkdir(start, S_IRWXU | S_IRWXG | S_IRWXO) != 0) {
-          return EFI_ABORTED;
+      if (temp[index + 1] != '\0') {
+        tempchar = temp[index + 1];
+        temp[index + 1] = 0;
+        if (chdir(start)) {
+          if (mkdir(start, S_IRWXU | S_IRWXG | S_IRWXO) != 0) {
+            return EFI_ABORTED;
+          }
+          chdir(start);
         }
-        chdir(start);
+        start = temp + index + 1;
+        temp[index] = '/';
+        temp[index + 1] = tempchar;
+      }
     }
-      start = temp + index + 1;
-      temp[index] = '/';
   }
-  }
 
   return EFI_SUCCESS;
 }

Modified: branches/UDK2015/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- branches/UDK2015/BaseTools/Source/C/VfrCompile/VfrSyntax.g  2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/C/VfrCompile/VfrSyntax.g  2015-11-16 
05:29:49 UTC (rev 18784)
@@ -3258,7 +3258,7 @@
   Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" ","     << IIObj.SetError 
(_STOSID(S->getText(), S->getLine())); >>
   { FLAGS "=" flagsField ( "\|" flagsField )* "," }
   vfrStatementExpression[0]
-  E:EndIf                                              << CRT_END_OP (E); >>
+  E:EndIf {";"}                                        << CRT_END_OP (E); >>
   ;
 
 vfrStatementNoSubmitIf :
@@ -3267,7 +3267,7 @@
   Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" ","     << NSIObj.SetError 
(_STOSID(S->getText(), S->getLine())); >>
   { FLAGS "=" flagsField ( "\|" flagsField )* "," }
   vfrStatementExpression[0]
-  E:EndIf                                              << CRT_END_OP (E); >>
+  E:EndIf {";"}                                        << CRT_END_OP (E); >>
   ;
 
 vfrStatementWarningIf :
@@ -3276,7 +3276,7 @@
   Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" ","     << WIObj.SetWarning 
(_STOSID(S->getText(), S->getLine())); >>
   {Timeout "=" T:Number ","                            << WIObj.SetTimeOut 
(_STOU8(T->getText(), T->getLine())); >>}
   vfrStatementExpression[0]
-  E:EndIf                                              << CRT_END_OP (E); >>
+  E:EndIf {";"}                                        << CRT_END_OP (E); >>
   ;
 
 vfrStatementDisableIfQuest :
@@ -3286,7 +3286,7 @@
   L:DisableIf                                          << 
DIObj.SetLineNo(L->getLine()); >>
   vfrStatementExpression[0] ";"
   vfrStatementQuestionOptionList
-  E:EndIf                                              << CRT_END_OP (E); >>
+  E:EndIf {";"}                                        << CRT_END_OP (E); >>
   ;
 
 vfrStatementRefresh :
@@ -3316,7 +3316,7 @@
   { FLAGS "=" flagsField ( "\|" flagsField )* "," }
   vfrStatementExpression[0] ";"
   vfrStatementQuestionOptionList
-  E:EndIf                                              << CRT_END_OP (E); >>
+  E:EndIf {";"}                                        << CRT_END_OP (E); >>
   ;
 
 vfrStatementGrayOutIfQuest :
@@ -3325,7 +3325,7 @@
   { FLAGS "=" flagsField ( "\|" flagsField )* "," }
   vfrStatementExpression[0] ";"
   vfrStatementQuestionOptionList
-  E:EndIf                                              << CRT_END_OP (E); >>
+  E:EndIf {";"}                                        << CRT_END_OP (E); >>
   ;
 
 vfrStatementOptions :

Modified: branches/UDK2015/BaseTools/Source/Python/AutoGen/AutoGen.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/AutoGen/AutoGen.py 2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/AutoGen/AutoGen.py 2015-11-16 
05:29:49 UTC (rev 18784)
@@ -40,7 +40,7 @@
 import Common.VpdInfoFile as VpdInfoFile
 from GenPcdDb import CreatePcdDatabaseCode
 from Workspace.MetaFileCommentParser import UsageList
-
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 import InfSectionParser
 
 ## Regular expression for splitting Dependency Expression string into tokens
@@ -953,7 +953,7 @@
         self._GuidValue = {}
         FdfModuleList = []
         for InfName in self._AsBuildInfList:
-            InfName = os.path.join(self.WorkspaceDir, InfName)
+            InfName = mws.join(self.WorkspaceDir, InfName)
             FdfModuleList.append(os.path.normpath(InfName))
         for F in self.Platform.Modules.keys():
             M = ModuleAutoGen(self.Workspace, F, self.BuildTarget, 
self.ToolChain, self.Arch, self.MetaFile)
@@ -1288,7 +1288,7 @@
     def _GetFdfFile(self):
         if self._FdfFile == None:
             if self.Workspace.FdfFile != "":
-                self._FdfFile= path.join(self.WorkspaceDir, 
self.Workspace.FdfFile)
+                self._FdfFile= mws.join(self.WorkspaceDir, 
self.Workspace.FdfFile)
             else:
                 self._FdfFile = ''
         return self._FdfFile
@@ -2115,8 +2115,11 @@
                         BuildOptions[Tool][Attr] = ""
                     # check if override is indicated
                     if Value.startswith('='):
-                        BuildOptions[Tool][Attr] = Value[1:]
+                        ToolPath = Value[1:]
+                        ToolPath = mws.handleWsMacro(ToolPath)
+                        BuildOptions[Tool][Attr] = ToolPath
                     else:
+                        Value = mws.handleWsMacro(Value)
                         BuildOptions[Tool][Attr] += " " + Value
         if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag != 
None:
             #
@@ -2193,8 +2196,7 @@
             return False
 
         self.SourceDir = self.MetaFile.SubDir
-        if self.SourceDir.upper().find(self.WorkspaceDir.upper()) == 0:
-            self.SourceDir = self.SourceDir[len(self.WorkspaceDir) + 1:]
+        self.SourceDir = mws.relpath(self.SourceDir, self.WorkspaceDir)
 
         self.SourceOverrideDir = None
         # use overrided path defined in DSC file
@@ -3042,7 +3044,7 @@
                 self._IncludePathList.append(self.DebugDir)
 
             for Package in self.Module.Packages:
-                PackageDir = path.join(self.WorkspaceDir, Package.MetaFile.Dir)
+                PackageDir = mws.join(self.WorkspaceDir, Package.MetaFile.Dir)
                 if PackageDir not in self._IncludePathList:
                     self._IncludePathList.append(PackageDir)
                 for Inc in Package.Includes:

Modified: branches/UDK2015/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/AutoGen/GenC.py    2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/AutoGen/GenC.py    2015-11-16 
05:29:49 UTC (rev 18784)
@@ -1384,22 +1384,21 @@
 #   @param      AutoGenH    The TemplateString object for header file
 #
 def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH):
-    if Info.IsLibrary:
-        return
-
     if Info.ModuleType in ["USER_DEFINED", "BASE"]:
         GuidType = "GUID"
     else:
         GuidType = "EFI_GUID"
 
     if Info.GuidList:
-        AutoGenC.Append("\n// Guids\n")
+        if not Info.IsLibrary:
+            AutoGenC.Append("\n// Guids\n")
         AutoGenH.Append("\n// Guids\n")
     #
     # GUIDs
     #
     for Key in Info.GuidList:
-        AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % 
(GuidType, Key, Info.GuidList[Key]))
+        if not Info.IsLibrary:
+            AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % 
(GuidType, Key, Info.GuidList[Key]))
         AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
 
 ## Create code for protocol
@@ -1409,22 +1408,21 @@
 #   @param      AutoGenH    The TemplateString object for header file
 #
 def CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH):
-    if Info.IsLibrary:
-        return
-
     if Info.ModuleType in ["USER_DEFINED", "BASE"]:
         GuidType = "GUID"
     else:
         GuidType = "EFI_GUID"
 
     if Info.ProtocolList:
-        AutoGenC.Append("\n// Protocols\n")
+        if not Info.IsLibrary:
+            AutoGenC.Append("\n// Protocols\n")
         AutoGenH.Append("\n// Protocols\n")
     #
     # Protocol GUIDs
     #
     for Key in Info.ProtocolList:
-        AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % 
(GuidType, Key, Info.ProtocolList[Key]))
+        if not Info.IsLibrary:
+            AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % 
(GuidType, Key, Info.ProtocolList[Key]))
         AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
 
 ## Create code for PPI
@@ -1434,22 +1432,21 @@
 #   @param      AutoGenH    The TemplateString object for header file
 #
 def CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH):
-    if Info.IsLibrary:
-        return
-
     if Info.ModuleType in ["USER_DEFINED", "BASE"]:
         GuidType = "GUID"
     else:
         GuidType = "EFI_GUID"
 
     if Info.PpiList:
-        AutoGenC.Append("\n// PPIs\n")
+        if not Info.IsLibrary:
+            AutoGenC.Append("\n// PPIs\n")
         AutoGenH.Append("\n// PPIs\n")
     #
     # PPI GUIDs
     #
     for Key in Info.PpiList:
-        AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % 
(GuidType, Key, Info.PpiList[Key]))
+        if not Info.IsLibrary:
+            AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % 
(GuidType, Key, Info.PpiList[Key]))
         AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
 
 ## Create code for PCD

Modified: branches/UDK2015/BaseTools/Source/Python/AutoGen/GenMake.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/AutoGen/GenMake.py 2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/AutoGen/GenMake.py 2015-11-16 
05:29:49 UTC (rev 18784)
@@ -19,7 +19,7 @@
 import re
 import os.path as path
 from Common.LongFilePathSupport import OpenLongFilePath as open
-
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 from Common.BuildToolError import *
 from Common.Misc import *
 from Common.String import *
@@ -559,7 +559,7 @@
         found = False
         while not found and os.sep in package_rel_dir:
             index = package_rel_dir.index(os.sep)
-            current_dir = os.path.join(current_dir, package_rel_dir[:index])
+            current_dir = mws.join(current_dir, package_rel_dir[:index])
             for fl in os.listdir(current_dir):
                 if fl.endswith('.dec'):
                     found = True

Modified: branches/UDK2015/BaseTools/Source/Python/Common/EdkIIWorkspace.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Common/EdkIIWorkspace.py   
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Common/EdkIIWorkspace.py   
2015-11-16 05:29:49 UTC (rev 18784)
@@ -17,6 +17,7 @@
 import Common.LongFilePathOs as os, sys, time
 from DataType import *
 from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ## EdkIIWorkspace
 #
@@ -112,7 +113,7 @@
     # @retval string  The full path filename
     #
     def WorkspaceFile(self, FileName):
-        return os.path.realpath(os.path.join(self.WorkspaceDir,FileName))
+        return os.path.realpath(mws.join(self.WorkspaceDir,FileName))
 
     ## Convert to a real path filename
     #

Modified: branches/UDK2015/BaseTools/Source/Python/Common/FdfParserLite.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Common/FdfParserLite.py    
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Common/FdfParserLite.py    
2015-11-16 05:29:49 UTC (rev 18784)
@@ -20,6 +20,7 @@
 
 import CommonDataClass.FdfClass
 from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ##define T_CHAR_SPACE                ' '
 ##define T_CHAR_NULL                 '\0'
@@ -485,7 +486,8 @@
                 IncFileName = self.__Token
                 if not os.path.isabs(IncFileName):
                     if IncFileName.startswith('$(WORKSPACE)'):
-                        Str = IncFileName.replace('$(WORKSPACE)', 
os.environ.get('WORKSPACE'))
+                        Str = mws.handleWsMacro(IncFileName)
+                        Str = Str.replace('$(WORKSPACE)', 
os.environ.get('WORKSPACE'))
                         if os.path.exists(Str):
                             if not os.path.isabs(Str):
                                 Str = os.path.abspath(Str)
@@ -494,7 +496,7 @@
                         # file is in the same dir with FDF file
                         FullFdf = self.FileName
                         if not os.path.isabs(self.FileName):
-                            FullFdf = 
os.path.join(os.environ.get('WORKSPACE'), self.FileName)
+                            FullFdf = mws.join(os.environ.get('WORKSPACE'), 
self.FileName)
                 
                         IncFileName = os.path.join(os.path.dirname(FullFdf), 
IncFileName)
                     

Modified: branches/UDK2015/BaseTools/Source/Python/Common/LongFilePathOsPath.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Common/LongFilePathOsPath.py       
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Common/LongFilePathOsPath.py       
2015-11-16 05:29:49 UTC (rev 18784)
@@ -49,3 +49,5 @@
 islink = os.path.islink
 isabs = os.path.isabs
 realpath = os.path.realpath
+relpath = os.path.relpath
+pardir = os.path.pardir

Modified: branches/UDK2015/BaseTools/Source/Python/Common/Misc.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Common/Misc.py     2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Common/Misc.py     2015-11-16 
05:29:49 UTC (rev 18784)
@@ -35,6 +35,7 @@
 from CommonDataClass.DataClass import *
 from Parsing import GetSplitValueList
 from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ## Regular expression used to find out place holders in string template
 gPlaceholderPattern = re.compile("\$\{([^$()\s]+)\}", re.MULTILINE|re.UNICODE)
@@ -1728,6 +1729,7 @@
 
         # Remove any '.' and '..' in path
         if self.Root:
+            self.Root = mws.getWs(self.Root, self.File)
             self.Path = os.path.normpath(os.path.join(self.Root, self.File))
             self.Root = os.path.normpath(CommonPath([self.Root, self.Path]))
             # eliminate the side-effect of 'C:'
@@ -1838,7 +1840,10 @@
                 RealFile = os.path.join(self.AlterRoot, self.File)
             elif self.Root:
                 RealFile = os.path.join(self.Root, self.File)
-            return FILE_NOT_FOUND, os.path.join(self.AlterRoot, RealFile)
+            if len (mws.getPkgPath()) == 0:
+                return FILE_NOT_FOUND, os.path.join(self.AlterRoot, RealFile)
+            else:
+                return FILE_NOT_FOUND, "%s is not found in packages 
path:\n\t%s" % (self.File, '\n\t'.join(mws.getPkgPath()))
 
         ErrorCode = 0
         ErrorInfo = ''

Modified: branches/UDK2015/BaseTools/Source/Python/Common/String.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Common/String.py   2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Common/String.py   2015-11-16 
05:29:49 UTC (rev 18784)
@@ -24,6 +24,7 @@
 from BuildToolError import *
 from CommonDataClass.Exceptions import *
 from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 gHexVerPatt = re.compile('0x[a-f0-9]{4}[a-f0-9]{4}$', re.IGNORECASE)
 gHumanReadableVerPatt = re.compile(r'([1-9][0-9]*|0)\.[0-9]{1,2}$')
@@ -305,6 +306,11 @@
         # To local path format
         #
         Path = os.path.normpath(Path)
+        if Path.startswith(GlobalData.gWorkspace) and not os.path.exists(Path):
+            Path = Path[len (GlobalData.gWorkspace):]
+            if Path[0] == os.path.sep:
+                Path = Path[1:]
+            Path = mws.join(GlobalData.gWorkspace, Path)
 
     if IsRelativePath and Path[0] != '.':
         Path = os.path.join('.', Path)
@@ -702,7 +708,7 @@
 # @retval string A full path
 #
 def WorkspaceFile(WorkspaceDir, Filename):
-    return os.path.join(NormPath(WorkspaceDir), NormPath(Filename))
+    return mws.join(NormPath(WorkspaceDir), NormPath(Filename))
 
 ## Split string
 #

Modified: branches/UDK2015/BaseTools/Source/Python/Ecc/Check.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Ecc/Check.py       2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Ecc/Check.py       2015-11-16 
05:29:49 UTC (rev 18784)
@@ -19,6 +19,7 @@
 import EccGlobalData
 import c
 from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ## Check
 #
@@ -380,9 +381,7 @@
             for Key in RecordDict:
                 if len(RecordDict[Key]) > 1:
                     for Item in RecordDict[Key]:
-                        Path = Item[1].replace(EccGlobalData.gWorkspace, '')
-                        if Path.startswith('\\') or Path.startswith('/'):
-                            Path = Path[1:]
+                        Path = mws.relpath(Item[1], EccGlobalData.gWorkspace)
                         if not 
EccGlobalData.gException.IsException(ERROR_INCLUDE_FILE_CHECK_NAME, Path):
                             
EccGlobalData.gDb.TblReport.Insert(ERROR_INCLUDE_FILE_CHECK_NAME, OtherMsg="The 
file name for [%s] is duplicate" % Path, BelongsToTable='File', 
BelongsToItem=Item[0])
 
@@ -653,7 +652,7 @@
                 if LibraryClass[1].upper() == 'NULL' or 
LibraryClass[1].startswith('!ifdef') or LibraryClass[1].startswith('!ifndef') 
or LibraryClass[1].endswith('!endif'):
                     continue
                 else:
-                    LibraryIns = 
os.path.normpath(os.path.join(EccGlobalData.gWorkspace, LibraryClass[2]))
+                    LibraryIns = 
os.path.normpath(mws.join(EccGlobalData.gWorkspace, LibraryClass[2]))
                     SqlCommand = """select Value3 from Inf where BelongsToFile 
=
                                     (select ID from File where lower(FullPath) 
= lower('%s'))
                                     and Value2 = '%s'""" % (LibraryIns, 
'LIBRARY_CLASS')
@@ -729,7 +728,7 @@
             for Record in RecordSet:
                 FdfID = Record[0]
                 FilePath = Record[1]
-                FilePath = 
os.path.normpath(os.path.join(EccGlobalData.gWorkspace, FilePath))
+                FilePath = os.path.normpath(mws.join(EccGlobalData.gWorkspace, 
FilePath))
                 SqlCommand = """select ID from Inf where Model = %s and 
BelongsToFile = (select ID from File where FullPath like '%s')
                                 """ % (MODEL_EFI_SOURCE_FILE, FilePath)
                 NewRecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
@@ -913,9 +912,7 @@
         RecordSet = Table.Exec(SqlCommand)
         Path = ""
         for Record in RecordSet:
-            Path = Record[0].replace(EccGlobalData.gWorkspace, '')
-            if Path.startswith('\\') or Path.startswith('/'):
-                Path = Path[1:]
+            Path = mws.relpath(Record[0], EccGlobalData.gWorkspace)
         return Path
 
     # Check whether two module INFs under one workspace has the same FILE_GUID 
value
@@ -1223,7 +1220,10 @@
             SqlCommand = """select ID, Name from %s where Model = %s""" % 
(FileTable, MODEL_IDENTIFIER_VARIABLE)
             RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
             for Record in RecordSet:
-                if not Pattern.match(Record[1]):
+                Var = Record[1]
+                if Var.startswith('CONST'):
+                    Var = Var[5:].lstrip()
+                if not Pattern.match(Var):
                     if not 
EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME,
 Record[1]):
                         
EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 
OtherMsg="The variable name [%s] does not follow the rules" % (Record[1]), 
BelongsToTable=FileTable, BelongsToItem=Record[0])
 

Modified: branches/UDK2015/BaseTools/Source/Python/Ecc/Ecc.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Ecc/Ecc.py 2015-11-13 09:35:54 UTC 
(rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Ecc/Ecc.py 2015-11-16 05:29:49 UTC 
(rev 18784)
@@ -38,6 +38,7 @@
 import re, string
 from Exception import *
 from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ## Ecc
 #
@@ -70,8 +71,13 @@
         #
         WorkspaceDir = 
os.path.normcase(os.path.normpath(os.environ["WORKSPACE"]))
         os.environ["WORKSPACE"] = WorkspaceDir
+        
+        # set multiple workspace
+        PackagesPath = os.getenv("PACKAGES_PATH")
+        mws.setWs(WorkspaceDir, PackagesPath)
+        
         if "ECP_SOURCE" not in os.environ:
-            os.environ["ECP_SOURCE"] = os.path.join(WorkspaceDir, 
GlobalData.gEdkCompatibilityPkg)
+            os.environ["ECP_SOURCE"] = mws.join(WorkspaceDir, 
GlobalData.gEdkCompatibilityPkg)
         if "EFI_SOURCE" not in os.environ:
             os.environ["EFI_SOURCE"] = os.environ["ECP_SOURCE"]
         if "EDK_SOURCE" not in os.environ:

Modified: branches/UDK2015/BaseTools/Source/Python/Ecc/MetaDataParser.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Ecc/MetaDataParser.py      
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Ecc/MetaDataParser.py      
2015-11-16 05:29:49 UTC (rev 18784)
@@ -14,6 +14,7 @@
 import Common.LongFilePathOs as os
 from CommonDataClass.DataClass import *
 from EccToolError import *
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 import EccGlobalData
 import re
 ## Get the inlcude path list for a source file
@@ -33,8 +34,8 @@
                 % (MODEL_META_DATA_PACKAGE, MODEL_EFI_SOURCE_FILE, '\\', 
Filepath)
     RecordSet = Db.TblFile.Exec(SqlCommand)
     for Record in RecordSet:
-        DecFullPath = os.path.normpath(os.path.join(WorkSpace, Record[0]))
-        InfFullPath = os.path.normpath(os.path.join(WorkSpace, Record[1]))
+        DecFullPath = os.path.normpath(mws.join(WorkSpace, Record[0]))
+        InfFullPath = os.path.normpath(mws.join(WorkSpace, Record[1]))
         (DecPath, DecName) = os.path.split(DecFullPath)
         (InfPath, InfName) = os.path.split(InfFullPath)
         SqlCommand = """select Value1 from Dec where BelongsToFile =

Modified: branches/UDK2015/BaseTools/Source/Python/Ecc/c.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Ecc/c.py   2015-11-13 09:35:54 UTC 
(rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Ecc/c.py   2015-11-16 05:29:49 UTC 
(rev 18784)
@@ -1271,7 +1271,10 @@
         FuncName = Result[5]
         if 
EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, 
FuncName):
             continue
-        Index = Result[0].find(TypeStart)
+        Result0 = Result[0]
+        if Result0.upper().startswith('STATIC'):
+            Result0 = Result0[6:].strip()
+        Index = Result0.find(TypeStart)
         if Index != 0 or Result[3] != 0:
             PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, '[%s] 
Return Type should appear at the start of line' % FuncName, FileTable, 
Result[1])
 
@@ -1313,9 +1316,10 @@
     for Result in ResultSet:
         ReturnType = GetDataTypeFromModifier(Result[0])
         TypeStart = ReturnType.split()[0]
-#        if len(ReturnType) == 0:
-#            continue
-        Index = Result[0].find(TypeStart)
+        Result0 = Result[0]
+        if Result0.upper().startswith('STATIC'):
+            Result0 = Result0[6:].strip()
+        Index = Result0.find(TypeStart)
         if Index != 0:
             
PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONAL_MODIFIER, '', 
FileTable, Result[1])
 
@@ -1327,8 +1331,6 @@
     for Result in ResultSet:
         ReturnType = GetDataTypeFromModifier(Result[0])
         TypeStart = ReturnType.split()[0]
-#        if len(ReturnType) == 0:
-#            continue
         Result0 = Result[0]
         if Result0.upper().startswith('STATIC'):
             Result0 = Result0[6:].strip()
@@ -1631,6 +1633,8 @@
         Field = Field.strip()
         if Field == '':
             continue
+        if Field.startswith("#"):
+            continue
         # Enum could directly assign value to variable
         Field = Field.split('=')[0].strip()
         TokenList = Field.split()

Modified: branches/UDK2015/BaseTools/Source/Python/GenFds/FfsInfStatement.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/GenFds/FfsInfStatement.py  
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/GenFds/FfsInfStatement.py  
2015-11-16 05:29:49 UTC (rev 18784)
@@ -28,6 +28,7 @@
 import RuleSimpleFile
 import RuleComplexFile
 from CommonDataClass.FdfClass import FfsInfStatementClassObject
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 from Common.String import *
 from Common.Misc import PathClass
 from Common.Misc import GuidStructureByteArrayToGuidString
@@ -365,7 +366,7 @@
         #
 
         self.__InfParse__(Dict)
-        SrcFile = os.path.join( GenFdsGlobalVariable.WorkSpaceDir , 
self.InfFileName);
+        SrcFile = mws.join( GenFdsGlobalVariable.WorkSpaceDir , 
self.InfFileName);
         DestFile = os.path.join( self.OutputPath, self.ModuleGuid + '.ffs')
         
         SrcFileDir = "."
@@ -511,7 +512,7 @@
     #
     def __GetPlatformArchList__(self):
 
-        InfFileKey = 
os.path.normpath(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, 
self.InfFileName))
+        InfFileKey = 
os.path.normpath(mws.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName))
         DscArchList = []
         PlatformDataBase = 
GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 
'IA32', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
         if  PlatformDataBase != None:
@@ -878,7 +879,7 @@
             
             if not HasGneratedFlag:
                 UniVfrOffsetFileSection = ""    
-                ModuleFileName = 
os.path.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName)
+                ModuleFileName = mws.join(GenFdsGlobalVariable.WorkSpaceDir, 
self.InfFileName)
                 InfData = 
GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(ModuleFileName), 
self.CurrentArch]
                 #
                 # Search the source list in InfData to find if there are .vfr 
file exist.

Modified: branches/UDK2015/BaseTools/Source/Python/GenFds/GenFds.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/GenFds/GenFds.py   2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/GenFds/GenFds.py   2015-11-16 
05:29:49 UTC (rev 18784)
@@ -39,6 +39,7 @@
 from Common.Misc import ClearDuplicatedInf
 from Common.Misc import GuidStructureStringToGuidString
 from Common.BuildVersion import gBUILD_VERSION
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ## Version and Copyright
 versionNumber = "1.0" + ' ' + gBUILD_VERSION
@@ -94,6 +95,10 @@
             if (Options.debug):
                 GenFdsGlobalVariable.VerboseLogger( "Using Workspace:" + 
Workspace)
         os.chdir(GenFdsGlobalVariable.WorkSpaceDir)
+        
+        # set multiple workspace
+        PackagesPath = os.getenv("PACKAGES_PATH")
+        mws.setWs(GenFdsGlobalVariable.WorkSpaceDir, PackagesPath)
 
         if (Options.filename):
             FdfFilename = Options.filename
@@ -102,7 +107,7 @@
             if FdfFilename[0:2] == '..':
                 FdfFilename = os.path.realpath(FdfFilename)
             if not os.path.isabs (FdfFilename):
-                FdfFilename = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, 
FdfFilename)
+                FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, 
FdfFilename)
             if not os.path.exists(FdfFilename):
                 EdkLogger.error("GenFds", FILE_NOT_FOUND, 
ExtraData=FdfFilename)
 
@@ -129,13 +134,13 @@
                 ActivePlatform = os.path.realpath(ActivePlatform)
 
             if not os.path.isabs (ActivePlatform):
-                ActivePlatform = 
os.path.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)
+                ActivePlatform = mws.join(GenFdsGlobalVariable.WorkSpaceDir, 
ActivePlatform)
 
             if not os.path.exists(ActivePlatform)  :
                 EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform 
doesn't exist!")
 
             if os.path.normcase (ActivePlatform).find(Workspace) == 0:
-                ActivePlatform = ActivePlatform[len(Workspace):]
+                ActivePlatform = mws.relpath(ActivePlatform, Workspace)
             if len(ActivePlatform) > 0 :
                 if ActivePlatform[0] == '\\' or ActivePlatform[0] == '/':
                     ActivePlatform = ActivePlatform[1:]
@@ -159,7 +164,7 @@
                 ConfDirectoryPath = 
os.path.join(GenFdsGlobalVariable.WorkSpaceDir, ConfDirectoryPath)
         else:
             # Get standard WORKSPACE/Conf, use the absolute path to the 
WORKSPACE/Conf
-            ConfDirectoryPath = 
os.path.join(GenFdsGlobalVariable.WorkSpaceDir, 'Conf')
+            ConfDirectoryPath = mws.join(GenFdsGlobalVariable.WorkSpaceDir, 
'Conf')
         GenFdsGlobalVariable.ConfDir = ConfDirectoryPath
         BuildConfigurationFile = 
os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt"))
         if os.path.isfile(BuildConfigurationFile) == True:

Modified: 
branches/UDK2015/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py     
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py     
2015-11-16 05:29:49 UTC (rev 18784)
@@ -31,6 +31,7 @@
 import Common.DataType as DataType
 from Common.Misc import PathClass
 from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ## Global variables
 #
@@ -322,12 +323,13 @@
     #   @param  String           String that may contain macro
     #
     def ReplaceWorkspaceMacro(String):
+        String = mws.handleWsMacro(String)
         Str = String.replace('$(WORKSPACE)', GenFdsGlobalVariable.WorkSpaceDir)
         if os.path.exists(Str):
             if not os.path.isabs(Str):
                 Str = os.path.abspath(Str)
         else:
-            Str = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, String)
+            Str = mws.join(GenFdsGlobalVariable.WorkSpaceDir, String)
         return os.path.normpath(Str)
 
     ## Check if the input files are newer than output files

Modified: branches/UDK2015/BaseTools/Source/Python/GenFds/Region.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/GenFds/Region.py   2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/GenFds/Region.py   2015-11-16 
05:29:49 UTC (rev 18784)
@@ -24,6 +24,7 @@
 from Common import EdkLogger
 from Common.BuildToolError import *
 from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ## generate Region
 #
@@ -205,7 +206,7 @@
             for RegionData in self.RegionDataList:
                 RegionData = GenFdsGlobalVariable.MacroExtend(RegionData, 
MacroDict)
                 if RegionData[1] != ':' :
-                    RegionData = os.path.join 
(GenFdsGlobalVariable.WorkSpaceDir, RegionData)
+                    RegionData = mws.join (GenFdsGlobalVariable.WorkSpaceDir, 
RegionData)
                 if not os.path.exists(RegionData):
                     EdkLogger.error("GenFds", FILE_NOT_FOUND, 
ExtraData=RegionData)
                 #

Modified: branches/UDK2015/BaseTools/Source/Python/Makefile
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Makefile   2015-11-13 09:35:54 UTC 
(rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Makefile   2015-11-16 05:29:49 UTC 
(rev 18784)
@@ -59,6 +59,7 @@
               $(BASE_TOOLS_PATH)\Source\Python\Common\ToolDefClassObject.py \
               $(BASE_TOOLS_PATH)\Source\Python\Common\VpdInfoFile.py \
               $(BASE_TOOLS_PATH)\Source\Python\Common\BuildVersion.py \
+              $(BASE_TOOLS_PATH)\Source\Python\Common\MultipleWorkspace.py \
               $(BASE_TOOLS_PATH)\Source\Python\CommonDataClass\CommonClass.py \
               $(BASE_TOOLS_PATH)\Source\Python\CommonDataClass\DataClass.py \
               $(BASE_TOOLS_PATH)\Source\Python\CommonDataClass\Exceptions.py \

Modified: 
branches/UDK2015/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py
===================================================================
--- 
branches/UDK2015/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py   
    2015-11-13 09:35:54 UTC (rev 18783)
+++ 
branches/UDK2015/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py   
    2015-11-16 05:29:49 UTC (rev 18784)
@@ -32,6 +32,7 @@
 from Object.POM.CommonObject import IdentificationObject
 from Object.POM.CommonObject import CommonHeaderObject
 from Object.POM.CommonObject import MiscFileObject
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ## DistributionPackageHeaderClass
 #
@@ -110,14 +111,17 @@
     # @param ModuleList:    A list of all modules
     #
     def GetDistributionPackage(self, WorkspaceDir, PackageList, ModuleList):
+        # Backup WorkspaceDir
+        Root = WorkspaceDir
+
         #
         # Get Packages
         #
         if PackageList:
             for PackageFile in PackageList:
-                PackageFileFullPath = \
-                os.path.normpath(os.path.join(WorkspaceDir, PackageFile))
-                DecObj = DecPomAlignment(PackageFileFullPath, WorkspaceDir, 
CheckMulDec = True)
+                PackageFileFullPath = mws.join(Root, PackageFile)
+                WorkspaceDir = mws.getWs(Root, PackageFile)
+                DecObj = DecPomAlignment(PackageFileFullPath, WorkspaceDir, 
CheckMulDec=True)
                 PackageObj = DecObj
                 #
                 # Parser inf file one bye one
@@ -140,8 +144,7 @@
                     # Inf class in InfPomAlignment.
                     #
                     try:
-                        ModuleObj = InfPomAlignment(Filename, WorkspaceDir, \
-                                                PackageObj.GetPackagePath())
+                        ModuleObj = InfPomAlignment(Filename, WorkspaceDir, 
PackageObj.GetPackagePath())
      
                         #
                         # Add module to package
@@ -168,11 +171,11 @@
         #
         if ModuleList:
             for ModuleFile in ModuleList:
-                ModuleFileFullPath = \
-                os.path.normpath(os.path.join(WorkspaceDir, ModuleFile))
+                ModuleFileFullPath = mws.join(Root, ModuleFile)
+                WorkspaceDir = mws.getWs(Root, ModuleFile)
+
                 try:
-                    ModuleObj = InfPomAlignment(ModuleFileFullPath, 
-                                                WorkspaceDir)
+                    ModuleObj = InfPomAlignment(ModuleFileFullPath, 
WorkspaceDir)
                     ModuleKey = (ModuleObj.GetGuid(), 
                                  ModuleObj.GetVersion(), 
                                  ModuleObj.GetName(), 
@@ -185,8 +188,11 @@
                                      ST.WRN_EDK1_INF_FOUND%ModuleFileFullPath, 
                                      ExtraData=ST.ERR_NOT_SUPPORTED_SA_MODULE)
                     else:
-                        raise                
+                        raise
 
+        # Recover WorkspaceDir
+        WorkspaceDir = Root
+
     ## Get all files included for a distribution package, except tool/misc of 
     # distribution level
     # 

Modified: branches/UDK2015/BaseTools/Source/Python/UPT/Core/PackageFile.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/UPT/Core/PackageFile.py    
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/UPT/Core/PackageFile.py    
2015-11-16 05:29:49 UTC (rev 18784)
@@ -37,6 +37,7 @@
 from Library.Misc import CreateDirectory
 from Library.Misc import RemoveDirectory
 from Core.FileHook import __FileHookOpen__
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 
 class PackageFile:
@@ -203,8 +204,11 @@
     # @param Files:  the files to pack 
     #
     def PackFiles(self, Files):
-        for File1 in Files:
-            self.PackFile(File1)
+        for File in Files:
+            Cwd = os.getcwd()
+            os.chdir(mws.getWs(mws.WORKSPACE, File))
+            self.PackFile(File)
+            os.chdir(Cwd)
 
     ## Pack the file
     # 

Modified: branches/UDK2015/BaseTools/Source/Python/UPT/Library/GlobalData.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/UPT/Library/GlobalData.py  
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/UPT/Library/GlobalData.py  
2015-11-16 05:29:49 UTC (rev 18784)
@@ -19,6 +19,7 @@
 # The workspace directory 
 #
 gWORKSPACE = '.'
+gPACKAGE_PATH = None
 
 #
 # INF module directory
@@ -107,4 +108,4 @@
 # Used by Library instance parser
 # {FilePath: FileObj}
 #
-gLIBINSTANCEDICT = {}
\ No newline at end of file
+gLIBINSTANCEDICT = {}

Modified: branches/UDK2015/BaseTools/Source/Python/UPT/Library/Misc.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/UPT/Library/Misc.py        
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/UPT/Library/Misc.py        
2015-11-16 05:29:49 UTC (rev 18784)
@@ -50,6 +50,7 @@
 from Library.ParserValidate import IsValidPath
 from Object.POM.CommonObject import TextObject
 from Core.FileHook import __FileHookOpen__
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ## Convert GUID string in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx style to C 
 # structure style
@@ -592,8 +593,12 @@
 
     if WorkspaceDir[-1] == ':':
         WorkspaceDir += os.sep
-    return WorkspaceDir
 
+    PackagesPath = os.environ.get("PACKAGES_PATH")
+    mws.setWs(WorkspaceDir, PackagesPath)
+
+    return WorkspaceDir, mws.PACKAGES_PATH
+
 ## Get relative path
 #
 #  use full path and workspace to get relative path

Modified: branches/UDK2015/BaseTools/Source/Python/UPT/Library/ParserValidate.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/UPT/Library/ParserValidate.py      
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/UPT/Library/ParserValidate.py      
2015-11-16 05:29:49 UTC (rev 18784)
@@ -27,6 +27,7 @@
 from Library.String import GetSplitValueList
 from Library.ExpressionValidate import IsValidBareCString
 from Library.ExpressionValidate import IsValidFeatureFlagExp
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ## __HexDigit() method
 #
@@ -236,7 +237,7 @@
     
     Path = os.path.normpath(Path).replace('\\', '/')
     Root = os.path.normpath(Root).replace('\\', '/')
-    FullPath = os.path.normpath(os.path.join(Root, Path)).replace('\\', '/')
+    FullPath = mws.join(Root, Path)
     
     if not os.path.exists(FullPath):
         return False

Modified: branches/UDK2015/BaseTools/Source/Python/UPT/Library/Parsing.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/UPT/Library/Parsing.py     
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/UPT/Library/Parsing.py     
2015-11-16 05:29:49 UTC (rev 18784)
@@ -827,21 +827,23 @@
 def GetWorkspacePackage():
     DecFileList = []
     WorkspaceDir = GlobalData.gWORKSPACE
-    for Root, Dirs, Files in os.walk(WorkspaceDir):
-        if 'CVS' in Dirs:
-            Dirs.remove('CVS')
-        if '.svn' in Dirs:
-            Dirs.remove('.svn')
-        for Dir in Dirs:
-            if Dir.startswith('.'):
-                Dirs.remove(Dir)
-        for FileSp in Files:
-            if FileSp.startswith('.'):
-                continue
-            Ext = os.path.splitext(FileSp)[1]
-            if Ext.lower() in ['.dec']:
-                DecFileList.append\
-                (os.path.normpath(os.path.join(Root, FileSp)))
+    PackageDir = GlobalData.gPACKAGE_PATH
+    for PkgRoot in [WorkspaceDir] + PackageDir:
+        for Root, Dirs, Files in os.walk(PkgRoot):
+            if 'CVS' in Dirs:
+                Dirs.remove('CVS')
+            if '.svn' in Dirs:
+                Dirs.remove('.svn')
+            for Dir in Dirs:
+                if Dir.startswith('.'):
+                    Dirs.remove(Dir)
+            for FileSp in Files:
+                if FileSp.startswith('.'):
+                    continue
+                Ext = os.path.splitext(FileSp)[1]
+                if Ext.lower() in ['.dec']:
+                    DecFileList.append\
+                    (os.path.normpath(os.path.join(Root, FileSp)))
     #
     # abstract package guid, version info from DecFile List
     #

Modified: branches/UDK2015/BaseTools/Source/Python/UPT/MkPkg.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/UPT/MkPkg.py       2015-11-13 
09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/UPT/MkPkg.py       2015-11-16 
05:29:49 UTC (rev 18784)
@@ -50,6 +50,7 @@
 
 from Core.DistributionPackageClass import DistributionPackageClass
 from Core.PackageFile import PackageFile
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 ## CheckForExistingDp
 #
@@ -136,7 +137,7 @@
                 # write().
                 #
                 FromFile = 
os.path.normpath(FileObject.GetURI()).encode('utf_8')
-                FileFullPath = os.path.normpath(os.path.join(WorkspaceDir, 
FromFile))
+                FileFullPath = mws.join(WorkspaceDir, FromFile)
                 if FileFullPath in RePkgDict:
                     (DpGuid, DpVersion, DpName, Repackage) = 
RePkgDict[FileFullPath]
                     if not Repackage:
@@ -183,7 +184,7 @@
                     DistPkg.Header.RePackage = True
           
         Cwd = getcwd()
-        chdir(WorkspaceDir)        
+        chdir(WorkspaceDir)
         ContentFile.PackFiles(FileList)
         chdir(Cwd)
         
@@ -264,7 +265,7 @@
                          ErrorStringExt % Item)
         
         Item = os.path.normpath(Item)
-        Path = os.path.normpath(os.path.join(WorkspaceDir, Item))
+        Path = mws.join(WorkspaceDir, Item)
         if not os.path.exists(Path):
             Logger.Error("\nMkPkg", FILE_NOT_FOUND, ST.ERR_NOT_FOUND % Item)
         elif Item == Path:

Modified: 
branches/UDK2015/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py  
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py  
2015-11-16 05:29:49 UTC (rev 18784)
@@ -51,8 +51,8 @@
 from PomAdapter.InfPomAlignmentMisc import GenBinaryData
 from Parser import InfParser
 from PomAdapter.DecPomAlignment import DecPomAlignment
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
-
 ## InfPomAlignment
 #
 # Inherit from ModuleObject
@@ -534,8 +534,7 @@
             
PackageDependency.SetSupArchList(ConvertArchList(PackageItemObj.GetSupArchList()))
             
PackageDependency.SetFeatureFlag(PackageItemObj.GetFeatureFlagExp())
 
-            PkgInfo = 
GetPkgInfoFromDec(os.path.normpath(os.path.join(self.WorkSpace,
-                                                                      
NormPath(PackageItemObj.GetPackageName()))))
+            PkgInfo = GetPkgInfoFromDec(mws.join(self.WorkSpace, 
NormPath(PackageItemObj.GetPackageName())))
             if PkgInfo[1] and PkgInfo[2]:
                 PackageDependency.SetGuid(PkgInfo[1])
                 PackageDependency.SetVersion(PkgInfo[2])

Modified: branches/UDK2015/BaseTools/Source/Python/UPT/UPT.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/UPT/UPT.py 2015-11-13 09:35:54 UTC 
(rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/UPT/UPT.py 2015-11-16 05:29:49 UTC 
(rev 18784)
@@ -39,6 +39,7 @@
 from Logger.ToolError import OPTION_CONFLICT
 from Logger.ToolError import FatalError
 from Logger.ToolError import UPT_ALREADY_INSTALLED_ERROR
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 import MkPkg
 import InstallPkg
@@ -164,7 +165,7 @@
         setattr(Opt, Var[0], Var[1])
 
     try:
-        GlobalData.gWORKSPACE = GetWorkspace()
+        GlobalData.gWORKSPACE, GlobalData.gPACKAGE_PATH = GetWorkspace()
     except FatalError, XExcept:
         if Logger.GetLevel() <= Logger.DEBUG_9:
             Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + 
format_exc())

Modified: branches/UDK2015/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Workspace/MetaFileParser.py        
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Workspace/MetaFileParser.py        
2015-11-16 05:29:49 UTC (rev 18784)
@@ -343,9 +343,14 @@
         Name, Value = self._ValueList[1], self._ValueList[2]
         # Sometimes, we need to make differences between EDK and EDK2 modules 
         if Name == 'INF_VERSION':
-            try:
-                self._Version = int(Value, 0)
-            except:
+            if re.match(r'0[xX][\da-f-A-F]{5,8}', Value):
+                self._Version = int(Value, 0)   
+            elif re.match(r'\d+\.\d+', Value):
+                ValueList = Value.split('.')
+                Major = '%04o' % int(ValueList[0], 0)
+                Minor = '%04o' % int(ValueList[1], 0)
+                self._Version = int('0x' + Major + Minor, 0)
+            else:
                 EdkLogger.error('Parser', FORMAT_INVALID, "Invalid version 
number",
                                 ExtraData=self._CurrentLine, 
File=self.MetaFile, Line=self._LineIndex + 1)
 

Modified: 
branches/UDK2015/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
===================================================================
--- branches/UDK2015/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py     
2015-11-13 09:35:54 UTC (rev 18783)
+++ branches/UDK2015/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py     
2015-11-16 05:29:49 UTC (rev 18784)
@@ -21,6 +21,7 @@
 
 import Common.EdkLogger as EdkLogger
 import Common.GlobalData as GlobalData
+from Common.MultipleWorkspace import MultipleWorkspace as mws
 
 from Common.String import *
 from Common.DataType import *
@@ -166,7 +167,7 @@
             ModuleFile = PathClass(NormPath(Record[0]), GlobalData.gWorkspace, 
Arch=self._Arch)
             RecordList = 
self._RawData[MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH, self._Arch, None, 
ModuleId]
             if RecordList != []:
-                SourceOverridePath = os.path.join(GlobalData.gWorkspace, 
NormPath(RecordList[0][0]))
+                SourceOverridePath = mws.join(GlobalData.gWorkspace, 
NormPath(RecordList[0][0]))
 
                 # Check if the source override path exists
                 if not os.path.isdir(SourceOverridePath):
@@ -1954,7 +1955,13 @@
             RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch, 
self._Platform]
             for Record in RecordList:
                 if Record[1] == TAB_INF_DEFINES_INF_VERSION:
-                    self._AutoGenVersion = int(Record[2], 0)
+                    if '.' in Record[2]:
+                        ValueList = Record[2].split('.')
+                        Major = '%04o' % int(ValueList[0], 0)
+                        Minor = '%04o' % int(ValueList[1], 0)
+                        self._AutoGenVersion = int('0x' + Major + Minor, 0)
+                    else:
+                        self._AutoGenVersion = int(Record[2], 0)
                     break
             if self._AutoGenVersion == None:
                 self._AutoGenVersion = 0x00010000
@@ -2179,8 +2186,11 @@
                 if self.AutoGenVersion < 0x00010005:
                     Macros["EDK_SOURCE"] = GlobalData.gEcpSource
                     Macros['PROCESSOR'] = self._Arch
+                    SourceFile = NormPath(Record[0], Macros)
+                    if SourceFile[0] == os.path.sep:
+                        SourceFile = mws.join(GlobalData.gWorkspace, 
SourceFile[1:])
                     # old module source files (Edk)
-                    File = PathClass(NormPath(Record[0], Macros), 
self._ModuleDir, self._SourceOverridePath,
+                    File = PathClass(SourceFile, self._ModuleDir, 
self._SourceOverridePath,
                                      '', False, self._Arch, ToolChainFamily, 
'', TagName, ToolCode)
                     # check the file validation
                     ErrorCode, ErrorInfo = File.Validate(CaseSensitive=False)
@@ -2343,10 +2353,21 @@
                     if File[0] == '.':
                         File = os.path.join(self._ModuleDir, File)
                     else:
-                        File = os.path.join(GlobalData.gWorkspace, File)
+                        File = mws.join(GlobalData.gWorkspace, File)
                     File = RealPath(os.path.normpath(File))
                     if File:
                         self._Includes.append(File)
+                    if not File and Record[0].find('EFI_SOURCE') > -1:
+                        # tricky to regard WorkSpace as EFI_SOURCE
+                        Macros['EFI_SOURCE'] = GlobalData.gWorkspace
+                        File = NormPath(Record[0], Macros)
+                        if File[0] == '.':
+                            File = os.path.join(self._ModuleDir, File)
+                        else:
+                            File = os.path.join(GlobalData.gWorkspace, File)
+                        File = RealPath(os.path.normpath(File))
+                        if File:
+                            self._Includes.append(File)
         return self._Includes
 
     ## Retrieve packages this module depends on
@@ -2797,7 +2818,7 @@
     def __init__(self, DbPath, RenewDb=False):
         self._DbClosedFlag = False
         if not DbPath:
-            DbPath = os.path.normpath(os.path.join(GlobalData.gWorkspace, 
'Conf', GlobalData.gDatabasePath))
+            DbPath = os.path.normpath(mws.join(GlobalData.gWorkspace, 'Conf', 
GlobalData.gDatabasePath))
 
         # don't create necessary path for db in memory
         if DbPath != ':memory:':

Modified: branches/UDK2015/BaseTools/toolsetup.bat
===================================================================
--- branches/UDK2015/BaseTools/toolsetup.bat    2015-11-13 09:35:54 UTC (rev 
18783)
+++ branches/UDK2015/BaseTools/toolsetup.bat    2015-11-16 05:29:49 UTC (rev 
18784)
@@ -113,30 +113,43 @@
 
 :set_PATH
   if defined WORKSPACE_TOOLS_PATH goto check_PATH
-  set PATH=%EDK_TOOLS_PATH%\Bin;%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 end
+    )
+  )
+  set PATH=%EDK_TOOLS_BIN%;%PATH%
   set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
   goto PATH_ok
 
 :check_PATH
   if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto PATH_ok
-  set PATH=%EDK_TOOLS_PATH%\Bin;%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 end
+    )
+  )
+  set PATH=%EDK_TOOLS_BIN%;%PATH%
   set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
   echo Resetting the PATH variable to include the EDK_TOOLS_PATH for this 
session.
 
 :PATH_ok
-  echo           PATH      = %PATH%
-  echo.
-  if defined WORKSPACE (
-    echo      WORKSPACE      = %WORKSPACE%
-  )
-  echo EDK_TOOLS_PATH      = %EDK_TOOLS_PATH%
-  if defined BASE_TOOLS_PATH (
-    echo BASE_TOOLS_PATH     = %BASE_TOOLS_PATH%
-  )
-  echo.
-
 REM
-REM copy *.template to %WORKSPACE%\Conf
+REM copy *.template to %CONF_PATH%
 REM
 if not defined WORKSPACE (
    if defined RECONFIG (
@@ -147,50 +160,81 @@
    goto skip_reconfig
 )
 
-if NOT exist %WORKSPACE%\Conf (
-  mkdir %WORKSPACE%\Conf
+set CONF_PATH=%WORKSPACE%\Conf
+if NOT exist %CONF_PATH% (
+  if defined PACKAGES_PATH (
+    for %%i IN (%PACKAGES_PATH%) DO (
+      if exist %%~fi\Conf (
+        set CONF_PATH=%%i\Conf
+        goto CopyConf
+      )
+    )
+  )
+)
+ 
+:CopyConf
+if NOT exist %CONF_PATH% (
+  mkdir %CONF_PATH%
 ) else (
   if defined RECONFIG (
     echo.
-    echo  Over-writing the files in the WORKSPACE\Conf directory
+    echo  Over-writing the files in the CONF_PATH directory
     echo  using the default template files
     echo.
   )
 )
 
-if NOT exist %WORKSPACE%\Conf\target.txt (
-  echo copying ... target.template to %WORKSPACE%\Conf\target.txt
+if NOT exist %CONF_PATH%\target.txt (
+  echo copying ... target.template to %CONF_PATH%\target.txt
   if NOT exist %EDK_TOOLS_PATH%\Conf\target.template (
     echo Error: target.template is missing at folder %EDK_TOOLS_PATH%\Conf\
   )
-  copy %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul
+  copy %EDK_TOOLS_PATH%\Conf\target.template %CONF_PATH%\target.txt > nul
 ) else (
-  if defined RECONFIG echo over-write ... target.template to 
%WORKSPACE%\Conf\target.txt
-  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\target.template 
%WORKSPACE%\Conf\target.txt > nul
+  if defined RECONFIG echo over-write ... target.template to 
%CONF_PATH%\target.txt
+  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\target.template 
%CONF_PATH%\target.txt > nul
 )
 
-if NOT exist %WORKSPACE%\Conf\tools_def.txt (
-  echo copying ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt
+if NOT exist %CONF_PATH%\tools_def.txt (
+  echo copying ... tools_def.template to %CONF_PATH%\tools_def.txt
   if NOT exist %EDK_TOOLS_PATH%\Conf\tools_def.template (
     echo Error: tools_def.template is missing at folder %EDK_TOOLS_PATH%\Conf\
   )
-  copy %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt 
> nul
+  copy %EDK_TOOLS_PATH%\Conf\tools_def.template %CONF_PATH%\tools_def.txt > nul
 ) else (
-  if defined RECONFIG echo over-write ... tools_def.template to 
%WORKSPACE%\Conf\tools_def.txt
-  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template 
%WORKSPACE%\Conf\tools_def.txt > nul
+  if defined RECONFIG echo over-write ... tools_def.template to 
%CONF_PATH%\tools_def.txt
+  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template 
%CONF_PATH%\tools_def.txt > nul
 )
 
-if NOT exist %WORKSPACE%\Conf\build_rule.txt (
-  echo copying ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt
+if NOT exist %CONF_PATH%\build_rule.txt (
+  echo copying ... build_rule.template to %CONF_PATH%\build_rule.txt
   if NOT exist %EDK_TOOLS_PATH%\Conf\build_rule.template (
     echo Error: build_rule.template is missing at folder %EDK_TOOLS_PATH%\Conf\
   )
-  copy %EDK_TOOLS_PATH%\Conf\build_rule.template 
%WORKSPACE%\Conf\build_rule.txt > nul
+  copy %EDK_TOOLS_PATH%\Conf\build_rule.template %CONF_PATH%\build_rule.txt > 
nul
 ) else (
-  if defined RECONFIG echo over-write ... build_rule.template to 
%WORKSPACE%\Conf\build_rule.txt
-  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template 
%WORKSPACE%\Conf\build_rule.txt > nul
+  if defined RECONFIG echo over-write ... build_rule.template to 
%CONF_PATH%\build_rule.txt
+  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template 
%CONF_PATH%\build_rule.txt > nul
 )
 
+echo           PATH      = %PATH%
+echo.
+if defined WORKSPACE (
+  echo      WORKSPACE      = %WORKSPACE%
+)
+if defined PACKAGES_PATH (
+  echo  PACKAGES_PATH      = %PACKAGES_PATH%
+)
+echo EDK_TOOLS_PATH      = %EDK_TOOLS_PATH%
+if defined BASE_TOOLS_PATH (
+  echo BASE_TOOLS_PATH     = %BASE_TOOLS_PATH%
+)
+if defined EDK_TOOLS_BIN (
+  echo  EDK_TOOLS_BIN      = %EDK_TOOLS_BIN%
+)
+echo      CONF_PATH      = %CONF_PATH%
+echo.
+
 :skip_reconfig
 
 @REM
@@ -198,28 +242,26 @@
 @REM
 if defined FORCE_REBUILD goto check_build_environment
 if defined REBUILD goto check_build_environment
-if not exist "%EDK_TOOLS_PATH%\Bin" goto check_build_environment
+if not exist "%EDK_TOOLS_PATH%" goto check_build_environment
 
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\BootSectImage.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\build.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\EfiLdrImage.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\EfiRom.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenBootSector.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFds.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFfs.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFv.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFw.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenPage.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenSec.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenVtf.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\MigrationMsa2Inf.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Split.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\TargetTool.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\TianoCompress.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Trim.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\VfrCompile.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Fpd2Dsc.exe" goto 
check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\VolInfo.exe" goto 
check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\BootSectImage.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\build.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\EfiLdrImage.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\EfiRom.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\GenBootSector.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\GenFds.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\GenFfs.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\GenFv.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\GenFw.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\GenPage.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\GenSec.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\GenVtf.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\Split.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\TargetTool.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\TianoCompress.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\Trim.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\VfrCompile.exe" goto check_build_environment
+IF NOT EXIST "%EDK_TOOLS_BIN%\VolInfo.exe" goto check_build_environment
 
 goto end
 


------------------------------------------------------------------------------
Presto, an open source distributed SQL query engine for big data, initially
developed by Facebook, enables you to easily query your data on Hadoop in a 
more interactive manner. Teradata is also now providing full enterprise
support for Presto. Download a free open source copy now.
http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to