More Linux porting changes. Use HostOS.EXE_EXT to select the Win32 ".exe" suffix in executable filenames.
authorEd Swartz <ed.swartz@nokia.com>
Fri, 04 Dec 2009 08:33:28 -0600
changeset 630 dee2f67c6538
parent 629 c24c517fe8c2
child 631 675796977d5c
More Linux porting changes. Use HostOS.EXE_EXT to select the Win32 ".exe" suffix in executable filenames.
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/builder/CarbideCPPBuilder.java
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/messages.properties
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ROMBuilderInfo.java
builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/PreprocessHandler.java
core/com.nokia.carbide.cpp.codescanner/src/com/nokia/carbide/cpp/internal/codescanner/config/CSConfigManager.java
core/com.nokia.carbide.cpp.leavescan/META-INF/MANIFEST.MF
core/com.nokia.carbide.cpp.leavescan/src/com/nokia/carbide/cpp/internal/leavescan/popup/actions/LeavescanAction.java
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianMacroStore.java
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java
core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/HostOS.java
project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/SymbianBuildParser.java
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/builder/CarbideCPPBuilder.java	Fri Dec 04 08:32:47 2009 -0600
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/builder/CarbideCPPBuilder.java	Fri Dec 04 08:33:28 2009 -0600
@@ -83,6 +83,7 @@
 import com.nokia.carbide.internal.api.cpp.epoc.engine.model.pkg.IPKGView;
 import com.nokia.carbide.internal.api.cpp.epoc.engine.model.pkg.PKGModelHelper;
 import com.nokia.cpp.internal.api.utils.core.FileUtils;
