merge commit C3_BUILDER_WORK
authortimkelly
Tue, 10 Aug 2010 19:18:52 -0500
branchC3_BUILDER_WORK
changeset 1802 7e50573a0115
parent 1801 1d73a4591cf8 (diff)
parent 1799 ee7381872847 (current diff)
child 1803 9482220f0b7b
merge commit
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/project/ICarbideProjectInfo.java
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildContext.java
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildInfo.java
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java	Tue Aug 10 19:18:52 2010 -0500
@@ -418,15 +418,8 @@
 				defaultContext = context;
 				ISymbianSDK sdk = defaultContext.getSDK();
 				
-				if (context instanceof ISBSv1BuildContext){
-					ISDKBuildInfo sdkBuildInfo = sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);;
-					if (sdkBuildInfo.getPrefixFromVariantCfg() != null)
-						break;
-				} else {
-					ISDKBuildInfo sdkBuildInfo = sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);;
-					if (sdkBuildInfo.getPrefixFromVariantCfg() != null)
-						break;
-				}
+				if (context.getPrefixFromVariantCfg() != null)
+					break;
 			}
 		}
 		final ISymbianBuildContext defaultContextToUse = defaultContext;
@@ -1912,8 +1905,15 @@
 
 					public Object run(IBldInfData infView) {
 						for (final IMMPReference mmp : infView.getAllMMPReferences()) {
-								final IPath workspaceRelativeMMPPath = new Path(info.getProject().getName()).append(mmp.getPath());
+							
+								IPath workspaceRelativeMMPPath1 = null;
+								if (info.getProjectRelativeBldInfPath().isAbsolute()){
+									workspaceRelativeMMPPath1 = mmp.getPath();
+								} else {
+									workspaceRelativeMMPPath1 = new Path(info.getProject().getName()).append(mmp.getPath());
+								}
 								
+								final IPath workspaceRelativeMMPPath = workspaceRelativeMMPPath1;
 								EpocEnginePlugin.runWithMMPData(workspaceRelativeMMPPath, 
 										new DefaultMMPViewConfiguration(info.getProject(), buildConfig.getBuildContext(), new AcceptedNodesViewFilter()),
 										new MMPDataRunnableAdapter() {
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/project/ICarbideProjectInfo.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/project/ICarbideProjectInfo.java	Tue Aug 10 19:18:52 2010 -0500
@@ -52,6 +52,7 @@
 	public static final int ACTION_LINK_ONLY = 1;
 	public static final int ACTION_COMPILE_AND_LINK = 2;
 
+
 	/**
 	 * Load all the configurations associated with this project. If this is a new project,
 	 * then a dummy .settings file will be created which can be used to generate new build
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java	Tue Aug 10 19:18:52 2010 -0500
@@ -162,7 +162,7 @@
 				macros.add(new CMacroEntry(define.getNameAndArguments(), define.getExpansion(), 0));
 			}
 
-			for (IDefine define : carbideBuildConfig.getBuildContext().getCompilerMacros()) {
+			for (IDefine define : carbideBuildConfig.getBuildContext().getCompilerPreincludeDefines()) {
 				macros.add(new CMacroEntry(define.getNameAndArguments(), define.getExpansion(), 0));
 			}
 			
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideProjectInfo.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideProjectInfo.java	Tue Aug 10 19:18:52 2010 -0500
@@ -327,6 +327,9 @@
 	}
 	
 	public IPath getAbsoluteBldInfPath(){
+		if (projectRelativeBldInfPath.isAbsolute()){
+			return projectRelativeBldInfPath;
+		}
 		return CarbideBuilderPlugin.getProjectRoot(projectTracker.getProject()).append(projectRelativeBldInfPath);
 	}
 	
@@ -335,6 +338,9 @@
 	}
 
 	public IPath getWorkspaceRelativeBldInfPath(){
+		if (projectRelativeBldInfPath.isAbsolute()){
+			return projectRelativeBldInfPath;
+		}
 		return new Path(projectTracker.getProject().getName()).append(projectRelativeBldInfPath);
 	}
 	
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java	Tue Aug 10 19:18:52 2010 -0500
@@ -2319,13 +2319,12 @@
 			}
 			
 			// we need to check the variant hrh files as well
-			ISDKBuildInfo sdkBuildInfo = config.getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);;
-			File prefixFile = sdkBuildInfo.getPrefixFromVariantCfg().toFile();
+			File prefixFile = config.getBuildContext().getPrefixFromVariantCfg().toFile();
 			if (prefixFile != null && prefixFile.lastModified() > oldestMakefileTimestamp) {
 				return true;
 			}
 
-			for (File file : config.getBuildContext().getPrefixFileIncludes()) {
+			for (File file : config.getBuildContext().getVariantHRHIncludes()) {
 				if (file.lastModified() > oldestMakefileTimestamp) {
 					return true;
 				}
@@ -2441,13 +2440,12 @@
 		final long makefileTimestamp = makefile.lastModified();
 		
 		// we need to check the variant hrh files as well
-		ISDKBuildInfo sdkBuildInfo = config.getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);;
-		File prefixFile = sdkBuildInfo.getPrefixFromVariantCfg().toFile();
+		File prefixFile = config.getBuildContext().getPrefixFromVariantCfg().toFile();
 		if (prefixFile != null && prefixFile.lastModified() > makefileTimestamp) {
 			return true;
 		}
 
-		for (File file : config.getBuildContext().getPrefixFileIncludes()) {
+		for (File file : config.getBuildContext().getVariantHRHIncludes()) {
 			if (file.lastModified() > makefileTimestamp) {
 				return true;
 			}
@@ -2525,13 +2523,12 @@
 		final long makefileTimestamp = makefile.lastModified();
 		
 		// we need to check the variant hrh files as well
-		ISDKBuildInfo sdkBuildInfo = config.getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);;
-		File prefixFile = sdkBuildInfo.getPrefixFromVariantCfg().toFile();
+		File prefixFile = config.getBuildContext().getPrefixFromVariantCfg().toFile();
 		if (prefixFile != null && prefixFile.lastModified() > makefileTimestamp) {
 			return true;
 		}
 		
-		for (File file : config.getBuildContext().getPrefixFileIncludes()) {
+		for (File file : config.getBuildContext().getVariantHRHIncludes()) {
 			if (file.lastModified() > makefileTimestamp) {
 				return true;
 			}
@@ -2899,8 +2896,7 @@
 				ISymbianSDK sdk = config.getSDK();
 				ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
 				ISBVPlatform sbvPlatform = sbsv1BuildInfo.getSBVCatalog().findPlatform(config.getPlatformString());
-				ISDKBuildInfo sdkBuildInfo = config.getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);;
-				File sdkPrefix = sdkBuildInfo.getPrefixFromVariantCfg().toFile();
+				File sdkPrefix = config.getBuildContext().getPrefixFromVariantCfg().toFile();
 
 				if (sbvPlatform != null){
 					// might be an alternate HRH file to use
@@ -2914,7 +2910,6 @@
 					newRule = newRule + "-include \"" + sdkPrefix.getAbsolutePath() + "\" "; 
 				}
 
-				
 				newRule += " -o " + depFilePath + view.getEOL();
 				
 				// for some reason cpp.exe doesn't like paths without the drive letter when working on a subst'ed drive.
--- a/builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/PreprocessHandler.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/PreprocessHandler.java	Tue Aug 10 19:18:52 2010 -0500
@@ -203,14 +203,7 @@
 							}
 
 							// add the sdk prefix file if any
-							File sdkPrefix = null;
-							if (buildConfig.getBuildContext() instanceof ISBSv1BuildContext) {
-								ISDKBuildInfo sdkBuildInfo = buildConfig.getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);;
-								sdkPrefix = sdkBuildInfo.getPrefixFromVariantCfg().toFile();
-							} else {
-								ISDKBuildInfo sdkBuildInfo = buildConfig.getSDK().getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);;
-								sdkPrefix = sdkBuildInfo.getPrefixFromVariantCfg().toFile();
-							}
+							File sdkPrefix = buildConfig.getBuildContext().getPrefixFromVariantCfg().toFile();
 							
 							if (sdkPrefix != null && sdkPrefix.exists()) {
 								args.add("-include"); //$NON-NLS-1$
--- a/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/TestSBSv2BuildContext.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/TestSBSv2BuildContext.java	Tue Aug 10 19:18:52 2010 -0500
@@ -77,14 +77,14 @@
 		assertNotNull(context.getVariantHRHDefines());
 
 		// getPrefixFileIncludes()
-		assertNotNull(context.getPrefixFileIncludes());
-		for (Iterator<File> itr = context.getPrefixFileIncludes().iterator(); itr.hasNext();) {
+		assertNotNull(context.getVariantHRHIncludes());
+		for (Iterator<File> itr = context.getVariantHRHIncludes().iterator(); itr.hasNext();) {
 			File includeFile = itr.next();
 			assertTrue(includeFile.exists());
 		}
 
 		// getCompilerMacros()
-		assertNotNull(context.getCompilerMacros());		
+		assertNotNull(context.getCompilerPreincludeDefines());		
 
 		// getToolChain()
 		String toolChain = context.getToolChain();
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java	Tue Aug 10 19:18:52 2010 -0500
@@ -13,11 +13,18 @@
 package com.nokia.carbide.cpp.internal.api.sdk;
 
 import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.eclipse.cdt.core.settings.model.ICStorageElement;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.osgi.framework.Version;
 
 import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine;
@@ -59,6 +66,14 @@
 	protected BuildArgumentsInfo buildArgumentsInfo;
 	protected final static String ARGUMENTS_DATA_ID = "ARGUMENTS_DATA_ID"; //$NON-NLS-1$
 	
+	// --> variant.cfg info
+	// greedy match means the filename is in the last group
+	public static Pattern VARIANT_HRH_LINE_PATTERN = Pattern.compile("(?i)(.*)(/|\\\\)(.*hrh)");
+	private IPath variantFilePath;
+	public static final String VARIANT_CFG_FILE = "epoc32/tools/variant/variant.cfg"; //$NON-NLS-1$
+	public static final String SPP_VARIANT_CFG_FILE = "epoc32/tools/variant/spp_variant.cfg"; //$NON-NLS-1$
+	// <--
+	
 	public BuildContextSBSv1(ISymbianSDK theSDK, String thePlatform, String theTarget) {
 		sdkId = theSDK.getUniqueId();
 		platform = thePlatform.toUpperCase();
@@ -352,12 +367,12 @@
 		return getCachedData().getVariantHRHDefines();
 	}
 
-	public List<File> getPrefixFileIncludes() {
+	public List<File> getVariantHRHIncludes() {
 		return getCachedData().getPrefixFileIncludes();
 	}
 
 
-	public List<IDefine> getCompilerMacros() {
+	public List<IDefine> getCompilerPreincludeDefines() {
 		// we parse the compiler prefix file to gather macros.  this can be time consuming so do it
 		// once and cache the values.  only reset the cache when the compiler prefix has changed.
 		
@@ -381,14 +396,13 @@
 		return varName;
 	}
 
-
-	public boolean isSymbianBinaryVariation() {
-		if (getPlatformString().split("\\.").length == 2){
-			return true;
-		} else {
-			return false;
-		}
-	}
+//	public boolean isSymbianBinaryVariation() {
+//		if (getPlatformString().split("\\.").length == 2){
+//			return true;
+//		} else {
+//			return false;
+//		}
+//	}
 
 	/**
 	 * Get the cache holding the data that applies to this build context globally.
@@ -568,5 +582,97 @@
 	public String getConfigurationID() {
 		return getDisplayString();
 	}
+	
+	/**
+	 * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
+	 * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
+	 */
+	public IPath getPrefixFromVariantCfg(){
+		
+		if (variantFilePath != null){
+			return variantFilePath;
+		}
+		
+		File epocRoot = new File(getSDK().getEPOCROOT());
+		File variantCfg;
+		variantCfg = new File(epocRoot, SPP_VARIANT_CFG_FILE);
+		if (!variantCfg.exists()) {
+			variantCfg = new File(epocRoot, VARIANT_CFG_FILE);
+			if (!variantCfg.exists())
+				return null;
+		}
+		
+		String variantDir = null;
+		String variantFile = null;
+		try {
+			char[] cbuf = new char[(int) variantCfg.length()];
+			Reader reader = new FileReader(variantCfg);
+			reader.read(cbuf);
+			reader.close();
+			String[] lines = new String(cbuf).split("\r\n|\r|\n");
+			for (int i = 0; i < lines.length; i++) {
+				// skip comments and blank lines
+				String line = SymbianSDK.removeComments(lines[i]);
+				if (line.matches("\\s*#.*") || line.trim().length() == 0) 
+					continue;
+				
+				// parse the variant line, which is an EPOCROOT-relative
+				// path to a bldvariant.hrh file
+				Matcher matcher = VARIANT_HRH_LINE_PATTERN.matcher(line);
+				if (matcher.matches()) {
+					variantDir = matcher.group(1);
+					variantFile = matcher.group(3); 
+					File variantFullPathFile = new File(epocRoot, variantDir + File.separator + variantFile);
+					variantFilePath = new Path(PathUtils.convertPathToUnix(variantFullPathFile.getAbsolutePath()));
+					return variantFilePath;
+				}
+			}
+		} catch (IOException e) {
+		}
+		
+		return null; // can't find the file...
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<String> getVariantCFGMacros(){
+		
+		List<String> variantCFGMacros = new ArrayList<String>();
+		File epocRoot = new File(getSDK().getEPOCROOT());
+		File variantCfg;
+		variantCfg = new File(epocRoot, SPP_VARIANT_CFG_FILE);
+		if (!variantCfg.exists()) {
+			variantCfg = new File(epocRoot, VARIANT_CFG_FILE);
+			if (!variantCfg.exists())
+				return Collections.EMPTY_LIST;
+		}
+		
+		try {
+			char[] cbuf = new char[(int) variantCfg.length()];
+			Reader reader = new FileReader(variantCfg);
+			reader.read(cbuf);
+			reader.close();
+			String[] lines = new String(cbuf).split("\r\n|\r|\n");
+			for (int i = 0; i < lines.length; i++) {
+				// skip comments and blank lines
+				String line = SymbianSDK.removeComments(lines[i]);
+				if (line.matches("\\s*#.*") || line.trim().length() == 0) 
+					continue;
+				
+				// parse the variant line, which is an EPOCROOT-relative
+				// path to a bldvariant.hrh file
+				Matcher matcher = VARIANT_HRH_LINE_PATTERN.matcher(line);
+				if (matcher.matches()) {
+					continue; // Skip this it's the file
+				} else {
+					// all other patterns are assumed to be macro
+					variantCFGMacros.add(line.trim());
+				}
+			}
+		} catch (IOException e) {
+		}
+		
+		return variantCFGMacros;
+	}
+	
 
 }
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java	Tue Aug 10 19:18:52 2010 -0500
@@ -20,6 +20,7 @@
 import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2QueryUtils;
 import com.nokia.carbide.cpp.internal.sdk.core.model.SBSv2BuildInfo;
 import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
+import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
 import com.nokia.cpp.internal.api.utils.core.Check;
@@ -41,6 +42,8 @@
 	// cconfiguration data store
 	private SBSv2BuilderInfo sbsv2BuildInfo;
 	
+	private IPath cachedVariantHRHFile = null;
+	
 	public BuildContextSBSv2(ISymbianSDK sdk, String platform, String target, String alias, String displayString, String configID) {
 		this.sdk = sdk;
 		if (platform == null){
@@ -157,12 +160,12 @@
 	}
 
 	@Override
-	public List<File> getPrefixFileIncludes() {
+	public List<File> getVariantHRHIncludes() {
 		return getCachedData().getPrefixFileIncludes();
 	}
 
 	@Override
-	public List<IDefine> getCompilerMacros() {
+	public List<IDefine> getCompilerPreincludeDefines() {
 		IPath prefixFile = getCompilerPrefixFile();
 		if (prefixFile == null || !prefixFile.toFile().exists()) {
 			return getCachedData().getCompilerMacros(null);
@@ -176,13 +179,6 @@
 		// Not needed for Raptor
 		return "";
 	}
-
-	@Override
-	public boolean isSymbianBinaryVariation() {
-		// Not be needed for Raptor. We do check
-		// in the MPP for the featurevariant keyword
-		return false;
-	}
 	
 	@Override
 	public String getSBSv2Alias() {
@@ -401,6 +397,16 @@
 	public String getConfigurationID() {
 		return getConfigID();
 	}
+	
+	/**
+	 * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
+	 * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
+	 */
+	public IPath getPrefixFromVariantCfg(){
+		ISBSv2BuildInfo sbsv2BldInfo = ((ISBSv2BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER));
+		return sbsv2BldInfo.getPrefixFromVariantCfg();
+	}
+
 
 	
 }
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildContext.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildContext.java	Tue Aug 10 19:18:52 2010 -0500
@@ -1,5 +1,7 @@
 package com.nokia.carbide.cpp.internal.api.sdk;
 
+import java.util.List;
+
 import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
 
 /**
@@ -56,5 +58,12 @@
 	 */
 	void setBuildArgumentsInfo(BuildArgumentsInfo bldArgInfo);
 	
+	/**
+	* Returns a list of the macros defined in the variant.cfg file. This is NOT the macros
+	* in the HRH file, but the actual maros written to the variant.cfg file.
+	* @return A String list of macros found as is, or an empty list if none.
+	*/
+	public List<String> getVariantCFGMacros();
+	
 	
 }
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildInfo.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildInfo.java	Tue Aug 10 19:18:52 2010 -0500
@@ -112,14 +112,6 @@
 	 * @deprecated
 	 */
 	List<String> getSupportedTargetTypes();
-
 	
-	/**
-	 * Returns a list of the macros defined in the variant.cfg file. This is NOT the macros
-	 * in the HRH file, but the actual maros written to the variant.cfg file.
-	 * @return A String list of macros found as is, or an empty list if none.
 	 * @deprecated
-	 */
-	List<String> getVariantCFGMacros();
-	
 }
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java	Tue Aug 10 19:18:52 2010 -0500
@@ -188,14 +188,13 @@
 			List<IDefine> macros = new ArrayList<IDefine>();
 			Map<String, IDefine> namedMacros = new HashMap<String, IDefine>();
 			
-			ISDKBuildInfo sdkBuildInfo = sdk.getBuildInfo(builderId);
-			File prefixFile = sdkBuildInfo.getPrefixFromVariantCfg().toFile();
+			File prefixFile = context.getPrefixFromVariantCfg().toFile();
 			ISDKBuildInfo buildInfo = sdk.getBuildInfo(builderId);
 			
 			if (prefixFile == null){
 				// Check that the prefix file may have become available since the SDK was scanned last.
 				// This can happen, for e.g., if the user opens the IDE _then_ does a subst on a drive that already has an SDK entry.
-				IPath prefixCheck = buildInfo.getPrefixFromVariantCfg();
+				IPath prefixCheck = context.getPrefixFromVariantCfg();
 				if (prefixCheck != null){
 					prefixFile = prefixCheck.toFile();
 					((SymbianSDK)sdk).setPrefixFile(prefixCheck, builderId);
@@ -261,9 +260,7 @@
 				
 				if (buildInfo instanceof ISBSv1BuildInfo) {
 					// SBSv2 does not parse the variant.cfg file to collect macros.
-					List<String> variantCFGMacros = new ArrayList<String>();
-					
-					variantCFGMacros = ((ISBSv1BuildInfo)buildInfo).getVariantCFGMacros();
+					List<String> variantCFGMacros = ((ISBSv1BuildContext)context).getVariantCFGMacros();
 					for (String cfgMacros : variantCFGMacros){
 						// we don't want duplicate macros, so check to see if it's already there.
 						IDefine existingMacro = namedMacros.get(cfgMacros);
@@ -476,8 +473,7 @@
 		}
 		
 		// also search files in same folder as variant.hrh
-		ISDKBuildInfo sdkBuildInfo = sdk.getBuildInfo(builderId);
-		File prefix = sdkBuildInfo.getPrefixFromVariantCfg().toFile();
+		File prefix = context.getPrefixFromVariantCfg().toFile();
 		if (sbvPlatform != null){
 			// might be an alternate HRH file to use
 			IPath varVarHRH = sbvPlatform.getBuildVariantHRHFile();
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv1BuildInfo.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv1BuildInfo.java	Tue Aug 10 19:18:52 2010 -0500
@@ -24,11 +24,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
 
 import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1;
 import com.nokia.carbide.cpp.internal.api.sdk.BuildPlat;
@@ -44,7 +39,6 @@
 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
 import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures;
 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
-import com.nokia.cpp.internal.api.utils.core.PathUtils;
 
 /**
  * SBSv1 specific build information.
@@ -60,14 +54,8 @@
 	private List<ISymbianBuildContext> bsfContextList = new ArrayList<ISymbianBuildContext>(0);
 	private Map<String, List<String>> cachedPlatformMacros = new HashMap<String, List<String>>();
 	private List<String> supportedTargetTypesList = new ArrayList<String>();
-	private IPath variantFilePath;
 	
 	private static final String TARGETTYPE_PM_FILE = "epoc32/tools/trgtype.pm"; //$NON-NLS-1$
-	public static final String VARIANT_CFG_FILE = "epoc32/tools/variant/variant.cfg"; //$NON-NLS-1$
-	public static final String SPP_VARIANT_CFG_FILE = "epoc32/tools/variant/spp_variant.cfg"; //$NON-NLS-1$
-
-	// greedy match means the filename is in the last group
-	public static Pattern VARIANT_HRH_LINE_PATTERN = Pattern.compile("(?i)(.*)(/|\\\\)(.*hrh)");
 	
 	public SBSv1BuildInfo(ISymbianSDK sdk) {
 		this.sdk = sdk;
@@ -154,55 +142,7 @@
 		return platformMacros;
 	}
 
-	/**
-	 * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
-	 * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
-	 */
-	public IPath getPrefixFromVariantCfg(){
-		
-		if (variantFilePath != null){
-			return variantFilePath;
-		}
-		
-		File epocRoot = new File(sdk.getEPOCROOT());
-		File variantCfg;
-		variantCfg = new File(epocRoot, SPP_VARIANT_CFG_FILE);
-		if (!variantCfg.exists()) {
-			variantCfg = new File(epocRoot, VARIANT_CFG_FILE);
-			if (!variantCfg.exists())
-				return null;
-		}
-		
-		String variantDir = null;
-		String variantFile = null;
-		try {
-			char[] cbuf = new char[(int) variantCfg.length()];
-			Reader reader = new FileReader(variantCfg);
-			reader.read(cbuf);
-			reader.close();
-			String[] lines = new String(cbuf).split("\r\n|\r|\n");
-			for (int i = 0; i < lines.length; i++) {
-				// skip comments and blank lines
-				String line = SymbianSDK.removeComments(lines[i]);
-				if (line.matches("\\s*#.*") || line.trim().length() == 0) 
-					continue;
-				
-				// parse the variant line, which is an EPOCROOT-relative
-				// path to a bldvariant.hrh file
-				Matcher matcher = VARIANT_HRH_LINE_PATTERN.matcher(line);
-				if (matcher.matches()) {
-					variantDir = matcher.group(1);
-					variantFile = matcher.group(3); 
-					File variantFullPathFile = new File(epocRoot, variantDir + File.separator + variantFile);
-					variantFilePath = new Path(PathUtils.convertPathToUnix(variantFullPathFile.getAbsolutePath()));
-					return variantFilePath;
-				}
-			}
-		} catch (IOException e) {
-		}
-		
-		return null; // can't find the file...
-	}
+
 
 	public ISBVCatalog getSBVCatalog() {
 		synchronized (sdk) {
@@ -385,46 +325,6 @@
 		return supportedTargetTypesList;
 	}
 	
-	@SuppressWarnings("unchecked")
-	public List<String> getVariantCFGMacros(){
-		
-		List<String> variantCFGMacros = new ArrayList<String>();
-		File epocRoot = new File(sdk.getEPOCROOT());
-		File variantCfg;
-		variantCfg = new File(epocRoot, SPP_VARIANT_CFG_FILE);
-		if (!variantCfg.exists()) {
-			variantCfg = new File(epocRoot, VARIANT_CFG_FILE);
-			if (!variantCfg.exists())
-				return Collections.EMPTY_LIST;
-		}
-		
-		try {
-			char[] cbuf = new char[(int) variantCfg.length()];
-			Reader reader = new FileReader(variantCfg);
-			reader.read(cbuf);
-			reader.close();
-			String[] lines = new String(cbuf).split("\r\n|\r|\n");
-			for (int i = 0; i < lines.length; i++) {
-				// skip comments and blank lines
-				String line = SymbianSDK.removeComments(lines[i]);
-				if (line.matches("\\s*#.*") || line.trim().length() == 0) 
-					continue;
-				
-				// parse the variant line, which is an EPOCROOT-relative
-				// path to a bldvariant.hrh file
-				Matcher matcher = VARIANT_HRH_LINE_PATTERN.matcher(line);
-				if (matcher.matches()) {
-					continue; // Skip this it's the file
-				} else {
-					// all other patterns are assumed to be macro
-					variantCFGMacros.add(line.trim());
-				}
-			}
-		} catch (IOException e) {
-		}
-		
-		return variantCFGMacros;
-	}
-	
+
 
 }
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java	Tue Aug 10 19:18:52 2010 -0500
@@ -12,11 +12,9 @@
 */
 package com.nokia.carbide.cpp.internal.sdk.core.model;
 
-import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
-import java.io.InputStreamReader;
 import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.text.MessageFormat;
@@ -25,12 +23,9 @@
 import java.util.List;
 
 import org.eclipse.cdt.utils.WindowsRegistry;
-import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Shell;
@@ -42,9 +37,9 @@
 import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DevicesFactory;
 import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DevicesType;
 import com.nokia.carbide.cpp.internal.sdk.core.xml.DevicesLoader;
+import com.nokia.carbide.cpp.sdk.core.ISDKManager;
 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
 import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures;
-import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
 import com.nokia.carbide.cpp.sdk.core.SDKEnvInfoFailureException;
 import com.nokia.cpp.internal.api.utils.core.HostOS;
 import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
@@ -79,7 +74,6 @@
 	
 	public SDKManager() {
 		super();
-		checkPerlInstallation();
 	}
 	
 	protected boolean doScanSDKs(IProgressMonitor monitor) {
@@ -297,33 +291,6 @@
 		return false;
 	}
 	
-	protected void checkPerlInstallation(){
-		
-		Runtime rt=Runtime.getRuntime();
-		
-		// check for Perl
-		try {
-			Process p = rt.exec("perl.exe -v");
-			
-			BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
-			String overallOutput = null;
-			String stdErrLine = null;
-			while ((stdErrLine = br.readLine()) != null) {
-				overallOutput += stdErrLine;
-			}
-			
-			if (overallOutput != null && !overallOutput.contains("v5.6.1")){
-				ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.WARNING, SDKCorePlugin.PLUGIN_ID, IStatus.WARNING, "Perl v5.6.1 was not detected. Some SDKs do not work with other Perl versions.", null));
-			}
-			
-			p.destroy();
-			
-		}
-		catch (IOException e) {
-			//	report error to PDE log
-			ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.PLUGIN_ID, IStatus.ERROR, "Perl was not found on the PATH environment variable. Perl 5.6.1 is recommended for Carbide use if using SBSv1 and Symbian OS 9.4 and prior.", e));
-		}
-	}
 	
 	/**
 	 * Checks to see if the devices.xml on disk contains the same current information
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISDKBuildInfo.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISDKBuildInfo.java	Tue Aug 10 19:18:52 2010 -0500
@@ -15,8 +15,6 @@
 
 import java.util.List;
 
-import org.eclipse.core.runtime.IPath;
-
 /**
  * Interface for build related information of a Symbian SDK.
  * @since 3.0
@@ -35,11 +33,5 @@
 	 * @return list of ISymbianBuildContext
 	 */
 	List<ISymbianBuildContext> getFilteredBuildConfigurations();
-
-	/**
-	 * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
-	 * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
-	 */
-	public IPath getPrefixFromVariantCfg();
 	
 }
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianBuildContext.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianBuildContext.java	Tue Aug 10 19:18:52 2010 -0500
@@ -85,27 +85,33 @@
 	public IPath getCompilerPrefixFile();
 
 	/**
-	 * Returns the list of all vendor specific C/C++ macros for this SDK.  The list of macros is defined in
-	 * the variant configuration file inside \epoc32\tools\variant.cfg (or \epoc32\tools\spp_variant.cfg
-	 * for platform variation SDKs).  The file itself contains an HRH file entry and may also contain macro definitions
-	 * thereafter.
+	 * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
+	 * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
+	 * @since 3.0
+	 */
+	public IPath getPrefixFromVariantCfg();
+	
+	/**
+	 * Returns the list of all vendor specific C/C++ macros for this SDK.  This is the result of preprocessing
+	 * the HRH file defined under /epoc32/tools/variant/variant.cfg
 	 * @return a list of macros which may be empty.
 	 */
 	public List<IDefine> getVariantHRHDefines();
 	
 	/**
-	 * Returns the list of all header files recursively included by the SDK prefix file.  Note that the list of
+	 * Returns the list of all header files recursively included by the SDK prefix file (defined in /epoc32/tools/variant/variant.cfg).  Note that the list of
 	 * files could be different for different context's since the platform can potentially change the list of include
 	 * paths.
 	 * @return a list of header files which may be empty
 	 */
-	public List<File> getPrefixFileIncludes();
+	public List<File> getVariantHRHIncludes();
 
 	/**
-	 * Returns the list of compiler macros from the compiler prefix file (if any).
+	 * Returns the list of compiler macros from the compiler prefix file (if any). This is the result
+	 * of preprocessing the actual compiler pre-include file, e.g. rvct.h or gcce.h. WINSCW platform builds will return an empty list.
 	 * @return a list of macros which may be empty.
 	 */
-	public List<IDefine> getCompilerMacros();
+	public List<IDefine> getCompilerPreincludeDefines();
 	
 	/**
 	 * For platforms that are building with Symbian Binary Variation, this suffix will be included in the configuration name
@@ -116,13 +122,6 @@
 	public String getBuildVariationName();
 	
 	/**
-	 * Is the current build context building as a Symbian Binary Variation? Not to be confused with BSF.
-	 * @return true if this is a binary variant build
-	 * @since 2.0
-	 */
-	public boolean isSymbianBinaryVariation();
-	
-	/**
 	 * Load build context specific configuration settings
 	 * @param ICStorageElement - a child of CARBIDE_STORAGE_ID ("CarbideConfigurationDataProvider") in .cproject data
 	 * @since 3.0
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java	Tue Aug 10 19:18:52 2010 -0500
@@ -12,8 +12,6 @@
 */
 package com.nokia.carbide.cpp.sdk.core;
 
-import java.io.File;
-import java.util.List;
 import java.util.Set;
 
 import org.eclipse.core.runtime.IPath;
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/ProjectUIPlugin.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/ProjectUIPlugin.java	Tue Aug 10 19:18:52 2010 -0500
@@ -276,6 +276,16 @@
 		store.setValue(PreferenceConstants.PREF_KEEP_PROJECTS_IN_SYNC, keepInSync);
 	}
 	
+	public static boolean supportLinkedResources() {
+		IPreferenceStore store = ProjectUIPlugin.getDefault().getPreferenceStore();
+		return store.getBoolean(PreferenceConstants.PREF_SUPPORT_LINKED_RESOURCES);
+	}
+	
+	public static void setSupportLinkedResources(boolean supported) {
+		IPreferenceStore store = ProjectUIPlugin.getDefault().getPreferenceStore();
+		store.setValue(PreferenceConstants.PREF_SUPPORT_LINKED_RESOURCES, supported);
+	}
+	
 	public static int getAddFilesToProjectOption() {
 		IPreferenceStore store = ProjectUIPlugin.getDefault().getPreferenceStore();
 		return store.getInt(PreferenceConstants.PREF_ADDED_FILES_OPTION);
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/BldInfImportWizard.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/BldInfImportWizard.java	Tue Aug 10 19:18:52 2010 -0500
@@ -20,12 +20,14 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.resources.WorkspaceJob;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.IDialogSettings;
@@ -82,11 +84,13 @@
     	
 		final String projectName = projectPropertiesPage.getProjectName();
 		final IPath rootDirectory = projectPropertiesPage.getRootDirectory();
+		final boolean isLinkedProject = projectPropertiesPage.linkedResourcesEnabled();
 		
 		// calculate the project relative path to the bld.inf file.
 		IPath absoluteBldInfPath = new Path(getBldInfFile());
 		assert(rootDirectory.isPrefixOf(absoluteBldInfPath));
 		final String projectRelativePath = absoluteBldInfPath.removeFirstSegments(rootDirectory.segmentCount()).setDevice(null).toOSString();
+		final String absoluteInfPath = absoluteBldInfPath.toOSString();
 		
 		// if all mmps are checked then don't pass any to createProject.  that
 		// way the project setting will be set to build bld.inf.
@@ -122,13 +126,21 @@
 				} // for
 
 				IProject newProject = null;
-        		newProject = ProjectCorePlugin.createProject(projectName, rootDirectory.toOSString());
+				if (isLinkedProject){
+					newProject = ProjectCorePlugin.createProject(projectName, null);
+					newProject.getFolder(rootDirectory.lastSegment()).createLink(rootDirectory.toFile().toURI(), IResource.BACKGROUND_REFRESH, new NullProgressMonitor());
+				} else {
+					newProject = ProjectCorePlugin.createProject(projectName, rootDirectory.toOSString());
+				}
         		monitor.worked(1);
-
+        		
     			newProject.setSessionProperty(CarbideBuilderPlugin.SBSV2_PROJECT, Boolean.valueOf(useSBSv2Builder()));
 
-    			// TODO pass PKG file path to postProjectCreatedActions, currently passing null
-        		ProjectCorePlugin.postProjectCreatedActions(newProject, projectRelativePath, selectedConfigs, components, debugMMP, null, monitor);
+    			if (isLinkedProject){
+    				ProjectCorePlugin.postProjectCreatedActions(newProject, absoluteInfPath, selectedConfigs, components, debugMMP, null, monitor);
+    			} else {
+    				ProjectCorePlugin.postProjectCreatedActions(newProject, projectRelativePath, selectedConfigs, components, debugMMP, null, monitor);
+    			}
         		
         		if (monitor.isCanceled()) {
 	    			// the user canceled the import so delete the project
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/Messages.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/Messages.java	Tue Aug 10 19:18:52 2010 -0500
@@ -112,6 +112,10 @@
 	public static String ProjectPropertiesPage_directoryTooLong;
 	
 	public static String ProjectPropertiesPage_directoryIsRoot;
+	
+	public static String ProjectPropertiesPage_linkedProject;
+	
+	public static String ProjectPropertiesPage_linkedProjectTooltip;
 
 	static {
 		// initialize resource bundle
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ProjectPropertiesPage.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ProjectPropertiesPage.java	Tue Aug 10 19:18:52 2010 -0500
@@ -45,6 +45,7 @@
 
 import com.nokia.carbide.cdt.builder.EpocEngineHelper;
 import com.nokia.carbide.cpp.internal.project.ui.ProjectUIHelpIds;
+import com.nokia.carbide.cpp.internal.project.ui.ProjectUIPlugin;
 import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
 import com.nokia.cpp.internal.api.utils.ui.BrowseDialogUtils;
 
@@ -53,6 +54,7 @@
     private Text projectName;
     private Text rootDirectory;
     private Button browseButton;
+    private Button linkedResourcesCheck;
     
     String projectNameText = ""; //$NON-NLS-1$
     IPath rootDirectoryPath = null;
@@ -143,6 +145,14 @@
 		gd.horizontalSpan = 3;
 		helpText.setLayoutData(gd);
 
+		if (ProjectUIPlugin.supportLinkedResources()){
+			linkedResourcesCheck = new Button(parent, SWT.CHECK);
+			linkedResourcesCheck.setFont(font);
+			linkedResourcesCheck.setText(Messages.ProjectPropertiesPage_linkedProject);
+			linkedResourcesCheck.setToolTipText(Messages.ProjectPropertiesPage_linkedProjectTooltip);
+			linkedResourcesCheck.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
+		}
+		
 		setButtonLayoutData(browseButton);
 	}
 
@@ -280,6 +290,10 @@
     	return rootDirectoryPath;
     }
 
+    public boolean linkedResourcesEnabled(){
+    	return linkedResourcesCheck.getSelection();
+    }
+    
 	@Override
 	public void setVisible(boolean visible) {
 		// this gets called just before the page goes in or out of view.  if it's
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/messages.properties	Tue Aug 10 14:39:10 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/messages.properties	Tue Aug 10 19:18:52 2010 -0500
@@ -18,6 +18,8 @@
 ProjectPropertiesPage_directoryDoesNotContainSourceFiles=The root directory specified does not contain all the source and resource files referenced in the project.  This may make navigation and editing more difficult.  
 ProjectPropertiesPage_directoryTooLong=The root directory specified is too long.  It cannot exceed 215 characters so that project settings files do not exceed the 256 character path limit.
 ProjectPropertiesPage_directoryIsRoot=A project path near the root SDK directory can lead to slow import times. Please select another project path or import a subset of included bld.inf files (if possible).
+ProjectPropertiesPage_linkedProject=Create project with linked resources
+ProjectPropertiesPage_linkedProjectToolTip=When enabled, the eclipse project files are created in the workspace and all project content is formed with linked resources.
 MMPSelectionPage_title=MMP Selection
 MMPSelectionPage_description=Select the mmp and extension make files to work with.  You will be able to edit this after the project has been created.
 MMPSelectionPage_selectAllAButtonLabel=Select All
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/preferences/PreferenceConstants.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/preferences/PreferenceConstants.java	Tue Aug 10 19:18:52 2010 -0500
@@ -28,4 +28,6 @@
 	public final static String PREF_CHANGED_FILES_OPTION = "changedFilesOption"; //$NON-NLS-1$
 
 	public static final String PREF_INDEX_ALL = "indexAll"; //$NON-NLS-1$
+	
+	public static final String PREF_SUPPORT_LINKED_RESOURCES = "supportsLinkedRsrcs"; //$NON-NLS-1$
 }
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/preferences/PreferenceInitializer.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/preferences/PreferenceInitializer.java	Tue Aug 10 19:18:52 2010 -0500
@@ -16,6 +16,7 @@
 */
 package com.nokia.carbide.cpp.internal.project.ui.preferences;
 
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
 import org.eclipse.jface.preference.IPreferenceStore;
 
@@ -35,6 +36,21 @@
 		IPreferenceStore store = ProjectUIPlugin.getDefault().getPreferenceStore();
 		store.setDefault(PreferenceConstants.PREF_KEEP_PROJECTS_IN_SYNC, true);
 		store.setDefault(PreferenceConstants.PREF_INDEX_ALL, false);
+		
+		if (cmdLineArgsSupportsLinkedResources()){
+			store.setDefault(PreferenceConstants.PREF_SUPPORT_LINKED_RESOURCES, true);
+		} else {
+			store.setDefault(PreferenceConstants.PREF_SUPPORT_LINKED_RESOURCES, false);
+		}
+	}
+	
+	private boolean cmdLineArgsSupportsLinkedResources(){
+		String[] args = Platform.getCommandLineArgs();
+		for (String arg : args){
+			if (arg.equals("supportsLinkedRsrcs=true"))
+				return true;
+		}
+		return false;
 	}
 
 }
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/views/SPNViewContentProvider.java	Tue Aug 10 14:39:10 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/views/SPNViewContentProvider.java	Tue Aug 10 19:18:52 2010 -0500
@@ -43,6 +43,7 @@
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
@@ -70,6 +71,7 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.model.BaseWorkbenchContentProvider;
 import org.eclipse.ui.model.IWorkbenchAdapter;
+import org.eclipse.ui.model.WorkbenchAdapter;
 
 import com.nokia.carbide.cdt.builder.BldInfViewPathHelper;
 import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
@@ -106,15 +108,13 @@
 import com.nokia.carbide.cpp.epoc.engine.preprocessor.DefaultModelDocumentProvider;
 import com.nokia.carbide.cpp.epoc.engine.preprocessor.DefaultTranslationUnitProvider;
 import com.nokia.carbide.cpp.epoc.engine.preprocessor.IIncludeFileLocator;
-import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo;
-import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo;
 import com.nokia.carbide.cpp.internal.project.ui.ProjectUIPlugin;
 import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
-import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
 import com.nokia.carbide.cpp.ui.CarbideUIPlugin;
 import com.nokia.carbide.cpp.ui.ICarbideSharedImages;
 import com.nokia.carbide.internal.api.cpp.epoc.engine.preprocessor.DependencyScanner;
+import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
 
 /**
  * Content provider for the SymbianProjectNavigatorView
@@ -2329,7 +2329,20 @@
         if (info != null) {
     		IPath infPath = info.getProjectRelativeBldInfPath();
     		if (infPath != null) {
-        		IFile file = getIFileFromBldInfViewPath(project, infPath);
+    			IFile file = null;
+    			if (infPath.isAbsolute()){
+    				// Make sure to get the project relative location if the inf path is absolute.
+    				// This means the project has linked resources
+    				// TODO: Just using for prototyping with using linked resources....
+    				// XXX: This is still not working, as the path is relative to the workspace and
+    				// hence it's wrong. Seems we need to change the container for the SPN to take
+    				// a bld.inf as an absolute path???
+    				IFile infFile = ResourcesPlugin.getWorkspace().getRoot().getFile(infPath);
+    				children.add(infFile);
+    				return children.toArray();
+    			} else {
+    				file = getIFileFromBldInfViewPath(project, infPath);
+    			}
         		if (file != null) {
         			children.add(containerFactory.getBldInfContainer(file, true));
 
@@ -2516,6 +2529,11 @@
 	}
 
 	protected IFile getIFileFromBldInfViewPath(IProject project, IPath pathFromBldInfView) {
+		
+		if (pathFromBldInfView.isAbsolute()){
+			IWorkspace workspace= ResourcesPlugin.getWorkspace();
+			return workspace.getRoot().getFile(pathFromBldInfView);
+		}
 		EpocEnginePathHelper helper = new EpocEnginePathHelper(project);
 		IPath resolvedProjectRelativePath = helper.convertToProject(pathFromBldInfView);
 		if (resolvedProjectRelativePath != null)