summaryrefslogtreecommitdiffstats
path: root/org.rtems.cdt.toolchain/src
diff options
context:
space:
mode:
Diffstat (limited to 'org.rtems.cdt.toolchain/src')
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/Activator.java52
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/IsRtemsToolChainSupported.java21
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsBspDefinedSymbolsValueHandler.java58
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsCommandLineGenerator.java89
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsEnvironmentVariableSupplier.java301
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsInstallBspDirectoryValueHandler.java101
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsLinkCommandLineInfo.java23
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsManagerRelocationLinkHandler.java177
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsScannerInfoCollector.java128
9 files changed, 0 insertions, 950 deletions
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/Activator.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/Activator.java
deleted file mode 100644
index 813df03..0000000
--- a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/Activator.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.rtems.cdt.toolchain;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.rtems.cdt.toolchain";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/IsRtemsToolChainSupported.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/IsRtemsToolChainSupported.java
deleted file mode 100644
index dda639d..0000000
--- a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/IsRtemsToolChainSupported.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2008 RobertF.
- * All rights reserved.
- **********************************************************************/
-
-package org.rtems.cdt.toolchain;
-
-import org.eclipse.cdt.managedbuilder.core.IManagedIsToolChainSupported;
-import org.eclipse.cdt.managedbuilder.core.IToolChain;
-import org.eclipse.core.runtime.PluginVersionIdentifier;
-
-public class IsRtemsToolChainSupported implements IManagedIsToolChainSupported {
- public IsRtemsToolChainSupported() {
- }
-
- public boolean isSupported(IToolChain toolChain,
- PluginVersionIdentifier version, String instance) {
- return RtemsEnvironmentVariableSupplier.toolChainSupported;
- }
-
-}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsBspDefinedSymbolsValueHandler.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsBspDefinedSymbolsValueHandler.java
deleted file mode 100644
index 00bed1e..0000000
--- a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsBspDefinedSymbolsValueHandler.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.rtems.cdt.toolchain;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ArrayList;
-
-import org.eclipse.cdt.managedbuilder.core.IBuildObject;
-import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
-import org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler;
-import org.eclipse.cdt.managedbuilder.core.IOption;
-import org.eclipse.cdt.managedbuilder.core.ManagedOptionValueHandler;
-
-public class RtemsBspDefinedSymbolsValueHandler extends ManagedOptionValueHandler
- implements IManagedOptionValueHandler {
- private List<String> bspDefinedSymbolList;
-
- public RtemsBspDefinedSymbolsValueHandler() {
- bspDefinedSymbolList = RtemsScannerInfoCollector.getBspDefinedSymbols();
- }
-
- /**
- * Handles transfer between values between UI element and
- * back-end in different circumstances.
- *
- * @param configuration build configuration of option
- * (may be IConfiguration or IResourceConfiguration)
- * @param holder contains the holder of the option
- * @param option the option that is handled
- * @param extraArgument extra argument for handler
- * @param event event to be handled, one of the following:
- * (EVENT_OPEN = 1, EVENT_CLOSE = 2,
- * EVENT_SETDEFAULT = 3,
- * EVENT_APPLY = 4, EVENT_LOAD = 5)
- *
- * @return True when the event was handled, false otherwise.
- * This enables default event handling can take place.
- */
- public boolean handleValue(IBuildObject configuration, IHoldsOptions holder,
- IOption option, String extraArgument, int event) {
- if (event == EVENT_CLOSE) return false;
-
- try {
- Object defaultValue = option.getDefaultValue();
-
- if ( defaultValue==null
- || ( defaultValue instanceof List
- && ((List)defaultValue).size()<=0
- )
- ) {
- option.setDefaultValue(bspDefinedSymbolList);
- }
- } catch (Exception e) {
- return false;
- }
-
- return true;
- }
-}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsCommandLineGenerator.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsCommandLineGenerator.java
deleted file mode 100644
index 1e52f85..0000000
--- a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsCommandLineGenerator.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package org.rtems.cdt.toolchain;
-
-import java.util.HashMap;
-
-import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator;
-import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
-import org.eclipse.cdt.managedbuilder.core.ITool;
-import org.eclipse.cdt.managedbuilder.internal.core.ManagedCommandLineGenerator;
-
-public class RtemsCommandLineGenerator extends ManagedCommandLineGenerator
- implements IManagedCommandLineGenerator {
-
- public static final String ENV_RTEMS_TOOLSET = "RTEMS_TOOLSET";
-
- public static final String TOOL_AR = "ar";
- public static final String TOOL_AS = "as";
- public static final String TOOL_GCC = "gcc";
- public static final String TOOL_GPP = "g++";
-
- private static final String DEFAULT_RTEMS_TOOLSET =
- "i386-rtems4.9-ar, i386-rtems4.9-as, i386-rtems4.9-gcc, i386-rtems4.9-g++";
-
- private static HashMap<String, String> toolCmdMap = new HashMap<String, String>(10);
- private String toolName;
-
- static {
- String toolset = System.getenv(ENV_RTEMS_TOOLSET);
- if (toolset==null) toolset = DEFAULT_RTEMS_TOOLSET;
-
- String[] tool = toolset.split(",");
- for (int i=0; i<tool.length; i++) {
- String cmd = tool[i].trim();
-
- if (cmd.endsWith(TOOL_AR)) toolCmdMap.put(TOOL_AR, cmd);
- else if (cmd.endsWith(TOOL_AS)) toolCmdMap.put(TOOL_AS, cmd);
- else if (cmd.endsWith(TOOL_GCC)) toolCmdMap.put(TOOL_GCC, cmd);
- else if (cmd.endsWith(TOOL_GPP)) toolCmdMap.put(TOOL_GPP, cmd);
- }
- }
-
- public RtemsCommandLineGenerator() {
- }
-
- public IManagedCommandLineInfo generateCommandLineInfo(ITool tool,
- String commandName, String[] flags, String outputFlag, String outputPrefix,
- String outputName, String[] inputResources, String commandLinePattern ) {
-
- boolean isLinker = false;
- String cmdName = commandName;
- String toolId = tool.getId();
-
- if (toolId.contains("gnu.archiver")) {
- cmdName = toolCmdMap.get(TOOL_AR);
-
- } else if (toolId.contains("gnu.assembler")) {
- cmdName = toolCmdMap.get(TOOL_AS);
-
- } else if (toolId.contains("gnu.c.compiler")) {
- cmdName = toolCmdMap.get(TOOL_GCC);
-
- } else if (toolId.contains("gnu.c.linker")) {
- cmdName = toolCmdMap.get(TOOL_GCC);
- isLinker = true;
-
- } else if (toolId.contains("gnu.cpp.compiler")) {
- cmdName = toolCmdMap.get(TOOL_GPP);
-
- } else if (toolId.contains("gnu.cpp.linker")) {
- cmdName = toolCmdMap.get(TOOL_GPP);
- isLinker = true;
- }
-
- tool.setToolCommand(cmdName);
-
- IManagedCommandLineInfo cmdLineInfo = super.generateCommandLineInfo(tool,
- cmdName, flags, outputFlag, outputPrefix,
- outputName, inputResources, commandLinePattern);
- if (isLinker){
- RtemsLinkCommandLineInfo rtemsCmdLineInfo = new RtemsLinkCommandLineInfo(
- cmdLineInfo.getCommandLine(), cmdLineInfo.getCommandLinePattern(),
- cmdLineInfo.getCommandName(), cmdLineInfo.getFlags(),
- cmdLineInfo.getOutputFlag(), cmdLineInfo.getOutputPrefix(),
- cmdLineInfo.getOutput(), cmdLineInfo.getInputs() );
-
- return rtemsCmdLineInfo;
-
- } else return cmdLineInfo;
- }
-}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsEnvironmentVariableSupplier.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsEnvironmentVariableSupplier.java
deleted file mode 100644
index 11865ec..0000000
--- a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsEnvironmentVariableSupplier.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2008 RobertF.
- * All rights reserved.
- **********************************************************************/
-
-package org.rtems.cdt.toolchain;
-
-import org.eclipse.cdt.managedbuilder.core.IConfiguration;
-import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
-import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
-import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
-import org.eclipse.cdt.utils.WindowsRegistry;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-
-public class RtemsEnvironmentVariableSupplier implements
- IConfigurationEnvironmentVariableSupplier {
- public static final String ENV_RTEMS_TOOL_DIR = "RTEMS_TOOL_DIR";
- public static final String ENV_RTEMS_TARGET_TOOL_DIR = "RTEMS_TARGET_TOOL_DIR";
- public static final String ENV_RTEMS_TARGET_CPU_GCC_LIB_DIR = "RTEMS_TARGET_CPU_GCC_LIB_DIR";
- public static final String ENV_RTEMS_INSTALL_DIR = "RTEMS_INSTALL_DIR";
- public static final String ENV_RTEMS_INSTALL_BSP_DIR = "RTEMS_INSTALL_BSP_DIR";
-
- private static IPath toolPath; // e.g., /opt/rtems-4.9
- private static IPath targetToolPath; // e.g., /opt/rtems-4.9/i386-rtems4.9
- private static IPath targetCpuGccLibPath; // e.g., /opt/rtems-4.9/lib/gcc/i386-rtems4.9/4.3.2/mpentiumpro
- private static IPath installPath; // e.g., /opt/rtems_install
- private static IPath installBspPath; // e.g., /opt/rtems_install/i386-rtems4.9/pc686/lib
-
- private static IBuildEnvironmentVariable evBinPath = null;
- private static IBuildEnvironmentVariable evCIncludePath = null;
- private static IBuildEnvironmentVariable evLibPath = null;
-
- public static boolean toolChainSupported;
- public static boolean isOSWindows;
- public static String pathSeparator; // ":" on UNIX
- private static String drivePrefix; // disk drive prefix: C: for Windows a
- // blank for other OS
-
- private static class RtemsBuildEnvironmentVariable implements IBuildEnvironmentVariable {
- private final String name;
- private final String value;
- private final int operation;
-
- public RtemsBuildEnvironmentVariable(String name, String value, int operation) {
- this.name = name;
- this.value = value;
- this.operation = operation;
- }
-
- public String getName() { return name; }
- public String getValue() { return value; }
- public int getOperation() { return operation; }
- public String getDelimiter() { return pathSeparator; }
- }
-
- static {
- /* Some useful system properties
-
- property Description
- -------------- ---------------------------
- os.name Operating system name
- os.arch Operating system architecture
- os.version Operating system version
- file.separator File separator ("/" on UNIX)
- path.separator Path separator (":" on UNIX)
- */
- pathSeparator = System.getProperty("path.separator");
-
- isOSWindows = false;
- String osName = System.getProperty("os.name");
- if (osName != null) {
- isOSWindows = osName.indexOf("Windows") >= 0;
- }
-
- drivePrefix = isOSWindows ? "C:" : "";
-
- toolPath = getRtemsToolDirectory();
- targetToolPath = getRtemsTargetToolDirectory();
- targetCpuGccLibPath = getRtemsTargetCpuGccLibDirectory();
- installPath = getRtemsInstallDirectory();
- installBspPath = getRtemsInstallBspDirectory();
-
- toolChainSupported = toolPath != null && targetToolPath != null
- && installPath != null && installBspPath != null
- && targetCpuGccLibPath != null;
-
- StringBuffer binPathBuf = new StringBuffer();
- StringBuffer incPathBuf = new StringBuffer();
- StringBuffer libPathBuf = new StringBuffer();
-
- if (toolPath != null) {
- binPathBuf = binPathBuf.append(toolPath.append("bin").toOSString());
- }
-
- if (targetCpuGccLibPath != null) {
- if (libPathBuf.length()>0) libPathBuf.append(pathSeparator);
- libPathBuf = libPathBuf.append(targetCpuGccLibPath.toOSString());
-
-
- IPath targetGccVersionPath;
- try {
- targetGccVersionPath = targetCpuGccLibPath.append("..");
-
- IPath gccIncPath = targetGccVersionPath.append("include");
- if (!gccIncPath.toFile().isDirectory()) {
- targetGccVersionPath = targetCpuGccLibPath;
- }
- } catch (Exception e) {
- targetGccVersionPath = targetCpuGccLibPath;
- }
-
- if (incPathBuf.length()>0) incPathBuf.append(pathSeparator);
- incPathBuf = incPathBuf.append(targetGccVersionPath.append("include").toOSString());
-
- incPathBuf.append(pathSeparator);
- incPathBuf = incPathBuf.append(targetGccVersionPath.append("include-fixed").toOSString());
-
- }
-
- if (targetToolPath != null) {
- if (binPathBuf.length()>0) binPathBuf.append(pathSeparator);
- binPathBuf = binPathBuf.append(targetToolPath.append("bin").toOSString());
-
- if (incPathBuf.length()>0) incPathBuf.append(pathSeparator);
- incPathBuf = incPathBuf.append(targetToolPath.append("include").toOSString());
-
- if (libPathBuf.length()>0) libPathBuf.append(pathSeparator);
- libPathBuf = libPathBuf.append(targetToolPath.append("lib").toOSString());
- }
-
- if (installPath != null) {
- if (binPathBuf.length()>0) binPathBuf.append(pathSeparator);
- binPathBuf = binPathBuf.append(installPath.append("bin").toOSString());
- }
-
- if (installBspPath != null) {
- if (binPathBuf.length()>0) binPathBuf.append(pathSeparator);
- binPathBuf = binPathBuf.append(installBspPath.append("build-tools").toOSString());
-
- IPath bspLibPath = installBspPath.append("lib");
- if (incPathBuf.length()>0) incPathBuf.append(pathSeparator);
- incPathBuf = incPathBuf.append(bspLibPath.append("include").toOSString());
-
- if (libPathBuf.length()>0) libPathBuf.append(pathSeparator);
- libPathBuf = libPathBuf.append(bspLibPath.toOSString());
- }
-
- evBinPath = new RtemsBuildEnvironmentVariable("PATH",
- binPathBuf.toString(),
- IBuildEnvironmentVariable.ENVVAR_PREPEND);
- evCIncludePath = new RtemsBuildEnvironmentVariable("C_INCLUDE_PATH",
- incPathBuf.toString(),
- IBuildEnvironmentVariable.ENVVAR_PREPEND);
- //evCppIncludePath = new RtemsBuildEnvironmentVariable("CPLUS_INCLUDE_PATH",
- // incPath.toString(),
- // IBuildEnvironmentVariable.ENVVAR_PREPEND);
- evLibPath = new RtemsBuildEnvironmentVariable("LIBRARY_PATH",
- libPathBuf.toString(),
- IBuildEnvironmentVariable.ENVVAR_PREPEND);
- }
-
- public RtemsEnvironmentVariableSupplier() {
- }
-
- public IBuildEnvironmentVariable getVariable(String variableName,
- IConfiguration configuration, IEnvironmentVariableProvider provider) {
- if (evBinPath != null &&
- variableName.equals(evBinPath.getName())) {
- return evBinPath;
-
- } else if (evLibPath != null &&
- variableName.equals(evLibPath.getName())) {
- return evLibPath;
-
- } else if (evCIncludePath != null &&
- variableName.equals(evCIncludePath.getName())) {
- return evCIncludePath;
- }
-
- return null;
- }
-
- public IBuildEnvironmentVariable[] getVariables(
- IConfiguration configuration, IEnvironmentVariableProvider provider) {
- return new IBuildEnvironmentVariable[] {
- evBinPath, evCIncludePath, evLibPath };
- }
-
- public static IPath getRtemsToolDirectory() {
- IPath path;
-
- // Preferred way to get RTEMS Tool directory via environment variable
- String dir = System.getenv(ENV_RTEMS_TOOL_DIR);
- if (dir != null) {
- path = new Path(dir);
- if (path.toFile().isDirectory()) return path;
- }
-
- // Try to locate RTEMS Tool directory at /opt/rtems
- // User can create such a soft link to point to the latest one
- path = new Path(drivePrefix + "/opt/rtems");
- if (path.toFile().isDirectory()) return path;
-
- // Try RTEMS 4.9 specific tool bin directory
- path = new Path(drivePrefix + "/opt/rtems-4.9");
- if (path.toFile().isDirectory()) return path;
-
- // Still not found
- return null;
- }
-
- public static IPath getRtemsTargetToolDirectory() {
- IPath path;
-
- // Preferred way to get RTEMS Target Tool directory via environment variable
- String dir = System.getenv(ENV_RTEMS_TARGET_TOOL_DIR);
- if (dir != null) {
- path = new Path(dir);
- if (path.toFile().isDirectory()) return path;
- }
-
- // Try to locate RTEMS Target Tool directory at /opt/rtems/i386-rtems4.9
- // User can create such a soft link to point to the latest one
- path = new Path(drivePrefix + "/opt/rtems/i386-rtems4.9");
- if (path.toFile().isDirectory()) return path;
-
- // Try RTEMS 4.9 specific target tool bin directory
- path = new Path(drivePrefix + "/opt/rtems-4.9/i386-rtems4.9");
- if (path.toFile().isDirectory()) return path;
-
- // Still not found
- return null;
- }
-
- public static IPath getRtemsTargetCpuGccLibDirectory() {
- IPath path;
-
- // Preferred way to get RTEMS Target Tool directory via environment variable
- String dir = System.getenv(ENV_RTEMS_TARGET_CPU_GCC_LIB_DIR);
- if (dir != null) {
- path = new Path(dir);
- if (path.toFile().isDirectory()) return path;
- }
-
- //Try default RTEMS 4.9 Target Tool bin directory
- path = new Path(drivePrefix + "/opt/rtems-4.9/lib/gcc/i386-rtems4.9/4.3.2/mpentiumpro");
- if (path.toFile().isDirectory()) return path;
-
- // Still not found
- return null;
- }
-
- public static IPath getRtemsInstallDirectory() {
- IPath path;
-
- // Preferred way to get RTEMS Install directory via environment variable
- String dir = System.getenv(ENV_RTEMS_INSTALL_DIR);
- if (dir != null) {
- path = new Path(dir);
- if (path.toFile().isDirectory()) return path;
- }
-
- // Try /opt/rtems_install
- path = new Path(drivePrefix + "/opt/rtems_install");
- if (path.toFile().isDirectory()) return path;
-
- // Still not found
- return null;
- }
-
- public static IPath getRtemsInstallBspDirectory() {
- IPath path;
-
- // Preferred way to get installed target lib directory via environment variable
- String dir = System.getenv(ENV_RTEMS_INSTALL_BSP_DIR);
- if (dir != null) {
- path = new Path(dir);
- if (path.toFile().isDirectory()) return path;
- }
-
- // Try /opt/rtems_install/i386-rtems4.9/pc686/lib
- path = new Path(drivePrefix + "/opt/rtems_install/i386-rtems4.9/pc686/lib");
- if (path.toFile().isDirectory()) return path;
-
- // Still not found
- return null;
- }
-
- public static IPath getRtemsInstallBspLibDirectory() {
- IPath installedBspLibPath = getRtemsInstallBspDirectory();
-
- if (installedBspLibPath != null) {
- installedBspLibPath = installedBspLibPath.append("lib");
- }
-
- return installedBspLibPath;
- }
-}
-
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsInstallBspDirectoryValueHandler.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsInstallBspDirectoryValueHandler.java
deleted file mode 100644
index 9be247e..0000000
--- a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsInstallBspDirectoryValueHandler.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.rtems.cdt.toolchain;
-
-import org.eclipse.cdt.managedbuilder.core.IBuildObject;
-import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
-import org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler;
-import org.eclipse.cdt.managedbuilder.core.IOption;
-import org.eclipse.core.runtime.IPath;
-
-public class RtemsInstallBspDirectoryValueHandler implements IManagedOptionValueHandler {
- private IPath installedBspLibPath; // e.g., /opt/rtems_install/i386-rtems4.9/pc686/lib
-
- public RtemsInstallBspDirectoryValueHandler() {
- installedBspLibPath = RtemsEnvironmentVariableSupplier.getRtemsInstallBspLibDirectory();
- }
-
- /**
- * Handles transfer between values between UI element and
- * back-end in different circumstances.
- *
- * @param configuration build configuration of option
- * (may be IConfiguration or IResourceConfiguration)
- * @param holder contains the holder of the option
- * @param option the option that is handled
- * @param extraArgument extra argument for handler
- * @param event event to be handled, one of the following:
- * (EVENT_OPEN = 1, EVENT_CLOSE = 2,
- * EVENT_SETDEFAULT = 3,
- * EVENT_APPLY = 4, EVENT_LOAD = 5)
- *
- * @return True when the event was handled, false otherwise.
- * This enables default event handling can take place.
- */
- public boolean handleValue(IBuildObject configuration, IHoldsOptions holder,
- IOption option, String extraArgument, int event) {
- if (event == EVENT_CLOSE) return false;
-
- try {
- String optionValue = (String) option.getValue();
- if (optionValue==null || optionValue.trim().length()<=0) {
- option.setValue(installedBspLibPath.toPortableString());
- }
- } catch (Exception e) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Checks whether the value of an option is its default value.
- *
- * @param configuration build configuration of option
- * (may be IConfiguration or IResourceConfiguration)
- * @param holder contains the holder of the option
- * @param option the option that is handled
- * @param extraArgument extra argument for handler
- *
- * The additional options besides configuration are supplied to
- * provide enough information for querying the default value from
- * a potential data storage back-end.
- *
- * @return True if the options value is its default value and
- * False otherwise. This enables that default event handling can
- * take place.
- */
- public boolean isDefaultValue(IBuildObject configuration,
- IHoldsOptions holder, IOption option, String extraArgument) {
- if (installedBspLibPath==null) return false;
-
- return installedBspLibPath.toPortableString().equals(option.getValue());
- }
-
- /**
- * Checks whether an enumeration value of an option is currently a
- * valid choice. The use-case for this method is the case, where
- * the set of valid enumerations in the plugin.xml file changes.
- * The UI will remove entries from selection lists if the value
- * returns false.
- *
- * @param configuration build configuration of option
- * (may be IConfiguration or IResourceConfiguration)
- * @param holder contains the holder of the option
- * @param option the option that is handled
- * @param extraArgument extra argument for handler
- * @param enumValue enumeration value that is to be checked
- *
- * The additional options besides configuration are supplied to
- * provide enough information for querying information from a
- * a potential data storage back-end.
- *
- * @return True if the enumeration value is valid and False
- * otherwise.
- */
- public boolean isEnumValueAppropriate(IBuildObject configuration,
- IHoldsOptions holder, IOption option, String extraArgument,
- String enumValue) {
- // By default return true for all the enum values.
- return true;
- }
-
-}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsLinkCommandLineInfo.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsLinkCommandLineInfo.java
deleted file mode 100644
index a19fef1..0000000
--- a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsLinkCommandLineInfo.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.rtems.cdt.toolchain;
-
-import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
-import org.eclipse.cdt.managedbuilder.internal.core.ManagedCommandLineInfo;
-
-public class RtemsLinkCommandLineInfo extends ManagedCommandLineInfo
- implements IManagedCommandLineInfo {
-
- public RtemsLinkCommandLineInfo(String commandLine,
- String commandLinePattern, String commandName, String flags,
- String outputFlag, String outputPrefix, String outputName,
- String inputResources) {
- super(commandLine, commandLinePattern, commandName, flags, outputFlag,
- outputPrefix, outputName, inputResources);
- }
-
- public String getCommandLine() {
- String defaultCmdLine = super.getCommandLine();
- String relObjs = RtemsManagerRelocationLinkHandler.getRelocationLinkObjs();
- return defaultCmdLine + relObjs;
- }
-
-}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsManagerRelocationLinkHandler.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsManagerRelocationLinkHandler.java
deleted file mode 100644
index 5d41b60..0000000
--- a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsManagerRelocationLinkHandler.java
+++ /dev/null
@@ -1,177 +0,0 @@
-package org.rtems.cdt.toolchain;
-
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.cdt.managedbuilder.core.IBuildObject;
-import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
-import org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler;
-import org.eclipse.cdt.managedbuilder.core.IOption;
-
-public class RtemsManagerRelocationLinkHandler implements
- IManagedOptionValueHandler {
- private static HashMap<String, Boolean> defaultMgrStatusMap = new HashMap<String, Boolean>(32);
- private static HashMap<String, Boolean> mgrStatusMap = new HashMap<String, Boolean>(32);
- private static HashMap<String, String> no_mgr_relMap = new HashMap<String, String>(32);
-
- private static String bspLibDir;
- private static String relocationLinkObjs;
-
- static {
- bspLibDir = " " + RtemsEnvironmentVariableSupplier.
- getRtemsInstallBspLibDirectory().toPortableString() + "/";
-
- defaultMgrStatusMap.put("barrier", Boolean.FALSE);
- defaultMgrStatusMap.put("console", Boolean.TRUE);
- defaultMgrStatusMap.put("dpmem", Boolean.FALSE);
- defaultMgrStatusMap.put("event", Boolean.FALSE);
- defaultMgrStatusMap.put("ext", Boolean.FALSE);
- defaultMgrStatusMap.put("filesystem", Boolean.FALSE);
- defaultMgrStatusMap.put("io", Boolean.TRUE);
- defaultMgrStatusMap.put("mp", Boolean.FALSE);
- defaultMgrStatusMap.put("msg", Boolean.FALSE);
- defaultMgrStatusMap.put("part", Boolean.FALSE);
- defaultMgrStatusMap.put("region", Boolean.FALSE);
- defaultMgrStatusMap.put("rtmon", Boolean.FALSE);
- defaultMgrStatusMap.put("sem", Boolean.FALSE);
- defaultMgrStatusMap.put("signal", Boolean.FALSE);
- defaultMgrStatusMap.put("timer", Boolean.FALSE);
-
- no_mgr_relMap.put("barrier" , "no-barrier.rel");
- no_mgr_relMap.put("console" , "no-console.rel");
- no_mgr_relMap.put("dpmem" , "no-dpmem.rel");
- no_mgr_relMap.put("event" , "no-event.rel");
- no_mgr_relMap.put("ext" , "no-ext.rel");
- no_mgr_relMap.put("filesystem", "no-filesystem.rel");
- no_mgr_relMap.put("io" , "no-io.rel");
- no_mgr_relMap.put("mp" , "no-mp.rel");
- no_mgr_relMap.put("msg" , "no-msg.rel");
- no_mgr_relMap.put("part" , "no-part.rel");
- no_mgr_relMap.put("region" , "no-region.rel");
- no_mgr_relMap.put("rtmon" , "no-rtmon.rel");
- no_mgr_relMap.put("sem" , "no-sem.rel");
- no_mgr_relMap.put("signal" , "no-signal.rel");
- no_mgr_relMap.put("timer" , "no-timer.rel");
- }
-
- public RtemsManagerRelocationLinkHandler() {
- }
-
- /**
- * @return the relocationLinkObjs
- */
- public static synchronized String getRelocationLinkObjs() {
- return relocationLinkObjs;
- }
-
- private static synchronized void updateRelocationLink(String selectedMgrId,
- Boolean enabled) {
- StringBuilder rel = new StringBuilder(1024); // relocation link builder
- mgrStatusMap.put(selectedMgrId, enabled);
-
- for(Iterator<Map.Entry<String, Boolean>>
- i = mgrStatusMap.entrySet().iterator(); i.hasNext(); ) {
- Map.Entry<String, Boolean> entry = (Map.Entry<String, Boolean>) i.next();
-
- String mgrId = (String)entry.getKey();
- Boolean mgrEnabled = (Boolean) entry.getValue();
-
- if (!mgrEnabled.booleanValue()) {
- rel = rel.append(bspLibDir).append( no_mgr_relMap.get(mgrId) );
- }
- }
-
- relocationLinkObjs = rel.toString();
- }
-
- /**
- * Handles transfer between values between UI element and
- * back-end in different circumstances.
- *
- * @param configuration build configuration of option
- * (may be IConfiguration or IResourceConfiguration)
- * @param holder contains the holder of the option
- * @param option the option that is handled
- * @param extraArgument extra argument for handler
- * @param event event to be handled, one of the following:
- * (EVENT_OPEN = 1, EVENT_CLOSE = 2,
- * EVENT_SETDEFAULT = 3,
- * EVENT_APPLY = 4, EVENT_LOAD = 5)
- *
- * @return True when the event was handled, false otherwise.
- * This enables default event handling can take place.
- */
- public boolean handleValue(IBuildObject configuration, IHoldsOptions holder,
- IOption option, String extraArgument, int event) {
- if (event == EVENT_CLOSE) return false;
-
- try {
- String mgrId = extraArgument;
- Boolean enabled = (Boolean) option.getValue();
-
- if (enabled==null) {
- enabled = defaultMgrStatusMap.get(mgrId);
- option.setValue(enabled.booleanValue());
- }
-
- updateRelocationLink(mgrId, enabled);
- } catch (Exception e) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Checks whether the value of an option is its default value.
- *
- * @param configuration build configuration of option
- * (may be IConfiguration or IResourceConfiguration)
- * @param holder contains the holder of the option
- * @param option the option that is handled
- * @param extraArgument extra argument for handler
- *
- * The additional options besides configuration are supplied to
- * provide enough information for querying the default value from
- * a potential data storage back-end.
- *
- * @return True if the options value is its default value and
- * False otherwise. This enables that default event handling can
- * take place.
- */
- public boolean isDefaultValue(IBuildObject configuration,
- IHoldsOptions holder, IOption option, String extraArgument) {
- String mgrId = extraArgument;
- return defaultMgrStatusMap.get(mgrId).equals(option.getValue());
- }
-
- /**
- * Checks whether an enumeration value of an option is currently a
- * valid choice. The use-case for this method is the case, where
- * the set of valid enumerations in the plugin.xml file changes.
- * The UI will remove entries from selection lists if the value
- * returns false.
- *
- * @param configuration build configuration of option
- * (may be IConfiguration or IResourceConfiguration)
- * @param holder contains the holder of the option
- * @param option the option that is handled
- * @param extraArgument extra argument for handler
- * @param enumValue enumeration value that is to be checked
- *
- * The additional options besides configuration are supplied to
- * provide enough information for querying information from a
- * a potential data storage back-end.
- *
- * @return True if the enumeration value is valid and False
- * otherwise.
- */
- public boolean isEnumValueAppropriate(IBuildObject configuration,
- IHoldsOptions holder, IOption option, String extraArgument,
- String enumValue) {
- // By default return true for all the enum values.
- return true;
- }
-
-}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsScannerInfoCollector.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsScannerInfoCollector.java
deleted file mode 100644
index 0f35fc9..0000000
--- a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsScannerInfoCollector.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 RobertF
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * RobertF - Initial API and implementation
- *******************************************************************************/
-package org.rtems.cdt.toolchain;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-
-import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
-import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
-import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
-import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
-import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
-import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
-
-/**
- * Implementation class for gathering the built-in compiler settings for
- * Rtems-based targets.
- *
- * @since 5.0.1
- */
-public class RtemsScannerInfoCollector extends PerProjectSICollector
- implements IScannerInfoCollector3, IManagedScannerInfoCollector {
- // extends DefaultGCCScannerInfoCollector <- has restriction, cannot be used
- public static final String ENV_RTEMS_BSP_DEFINED_SYMBOLS = "RTEMS_BSP_DEFINED_SYMBOLS";
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(java.lang.Object, java.util.Map)
- */
- public void contributeToScannerConfig(Object resource, Map scannerInfo) {
-
- List filteredIncludes = (List) scannerInfo.get(ScannerInfoTypes.INCLUDE_PATHS);
-
- // This method will be called by the parser each time there is a new value
- Iterator pathIter = filteredIncludes.listIterator();
- while (pathIter.hasNext()) {
- String incPath = (String) pathIter.next();
- // Could find the switch to disable auto discovery, so filtered
- // out MinGW and Cygwin default includes
- if (incPath.contains("MinGW") || incPath.contains("mingw")
- || incPath.contains("Cygwin") || incPath.contains("cygwin")) {
- pathIter.remove();
- }
- }
- //scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, filteredIncludes);
-
- List definedSymbols = (List) scannerInfo.get(ScannerInfoTypes.SYMBOL_DEFINITIONS);
-
- addBspDefinedSymbols(definedSymbols);
-
- //scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, definedSymbols);
-
- super.contributeToScannerConfig(resource, scannerInfo);
- }
-
- private static void addBspDefinedSymbols(List definedSymbols) {
- if (definedSymbols==null) return;
-
- String bspSymbols = System.getenv(ENV_RTEMS_BSP_DEFINED_SYMBOLS);
- // e.g., "STDC_HEADERS,HAVE_SYS_TYPES_H,HAVE_SYS_STAT_H,HAVE_STDLIB_H..."
- //NOTE: it's insufficient to test for a non-null string, thus the test for length>0
- if (bspSymbols != null && bspSymbols.length() > 0) {
- String[] macro = bspSymbols.split(",");
- for (int i=0; i<macro.length; i++) {
- String symbol = macro[i].trim() + "=1";
- if (!definedSymbols.contains(symbol)) definedSymbols.add(symbol);
- }
- }
- }
-
- public static List<String> getBspDefinedSymbols() {
- ArrayList<String> definedSymbols = new ArrayList<String>();
-
- addBspDefinedSymbols(definedSymbols);
-
- return definedSymbols;
- }
-
- /**
- * Answers a map of collected defines that the the compiler uses by default.
- * The symbols are defined in the map as a (macro, value) pair as follows
- * <p><p><code>-DFOO</code> will be stored as ("FOO","")
- * <p><code>-DFOO=BAR</code> will be stored as ("FOO","BAR")
- * <p><p>Duplicates will not be stored in the map and any whitespaces in
- * the macro or value will be trimmed out.
- *
- * @return a <code>Map</code> of defined symbols and values
- */
- /*
- public Map getDefinedSymbols() {
- HashMap symbolMap = new HashMap();
-
- String bspSymbols = System.getenv(ENV_RTEMS_BSP_DEFINED_SYMBOLS);
- //String bspSymbols ="STDC_HEADERS,HAVE_SYS_TYPES_H,HAVE_SYS_STAT_H,HAVE_STDLIB_H,HAVE_STRING_H,HAVE_INTTYPES_H,HAVE_STDINT_H,HAVE_UNISTD_H,HAVE_CSTDIO,HAVE_CSTDLIB,HAVE_IOSTREAM";
-
- if (bspSymbols != null) {
- String[] macro = bspSymbols.split(",");
- for (int i=0; i<macro.length; i++) {
- symbolMap.put(macro[i].trim(), "1");
- }
- }
-
- return symbolMap;
- }
- */
-
- public void setProject(IProject project) {
- super.setProject(project);
- }
-
- public void setInfoContext(InfoContext context) {
- super.setInfoContext(context);
- }
-}