+import com.nokia.cpp.internal.api.utils.core.HostOS;
 import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
 
 /**
@@ -110,10 +111,10 @@
     private static final String DEFAULT_KEY_NAME = "key-gen.key"; //$NON-NLS-1$
     private static final String DEFAULT_CERT_NAME = "cert-gen.cer"; //$NON-NLS-1$
     private static final String DEAULT_PASSWORD = "DefaultPassword"; //$NON-NLS-1$
-    private static final String MAKEKEYS_EXE = "makekeys.exe"; //$NON-NLS-1$
-    private static final String MAKESIS_EXE = "makesis.exe"; //$NON-NLS-1$
+    private static final String MAKEKEYS_EXE = "makekeys" + HostOS.EXE_EXT; //$NON-NLS-1$
+    private static final String MAKESIS_EXE = "makesis" + HostOS.EXE_EXT; //$NON-NLS-1$
     
-    private static final String SIGNSIS_EXE = "signsis.exe"; //$NON-NLS-1$
+    private static final String SIGNSIS_EXE = "signsis" + HostOS.EXE_EXT; //$NON-NLS-1$
     
 	private static List<IPath> normalMakMakePaths = Collections.synchronizedList(new ArrayList<IPath>());
 	private static List<IPath> testMakMakePaths = Collections.synchronizedList(new ArrayList<IPath>());
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/messages.properties	Fri Dec 04 08:32:47 2009 -0600
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/messages.properties	Fri Dec 04 08:33:28 2009 -0600
@@ -1,5 +1,5 @@
 ManageConfigurationsDialog.Add_Remove_Build_Configs=Add/Remove Carbide Build Configurations
-ManageConfigurationsDialog.Config_Label_ToolTip=Show the SDKs and build configurations that the current project can use
+ManageConfigurationsDialog.Config_Label_ToolTip=Show the SDKs and build configurations, filtered by the Platform Filtering preferences, that the current project can use
 ManageConfigurationsDialog.Available_SDks_and_Configs=\n Available SDKs and Configurations:\n\n
 ManageConfigurationsDialog.Unavailable_Config_Label_ToolTip=Show the SDKs and build configurations that are unavailable to the current project
 ManageConfigurationsDialog.Unavailable_SDks_and_Configs=\n Unavailable SDKs and Configurations:\n\n
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java	Fri Dec 04 08:32:47 2009 -0600
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java	Fri Dec 04 08:33:28 2009 -0600
@@ -46,6 +46,7 @@
 import com.nokia.carbide.cpp.internal.qt.core.QtCorePlugin;
 import com.nokia.carbide.cpp.sdk.core.*;
 import com.nokia.cpp.internal.api.utils.core.FileUtils;
+import com.nokia.cpp.internal.api.utils.core.HostOS;
 import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
 
 
@@ -65,8 +66,8 @@
     private static final String FINAL_CMD = "final"; //$NON-NLS-1$
     private static final String TEST_CMD = "test"; //$NON-NLS-1$
 
-    private static final IPath MAKE = new Path("make.exe"); //$NON-NLS-1$
-    private static final IPath PERL = new Path("perl.exe"); //$NON-NLS-1$
+    private static final IPath MAKE = new Path("make" + HostOS.EXE_EXT); //$NON-NLS-1$
+    private static final IPath PERL = new Path("perl" + HostOS.EXE_EXT); //$NON-NLS-1$
 
 	private static final String ABLD_BAT_NAME = "abld.bat"; //$NON-NLS-1$
 
@@ -2738,10 +2739,10 @@
 		
 		// now add preprocess commands to the resource file rules.  if ALT_PRE env variable is set then
 		// use scpp.exe, otherwise use cpp.exe.  pipe the output to a dependency file in the makefile directory.
-		String cpp = "cpp.exe";
+		String cpp = "cpp" + HostOS.EXE_EXT;
 		for (String var : getResolvedEnvVars(config)) {
 			if (var.compareTo("ALT_PRE") == 0 || var.startsWith("ALT_PRE=")) {
-				cpp = "rcpp.exe";
+				cpp = "rcpp" + HostOS.EXE_EXT;
 				break;
 			}
 		}
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ROMBuilderInfo.java	Fri Dec 04 08:32:47 2009 -0600
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ROMBuilderInfo.java	Fri Dec 04 08:33:28 2009 -0600
@@ -22,6 +22,7 @@
 
 import com.nokia.carbide.cdt.builder.project.IROMBuilderInfo;
 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+import com.nokia.cpp.internal.api.utils.core.HostOS;
 
 
 public class ROMBuilderInfo implements IROMBuilderInfo {
@@ -37,11 +38,11 @@
 	public ROMBuilderInfo(ISymbianSDK sdk) {
 
 		this.romBuildCommandLine = ""; //$NON-NLS-1$
-		this.romBuildWorkingDirectory = "C:\\"; //$NON-NLS-1$
+		this.romBuildWorkingDirectory = HostOS.IS_WIN32 ? "C:\\" : "/tmp"; //$NON-NLS-1$ //$NON-NLS-2$
 		
 		// now set epoc32\rom folder in the sdk as the default working dir 
 		// this is most common folder that rom images are built from for most symbian kits..
-		String dir = sdk.getEPOCROOT() + "epoc32\\rom\\";  //$NON-NLS-1$
+		String dir = sdk.getEPOCROOT() + "epoc32/rom/";  //$NON-NLS-1$
 		if (new File(dir).exists())
 			romBuildWorkingDirectory = dir;
 	}
--- a/builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/PreprocessHandler.java	Fri Dec 04 08:32:47 2009 -0600
+++ b/builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/PreprocessHandler.java	Fri Dec 04 08:33:28 2009 -0600
@@ -84,6 +84,7 @@
 import com.nokia.carbide.cpp.internal.builder.utils.ui.LanguageSelectionDialog;
 import com.nokia.carbide.cpp.internal.builder.utils.ui.PreprocessPreferencePage;
 import com.nokia.cpp.internal.api.utils.core.FileUtils;
+import com.nokia.cpp.internal.api.utils.core.HostOS;
 import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
 
 public class PreprocessHandler extends AbstractHandler {
@@ -130,10 +131,10 @@
 			        		CarbideCommandLauncher launcher = new CarbideCommandLauncher(project, monitor, CarbideCPPBuilder.getParserIdArray(buildConfig.getErrorParserId()), cpi.getINFWorkingDirectory());
 							launcher.showCommand(true);
 
-							String cppTool = "cpp.exe"; //$NON-NLS-1$
+							String cppTool = "cpp" + HostOS.EXE_EXT; //$NON-NLS-1$
 							for (String var : CarbideCPPBuilder.getResolvedEnvVars(buildConfig)) {
 								if (var.compareTo("ALT_PRE") == 0 || var.startsWith("ALT_PRE=")) { //$NON-NLS-1$ //$NON-NLS-2$
-									cppTool = "rcpp.exe"; //$NON-NLS-1$
+									cppTool = "rcpp" + HostOS.EXE_EXT; //$NON-NLS-1$
 									break;
 								}
 							}
--- a/core/com.nokia.carbide.cpp.codescanner/src/com/nokia/carbide/cpp/internal/codescanner/config/CSConfigManager.java	Fri Dec 04 08:32:47 2009 -0600
+++ b/core/com.nokia.carbide.cpp.codescanner/src/com/nokia/carbide/cpp/internal/codescanner/config/CSConfigManager.java	Fri Dec 04 08:33:28 2009 -0600
@@ -36,6 +36,7 @@
 
 import com.nokia.carbide.cpp.internal.codescanner.CSPlugin;
 import com.nokia.carbide.cpp.internal.codescanner.ui.CSPreferenceConstants;
+import com.nokia.cpp.internal.api.utils.core.HostOS;
 
 /**
  * A class for handling global and project specific Codescanner configuration settings.
@@ -46,7 +47,7 @@
 	public static final String CS_CONFIG_SETTINGS_FILE = "carbide_cs_config.xml";
 
 	// name of CodeScanner commandline tool
-	public static final String CS_CMDLINE_TOOL = "codescanner.exe";
+	public static final String CS_CMDLINE_TOOL = "codescanner" + HostOS.EXE_EXT;
 
 	// private members
 	private static CSConfigSettings defaultConfig;
--- a/core/com.nokia.carbide.cpp.leavescan/META-INF/MANIFEST.MF	Fri Dec 04 08:32:47 2009 -0600
+++ b/core/com.nokia.carbide.cpp.leavescan/META-INF/MANIFEST.MF	Fri Dec 04 08:33:28 2009 -0600
@@ -11,5 +11,6 @@
  org.eclipse.core.resources,
  org.eclipse.cdt.core,
  com.nokia.carbide.cdt.builder,
- com.nokia.carbide.cpp.sdk.core
+ com.nokia.carbide.cpp.sdk.core,
+ com.nokia.cpp.utils.core
 Bundle-ActivationPolicy: lazy
--- a/core/com.nokia.carbide.cpp.leavescan/src/com/nokia/carbide/cpp/internal/leavescan/popup/actions/LeavescanAction.java	Fri Dec 04 08:32:47 2009 -0600
+++ b/core/com.nokia.carbide.cpp.leavescan/src/com/nokia/carbide/cpp/internal/leavescan/popup/actions/LeavescanAction.java	Fri Dec 04 08:33:28 2009 -0600
@@ -43,6 +43,7 @@
 import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
 import com.nokia.carbide.cpp.internal.leavescan.LeavescanPlugin;
 import com.nokia.carbide.cpp.internal.leavescan.ui.LeavescanPreferenceConstants;
+import com.nokia.cpp.internal.api.utils.core.HostOS;
 
 public class LeavescanAction implements IObjectActionDelegate {
 	
@@ -164,9 +165,9 @@
 						leaveScanArgList.add("/c");
 						
 						if (leaveScanFolder.length() > 0){
-							leaveScanArgList.add(leaveScanFolder + "leavescan.exe");
+							leaveScanArgList.add(leaveScanFolder + "leavescan" + HostOS.EXE_EXT);
 						} else {
-							leaveScanArgList.add("leavescan.exe");
+							leaveScanArgList.add("leavescan" + HostOS.EXE_EXT);
 						}
 
 						if (noisyOutput) {
@@ -273,9 +274,9 @@
 					leaveScanArgList.add("/c");
 					
 					if (leaveScanFolder.length() > 0){
-						leaveScanArgList.add(leaveScanFolder + "leavescan.exe");
+						leaveScanArgList.add(leaveScanFolder + "leavescan" + HostOS.EXE_EXT);
 					} else {
-						leaveScanArgList.add("leavescan.exe");
+						leaveScanArgList.add("leavescan" + HostOS.EXE_EXT);
 					}
 
 					if (noisyOutput) {
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianMacroStore.java	Fri Dec 04 08:32:47 2009 -0600
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianMacroStore.java	Fri Dec 04 08:33:28 2009 -0600
@@ -13,7 +13,6 @@
 
 package com.nokia.carbide.cpp.internal.api.sdk;
 
-import java.io.File;
 import java.io.IOException;
 import java.net.URISyntaxException;
 import java.net.URL;
@@ -25,7 +24,6 @@
 import java.util.List;
 
 import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.emf.common.util.EList;
 import org.osgi.framework.Bundle;
@@ -53,10 +51,10 @@
 
 public class SymbianMacroStore {
 	
-	private static final String PLUGIN_DATA_FOLDER = "data";
-	private static final String MACRO_STORE_FILE = "symbianMacroStore.xml";
-	private static final String BEECH_BRANCH_ID = "a";
-	private static final String CEDAR_BRANCH_ID = "b";
+	//private static final String PLUGIN_DATA_FOLDER = "data";
+	//private static final String MACRO_STORE_FILE = "symbianMacroStore.xml";
+	//private static final String BEECH_BRANCH_ID = "a";
+	//private static final String CEDAR_BRANCH_ID = "b";
 	private static final String MACRO_STORE_LOCATION ="/data/symbianMacroStore.xml";
 	private static SymbianMacroStore instance;
 	
@@ -157,6 +155,7 @@
 			}
 	} 
 	
+	/*
     private File getMacroStoreFile() throws IOException {
     	String location = "";
 		try {
@@ -170,6 +169,7 @@
 		}
 		return new File (location + File.separator + MACRO_STORE_FILE);
 	}
+	*/
 	
     private void initData(){
     	osMacros = new HashMap<String, List<String>>();
@@ -284,7 +284,7 @@
     		}
     		
     		if (macroList == null) {
-    			macroList = Collections.EMPTY_LIST;
+    			macroList = Collections.emptyList();
     		}
 		}
     	
