Skip to main content
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorDoug Schaefer2003-09-26 00:24:42 +0000
committerDoug Schaefer2003-09-26 00:24:42 +0000
commitdb4d8196234426576f615fe79c7b53278b66c08b (patch)
tree385e0c8d7350ea5bce8901527d3673d81cb576a3 /build
parentc20c27d23466cea9a3115df6cad94c0ea726833b (diff)
downloadorg.eclipse.cdt-db4d8196234426576f615fe79c7b53278b66c08b.tar.gz
org.eclipse.cdt-db4d8196234426576f615fe79c7b53278b66c08b.tar.xz
org.eclipse.cdt-db4d8196234426576f615fe79c7b53278b66c08b.zip
Patch for Sean Evoy:
the new project wizard now filters out targets that should not be selected by the user, and that the build model handles inherited option references properly now.
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/ChangeLog43
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java42
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java89
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java117
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java90
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/ChangeLog21
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/plugin.properties14
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/plugin.xml440
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java8
11 files changed, 733 insertions, 150 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
index 3c95c03c3f0..f2ebf0461d7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
+++ b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
@@ -1,3 +1,46 @@
+2003-09-25 Sean Evoy
+ This patch contains a lot of changes needed to implement fixes for 42648 and
+ 43122.
+
+ For 42648, the schema for the the target had to be modified to include a
+ comma-separated list of valid host platforms.
+ * schema/ManagedBuildTools.exsd
+
+ The target had to be updated to properly read in and understand this info, and
+ the interface had to be updated to return a list to the clients in the UI. The
+ target was also changed slightly. It now uses a safer accessor method to get at
+ the list of tools it maintains. I have also stopped persisting non-variant info
+ to the project file on serialize. There are elements of the target that are not
+ subject to change by the user (yet) so they should not be saved.
+ * src/org/eclipse/cdt/managedbuilder/core/ITarget.java
+ * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
+
+ For 43122, I started by simply adding a tool reference to the configurations.
+ The tool reference had option references for debug and optimization levels. It
+ should have worked, but the model was not handling the inheritance properly. The
+ JUnit tests were not finding it because of how they were configured. It was most
+ evident in the UI. So, the way configurations and tool reference search for
+ overridden option references had to be modified. While I was in there, I cleaned
+ up some of the accessor and iteration code in ToolReference and OptionReference.
+
+ For the configuration, the only significant change was a new search method to
+ find all option references for a given tool, no matter where they are stored.
+ The method had to consider what was overridden in a child config, what was added by
+ a child config, and what the parent (or parents) define.
+ * src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
+
+ Option reference now pays attention to overidden values in the plugin file. Until
+ now, it only handled the overrides in the project file.
+ * src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
+
+ The ToolReference now distinguishes between local option references which it
+ manages directly, and option references held by tool references in the parent(s)
+ of its owner. It only serializes its own references, but when asked for options
+ relating to the tool it references, it replies with all option references in its
+ hierarchy.
+ * src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
+
+
2003-09-24 Sean Evoy
Changed the implementor of IScannerInfo to answer only absolute paths when asked for
includes paths. Users will specify the includes paths in the managed build UI in such a way
diff --git a/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd b/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd
index 79709bc8f5e..82bf278d2fb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd
+++ b/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd
@@ -394,6 +394,13 @@ Two additional types exist to flag options of special relevance to the build mod
</documentation>
</annotation>
</attribute>
+ <attribute name="osList" type="string">
+ <annotation>
+ <documentation>
+ This field is used by the managed build system to decide when to show the user the target. The value should be a comma-separated list. Current values are &quot;win32&quot;, &quot;linux&quot;, and &quot;solaris&quot;.
+ </documentation>
+ </annotation>
+ </attribute>
</complexType>
</element>
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java
index 010a97db574..ef7395aba71 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java
@@ -25,6 +25,7 @@ public interface ITarget extends IBuildObject {
public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$
public static final String IS_TEST = "isTest"; //$NON-NLS-1$
public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$
+ public static final String OS_LIST = "osList"; //$NON-NLS-1$
public static final String PARENT = "parent"; //$NON-NLS-1$
/**
@@ -35,7 +36,7 @@ public interface ITarget extends IBuildObject {
*
* @param parent The <code>IConfiguration</code> to use as a settings template
* @param id The unique id the new configuration will have
- * @return
+ * @return IConfiguration
*/
public IConfiguration createConfiguration(IConfiguration parent, String id);
@@ -44,34 +45,35 @@ public interface ITarget extends IBuildObject {
* the tools defined for that target and options set at their defaults.
*
* @param id id for this configuration.
- * @return
+ * @return IConfiguration
*/
public IConfiguration createConfiguration(String id);
/**
* Get the name of the final build artifact.
*
- * @return
+ * @return String
*/
public String getArtifactName();
/**
* Answers the unique ID of the binary parser associated with the target.
*
- * @return
+ * @return String
*/
public String getBinaryParserId();
/**
* Answers the OS-specific command to remove files created by the build
*
- * @return
+ * @return String
*/
public String getCleanCommand();
/**
* Returns all of the configurations defined by this target.
- * @return
+ *
+ * @return IConfiguration[]
*/
public IConfiguration[] getConfigurations();
@@ -79,14 +81,14 @@ public interface ITarget extends IBuildObject {
* Get the default extension that should be applied to build artifacts
* created by this target.
*
- * @return
+ * @return String
*/
public String getDefaultExtension();
/**
* Answers the name of the make utility for the target.
*
- * @return
+ * @return String
*/
public String getMakeCommand();
@@ -94,27 +96,36 @@ public interface ITarget extends IBuildObject {
* Returns the configuration with the given id, or <code>null</code> if not found.
*
* @param id
- * @return
+ * @return IConfiguration
*/
public IConfiguration getConfiguration(String id);
/**
* Gets the resource that this target is applied to.
*
- * @return
+ * @return IResource
*/
public IResource getOwner();
/**
- * @return the <code>ITarget</code> that is the parent of the receiver.
+ * Answers the <code>ITarget</code> that is the parent of the receiver.
+ *
+ * @return ITarget
*/
public ITarget getParent();
/**
+ * Answers an array of operating systems the target can be created on.
+ *
+ * @return String[]
+ */
+ public String[] getTargetOSList();
+
+ /**
* Returns the list of platform specific tools associated with this
* platform.
*
- * @return
+ * @return ITool[]
*/
public ITool[] getTools();
@@ -123,13 +134,13 @@ public interface ITarget extends IBuildObject {
* Answers true if the receiver has a make command that differs from its
* parent specification.
*
- * @return
+ * @return boolean
*/
public boolean hasOverridenMakeCommand();
/**
* Returns whether this target is abstract.
- * @return
+ * @return boolean
*/
public boolean isAbstract();
@@ -138,7 +149,7 @@ public interface ITarget extends IBuildObject {
* for testing purposes only, else <code>false</code>. A test target will
* not be shown in the UI but can still be manipulated programmatically.
*
- * @return
+ * @return boolean
*/
public boolean isTestTarget();
@@ -170,4 +181,5 @@ public interface ITarget extends IBuildObject {
* @param command
*/
public void setMakeCommand(String command);
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
index 4de1b3afa7e..e11691734f0 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
@@ -12,6 +12,7 @@ package org.eclipse.cdt.managedbuilder.internal.core;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.cdt.managedbuilder.core.BuildException;
@@ -61,6 +62,9 @@ public class Configuration extends BuildObject implements IConfiguration {
this.target = target;
this.parent = parent;
+ // Get the tool references from the parent
+ getLocalToolReferences().addAll(((Configuration)parent).getLocalToolReferences());
+
target.addConfiguration(this);
}
@@ -147,25 +151,23 @@ public class Configuration extends BuildObject implements IConfiguration {
if (parent != null)
element.setAttribute(IConfiguration.PARENT, parent.getId());
- for (int i = 0; i < getToolReferences().size(); ++i) {
- ToolReference toolRef = (ToolReference)getToolReferences().get(i);
+ // Serialize only the tool references defined in the configuration
+ Iterator iter = getLocalToolReferences().listIterator();
+ while (iter.hasNext()) {
+ ToolReference toolRef = (ToolReference) iter.next();
Element toolRefElement = doc.createElement(IConfiguration.TOOL_REF);
element.appendChild(toolRefElement);
toolRef.serialize(doc, toolRefElement);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.build.managed.IConfiguration#getName()
- */
- public String getName() {
- return (name == null && parent != null) ? parent.getName() : name;
- }
-
- /*
- * @return
+ /* (non-javadoc)
+ * A safety method to avoid NPEs. It answers the tool reference list in the
+ * receiver. It does not look at the tool references defined in the parent.
+ *
+ * @return List
*/
- private List getToolReferences() {
+ protected List getLocalToolReferences() {
if (toolReferences == null) {
toolReferences = new ArrayList();
}
@@ -173,6 +175,13 @@ public class Configuration extends BuildObject implements IConfiguration {
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IConfiguration#getName()
+ */
+ public String getName() {
+ return (name == null && parent != null) ? parent.getName() : name;
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getTools()
*/
public ITool[] getTools() {
@@ -180,7 +189,7 @@ public class Configuration extends BuildObject implements IConfiguration {
? parent.getTools()
: target.getTools();
- // Replace tools with overrides
+ // Replace tools with local overrides
for (int i = 0; i < tools.length; ++i) {
ToolReference ref = getToolReference(tools[i]);
if (ref != null)
@@ -195,7 +204,7 @@ public class Configuration extends BuildObject implements IConfiguration {
*/
public void reset(IConfigurationElement element) {
// I just need to reset the tool references
- getToolReferences().clear();
+ getLocalToolReferences().clear();
IConfigurationElement[] configElements = element.getChildren();
for (int l = 0; l < configElements.length; ++l) {
IConfigurationElement configElement = configElements[l];
@@ -211,6 +220,35 @@ public class Configuration extends BuildObject implements IConfiguration {
public IConfiguration getParent() {
return parent;
}
+
+ /* (non-javadoc)
+ *
+ * @param tool
+ * @return List
+ */
+ protected List getOptionReferences(ITool tool) {
+ List references = new ArrayList();
+
+ // Get all the option references I add for this tool
+ ToolReference toolRef = getToolReference(tool);
+ if (toolRef != null) {
+ references.addAll(toolRef.getLocalOptionRefs());
+ }
+
+ // See if there is anything that my parents add that I don't
+ if (parent != null) {
+ List temp = ((Configuration)parent).getOptionReferences(tool);
+ Iterator iter = temp.listIterator();
+ while (iter.hasNext()) {
+ OptionReference ref = (OptionReference) iter.next();
+ if (!references.contains(ref)) {
+ references.add(ref);
+ }
+ }
+ }
+
+ return references;
+ }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getTarget()
@@ -227,22 +265,29 @@ public class Configuration extends BuildObject implements IConfiguration {
}
/**
- * Returns the reference for a given tool.
+ * Returns the reference for a given tool or <code>null</code> if one is not
+ * found.
*
* @param tool
- * @return
+ * @return ToolReference
*/
private ToolReference getToolReference(ITool tool) {
- for (int i = 0; i < getToolReferences().size(); ++i) {
- ToolReference toolRef = (ToolReference)getToolReferences().get(i);
- if (toolRef.references(tool))
- return toolRef;
+ // See if the receiver has a reference to the tool
+ ToolReference ref = null;
+ Iterator iter = getLocalToolReferences().listIterator();
+ while (iter.hasNext()) {
+ ToolReference temp = (ToolReference)iter.next();
+ if (temp.references(tool)) {
+ ref = temp;
+ break;
+ }
}
- return null;
+
+ return ref;
}
public void addToolReference(ToolReference toolRef) {
- getToolReferences().add(toolRef);
+ getLocalToolReferences().add(toolRef);
}
public OptionReference createOptionReference(IOption option) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
index 269812c5832..5f72cf0dd34 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
@@ -76,11 +76,15 @@ public class OptionReference implements IOption {
value = element.getAttribute(IOption.DEFAULT_VALUE);
break;
case IOption.ENUMERATED:
- try {
- value = option.getSelectedEnum();
- } catch (BuildException e) {
- value = new String();
+ String temp = element.getAttribute(DEFAULT_VALUE);
+ if (temp == null) {
+ try {
+ temp = option.getSelectedEnum();
+ } catch (BuildException e) {
+ temp = new String();
+ }
}
+ value = temp;
break;
case IOption.STRING_LIST:
case IOption.INCLUDE_PATH:
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
index a40912c2b60..9461b47da91 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
@@ -16,6 +16,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.StringTokenizer;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
@@ -42,8 +43,9 @@ public class Target extends BuildObject implements ITarget {
private String makeCommand;
private IResource owner;
private ITarget parent;
+ private List targetOSList;
private Map toolMap;
- private List tools;
+ private List toolList;
private static final IConfiguration[] emptyConfigs = new IConfiguration[0];
private static final String EMPTY_STRING = new String();
@@ -78,7 +80,8 @@ public class Target extends BuildObject implements ITarget {
}
/**
- * This constructor is called to create a target defined by an extension.
+ * This constructor is called to create a target defined by an extension point in
+ * a plugin manifest file.
*
* @param element
*/
@@ -113,8 +116,7 @@ public class Target extends BuildObject implements ITarget {
}
// isAbstract
- if ("true".equals(element.getAttribute(IS_ABSTRACT)))
- isAbstract = true;
+ isAbstract = ("true".equals(element.getAttribute(IS_ABSTRACT)));
// Is this a test target
isTest = ("true".equals(element.getAttribute(IS_TEST)));
@@ -133,12 +135,29 @@ public class Target extends BuildObject implements ITarget {
makeCommand = parent.getMakeCommand();
}
+ // Get the comma-separated list of valid OS
+ String os = element.getAttribute(OS_LIST);
+ if (os != null) {
+ targetOSList = new ArrayList();
+ StringTokenizer tokens = new StringTokenizer(os, ",");
+ while (tokens.hasMoreTokens()) {
+ targetOSList.add(tokens.nextToken().trim());
+ }
+ }
+
IConfigurationElement[] targetElements = element.getChildren();
- for (int k = 0; k < targetElements.length; ++k) {
+ int k;
+ // Load the tools first
+ for (k = 0; k < targetElements.length; ++k) {
IConfigurationElement targetElement = targetElements[k];
if (targetElement.getName().equals(ITool.TOOL_ELEMENT_NAME)) {
new Tool(this, targetElement);
- } else if (targetElement.getName().equals(IConfiguration.CONFIGURATION_ELEMENT_NAME)) {
+ }
+ }
+ // Then load the configurations which may have tool references
+ for (k = 0; k < targetElements.length; ++k) {
+ IConfigurationElement targetElement = targetElements[k];
+ if (targetElement.getName().equals(IConfiguration.CONFIGURATION_ELEMENT_NAME)) {
new Configuration(this, targetElement);
}
}
@@ -146,7 +165,7 @@ public class Target extends BuildObject implements ITarget {
}
/**
- * Create target from project file
+ * Create target from project file.
*
* @param buildInfo
* @param element
@@ -167,9 +186,6 @@ public class Target extends BuildObject implements ITarget {
// contain what the user entered in the UI).
artifactName = element.getAttribute(ARTIFACT_NAME);
- // Get the ID of the binary parser
- binaryParserId = element.getAttribute(BINARY_PARSER);
-
// Get the default extension
defaultExtension = element.getAttribute(DEFAULT_EXTENSION);
@@ -238,7 +254,6 @@ public class Target extends BuildObject implements ITarget {
element.setAttribute(PARENT, parent.getId());
element.setAttribute(IS_ABSTRACT, isAbstract ? "true" : "false");
element.setAttribute(ARTIFACT_NAME, getArtifactName());
- element.setAttribute(BINARY_PARSER, getBinaryParserId());
element.setAttribute(DEFAULT_EXTENSION, getDefaultExtension());
element.setAttribute(IS_TEST, isTest ? "true" : "false");
element.setAttribute(CLEAN_COMMAND, getCleanCommand());
@@ -278,6 +293,22 @@ public class Target extends BuildObject implements ITarget {
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITarget#getTargetOSList()
+ */
+ public String[] getTargetOSList() {
+ if (targetOSList == null) {
+ // Ask parent for its list
+ if (parent != null) {
+ return parent.getTargetOSList();
+ } else {
+ // I have no parent and no defined list but never return null
+ return new String[0];
+ }
+ }
+ return (String[]) targetOSList.toArray(new String[targetOSList.size()]);
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getOwner()
*/
public IResource getOwner() {
@@ -285,25 +316,41 @@ public class Target extends BuildObject implements ITarget {
}
private int getNumTools() {
- int n = (tools == null) ? 0 : tools.size();
+ int n = getToolList().size();
if (parent != null)
n += ((Target)parent).getNumTools();
return n;
}
+
private int addToolsToArray(ITool[] toolArray, int start) {
int n = start;
if (parent != null)
n = ((Target)parent).addToolsToArray(toolArray, start);
- if (tools != null) {
- for (int i = 0; i < tools.size(); ++i)
- toolArray[n++] = (ITool)tools.get(i);
+ for (int i = 0; i < getToolList().size(); ++i) {
+ toolArray[n++] = (ITool)getToolList().get(i);
}
return n;
}
+ private List getToolList() {
+ if (toolList == null) {
+ toolList = new ArrayList();
+ toolList.clear();
+ }
+ return toolList;
+ }
+
+ private Map getToolMap() {
+ if (toolMap == null) {
+ toolMap = new HashMap();
+ toolMap.clear();
+ }
+ return toolMap;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getTools()
*/
@@ -322,16 +369,19 @@ public class Target extends BuildObject implements ITarget {
/**
* @param id
- * @return
+ * @return ITool
*/
public ITool getTool(String id) {
ITool result = null;
+
// See if receiver has it in list
- result = (ITool)toolMap.get(id);
+ result = (ITool) getToolMap().get(id);
+
// If not, check if parent has it
if (result == null && parent != null) {
result = ((Target)parent).getTool(id);
}
+
return result;
}
@@ -339,13 +389,8 @@ public class Target extends BuildObject implements ITarget {
* @param tool
*/
public void addTool(ITool tool) {
- if (tools == null) {
- tools = new ArrayList();
- toolMap = new HashMap();
- }
-
- tools.add(tool);
- toolMap.put(tool.getId(), tool);
+ getToolList().add(tool);
+ getToolMap().put(tool.getId(), tool);
}
/* (non-Javadoc)
@@ -377,15 +422,33 @@ public class Target extends BuildObject implements ITarget {
* @see org.eclipse.cdt.core.build.managed.ITarget#getArtifactName()
*/
public String getArtifactName() {
- // Return name or an empty string
- return artifactName == null ? EMPTY_STRING : artifactName;
+ if (artifactName == null) {
+ // If I have a parent, ask it
+ if (parent != null) {
+ return parent.getArtifactName();
+ } else {
+ // I'm it and this is not good!
+ return EMPTY_STRING;
+ }
+ } else {
+ return artifactName;
+ }
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getBinaryParserId()
*/
public String getBinaryParserId() {
- return binaryParserId == null ? EMPTY_STRING : binaryParserId;
+ if (binaryParserId == null) {
+ // If I have a parent, ask it
+ if (parent != null) {
+ return parent.getBinaryParserId();
+ } else {
+ // I'm it and this is not good!
+ return EMPTY_STRING;
+ }
+ }
+ return binaryParserId;
}
/* (non-Javadoc)
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
index bd230450dbf..e671a2a3dcc 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
@@ -11,6 +11,7 @@
package org.eclipse.cdt.managedbuilder.internal.core;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -50,6 +51,15 @@ public class ToolReference implements ITool {
}
/**
+ * Adds the option reference specified in the argument to the receiver.
+ *
+ * @param optionRef
+ */
+ public void addOptionReference(OptionReference optionRef) {
+ getLocalOptionRefs().add(optionRef);
+ }
+
+ /**
* Created tool reference from an extension defined in a plugin manifest.
*
* @param owner The <code>Configuration</code> the receiver will be added to.
@@ -58,7 +68,7 @@ public class ToolReference implements ITool {
public ToolReference(Configuration owner, IConfigurationElement element) {
this.owner = owner;
- parent = ((Target)owner.getTarget()).getTool(element.getAttribute("id"));
+ parent = ((Target)owner.getTarget()).getTool(element.getAttribute(ID));
owner.addToolReference(this);
@@ -104,14 +114,13 @@ public class ToolReference implements ITool {
*/
public void serialize(Document doc, Element element) {
element.setAttribute(ITool.ID, parent.getId());
-
- if (optionReferences != null)
- for (int i = 0; i < optionReferences.size(); ++i) {
- OptionReference optionRef = (OptionReference)optionReferences.get(i);
- Element optionRefElement = doc.createElement(ITool.OPTION_REF);
- element.appendChild(optionRefElement);
- optionRef.serialize(doc, optionRefElement);
- }
+ Iterator iter = getLocalOptionRefs().listIterator();
+ while (iter.hasNext()) {
+ OptionReference optionRef = (OptionReference) iter.next();
+ Element optionRefElement = doc.createElement(ITool.OPTION_REF);
+ element.appendChild(optionRefElement);
+ optionRef.serialize(doc, optionRefElement);
+ }
}
public IConfiguration getConfiguration() {
@@ -254,6 +263,11 @@ public class ToolReference implements ITool {
return parent.producesFileType(outputExtension);
}
+ protected List getAllOptionRefs() {
+ // First get all the option references this tool reference contains
+ return ((Configuration)owner).getOptionReferences(parent);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getId()
*/
@@ -283,35 +297,63 @@ public class ToolReference implements ITool {
}
public boolean references(ITool target) {
- if (equals(target))
+ if (equals(target)) {
// we are the target
return true;
- else if (parent instanceof ToolReference)
+ }
+ else if (parent instanceof ToolReference) {
// check the reference we are overriding
return ((ToolReference)parent).references(target);
- else
+ }
+ else if (target instanceof ToolReference) {
+ return parent.equals(((ToolReference)target).parent);
+ }
+ else {
// the real reference
return parent.equals(target);
+ }
}
+ /* (non-javadoc)
+ * Answers an option reference that overrides the option, or <code>null</code>
+ *
+ * @param option
+ * @return OptionReference
+ */
private OptionReference getOptionReference(IOption option) {
- if (optionReferences != null)
- for (int i = 0; i < optionReferences.size(); ++i) {
- OptionReference optionRef = (OptionReference)optionReferences.get(i);
- if (optionRef.references(option))
- return optionRef;
- }
+ // Get all the option references for this option
+ Iterator iter = getAllOptionRefs().listIterator();
+ while (iter.hasNext()) {
+ OptionReference optionRef = (OptionReference) iter.next();
+ if (optionRef.references(option))
+ return optionRef;
+ }
+
return null;
}
- public OptionReference createOptionReference(IOption option) {
- return new OptionReference(this, option);
+ protected List getLocalOptionRefs() {
+ if (optionReferences == null) {
+ optionReferences = new ArrayList();
+ optionReferences.clear();
+ }
+ return optionReferences;
}
- public void addOptionReference(OptionReference optionRef) {
- if (optionReferences == null)
- optionReferences = new ArrayList();
- optionReferences.add(optionRef);
+ /**
+ * Answers a reference to the option. If the reference does not exist,
+ * a new reference is created.
+ *
+ * @param option
+ * @return OptionReference
+ */
+ public OptionReference createOptionReference(IOption option) {
+ // Check if the option reference already exists
+ OptionReference ref = getOptionReference(option);
+ if (ref == null) {
+ ref = new OptionReference(this, option);
+ }
+ return ref;
}
/* (non-Javadoc)
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog b/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog
index 98cbb16ca00..f0a2e2f0649 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog
+++ b/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog
@@ -1,3 +1,24 @@
+2003-09-25 Sean Evoy
+ This patch contains a lot of changes needed to implement fixes for 42648 and
+ 43122.
+
+ The properties file has been updated to externalize some of the option labels
+ to try and address some of the concern about continuity between UIs on
+ different platforms.
+ * plugin.properties
+
+ There are changes in the plugin XML file to accomodate showing the targets
+ only on the correct host platform. Option names have bee replaced with
+ externalized equivalents where possible. The release and debug configurations
+ for each configuration now apply "reasonable" defaults for debug and optimization
+ option. Finally, the Cygwinb tool specification has been brought closer to those
+ for *nix.
+ * plugin.xml
+
+ Only targets that correspond to the host platforms are shown in the drop-down
+ list.
+ * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
+
2003-09-23 Sean Evoy
I added a fix for critical bug 43439. The new project wizard is ready to be hooked
up to the help system content on F1. There is a new file with the string constant
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties
index bff79be6a1e..10a64d102da 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties
@@ -22,7 +22,21 @@ OptionCategory.Debug=Debugging
OptionCategory.Warn=Warnings
OptionCategory.Misc=Miscellaneous
OptionCategory.Libs=Libraries
+
Option.Posix.PreprocOnly=Preprocess only (-E)
+Option.Posix.Nostdinc=Do not search system directories (-nostdinc)
+
Option.Posix.DefSym=Defined symbols (-D)
+Option.Posix.UndefSym=Undefined symbols (-U)
+
+Option.Posix.Optimize.None=None (-O0)
+Option.Posix.Optimize.Optimize=Optimize (-O1)
+Option.Posix.Optimize.More=Optimize more (-O2)
+Option.Posix.Optimize.Most=Optimize most (-O3)
+
+Option.Posix.Verbose=Verbose (-v)
+Option.OtherFlags=Other flags
+
+Option.Posix.Linker.Flags=Linker flags
Option.Posix.Libs=Libraries (-l)
Option.Posix.Libsearch=Library search path (-L)
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
index 95183810699..7210dbccae4 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
@@ -61,19 +61,21 @@
</filter>
</page>
</extension>
+<!-- Managed Make Builder Tool Specifications -->
<extension
id="cdt.managed.build.info"
name="Managed Build Tools Description"
point="org.eclipse.cdt.managedbuilder.core.ManagedBuildInfo">
<target
- makeFlags="-k"
- isTest="false"
- cleanCommand="rm -rf"
name="Cygwin"
- binaryParser="org.eclipse.cdt.core.PE"
+ id="cygwin"
+ cleanCommand="rm -rf"
+ isTest="false"
isAbstract="true"
makeCommand="make"
- id="cygwin">
+ binaryParser="org.eclipse.cdt.core.PE"
+ makeFlags="-k"
+ osList="win32">
<tool
sources="c,cc,cpp,cxx,C"
name="%ToolName.compiler"
@@ -88,7 +90,7 @@
</optionCategory>
<option
defaultValue="false"
- name="Do not search system directories (-nostdinc)"
+ name="%Option.Posix.Nostdinc"
category="cygwin.compiler.category.preprocessor"
command="-nostdinc"
valueType="boolean"
@@ -210,7 +212,7 @@
</listOptionValue>
</option>
<option
- name="Undefined symbols (-U)"
+ name="%Option.Posix.UndefSym"
category="cygwin.gnu.compiler.category.symbols"
command="-U"
valueType="stringList"
@@ -222,35 +224,29 @@
id="cygwin.compiler.category.general">
</optionCategory>
<option
- defaultValue="-c"
- name="Compiler Flags"
- category="cygwin.compiler.category.general"
- valueType="string"
- id="cygwin.compiler.general.ccflags">
- </option>
- <option
name="Optimization Level"
category="cygwin.compiler.category.general"
valueType="enumerated"
id="cygwin.compiler.general.optimization.level">
<enumeratedOptionValue
- name="None (-O0)"
+ name="%Option.Posix.Optimize.None"
+ isDefault="false"
command="-O0"
id="cygwin.optimization.level.none">
</enumeratedOptionValue>
<enumeratedOptionValue
- name="Optimize (-O1)"
+ name="%Option.Posix.Optimize.Optimize"
command="-O1"
id="cygwin.optimization.level.optimize">
</enumeratedOptionValue>
<enumeratedOptionValue
- name="Optimize more (-O2)"
+ name="%Option.Posix.Optimize.More"
isDefault="true"
command="-O2"
id="cygwin.optimization.level.more">
</enumeratedOptionValue>
<enumeratedOptionValue
- name="Optimize most (-O3)"
+ name="%Option.Posix.Optimize.Most"
command="-O3"
id="cygwin.optimization.level.most">
</enumeratedOptionValue>
@@ -294,13 +290,78 @@
builtIn="true">
</listOptionValue>
</option>
+ <optionCategory
+ owner="org.eclipse.cdt.build.tool.cygwin.compiler"
+ name="%OptionCategory.Warn"
+ id="cygwin.compiler.category.warnings">
+ </optionCategory>
+ <option
+ defaultValue="false"
+ name="Check syntax only (-fsyntax-only)"
+ category="cygwin.compiler.category.warnings"
+ command="-fsyntax-only"
+ valueType="boolean"
+ id="cygwin.gnu.compiler.warnings.syntax">
+ </option>
<option
defaultValue="false"
- name="Verbose"
- category="cygwin.compiler.category.general"
+ name="Pedantic (-pedantic)"
+ category="cygwin.compiler.category.warnings"
+ command="-pedantic"
+ valueType="boolean"
+ id="cygwin.gnu.compiler.warnings.pedantic">
+ </option>
+ <option
+ defaultValue="false"
+ name="Pedantic warnings as errors (-pedantic-errors)"
+ category="cygwin.compiler.category.warnings"
+ command="-pedantic-errors"
+ valueType="boolean"
+ id="cygwin.gnu.compiler.warnings.pedantic.error">
+ </option>
+ <option
+ defaultValue="false"
+ name="Inhibit all warnings (-w)"
+ category="cygwin.compiler.category.warnings"
+ command="-w"
+ valueType="boolean"
+ id="cygwin.gnu.compiler.warnings.nowarn">
+ </option>
+ <option
+ defaultValue="true"
+ name="All warnings (-Wall)"
+ category="cygwin.compiler.category.warnings"
+ command="-Wall"
+ valueType="boolean"
+ id="cygwin.gnu.compiler.warnings.allwarn">
+ </option>
+ <option
+ defaultValue="false"
+ name="Warnings as errors (-werror)"
+ category="cygwin.compiler.category.warnings"
+ command="-werror"
+ valueType="boolean"
+ id="cygwin.gnu.compiler.warnings.toerrors">
+ </option>
+ <optionCategory
+ owner="cdt.build.tool.linux.gnu.compiler"
+ name="%OptionCategory.Misc"
+ id="cygwin.compiler.category.other">
+ </optionCategory>
+ <option
+ defaultValue="-c"
+ name="%Option.OtherFlags"
+ category="cygwin.compiler.category.other"
+ valueType="string"
+ id="cygwin.compiler.misc.other">
+ </option>
+ <option
+ defaultValue="false"
+ name="%Option.Posix.Verbose"
+ category="cygwin.compiler.category.other"
command="-v"
valueType="boolean"
- id="cygwin.compiler.general.verbose">
+ id="cygwin.compiler.misc.verbose">
</option>
</tool>
</target>
@@ -315,10 +376,35 @@
<configuration
name="%ConfigName.Rel"
id="cygwin.exec.release">
+ <toolReference
+ id="org.eclipse.cdt.build.tool.cygwin.compiler">
+ <optionReference
+ defaultValue="Optimize most (-O3)"
+ command="-O3"
+ id="cygwin.compiler.general.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="None"
+ id="cygwin.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<configuration
name="%ConfigName.Dbg"
id="cygwin.exec.debug">
+ <toolReference
+ id="org.eclipse.cdt.build.tool.cygwin.compiler">
+ <optionReference
+ defaultValue="None (-O0)"
+ command="-O0"
+ id="cygwin.compiler.general.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="Maximum (-g3)"
+ command="-g3"
+ id="cygwin.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<tool
name="%ToolName.linker"
@@ -364,10 +450,35 @@
<configuration
name="%ConfigName.Rel"
id="cygwin.so.release">
+ <toolReference
+ id="org.eclipse.cdt.build.tool.cygwin.compiler">
+ <optionReference
+ defaultValue="Optimize most (-O3)"
+ command="-O3"
+ id="cygwin.compiler.general.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="None"
+ id="cygwin.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<configuration
name="%ConfigName.Dbg"
id="cygwin.so.debug">
+ <toolReference
+ id="org.eclipse.cdt.build.tool.cygwin.compiler">
+ <optionReference
+ defaultValue="None (-O0)"
+ command="-O0"
+ id="cygwin.compiler.general.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="Maximum (-g3)"
+ command="-g3"
+ id="cygwin.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<tool
name="%ToolName.linker"
@@ -415,10 +526,35 @@
<configuration
name="%ConfigName.Rel"
id="cygwin.exp.release">
+ <toolReference
+ id="org.eclipse.cdt.build.tool.cygwin.compiler">
+ <optionReference
+ defaultValue="Optimize most (-O3)"
+ command="-O3"
+ id="cygwin.compiler.general.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="None"
+ id="cygwin.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<configuration
name="%ConfigName.Dbg"
id="cygwin.exp.debug">
+ <toolReference
+ id="org.eclipse.cdt.build.tool.cygwin.compiler">
+ <optionReference
+ defaultValue="None (-O0)"
+ command="-O0"
+ id="cygwin.compiler.general.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="Maximum (-g3)"
+ command="-g3"
+ id="cygwin.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<tool
name="%ToolName.linker"
@@ -466,10 +602,35 @@
<configuration
name="%ConfigName.Rel"
id="cygwin.lib.release">
+ <toolReference
+ id="org.eclipse.cdt.build.tool.cygwin.compiler">
+ <optionReference
+ defaultValue="Optimize most (-O3)"
+ command="-O3"
+ id="cygwin.compiler.general.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="None"
+ id="cygwin.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<configuration
name="%ConfigName.Dbg"
id="cygwin.lib.debug">
+ <toolReference
+ id="org.eclipse.cdt.build.tool.cygwin.compiler">
+ <optionReference
+ defaultValue="None (-O0)"
+ command="-O0"
+ id="cygwin.compiler.general.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="Maximum (-g3)"
+ command="-g3"
+ id="cygwin.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<tool
name="%ToolName.archiver"
@@ -492,14 +653,15 @@
</tool>
</target>
<target
- makeFlags="-k"
- isTest="false"
- cleanCommand="rm -rf"
name="Linux"
- binaryParser="org.eclipse.cdt.core.ELF"
+ id="linux.gnu"
+ cleanCommand="rm -rf"
+ isTest="false"
isAbstract="true"
makeCommand="make"
- id="linux.gnu">
+ binaryParser="org.eclipse.cdt.core.ELF"
+ makeFlags="-k"
+ osList="linux">
<tool
sources="c,C,cc,cxx,cpp"
name="%ToolName.compiler"
@@ -514,7 +676,7 @@
</optionCategory>
<option
defaultValue="false"
- name="Do not search system directories (-nostdinc)"
+ name="%Option.Posix.Nostdinc"
category="linux.gnu.compiler.category.preprocessor"
command="-nostdinc"
valueType="boolean"
@@ -595,6 +757,13 @@
builtIn="true">
</listOptionValue>
</option>
+ <option
+ name="%Option.Posix.UndefSym"
+ category="linux.gnu.compiler.category.preprocessor"
+ command="-U"
+ valueType="stringList"
+ id="linux.gnu.compiler.preprocessor.undef">
+ </option>
<optionCategory
owner="cdt.build.tool.linux.gnu.compiler"
name="%OptionCategory.Dirs"
@@ -626,23 +795,23 @@
valueType="enumerated"
id="linux.gnu.compiler.optimization.level">
<enumeratedOptionValue
- name="None (-O0)"
+ name="%Option.Posix.Optimize.None"
command="-O0"
id="linux.gnu.compiler.optimization.level.none">
</enumeratedOptionValue>
<enumeratedOptionValue
- name="Optimize (-O1)"
+ name="%Option.Posix.Optimize.Optimize"
command="-O1"
id="linux.gnu.compiler.optimization.level.optimize">
</enumeratedOptionValue>
<enumeratedOptionValue
- name="Optimize more (-O2)"
+ name="%Option.Posix.Optimize.More"
isDefault="true"
command="-O2"
id="linux.gnu.compiler.optimization.level.more">
</enumeratedOptionValue>
<enumeratedOptionValue
- name="Optimize most (-O3)"
+ name="%Option.Posix.Optimize.Most"
command="-O3"
id="linux.gnu.compiler.optimization.level.most">
</enumeratedOptionValue>
@@ -767,20 +936,20 @@
id="linux.gnu.compiler.category.other">
</optionCategory>
<option
+ defaultValue="-c"
+ name="%Option.OtherFlags"
+ category="linux.gnu.compiler.category.other"
+ valueType="string"
+ id="linux.gnu.compiler.other.other">
+ </option>
+ <option
defaultValue="false"
- name="Verbose (-v)"
+ name="%Option.Posix.Verbose"
category="linux.gnu.compiler.category.other"
command="-v"
valueType="boolean"
id="linux.gnu.compiler.other.verbose">
</option>
- <option
- defaultValue="-c"
- name="Other flags"
- category="linux.gnu.compiler.category.other"
- valueType="string"
- id="linux.gnu.compiler.other.other">
- </option>
</tool>
</target>
<target
@@ -793,10 +962,32 @@
<configuration
name="%ConfigName.Rel"
id="linux.gnu.exec.release">
+ <toolReference
+ id="cdt.build.tool.linux.gnu.compiler">
+ <optionReference
+ defaultValue="Optimize most (-O3)"
+ id="linux.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="None"
+ id="linux.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<configuration
name="%ConfigName.Dbg"
id="linux.gnu.exec.debug">
+ <toolReference
+ id="cdt.build.tool.linux.gnu.compiler">
+ <optionReference
+ defaultValue="None (-O0)"
+ id="linux.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="Maximum (-g3)"
+ id="linux.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<tool
sources="o"
@@ -862,6 +1053,12 @@
id="linux.gnu.linker.category.libs">
</optionCategory>
<option
+ name="%Option.Posix.Linker.Flags"
+ category="linux.gnu.linker.category.libs"
+ valueType="string"
+ id="linux.gnu.linker.libs.flags">
+ </option>
+ <option
name="%Option.Posix.Libs"
category="linux.gnu.linker.category.libs"
command="-l"
@@ -888,10 +1085,32 @@
<configuration
name="%ConfigName.Rel"
id="linux.gnu.so.release">
+ <toolReference
+ id="cdt.build.tool.linux.gnu.compiler">
+ <optionReference
+ defaultValue="Optimize most (-O3)"
+ id="linux.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="None"
+ id="linux.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<configuration
name="%ConfigName.Dbg"
id="linux.gnu.so.debug">
+ <toolReference
+ id="cdt.build.tool.linux.gnu.compiler">
+ <optionReference
+ defaultValue="None (-O0)"
+ id="linux.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="Maximum (-g3)"
+ id="linux.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<tool
sources="o"
@@ -967,6 +1186,12 @@
id="linux.gnu.solink.category.libs">
</optionCategory>
<option
+ category="linux.gnu.solink.category.libs"
+ name="%Option.Posix.Linker.Flags"
+ id="linux.gnu.solink.libs.flags"
+ valueType="string">
+ </option>
+ <option
name="%Option.Posix.Libs"
category="linux.gnu.solink.category.libs"
command="-l"
@@ -993,10 +1218,32 @@
<configuration
name="%ConfigName.Rel"
id="linux.gnu.lib.release">
+ <toolReference
+ id="cdt.build.tool.linux.gnu.compiler">
+ <optionReference
+ defaultValue="Optimize most (-O3)"
+ id="linux.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="None"
+ id="linux.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<configuration
name="%ConfigName.Dbg"
id="linux.gnu.lib.debug">
+ <toolReference
+ id="cdt.build.tool.linux.gnu.compiler">
+ <optionReference
+ defaultValue="None (-O0)"
+ id="linux.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="Maximum (-g3)"
+ id="linux.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<tool
sources="o"
@@ -1020,14 +1267,15 @@
</tool>
</target>
<target
- makeFlags="-k"
- isTest="false"
- cleanCommand="rm -rf"
name="Solaris"
- binaryParser="org.eclipse.cdt.core.ELF"
+ id="solaris.gnu"
+ cleanCommand="rm -rf"
+ isTest="false"
isAbstract="true"
makeCommand="make"
- id="solaris.gnu">
+ binaryParser="org.eclipse.cdt.core.ELF"
+ makeFlags="-k"
+ osList="solaris">
<tool
sources="c,C,cc,cxx,cpp"
name="%ToolName.compiler"
@@ -1042,7 +1290,7 @@
</optionCategory>
<option
defaultValue="false"
- name="Do not search system directories (-nostdinc)"
+ name="%Option.Posix.Nostdinc"
category="solaris.gnu.compiler.category.preprocessor"
command="-nostdinc"
valueType="boolean"
@@ -1146,23 +1394,23 @@
valueType="enumerated"
id="solaris.gnu.compiler.optimization.level">
<enumeratedOptionValue
- name="None (-O0)"
+ name="%Option.Posix.Optimize.None"
command="-O0"
id="solaris.gnu.compiler.optimization.level.none">
</enumeratedOptionValue>
<enumeratedOptionValue
- name="Optimize (-O1)"
+ name="%Option.Posix.Optimize.Optimize"
command="-O1"
id="solaris.gnu.compiler.optimization.level.optimize">
</enumeratedOptionValue>
<enumeratedOptionValue
- name="Optimize more (-O2)"
+ name="%Option.Posix.Optimize.More"
isDefault="true"
command="-O2"
id="solaris.gnu.compiler.optimization.level.more">
</enumeratedOptionValue>
<enumeratedOptionValue
- name="Optimize most (-O3)"
+ name="%Option.Posix.Optimize.Most"
command="-O3"
id="solaris.gnu.compiler.optimization.level.most">
</enumeratedOptionValue>
@@ -1287,20 +1535,20 @@
id="solaris.gnu.compiler.category.other">
</optionCategory>
<option
+ defaultValue="-c"
+ name="%Option.OtherFlags"
+ category="solaris.gnu.compiler.category.other"
+ valueType="string"
+ id="solaris.gnu.compiler.other.other">
+ </option>
+ <option
defaultValue="false"
- name="Verbose (-v)"
+ name="%Option.Posix.Verbose"
category="solaris.gnu.compiler.category.other"
command="-v"
valueType="boolean"
id="solaris.gnu.compiler.other.verbose">
</option>
- <option
- defaultValue="-c"
- name="Other flags"
- category="solaris.gnu.compiler.category.other"
- valueType="string"
- id="solaris.gnu.compiler.other.other">
- </option>
</tool>
</target>
<target
@@ -1313,10 +1561,32 @@
<configuration
name="%ConfigName.Rel"
id="solaris.gnu.exec.release">
+ <toolReference
+ id="cdt.build.tool.solaris.gnu.compiler">
+ <optionReference
+ defaultValue="Optimize most (-O3)"
+ id="solaris.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="None"
+ id="solaris.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<configuration
name="%ConfigName.Dbg"
id="solaris.gnu.exec.debug">
+ <toolReference
+ id="cdt.build.tool.solaris.gnu.compiler">
+ <optionReference
+ defaultValue="None (-O0)"
+ id="solaris.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="Maximum (-g3)"
+ id="solaris.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<tool
sources="o"
@@ -1382,6 +1652,12 @@
id="solaris.gnu.linker.category.libs">
</optionCategory>
<option
+ category="solaris.gnu.linker.category.libs"
+ name="%Option.Posix.Linker.Flags"
+ id="solaris.gnu.linker.libs.flags"
+ valueType="string">
+ </option>
+ <option
name="%Option.Posix.Libs"
category="solaris.gnu.linker.category.libs"
command="-l"
@@ -1408,10 +1684,32 @@
<configuration
name="%ConfigName.Rel"
id="solaris.gnu.so.release">
+ <toolReference
+ id="cdt.build.tool.solaris.gnu.compiler">
+ <optionReference
+ defaultValue="Optimize most (-O3)"
+ id="solaris.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="None"
+ id="solaris.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<configuration
name="%ConfigName.Dbg"
id="solaris.gnu.so.debug">
+ <toolReference
+ id="cdt.build.tool.solaris.gnu.compiler">
+ <optionReference
+ defaultValue="None (-O0)"
+ id="solaris.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="Maximum (-g3)"
+ id="solaris.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<tool
sources="o"
@@ -1487,6 +1785,12 @@
id="solaris.gnu.solink.category.libs">
</optionCategory>
<option
+ name="%Option.Posix.Linker.Flags"
+ category="solaris.gnu.solink.category.libs"
+ valueType="string"
+ id="solaris.gnu.solink.libs.flags">
+ </option>
+ <option
name="%Option.Posix.Libs"
category="solaris.gnu.solink.category.libs"
command="-l"
@@ -1513,10 +1817,32 @@
<configuration
name="%ConfigName.Rel"
id="solaris.gnu.lib.release">
+ <toolReference
+ id="cdt.build.tool.solaris.gnu.compiler">
+ <optionReference
+ defaultValue="Optimize most (-O3)"
+ id="solaris.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="None"
+ id="solaris.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<configuration
name="%ConfigName.Dbg"
id="solaris.gnu.lib.debug">
+ <toolReference
+ id="cdt.build.tool.solaris.gnu.compiler">
+ <optionReference
+ defaultValue="None (-O0)"
+ id="solaris.gnu.compiler.optimization.level">
+ </optionReference>
+ <optionReference
+ defaultValue="Maximum (-g3)"
+ id="solaris.gnu.compiler.debugging.level">
+ </optionReference>
+ </toolReference>
</configuration>
<tool
sources="o"
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
index 05919effbe8..9bd516a9e6f 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
@@ -13,6 +13,7 @@ package org.eclipse.cdt.managedbuilder.ui.wizards;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
import java.util.ListIterator;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
@@ -21,6 +22,7 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderHelpContextIds;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
+import org.eclipse.core.boot.BootLoader;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -202,11 +204,15 @@ public class CProjectPlatformPage extends WizardPage {
// Get a list of platforms defined by plugins
ITarget[] allTargets = ManagedBuildManager.getDefinedTargets(null);
targets = new ArrayList();
+ String os = BootLoader.getOS();
// Add all of the concrete targets to the target list
for (int index = 0; index < allTargets.length; ++index) {
ITarget target = allTargets[index];
if (!target.isAbstract() && !target.isTestTarget()) {
- targets.add(target);
+ List targetOSList = Arrays.asList(target.getTargetOSList());
+ if (targetOSList.contains(os)) {
+ targets.add(target);
+ }
}
}
targets.trimToSize();

Back to the top