SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive fix
authoryiluzhu
Tue, 25 May 2010 10:23:35 +0100
branchfix
changeset 570 971d2c670e06
parent 569 6656482ba0da
child 571 25e377052d9f
SF bug 2203 [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive
sbsv2/raptor/RELEASE-NOTES.html
sbsv2/raptor/python/raptor_meta.py
sbsv2/raptor/test/unit_suite/raptor_meta_unit.py
--- 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 @@
 
 <h3>Defect Fixes</h3>
 <ul>
+<li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2203"> SF Bug 2203 </a> - [Raptor] Building extension makefile with SBS_BUILD_DIR set to another drive</li>
 <li>Fix : tracecompiler.mk caused poor makefile parse performance due to use of $(shell)</li>
 <li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2561"> SF Bug 2561 </a> - [Raptor] creates incorrect .iby files w.r.t target file versions &amp; ramtargets</li>
 <li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2562"> SF Bug 2562 </a> - [Raptor] adds incorrect entries into .iby files w.r.t file paths</li>
--- 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))
--- 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}		
 							)