# HG changeset patch
# User yiluzhu
# Date 1274779415 -3600
# Node ID 971d2c670e0675e856bbd8a7b8272ed1b1f5d446
# Parent 6656482ba0da2ccc25305f04dd20bd1e052fad91
SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
diff -r 6656482ba0da -r 971d2c670e06 sbsv2/raptor/RELEASE-NOTES.html
--- a/sbsv2/raptor/RELEASE-NOTES.html Wed May 19 15:47:58 2010 +0100
+++ b/sbsv2/raptor/RELEASE-NOTES.html Tue May 25 10:23:35 2010 +0100
@@ -10,6 +10,7 @@
Defect Fixes
+- SF Bug 2203 - [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
- Fix : tracecompiler.mk caused poor makefile parse performance due to use of $(shell)
- SF Bug 2561 - [Raptor] creates incorrect .iby files w.r.t target file versions & ramtargets
- SF Bug 2562 - [Raptor] adds incorrect entries into .iby files w.r.t file paths
diff -r 6656482ba0da -r 971d2c670e06 sbsv2/raptor/python/raptor_meta.py
--- a/sbsv2/raptor/python/raptor_meta.py Wed May 19 15:47:58 2010 +0100
+++ b/sbsv2/raptor/python/raptor_meta.py Tue May 25 10:23:35 2010 +0100
@@ -35,6 +35,7 @@
from mmpparser import *
import time
+import generic_path
PiggyBackedBuildPlatforms = {'ARMV5':['GCCXML']}
@@ -768,9 +769,13 @@
biloc="." # Someone building with a relative raptor path
self.__StandardVariables = {}
- # Relative step-down to the root - let's try ignoring this for now, as it
- # should amount to the same thing in a world where absolute paths are king
- self.__StandardVariables['TO_ROOT'] = ""
+ # Relative step-down to the root. Amount to env variable SRCROOT
+ # in case SBS_BUILD_DIR is on a different drive
+ if 'SRCROOT' in os.environ:
+ self.__StandardVariables['TO_ROOT'] = str(generic_path.Path(os.environ['SRCROOT']))
+ else:
+ self.__StandardVariables['TO_ROOT'] = ""
+
# Top-level bld.inf location
self.__StandardVariables['TO_BLDINF'] = biloc
self.__StandardVariables['EXTENSION_ROOT'] = eiloc
@@ -838,9 +843,12 @@
eiloc="." # Someone building with a relative raptor path
self.__StandardVariables = {}
- # Relative step-down to the root - let's try ignoring this for now, as it
- # should amount to the same thing in a world where absolute paths are king
- self.__StandardVariables['TO_ROOT'] = ""
+ # Relative step-down to the root. Amount to env variable SRCROOT
+ # in case SBS_BUILD_DIR is on a different drive
+ if 'SRCROOT' in os.environ:
+ self.__StandardVariables['TO_ROOT'] = str(generic_path.Path(os.environ['SRCROOT']))
+ else:
+ self.__StandardVariables['TO_ROOT'] = ""
# Top-level bld.inf location
self.__StandardVariables['TO_BLDINF'] = biloc
# Location of bld.inf file containing the current EXTENSION block
@@ -3082,7 +3090,6 @@
value = options[option].replace('$(EPOCROOT)', '$(EPOCROOT)/')
value = value.replace('$(', '$$$$(')
value = value.replace('$/', '/').replace('$;', ':')
- value = value.replace('$/', '/').replace('$;', ':')
if customInterface:
var.AddOperation(raptor_data.Set(option, value))
diff -r 6656482ba0da -r 971d2c670e06 sbsv2/raptor/test/unit_suite/raptor_meta_unit.py
--- a/sbsv2/raptor/test/unit_suite/raptor_meta_unit.py Wed May 19 15:47:58 2010 +0100
+++ b/sbsv2/raptor/test/unit_suite/raptor_meta_unit.py Tue May 25 10:23:35 2010 +0100
@@ -494,15 +494,21 @@
self.assertTrue(testOptions.has_key(testParameter))
self.assertEquals(testOptions.get(testParameter), aTestParameters.get(testParameter))
+
def testBldInfExtensions(self):
bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs')
bldInfMakefilePathTestRoot = str(self.__makefilePathTestRoot)+'/metadata/project/bld.infs'
+ if 'SRCROOT' in os.environ:
+ srcroot = os.environ['SRCROOT']
+ else:
+ srcroot = os.environ['SRCROOT'] = "x:/somesrcroot"
+
depfiles = []
bldInfObject = raptor_meta.BldInfFile(bldInfTestRoot.Append('extensions.inf'),
self.__gnucpp, depfiles=depfiles, log=self.raptor)
extensions = bldInfObject.getExtensions(self.ARMV5)
-
+
self.__testExtension(extensions[0],
'test/dummyextension1.mk',
{'TARGET':'dummyoutput1.exe',
@@ -511,7 +517,7 @@
'TOOL':'dummytool1.exe',
'OPTION11':'option11value',
'OPTION12':'$(MAKE_VAR)',
- 'STDVAR_TO_ROOT':"",
+ 'STDVAR_TO_ROOT':srcroot,
'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}
)
@@ -524,7 +530,7 @@
'TOOL':'dummytool2.exe',
'OPTION21':'option21value',
'OPTION22':'$(MAKE_VAR)',
- 'STDVAR_TO_ROOT':"",
+ 'STDVAR_TO_ROOT':srcroot,
'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}
)
@@ -537,7 +543,7 @@
'TOOL':'dummytool3.exe',
'OPTION31':'option31value',
'OPTION32':'$(MAKE_VAR)',
- 'STDVAR_TO_ROOT':"",
+ 'STDVAR_TO_ROOT':srcroot,
'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}
)
@@ -552,7 +558,7 @@
'TOOL':'dummytesttool1.exe',
'OPTIONTEST11':'optiontest11value',
'OPTIONTEST12':'$(MAKE_VAR)',
- 'STDVAR_TO_ROOT':"",
+ 'STDVAR_TO_ROOT':srcroot,
'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}
)
@@ -565,7 +571,7 @@
'TOOL':'dummytesttool2.exe',
'OPTIONTEST21':'optiontest21value',
'OPTIONTEST22':'$(MAKE_VAR)',
- 'STDVAR_TO_ROOT':"",
+ 'STDVAR_TO_ROOT':srcroot,
'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}
)