From 7241330bc45c2e03e8edaf4282f22be204f22d22 Mon Sep 17 00:00:00 2001
From: Olivier Martin <olivier.martin@arm.com>
Date: Fri, 14 Jan 2011 11:53:24 +0000
Subject: [PATCH 33/37] BaseTools: Add new 'RVCT' & 'RVCTLINUX' toolchains

These toolchains use the fix for the ENV() macro. There is no need of hardcoded path.
That will remove the update of tools_def for any single new toolchain build number.
---
 BaseTools/Conf/tools_def.template |  154 +++++++++++++++++++++++++++++++++----
 1 files changed, 140 insertions(+), 14 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 0645d6f..f9db7db 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -164,8 +164,6 @@ DEFINE IPHONE_TOOLS            = /Developer/Platforms/iPhoneOS.platform/Develope
 DEFINE RVCT31_TOOLS_PATH       = c:/Program Files/ARM/RVCT/Programs/3.1/569/win_32-pentium
 DEFINE RVCT31CYGWIN_TOOLS_PATH = /cygdrive/c/Program Files/ARM/RVCT/Programs/3.1/569/win_32-pentium
 
-DEFINE SOURCERY_TOOLS        = c:/Program Files/CodeSourcery/Sourcery G++ Lite/bin
-DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G++ Lite/bin
 
 ####################################################################################
 #
@@ -3020,6 +3018,45 @@ RELEASE_ICC11x86_IPF_DLINK_FLAGS              = /NOLOGO /NODEFAULTLIB /LTCG /DLL
 *_ICC11x86_EBC_SLINK_FLAGS                = /lib /NOLOGO /MACHINE:EBC
 *_ICC11x86_EBC_DLINK_FLAGS                = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP
 
+####################################################################################
+#
+# ARM RealView 4.0 Tools & Linux
+#
+####################################################################################
+#   ARMCYGWIN         - Tools from ARM in a Cygwin environment
+
+*_RVCTLINUX_*_*_FAMILY               = RVCT
+*_RVCTLINUX_*_*_BUILDRULEFAMILY      = RVCTLINUX
+
+#
+# Use default values, or override in DSC file
+#
+*_RVCTLINUX_ARM_ARCHCC_FLAGS    = --thumb --cpu ARM1176JZF-S
+*_RVCTLINUX_ARM_ARCHASM_FLAGS   = --cpu ARM1176JZF-S
+*_RVCTLINUX_ARM_ARCHDLINK_FLAGS = 
+*_RVCTLINUX_ARM_PLATFORM_FLAGS  =
+
+DEBUG_RVCTLINUX_ARM_DLINK_FLAGS     = $(DLINKPATH_FLAG) $(ARCHDLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT)  --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map 
+RELEASE_RVCTLINUX_ARM_DLINK_FLAGS     = $(DLINKPATH_FLAG) $(ARCHDLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT)  --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map
+
+*_RVCTLINUX_ARM_ASM_FLAGS       = $(ASMPATH_FLAG) $(ARCHASM_FLAGS) --apcs /interwork
+*_RVCTLINUX_ARM_PP_FLAGS        = $(CCPATH_FLAG) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E
+*_RVCTLINUX_ARM_VFRPP_FLAGS     = $(CCPATH_FLAG) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E  -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
+*_RVCTLINUX_ARM_MAKE_PATH       = make
+*_RVCTLINUX_ARM_SLINK_FLAGS     = $(SLINKPATH_FLAG) --partial -o
+  DEBUG_RVCTLINUX_ARM_CC_FLAGS  = $(CCPATH_FLAG) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c -g -O2 --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --preinclude AutoGen.h --diag_warning 167
+RELEASE_RVCTLINUX_ARM_CC_FLAGS  = $(CCPATH_FLAG) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --preinclude AutoGen.h --diag_warning 167
+
+##################
+# ARM definitions
+##################
+*_RVCTLINUX_ARM_CC_PATH         = ENV(RVCT_TOOLS_PATH)armcc
+*_RVCTLINUX_ARM_SLINK_PATH      = ENV(RVCT_TOOLS_PATH)armlink
+*_RVCTLINUX_ARM_DLINK_PATH      = ENV(RVCT_TOOLS_PATH)armlink
+*_RVCTLINUX_ARM_ASM_PATH        = ENV(RVCT_TOOLS_PATH)armasm
+*_RVCTLINUX_ARM_PP_PATH         = ENV(RVCT_TOOLS_PATH)armcc
+*_RVCTLINUX_ARM_VFRPP_PATH      = ENV(RVCT_TOOLS_PATH)armcc
+*_RVCTLINUX_ARM_FROMELF_PATH    = ENV(RVCT_TOOLS_PATH)fromelf
 
 ####################################################################################
 #
