merge commit RCL_2_4
authortimkelly
Tue, 20 Apr 2010 14:10:08 -0500
branchRCL_2_4
changeset 1252 174c8b7f4dff
parent 1251 9cfb1ca53be5 (diff)
parent 1247 897fa364d410 (current diff)
child 1253 75aabc8b4b41
child 1254 0e45b6356eac
merge commit
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/DefaultViewConfiguration.java	Tue Apr 20 11:23:17 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/DefaultViewConfiguration.java	Tue Apr 20 14:10:08 2010 -0500
@@ -198,6 +198,11 @@
 	public Collection<IDefine> getMacros() {
 		List<IDefine> macros = new ArrayList<IDefine>();
 		if (context != null) {
+			
+			if (context.getSBSv2Alias() != null){
+				macros.add(DefineFactory.createDefine("SBSV2", null));
+			}
+			
 			for (IDefine macro : context.getVariantHRHDefines()) {
 				macros.add(macro);
 			}
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java	Tue Apr 20 11:23:17 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java	Tue Apr 20 14:10:08 2010 -0500
@@ -328,6 +328,10 @@
 	public List<String> getBuiltinMacros() {
 		List<String> macros = new ArrayList<String>();
 		
+		if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(getCarbideProject().getProject())){
+			macros.add("SBSV2"); //$NON-NLS-1$
+		}
+		
 		// add the macros that should always be defined
 		macros.add("__SYMBIAN32__"); //$NON-NLS-1$
 		macros.add("_UNICODE"); //$NON-NLS-1$
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/messages.properties	Tue Apr 20 11:23:17 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/messages.properties	Tue Apr 20 14:10:08 2010 -0500
@@ -5,3 +5,10 @@
 SBVCatalog.SBVLoadError=Error loading/parsing VAR file: {0}
 SBVCatalog.MissingCustomizedPlatform=Variant platform ''{0}'' customizes platform ''{1}'' which cannot be located or parsed.
 SBSv2Utils.CannotFindSBSScriptError=Cannot find {0} on the PATH.  Please verify your SBSv2 installation.
+
+CheckS60CustKitSupport.undefSBSV2Code=\
+// When building with Raptor, "gnumakefile" builds are no longer recommended.\n\
+// But the extension Makefiles referenced here are only available in OS 9.5+.\n\
+// Uncomment this to perform Raptor builds using old-style "gnumakefile".\n\
+//\#undef SBSV2\n\
+\n
\ No newline at end of file
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/processes/CheckS60CustKitSupport.java	Tue Apr 20 11:23:17 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/processes/CheckS60CustKitSupport.java	Tue Apr 20 14:10:08 2010 -0500
@@ -19,7 +19,9 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.Version;
 
+import com.nokia.carbide.cpp.internal.api.sdk.Messages;
 import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
@@ -33,7 +35,9 @@
  */
 public class CheckS60CustKitSupport extends AbstractProjectProcess {
 	
+	// copied from ProjectCreatedTasks (YUCK) 
 	private static final String SELECTED_BUILD_CONFIGS_VALUE_KEY = "selectedBuildConfigs"; //$NON-NLS-1$
+	
 	private static final String S60_50_BUILD_MACROS = "S60_50_CustomBuildIncludes";
 	
 	private static final String S60_INC_MACROS = "#include <data_caging_paths.hrh>\n#include <domain/osextensions/platform_paths.hrh>\nMW_LAYER_SYSTEMINCLUDE";
@@ -48,6 +52,11 @@
 	private static final String S60_SF_FOLDER =  "sf";
 	private static final String S60_INC_MACROS_SF = "#include <platform_paths.hrh>\n#include <data_caging_paths.hrh>\nAPP_LAYER_SYSTEMINCLUDE";
 
+	private static final String USE_PRJ_EXTENSIONS_VALUE = "usePrjExtensionsValue"; 
+	
+	private static final String UNDEF_SBSV2 = "undefSBSV2"; 
+	private static final String UNDEF_SBSV2_CODE = Messages.getString("CheckS60CustKitSupport.undefSBSV2Code"); //$NON-NLS-1$
+
 	private static final String BUILD_HELP_PREFIX = "buildHelpPrefix";
 	private static final String BUILD_HELP_SIS_PREFIX = "buildHelpSISPrefix"; 
 	private static final String DISABLE_HELP_STRING = "//";
@@ -55,7 +64,8 @@
 	private static final String HELP_COMPILER = "epoc32/tools/cshlpcmp.bat";
 	private static final String HELP_SUPPORT_MACRO = "helpSupport";
 	private static final String HELP_SUPPORT_STRING = "MACRO _HELP_AVAILABLE_";
-
+	private static final Version VERSION_9_5 = new Version(9, 5, 0); 
+	
 	protected IProject project;
 
 	@Override
@@ -80,6 +90,16 @@
 		template.getTemplateValues().put(BUILD_HELP_PREFIX, enableHelpString);
 		template.getTemplateValues().put(BUILD_HELP_SIS_PREFIX, enableHelpSISString); 
 		template.getTemplateValues().put(HELP_SUPPORT_MACRO, helpSupportString);
+		
+		String usePrjExtensionsValue = usePrjExtensionsRequired(template) ? "1" : "0"; 
+		template.getTemplateValues().put(USE_PRJ_EXTENSIONS_VALUE, usePrjExtensionsValue); 
+		
+		if (usePrjExtensionsRequired(template)) { 
+			template.getTemplateValues().put(UNDEF_SBSV2, UNDEF_SBSV2_CODE); 
+		} else {
+			template.getTemplateValues().put(UNDEF_SBSV2, ""); //$NON-NLS-1$ 
+		}
+		
 	}
 
 	@Override
@@ -87,6 +107,7 @@
 		return SDKCorePlugin.getDefault();
 	}
 	
+	@SuppressWarnings("unchecked")
 	private boolean isHelpCompilerAvailable(ITemplate template) {
 		Object object = template.getTemplateValues().get(SELECTED_BUILD_CONFIGS_VALUE_KEY);
 		if (object instanceof List) {
@@ -168,4 +189,60 @@
 		return S60_50_Macros_String;
 	}
 	
+	/**
+	 * Tell whether we should use PRJ_EXTENSIONS in bld.inf. Raptor doesn't 
+	 * officially support [n|gnu]makefile statements in PRJ_MMPFILES anymore, 
+	 * and actively ignores them on Linux. 
+	 * @param template 
+	 * @return 
+	 */
+	private boolean usePrjExtensionsRequired(ITemplate template) {
+		
+		// look for the directory housing the extension templates;
+		// if this doesn't exist, then PRJ_EXTENSIONS won't work
+		boolean makefileTemplatesAlwaysAvailable = true;
+
+		boolean allPostSDK9_5 = true;
+
+		for (ISymbianBuildContext symbianBuildContext : getBuildContexts(template)) {
+			ISymbianSDK sdk = symbianBuildContext.getSDK();
+			if (sdk != null) {
+				File makefileTemplateDir = new File(sdk.getEPOCROOT(), "epoc32/tools/makefile_templates"); //$NON-NLS-1$
+				if (!makefileTemplateDir.exists()) {
+					// old location
+					makefileTemplateDir = new File(sdk.getEPOCROOT(), "s60/tools/makefile_templates"); //$NON-NLS-1$
+					if (!makefileTemplateDir.exists()) {
+						makefileTemplatesAlwaysAvailable = false;
+						break;
+					}
+				}
+				
+				if (sdk.getOSVersion().compareTo(VERSION_9_5) < 0) {
+					allPostSDK9_5 = false;
+				}
+			}
+		}
+		
+		if (!makefileTemplatesAlwaysAvailable)
+			return false;
+		
+		// OS 9.5+ kits are supposed to be Raptorized.  Don't recommend extensions
+		// unless we think they'll be present.
+		//
+		if (!allPostSDK9_5)
+			return false;
+		
+		return true;
+	}
+	
+	@SuppressWarnings("unchecked")
+	private ISymbianBuildContext[] getBuildContexts(ITemplate template) {
+		Object object = template.getTemplateValues().get(SELECTED_BUILD_CONFIGS_VALUE_KEY);
+		if (object instanceof List) {
+			List<ISymbianBuildContext> listOfBuildConfigs = (List<ISymbianBuildContext>) object;
+			return (ISymbianBuildContext[]) listOfBuildConfigs
+					.toArray(new ISymbianBuildContext[listOfBuildConfigs.size()]);
+		}
+		return new ISymbianBuildContext[0];
+	}
 }
--- a/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-PlatsecApp/group/bld.inf	Tue Apr 20 11:23:17 2010 -0500
+++ b/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-PlatsecApp/group/bld.inf	Tue Apr 20 14:10:08 2010 -0500
@@ -12,11 +12,35 @@
 PRJ_PLATFORMS
 WINSCW ARMV5 GCCE
 
+$(undefSBSV2)
+#ifdef SBSV2
+
+PRJ_EXTENSIONS
+	
+	START EXTENSION s60/mifconv
+	OPTION TARGETFILE $(baseName$lower)_$(uid3).mif
+	OPTION HEADERFILE $(baseName$lower)_$(uid3).mbg
+	OPTION SOURCEDIR ../gfx
+	OPTION SOURCES -c32 qgn_menu_$(baseName)
+	END
+	
+	// help compiler is not always available; see similar comment in *.pkg file
+	$(buildHelpPrefix)START EXTENSION techview/bldhelp
+	$(buildHelpPrefix)OPTION HELPPROJECTFILE $(baseName).cshlp
+	$(buildHelpPrefix)OPTION HELPTOOLTARGETNAME $(baseName$lower)_$(uid3).hlp
+	$(buildHelpPrefix)END
+
+#else
+
 PRJ_MMPFILES
 
-gnumakefile icons_scalable_dc.mk
+	gnumakefile icons_scalable_dc.mk
 
-$(buildHelpPrefix)gnumakefile ..\$(helpDir)\build_help.mk
+	// help compiler is not always available; see similar comment in *.pkg file
+	$(buildHelpPrefix)gnumakefile ../$(helpDir)/build_help.mk
 
+#endif
+
+PRJ_MMPFILES
 $(baseName).mmp
 
--- a/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-TouchUIApplication/group/bld.inf	Tue Apr 20 11:23:17 2010 -0500
+++ b/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-TouchUIApplication/group/bld.inf	Tue Apr 20 14:10:08 2010 -0500
@@ -12,11 +12,35 @@
 PRJ_PLATFORMS
 WINSCW ARMV5 GCCE
 
+$(undefSBSV2)
+#ifdef SBSV2
+
+PRJ_EXTENSIONS
+	
+	START EXTENSION s60/mifconv
+	OPTION TARGETFILE $(baseName$lower)_$(uid3).mif
+	OPTION HEADERFILE $(baseName$lower)_$(uid3).mbg
+	OPTION SOURCEDIR ../gfx
+	OPTION SOURCES -c32 qgn_menu_$(baseName)
+	END
+	
+	// help compiler is not always available; see similar comment in *.pkg file
+	$(buildHelpPrefix)START EXTENSION techview/bldhelp
+	$(buildHelpPrefix)OPTION HELPPROJECTFILE $(baseName).cshlp
+	$(buildHelpPrefix)OPTION HELPTOOLTARGETNAME $(baseName$lower)_$(uid3).hlp
+	$(buildHelpPrefix)END
+
+#else
+
 PRJ_MMPFILES
 
-gnumakefile icons_scalable_dc.mk
+	gnumakefile icons_scalable_dc.mk
 
-$(buildHelpPrefix)gnumakefile ..\$(helpDir)\build_help.mk
+	// help compiler is not always available; see similar comment in *.pkg file
+	$(buildHelpPrefix)gnumakefile ../$(helpDir)/build_help.mk
+
+#endif
+
+PRJ_MMPFILES
 
 $(baseName).mmp
-