Skip to main content
summaryrefslogtreecommitdiffstats
path: root/cross
diff options
context:
space:
mode:
authorDoug Schaefer2009-04-17 15:15:56 -0400
committerDoug Schaefer2009-04-17 15:15:56 -0400
commit1042ed5f25a54495dd18079515e8b07b4c4d1bf2 (patch)
tree0a7fa7e55e4b6022b7c526d03523ed3c5bdeb4c9 /cross
parentd849341ad44d8962c61c19a7977b48a0830f9e62 (diff)
downloadorg.eclipse.cdt-1042ed5f25a54495dd18079515e8b07b4c4d1bf2.tar.gz
org.eclipse.cdt-1042ed5f25a54495dd18079515e8b07b4c4d1bf2.tar.xz
org.eclipse.cdt-1042ed5f25a54495dd18079515e8b07b4c4d1bf2.zip
gcc cross compiler integration plugin.
Diffstat (limited to 'cross')
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/.classpath7
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/.project28
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/.settings/org.eclipse.jdt.core.prefs8
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/META-INF/MANIFEST.MF13
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/build.properties5
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/plugin.xml190
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/build/crossgcc/SetCrossCommandProcess.java66
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Activator.java50
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossCommandLineGenerator.java24
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossEnvironmentVariableSupplier.java77
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/templates/setCrossCommand/template.xml33
11 files changed, 501 insertions, 0 deletions
diff --git a/cross/org.eclipse.cdt.build.crossgcc/.classpath b/cross/org.eclipse.cdt.build.crossgcc/.classpath
new file mode 100755
index 0000000000..8a8f1668cd
--- /dev/null
+++ b/cross/org.eclipse.cdt.build.crossgcc/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/cross/org.eclipse.cdt.build.crossgcc/.project b/cross/org.eclipse.cdt.build.crossgcc/.project
new file mode 100755
index 0000000000..2655c34520
--- /dev/null
+++ b/cross/org.eclipse.cdt.build.crossgcc/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.cdt.build.crossgcc</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/cross/org.eclipse.cdt.build.crossgcc/.settings/org.eclipse.jdt.core.prefs b/cross/org.eclipse.cdt.build.crossgcc/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 0000000000..f8e6bb7698
--- /dev/null
+++ b/cross/org.eclipse.cdt.build.crossgcc/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Sun Mar 22 23:47:05 PDT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/cross/org.eclipse.cdt.build.crossgcc/META-INF/MANIFEST.MF b/cross/org.eclipse.cdt.build.crossgcc/META-INF/MANIFEST.MF
new file mode 100755
index 0000000000..267961a006
--- /dev/null
+++ b/cross/org.eclipse.cdt.build.crossgcc/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Good
+Bundle-SymbolicName: org.eclipse.cdt.build.crossgcc;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.eclipse.cdt.internal.build.crossgcc.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.cdt.managedbuilder.core;bundle-version="5.0.100",
+ org.eclipse.cdt.managedbuilder.gnu.ui;bundle-version="5.0.100",
+ org.eclipse.cdt.core;bundle-version="5.1.0",
+ org.eclipse.core.resources;bundle-version="3.5.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/cross/org.eclipse.cdt.build.crossgcc/build.properties b/cross/org.eclipse.cdt.build.crossgcc/build.properties
new file mode 100755
index 0000000000..6f20375d6c
--- /dev/null
+++ b/cross/org.eclipse.cdt.build.crossgcc/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/cross/org.eclipse.cdt.build.crossgcc/plugin.xml b/cross/org.eclipse.cdt.build.crossgcc/plugin.xml
new file mode 100755
index 0000000000..692cfb4ade
--- /dev/null
+++ b/cross/org.eclipse.cdt.build.crossgcc/plugin.xml
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.cdt.managedbuilder.core.buildDefinitions">
+ <managedBuildRevision
+ fileVersion="4.0.0">
+ </managedBuildRevision>
+ <toolChain
+ archList="all"
+ configurationEnvironmentSupplier="org.eclipse.cdt.internal.build.crossgcc.CrossEnvironmentVariableSupplier"
+ id="cdt.managedbuild.toolchain.gnu.cross.base"
+ isAbstract="false"
+ name="Cross GCC"
+ osList="all">
+ <targetPlatform
+ archList="all"
+ binaryParser="org.eclipse.cdt.core.ELF"
+ id="cdt.managedbuild.targetPlatform.gnu.cross"
+ isAbstract="false"
+ osList="all">
+ </targetPlatform>
+ <builder
+ id="cdt.managedbuild.builder.gnu.cross"
+ isAbstract="false"
+ isVariableCaseSensitive="false"
+ superClass="org.eclipse.cdt.build.core.internal.builder">
+ </builder>
+ <optionCategory
+ id="cdt.managedbuild.optionCategory.gnu.cross.settings"
+ name="Cross Settings">
+ </optionCategory>
+ <option
+ category="cdt.managedbuild.optionCategory.gnu.cross.settings"
+ id="cdt.managedbuild.option.gnu.cross.prefix"
+ isAbstract="false"
+ name="Prefix"
+ resourceFilter="all"
+ valueType="string">
+ </option>
+ <option
+ browseType="directory"
+ category="cdt.managedbuild.optionCategory.gnu.cross.settings"
+ id="cdt.managedbuild.option.gnu.cross.path"
+ isAbstract="false"
+ name="Path"
+ resourceFilter="all"
+ valueType="string">
+ </option>
+ <tool
+ commandLineGenerator="org.eclipse.cdt.internal.build.crossgcc.CrossCommandLineGenerator"
+ id="cdt.managedbuild.tool.gnu.cross.cpp.compiler"
+ isAbstract="false"
+ name="Cross G++ Compiler"
+ superClass="cdt.managedbuild.tool.gnu.cpp.compiler">
+ </tool>
+ <tool
+ commandLineGenerator="org.eclipse.cdt.internal.build.crossgcc.CrossCommandLineGenerator"
+ id="cdt.managedbuild.tool.gnu.cross.cpp.linker"
+ isAbstract="false"
+ name="Cross G++ Linker"
+ superClass="cdt.managedbuild.tool.gnu.cpp.linker">
+ </tool>
+ </toolChain>
+ <projectType
+ buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe"
+ id="cdt.managedbuild.target.gnu.cross.exe"
+ isAbstract="false"
+ isTest="false"
+ >
+ <configuration
+ name="Debug"
+ cleanCommand="rm -rf"
+ id="cdt.managedbuild.config.gnu.cross.exe.debug"
+ parent="cdt.managedbuild.config.gnu.base"
+ buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
+ <toolChain
+ superClass="cdt.managedbuild.toolchain.gnu.cross.base"
+ id="cdt.managedbuild.toolchain.gnu.cross.exe.debug">
+ </toolChain>
+ </configuration>
+ <configuration
+ name="Release"
+ cleanCommand="rm -rf"
+ id="cdt.managedbuild.config.gnu.cross.exe.release"
+ parent="cdt.managedbuild.config.gnu.base"
+ buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
+ <toolChain
+ superClass="cdt.managedbuild.toolchain.gnu.cross.base"
+ id="cdt.managedbuild.toolchain.gnu.cross.exe.release">
+ </toolChain>
+ </configuration>
+ </projectType>
+
+ <projectType
+ buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"
+ id="cdt.managedbuild.target.gnu.cross.so"
+ isAbstract="false"
+ isTest="false"
+ >
+ <configuration
+ name="Debug"
+ cleanCommand="rm -rf"
+ parent="cdt.managedbuild.config.gnu.base"
+ buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug"
+ id="cdt.managedbuild.config.gnu.cross.so.debug">
+ <toolChain
+ superClass="cdt.managedbuild.toolchain.gnu.cross.base"
+ id="cdt.managedbuild.toolchain.gnu.cross.so.debug">
+ </toolChain>
+ </configuration>
+ <configuration
+ name="Release"
+ cleanCommand="rm -rf"
+ parent="cdt.managedbuild.config.gnu.base"
+ buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release"
+ id="cdt.managedbuild.config.gnu.cross.so.release">
+ <toolChain
+ superClass="cdt.managedbuild.toolchain.gnu.cross.base"
+ id="cdt.managedbuild.toolchain.gnu.cross.so.release">
+ </toolChain>
+ </configuration>
+ </projectType>
+
+ <projectType
+ buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib"
+ id="cdt.managedbuild.target.gnu.cross.lib"
+ isAbstract="false"
+ isTest="false"
+ >
+ <configuration
+ name="Debug"
+ parent="cdt.managedbuild.config.gnu.base"
+ buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug"
+ cleanCommand="rm -rf"
+ id="cdt.managedbuild.config.gnu.cross.lib.debug">
+ <toolChain
+ superClass="cdt.managedbuild.toolchain.gnu.cross.base"
+ id="cdt.managedbuild.toolchain.gnu.cross.lib.debug">
+ </toolChain>
+ </configuration>
+ <configuration
+ name="Release"
+ parent="cdt.managedbuild.config.gnu.base"
+ buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release"
+ cleanCommand="rm -rf"
+ id="cdt.managedbuild.config.gnu.cross.lib.release">
+ <toolChain
+ superClass="cdt.managedbuild.toolchain.gnu.cross.base"
+ id="cdt.managedbuild.toolchain.gnu.cross.lib.release">
+ </toolChain>
+ </configuration>
+ </projectType>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.core.templateProcessTypes">
+ <processType
+ name="setCrossCommand"
+ processRunner="org.eclipse.cdt.build.crossgcc.SetCrossCommandProcess">
+ <simple
+ name="projectName">
+ </simple>
+ <simple
+ name="prefix">
+ </simple>
+ <simple
+ name="path">
+ </simple>
+ </processType>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.core.templates">
+ <template
+ id="tut.cross.good.setCrossCommand"
+ location="templates/setCrossCommand/template.xml"
+ projectType="org.eclipse.cdt.build.core.buildArtefactType.exe">
+ </template>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.core.templateAssociations">
+ <template
+ id="tut.cross.good.setCrossCommand">
+ <toolChain
+ id="cdt.managedbuild.toolchain.gnu.cross.base">
+ </toolChain>
+ </template>
+ </extension>
+
+</plugin>
diff --git a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/build/crossgcc/SetCrossCommandProcess.java b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/build/crossgcc/SetCrossCommandProcess.java
new file mode 100755
index 0000000000..efcec43f26
--- /dev/null
+++ b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/build/crossgcc/SetCrossCommandProcess.java
@@ -0,0 +1,66 @@
+package org.eclipse.cdt.build.crossgcc;
+
+import java.util.Map;
+
+import org.eclipse.cdt.build.core.scannerconfig.CfgInfoContext;
+import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
+import org.eclipse.cdt.build.internal.core.scannerconfig2.CfgScannerConfigProfileManager;
+import org.eclipse.cdt.core.templateengine.TemplateCore;
+import org.eclipse.cdt.core.templateengine.process.ProcessArgument;
+import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
+import org.eclipse.cdt.core.templateengine.process.ProcessRunner;
+import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public class SetCrossCommandProcess extends ProcessRunner {
+
+ @Override
+ public void process(TemplateCore template, ProcessArgument[] args,
+ String processId, IProgressMonitor monitor)
+ throws ProcessFailureException {
+ String projectName = args[0].getSimpleValue();
+ String prefix = args[1].getSimpleValue();
+ String path = args[2].getSimpleValue();
+
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if (!project.exists())
+ return;
+
+ IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
+ if (buildInfo == null)
+ return;
+
+ IConfiguration[] configs = buildInfo.getManagedProject().getConfigurations();
+ for (IConfiguration config : configs) {
+ IToolChain toolchain = config.getToolChain();
+ IOption option = toolchain.getOptionBySuperClassId("cdt.managedbuild.option.gnu.cross.prefix");
+ ManagedBuildManager.setOption(config, toolchain, option, prefix);
+ option = toolchain.getOptionBySuperClassId("cdt.managedbuild.option.gnu.cross.path");
+ ManagedBuildManager.setOption(config, toolchain, option, path);
+
+ ICfgScannerConfigBuilderInfo2Set cbi = CfgScannerConfigProfileManager.getCfgScannerConfigBuildInfo(config);
+ Map<CfgInfoContext, IScannerConfigBuilderInfo2> map = cbi.getInfoMap();
+ IScannerConfigBuilderInfo2 bi = map.values().iterator().next();
+ String providerId = "specsFile";
+ String runCommand = bi.getProviderRunCommand(providerId);
+ bi.setProviderRunCommand(providerId, prefix + runCommand);
+ try {
+ bi.save();
+ } catch (CoreException e) {
+ throw new ProcessFailureException(e);
+ }
+ }
+
+ ManagedBuildManager.saveBuildInfo(project, true);
+
+ }
+
+}
diff --git a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Activator.java b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Activator.java
new file mode 100755
index 0000000000..b508529561
--- /dev/null
+++ b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.cdt.internal.build.crossgcc;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "tut.cross.good";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#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/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossCommandLineGenerator.java b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossCommandLineGenerator.java
new file mode 100755
index 0000000000..c64fd7bd98
--- /dev/null
+++ b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossCommandLineGenerator.java
@@ -0,0 +1,24 @@
+package org.eclipse.cdt.internal.build.crossgcc;
+
+import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+import org.eclipse.cdt.managedbuilder.core.ITool;
+import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.cdt.managedbuilder.internal.core.ManagedCommandLineGenerator;
+
+public class CrossCommandLineGenerator extends ManagedCommandLineGenerator {
+
+ @Override
+ public IManagedCommandLineInfo generateCommandLineInfo(ITool tool,
+ String commandName, String[] flags, String outputFlag,
+ String outputPrefix, String outputName, String[] inputResources,
+ String commandLinePattern) {
+ IToolChain toolchain = (IToolChain)tool.getParent();
+ IOption option = toolchain.getOptionBySuperClassId("cdt.managedbuild.option.gnu.cross.prefix");
+ String prefix = (String)option.getValue();
+ String newCommandName = prefix + commandName;
+ return super.generateCommandLineInfo(tool, newCommandName, flags, outputFlag,
+ outputPrefix, outputName, inputResources, commandLinePattern);
+ }
+
+}
diff --git a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossEnvironmentVariableSupplier.java b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossEnvironmentVariableSupplier.java
new file mode 100755
index 0000000000..5317421ae5
--- /dev/null
+++ b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossEnvironmentVariableSupplier.java
@@ -0,0 +1,77 @@
+package org.eclipse.cdt.internal.build.crossgcc;
+
+import java.io.File;
+
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
+import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
+import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
+import org.eclipse.core.runtime.Platform;
+
+public class CrossEnvironmentVariableSupplier implements
+ IConfigurationEnvironmentVariableSupplier {
+
+ @Override
+ public IBuildEnvironmentVariable getVariable(String variableName,
+ IConfiguration configuration, IEnvironmentVariableProvider provider) {
+ if (PathEnvironmentVariable.isVar(variableName))
+ return PathEnvironmentVariable.create(configuration);
+ else
+ return null;
+ }
+
+ @Override
+ public IBuildEnvironmentVariable[] getVariables(
+ IConfiguration configuration, IEnvironmentVariableProvider provider) {
+ IBuildEnvironmentVariable path = PathEnvironmentVariable.create(configuration);
+ return path != null ? new IBuildEnvironmentVariable[] { path } : new IBuildEnvironmentVariable[0];
+ }
+
+ private static class PathEnvironmentVariable implements IBuildEnvironmentVariable {
+
+ public static String name = "PATH";
+
+ private File path;
+
+ private PathEnvironmentVariable(File path) {
+ this.path = path;
+ }
+
+ public static PathEnvironmentVariable create(IConfiguration configuration) {
+ IToolChain toolchain = configuration.getToolChain();
+ IOption option = toolchain.getOptionBySuperClassId("cdt.managedbuild.option.gnu.cross.path");
+ String path = (String)option.getValue();
+ return new PathEnvironmentVariable(new File(path, "bin"));
+ }
+
+ public static boolean isVar(String name) {
+ // Windows has case insensitive env var names
+ return Platform.getOS().equals(Platform.OS_WIN32)
+ ? name.equalsIgnoreCase(PathEnvironmentVariable.name)
+ : name.equals(PathEnvironmentVariable.name);
+ }
+
+ @Override
+ public String getDelimiter() {
+ return Platform.getOS().equals(Platform.OS_WIN32) ? ";" : ":";
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public int getOperation() {
+ return IBuildEnvironmentVariable.ENVVAR_PREPEND;
+ }
+
+ @Override
+ public String getValue() {
+ return path.getAbsolutePath();
+ }
+
+ }
+}
diff --git a/cross/org.eclipse.cdt.build.crossgcc/templates/setCrossCommand/template.xml b/cross/org.eclipse.cdt.build.crossgcc/templates/setCrossCommand/template.xml
new file mode 100755
index 0000000000..cb46bdd59b
--- /dev/null
+++ b/cross/org.eclipse.cdt.build.crossgcc/templates/setCrossCommand/template.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="EclipseCon"
+ copyright="Copyright (c) 2009 EclipseCon and others. 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"
+ id="EmptyProject" label="Cross-Compile Project" description="Set up a cross compiler"
+ help="help.html">
+
+ <property-group id="command" label="Command" description="The Cross Compile Command" type="PAGES-ONLY" help="help.html">
+ <property id="prefix"
+ label="Tool command prefix"
+ description="The prefix to attach to the build commands, e.g. gcc"
+ type="input"
+ pattern=".*"
+ default=""
+ hidden="false"
+ persist="true"/>
+
+ <property id="path"
+ label="Tool command path"
+ description="The root directory for the toolchain"
+ type="browsedir"
+ pattern=".*"
+ default=""
+ hidden="false"
+ persist="true"/>
+ </property-group>
+
+ <process type="tut.cross.good.setCrossCommand">
+ <simple name="projectName" value="$(projectName)"/>
+ <simple name="prefix" value="$(prefix)"/>
+ <simple name="path" value="$(path)"/>
+ </process>
+
+</template>

Back to the top