@@ -3387,7 +3424,7 @@ RELEASE_XCODE32_ARM_CC_FLAGS   = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mthumb-inter
 
 ####################################################################################
 #
-# ARM Tools
+# ARM RealView 3.1 Tools
 #
 ####################################################################################
 #   RVCT31         - Tools from ARM
@@ -3427,7 +3464,7 @@ RELEASE_RVCT31_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90    -Ospac
 
 ####################################################################################
 #
-# ARM Tools & Cygwin
+# ARM RealView 3.1 Tools & Cygwin
 #
 ####################################################################################
 #   ARMCYGWIN         - Tools from ARM in a Cygwin environment
@@ -3476,6 +3513,95 @@ RELEASE_RVCT31CYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM
 
 ####################################################################################
 #
+# ARM RealView 4.0 Tools
+#
+####################################################################################
+#   RVCT         - Tools from ARM
+
+*_RVCT_*_*_FAMILY          = RVCT
+
+#
+# Use default values, or override in DSC file
+#
+*_RVCT_ARM_ARCHCC_FLAGS    = --thumb --cpu ARM1176JZF-S
+*_RVCT_ARM_ARCHASM_FLAGS   = --cpu ARM1176JZF-S
+*_RVCT_ARM_ARCHDLINK_FLAGS = 
+*_RVCT_ARM_PLATFORM_FLAGS  =
+
+  DEBUG_RVCT_ARM_DLINK_FLAGS     = $(ARCHDLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT)  --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map 
+RELEASE_RVCT_ARM_DLINK_FLAGS     = $(ARCHDLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT)  --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map 
+
+
+*_RVCT_ARM_ASM_FLAGS       = $(ARCHASM_FLAGS) --apcs /interwork
+*_RVCT_ARM_PP_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E
+*_RVCT_ARM_VFRPP_FLAGS     = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E  -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
+*_RVCT_ARM_MAKE_PATH       = nmake /NOLOGO
+*_RVCT_ARM_SLINK_FLAGS     = --partial -o
+  DEBUG_RVCT_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c -g -O2 --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_warning 167
+RELEASE_RVCT_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_warning 167
+
+##################
+# ARM definitions
+##################
+*_RVCT_ARM_CC_PATH         = ENV(RVCT_TOOLS_PATH)armcc
+*_RVCT_ARM_SLINK_PATH      = ENV(RVCT_TOOLS_PATH)armlink
+*_RVCT_ARM_DLINK_PATH      = ENV(RVCT_TOOLS_PATH)armlink
+*_RVCT_ARM_ASM_PATH        = ENV(RVCT_TOOLS_PATH)armasm
+*_RVCT_ARM_PP_PATH         = ENV(RVCT_TOOLS_PATH)armcc
+*_RVCT_ARM_VFRPP_PATH      = ENV(RVCT_TOOLS_PATH)armcc
+*_RVCT_ARM_FROMELF_PATH    = ENV(RVCT_TOOLS_PATH)fromelf
+
+####################################################################################
+#
+# ARM RealView 4.0 Tools & Cygwin
+#
+####################################################################################
+#   ARMCYGWIN         - Tools from ARM in a Cygwin environment
+
+*_RVCTCYGWIN_*_*_FAMILY               = RVCT
+*_RVCTCYGWIN_*_*_BUILDRULEFAMILY      = RVCTCYGWIN
+
+*_RVCTCYGWIN_ARM_CCPATH_FLAG         = ENV(RVCT_TOOLS_PATH)armcc
+*_RVCTCYGWIN_ARM_SLINKPATH_FLAG      = ENV(RVCT_TOOLS_PATH)armlink
+*_RVCTCYGWIN_ARM_DLINKPATH_FLAG      = ENV(RVCT_TOOLS_PATH)armlink
+*_RVCTCYGWIN_ARM_ASMPATH_FLAG        = ENV(RVCT_TOOLS_PATH)armasm
+*_RVCTCYGWIN_ARM_PPPATH_FLAG         = ENV(RVCT_TOOLS_PATH)armcc
+*_RVCTCYGWIN_ARM_VFRPPPATH_FLAG      = ENV(RVCT_TOOLS_PATH)armcc
+*_RVCTCYGWIN_ARM_FROMELFPATH_FLAG    = ENV(RVCT_TOOLS_PATH)fromelf
+
+
+#
+# Use default values, or override in DSC file
+#
+*_RVCTCYGWIN_ARM_ARCHCC_FLAGS    = --thumb --cpu ARM1176JZF-S
+*_RVCTCYGWIN_ARM_ARCHASM_FLAGS   = --cpu ARM1176JZF-S
+*_RVCTCYGWIN_ARM_ARCHDLINK_FLAGS = 
+*_RVCTCYGWIN_ARM_PLATFORM_FLAGS  =
+
+  DEBUG_RVCTCYGWIN_ARM_DLINK_FLAGS     = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT)  --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --map --list `cygpath -m $(DEST_DIR_DEBUG)/$(BASE_NAME).map` 
+RELEASE_RVCTCYGWIN_ARM_DLINK_FLAGS     = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT)  --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --map --list `cygpath -m $(DEST_DIR_DEBUG)/$(BASE_NAME).map` 
+
+*_RVCTCYGWIN_ARM_ASM_FLAGS       = "$(ASMPATH_FLAG)" $(ARCHASM_FLAGS) --apcs /interwork
+*_RVCTCYGWIN_ARM_PP_FLAGS        = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E
+*_RVCTCYGWIN_ARM_VFRPP_FLAGS     = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E  -DVFRCOMPILE --preinclude `cygpath -m $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h`
+*_RVCTCYGWIN_ARM_MAKE_PATH       = make
+*_RVCTCYGWIN_ARM_SLINK_FLAGS     = "$(SLINKPATH_FLAG)" --partial -o
+  DEBUG_RVCTCYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c -g -O2 --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --preinclude AutoGen.h --diag_warning 167
+RELEASE_RVCTCYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --preinclude AutoGen.h --diag_warning 167
+
+##################
+# ARM definitions
+##################
+*_RVCTCYGWIN_ARM_CC_PATH         = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
+*_RVCTCYGWIN_ARM_SLINK_PATH      = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
+*_RVCTCYGWIN_ARM_DLINK_PATH      = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
+*_RVCTCYGWIN_ARM_ASM_PATH        = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
+*_RVCTCYGWIN_ARM_PP_PATH         = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
+*_RVCTCYGWIN_ARM_VFRPP_PATH      = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
+*_RVCTCYGWIN_ARM_FROMELF_PATH    = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
+
+####################################################################################
+#
 # ARM GCC (www.codesourcery.com)
 #
 ####################################################################################