@@ -325,7 +325,7 @@
     	}
     	
     	if (supportedOSVersionList == null){
-    		return Collections.EMPTY_LIST;
+    		return Collections.emptyList();
     	}
     	
     	Collections.sort(supportedOSVersionList, new Comparator<String>() {
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java	Fri Dec 04 08:32:47 2009 -0600
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java	Fri Dec 04 08:33:28 2009 -0600
@@ -42,6 +42,7 @@
 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
 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;
 
 public class SDKManager extends AbstractSDKManager {
@@ -240,9 +241,9 @@
 
 		String gcceToolDir = installPath + "\\bin";
 		
-		String[] gccBinToolList = { "arm-none-symbianelf-nm.exe",
-									"arm-none-symbianelf-readelf.exe",
-									"arm-none-symbianelf-c++filt.exe"
+		String[] gccBinToolList = { "arm-none-symbianelf-nm" + HostOS.EXE_EXT,
+									"arm-none-symbianelf-readelf" + HostOS.EXE_EXT,
+									"arm-none-symbianelf-c++filt" + HostOS.EXE_EXT
 									};
 		String toolName = null;
 		String toolPathName = null;
--- a/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/HostOS.java	Fri Dec 04 08:32:47 2009 -0600
+++ b/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/HostOS.java	Fri Dec 04 08:33:28 2009 -0600
@@ -30,6 +30,8 @@
 	public static boolean IS_WIN32 = File.separatorChar == '\\';
 	/** Is the host some Unix variant? */
 	public static boolean IS_UNIX = File.separatorChar == '/';
+	/** Executable file extension */
+	public static final String EXE_EXT = IS_WIN32 ? ".exe" : "";
 	
 	/** The name of the PATH variable in the environment.  Capitalized differently per OS. */
 	public static String PATH_VARIABLE_NAME = IS_WIN32 ? "Path" : "PATH";
@@ -104,7 +106,7 @@
 			IPath executablePath = new Path(executable);
 			String ext = executablePath.getFileExtension();
 			if (ext == null) {
-				executable += ".exe";
+				executable += EXE_EXT;
 			}
 		}
 		return executable;
--- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/SymbianBuildParser.java	Fri Dec 04 08:32:47 2009 -0600
+++ b/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/SymbianBuildParser.java	Fri Dec 04 08:33:28 2009 -0600
@@ -73,7 +73,7 @@
 	private static final String MACROS = "macros"; //$NON-NLS-1$
 	private static final String MBM = "mbm"; //$NON-NLS-1$
 	private static final String MIF = "mif"; //$NON-NLS-1$
-	private static final String DEFAULT_TARGET = "untitled.exe"; //$NON-NLS-1$
+	private static final String DEFAULT_TARGET = HostOS.IS_WIN32 ? "untitled.exe" : "untitled"; //$NON-NLS-1$ //$NON-NLS-2$
 	private static final String DEFAULT_TARGETTYPE = "exe"; //$NON-NLS-1$
 	private static final String[] plaformMacros = {
 		"GCC32", "EPOC32", "MARM", "EABI", "GENERIC_MARM",  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$