@@ -3484,7 +3610,7 @@ RELEASE_RVCT31CYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM
 *_ARMGCC_*_*_FAMILY          = GCC
 *_ARMGCC_*_*_BUILDRULEFAMILY = ARMGCC
 
-*_ARMGCC_*_MAKE_PATH         = DEF(SOURCERY_TOOLS)/cs-make
+*_ARMGCC_*_MAKE_PATH         = make
 *_ARMGCC_*_MAKE_FLAGS        = --no-print-directory
 
 ##################
@@ -3501,16 +3627,16 @@ RELEASE_RVCT31CYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM
 # ARM definitions
 ##################
 
-*_ARMGCC_ARM_ASLCC_PATH      = DEF(SOURCERY_TOOLS)/arm-none-eabi-gcc
-*_ARMGCC_ARM_ASLDLINK_PATH   = DEF(SOURCERY_TOOLS)/arm-none-eabi-ld
-*_ARMGCC_ARM_ASLPP_PATH      = DEF(SOURCERY_TOOLS)/arm-none-eabi-gcc
+*_ARMGCC_ARM_ASLCC_PATH      = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-gcc
+*_ARMGCC_ARM_ASLDLINK_PATH   = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-ld
+*_ARMGCC_ARM_ASLPP_PATH      = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-gcc
 
-*_ARMGCC_ARM_CC_PATH         = DEF(SOURCERY_TOOLS)/arm-none-eabi-gcc
-*_ARMGCC_ARM_SLINK_PATH      = DEF(SOURCERY_TOOLS)/arm-none-eabi-ar
-*_ARMGCC_ARM_DLINK_PATH      = DEF(SOURCERY_TOOLS)/arm-none-eabi-ld
-*_ARMGCC_ARM_ASM_PATH        = DEF(SOURCERY_TOOLS)/arm-none-eabi-as
-*_ARMGCC_ARM_PP_PATH         = DEF(SOURCERY_TOOLS)/arm-none-eabi-gcc
-*_ARMGCC_ARM_VFRPP_PATH      = DEF(SOURCERY_TOOLS)/arm-none-eabi-gcc
+*_ARMGCC_ARM_CC_PATH         = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-gcc
+*_ARMGCC_ARM_SLINK_PATH      = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-ar
+*_ARMGCC_ARM_DLINK_PATH      = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-ld
+*_ARMGCC_ARM_ASM_PATH        = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-as
+*_ARMGCC_ARM_PP_PATH         = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-gcc
+*_ARMGCC_ARM_VFRPP_PATH      = ENV(ARMGCC_TOOLS_PATH)arm-none-eabi-gcc
 
 #
 # Use default values, or override in DSC file
-- 
1.6.3.3

