Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-06-12 15:56:11 -0400
committerAndrew Gvozdev2012-06-12 15:56:11 -0400
commit2df46fd99fd4b83ad5fa6a2faf9c01c92b196bd9 (patch)
tree2e9d03bb0faafc40aea3b43a757205aaa41e153d
parent3f3026481cffdc841b65ed2fd5d86b0b732c64e3 (diff)
downloadorg.eclipse.cdt-2df46fd99fd4b83ad5fa6a2faf9c01c92b196bd9.tar.gz
org.eclipse.cdt-2df46fd99fd4b83ad5fa6a2faf9c01c92b196bd9.tar.xz
org.eclipse.cdt-2df46fd99fd4b83ad5fa6a2faf9c01c92b196bd9.zip
bug 382422: [sd90] Add MinGW specs detector
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/plugin.xml8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorMinGW.java38
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java48
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java28
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/BuiltinSpecsDetectorOptionPage.java29
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManagedBuilderUIPlugin.java8
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/EnvVarOperationProcessor.java54
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.core/src/org/eclipse/cdt/managedbuilder/xlc/core/XlcBuiltinSpecsDetector.java2
11 files changed, 178 insertions, 52 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
index 9d615cbc09..f6e4a4f035 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
@@ -622,6 +622,14 @@
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider
+ class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorMinGW"
+ id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW"
+ name="CDT GCC Builtin Compiler Settings MinGW"
+ parameter="${COMMAND} -E -P -v -dD ${INPUTS}">
+ <language-scope id="org.eclipse.cdt.core.gcc"/>
+ <language-scope id="org.eclipse.cdt.core.g++"/>
+ </provider>
+ <provider
class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser"
id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"
name="CDT GCC Build Output Parser"
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java
index 00e8b29161..1c38ce7ab6 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java
@@ -18,11 +18,13 @@ import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpec
import org.eclipse.core.resources.IResource;
/**
- * Class to detect built-in compiler settings.
+ * Class to detect built-in compiler settings for Cygwin toolchain.
* The paths are converted to cygwin "file-system" representation.
- *
*/
public class GCCBuiltinSpecsDetectorCygwin extends GCCBuiltinSpecsDetector {
+ // ID must match the tool-chain definition in org.eclipse.cdt.managedbuilder.core.buildDefinitions extension point
+ private static final String GCC_TOOLCHAIN_ID_CYGWIN = "cdt.managedbuild.toolchain.gnu.cygwin.base"; //$NON-NLS-1$
+
private static final URI CYGWIN_ROOT;
static {
try {
@@ -34,6 +36,11 @@ public class GCCBuiltinSpecsDetectorCygwin extends GCCBuiltinSpecsDetector {
}
@Override
+ public String getToolchainId() {
+ return GCC_TOOLCHAIN_ID_CYGWIN;
+ }
+
+ @Override
protected URI getMappedRootURI(IResource sourceFile, String parsedResourceName) {
if (mappedRootURI == null) {
mappedRootURI = super.getMappedRootURI(sourceFile, parsedResourceName);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorMinGW.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorMinGW.java
new file mode 100644
index 0000000000..87f9fc6a63
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorMinGW.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2012 Andrew Gvozdev 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
+ *
+ * Contributors:
+ * Andrew Gvozdev - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.cdt.managedbuilder.internal.language.settings.providers;
+
+import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector;
+
+/**
+ * Class to detect built-in compiler settings for MinGW toolchain.
+ */
+public class GCCBuiltinSpecsDetectorMinGW extends GCCBuiltinSpecsDetector {
+ // ID must match the tool-chain definition in org.eclipse.cdt.managedbuilder.core.buildDefinitions extension point
+ private static final String GCC_TOOLCHAIN_ID_MINGW = "cdt.managedbuild.toolchain.gnu.mingw.base"; //$NON-NLS-1$
+
+ @Override
+ public String getToolchainId() {
+ return GCC_TOOLCHAIN_ID_MINGW;
+ }
+
+ @Override
+ public GCCBuiltinSpecsDetectorMinGW cloneShallow() throws CloneNotSupportedException {
+ return (GCCBuiltinSpecsDetectorMinGW) super.cloneShallow();
+ }
+
+ @Override
+ public GCCBuiltinSpecsDetectorMinGW clone() throws CloneNotSupportedException {
+ return (GCCBuiltinSpecsDetectorMinGW) super.clone();
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
index 4d1b14ea59..d3fbb3b722 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
@@ -17,8 +17,9 @@ import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Iterator;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CommandLauncher;
@@ -27,6 +28,9 @@ import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.IConsoleParser;
import org.eclipse.cdt.core.IMarkerGenerator;
import org.eclipse.cdt.core.ProblemMarkerInfo;
+import org.eclipse.cdt.core.envvar.EnvironmentVariable;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager;
import org.eclipse.cdt.core.language.settings.providers.ICBuildOutputParser;
import org.eclipse.cdt.core.language.settings.providers.ICListenerAgent;
import org.eclipse.cdt.core.language.settings.providers.IWorkingDirectoryTracker;
@@ -43,6 +47,7 @@ import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSetting
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
import org.eclipse.cdt.utils.CommandLineUtil;
+import org.eclipse.cdt.utils.envvar.EnvironmentCollector;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -149,7 +154,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
}
}
} catch (CoreException e) {
- return new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error checking markers.", e); //$NON-NLS-1$
+ return new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error checking markers.", e); //$NON-NLS-1$
}
try {
@@ -166,7 +171,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
marker.setAttribute(IMarker.LOCATION, msgProperties);
}
} catch (CoreException e) {
- return new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error adding markers.", e); //$NON-NLS-1$
+ return new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error adding markers.", e); //$NON-NLS-1$
}
return Status.OK_STATUS;
@@ -192,7 +197,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
}
}
} catch (CoreException e) {
- ManagedBuilderCorePlugin.log(new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error deleting markers.", e)); //$NON-NLS-1$
+ ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error deleting markers.", e)); //$NON-NLS-1$
}
}
@@ -596,26 +601,39 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
}
/**
- * Get array of environment variables in format "var=value".
+ * Returns list of environment variables to be used during execution of provider's command.
+ * Implementers are expected to add their variables to the end of the list.
+ *
+ * @return list of environment variables.
*/
- private String[] getEnvp() {
+ protected List<IEnvironmentVariable> getEnvironmentVariables() {
+ IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager();
+ List<IEnvironmentVariable> vars = new ArrayList<IEnvironmentVariable>(Arrays.asList(mngr.getVariables(currentCfgDescription, true)));
+
// On POSIX (Linux, UNIX) systems reset language variables to default (English)
// with UTF-8 encoding since GNU compilers can handle only UTF-8 characters.
// Include paths with locale characters will be handled properly regardless
// of the language as long as the encoding is set to UTF-8.
// English language is set for parser because it relies on English messages
// in the output of the 'gcc -v' command.
+ vars.add(new EnvironmentVariable(ENV_LANGUAGE, "en")); //$NON-NLS-1$
+ vars.add(new EnvironmentVariable(ENV_LC_ALL, "C.UTF-8")); //$NON-NLS-1$
- List<String> envp = new ArrayList<String>(Arrays.asList(BuildRunnerHelper.getEnvp(currentCfgDescription)));
- for (Iterator<String> iterator = envp.iterator(); iterator.hasNext();) {
- String var = iterator.next();
- if (var.startsWith(ENV_LANGUAGE + '=') || var.startsWith(ENV_LC_ALL + '=')) {
- iterator.remove();
- }
- }
- envp.add(ENV_LANGUAGE + "=en"); // override for GNU gettext //$NON-NLS-1$
- envp.add(ENV_LC_ALL + "=C.UTF-8"); // for other parts of the system libraries //$NON-NLS-1$
+ return vars;
+ }
+ /**
+ * Get array of environment variables in format "var=value".
+ */
+ private String[] getEnvp() {
+ EnvironmentCollector collector = new EnvironmentCollector();
+ List<IEnvironmentVariable> vars = getEnvironmentVariables();
+ collector.addVariables(vars.toArray(new IEnvironmentVariable[vars.size()]));
+
+ Set<String> envp = new HashSet<String>();
+ for (IEnvironmentVariable var : collector.getVariables()) {
+ envp.add(var.getName() + '=' + var.getValue());
+ }
return envp.toArray(new String[envp.size()]);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
index 5723139096..1727f6e20e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
@@ -49,7 +49,7 @@ public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
};
@Override
- protected String getToolchainId() {
+ public String getToolchainId() {
return GCC_TOOLCHAIN_ID;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java
index 0bf78b2ce0..f7728a1a08 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java
@@ -11,14 +11,22 @@
package org.eclipse.cdt.managedbuilder.language.settings.providers;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IInputType;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.IToolChain;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
+import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
+import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
+import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
/**
* Abstract parser capable to execute compiler command printing built-in compiler
@@ -43,7 +51,7 @@ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecs
* Tool-chain id must be supplied for global providers where we don't
* have configuration description to figure that out programmatically.
*/
- protected abstract String getToolchainId();
+ public abstract String getToolchainId();
/**
* Finds a tool handling given language in the tool-chain of the provider.
@@ -109,4 +117,22 @@ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecs
return ext;
}
+ @Override
+ protected List<IEnvironmentVariable> getEnvironmentVariables() {
+ List<IEnvironmentVariable> vars = new ArrayList<IEnvironmentVariable>(super.getEnvironmentVariables());
+
+ String toolchainId = getToolchainId();
+ for (IToolChain toolchain = ManagedBuildManager.getExtensionToolChain(toolchainId); toolchain != null; toolchain = toolchain.getSuperClass()) {
+ IConfigurationEnvironmentVariableSupplier envSupplier = toolchain.getEnvironmentVariableSupplier();
+ if (envSupplier != null) {
+ IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(currentCfgDescription);
+ IEnvironmentVariableProvider provider = ManagedBuildManager.getEnvironmentVariableProvider();
+ IBuildEnvironmentVariable[] added = envSupplier.getVariables(cfg, provider);
+ vars.addAll(Arrays.asList(added));
+ break;
+ }
+ }
+
+ return vars;
+ }
}
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
index 202ecf0552..eaa55a1ea6 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
@@ -1842,7 +1842,7 @@
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwEnvironmentVariableSupplier"
id="cdt.managedbuild.toolchain.gnu.mingw.base"
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwIsToolChainSupported"
- languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
+ languageSettingsProviders="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW"
name="%ToolChainName.MinGW"
osList="win32"
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base;cdt.managedbuild.tool.gnu.c.linker.mingw.base;cdt.managedbuild.tool.gnu.archiver">
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/BuiltinSpecsDetectorOptionPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/BuiltinSpecsDetectorOptionPage.java
index bb8d0062a5..9e89aef331 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/BuiltinSpecsDetectorOptionPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/BuiltinSpecsDetectorOptionPage.java
@@ -11,14 +11,21 @@
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
+import org.eclipse.cdt.internal.ui.newui.StatusMessageLine;
+import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
+import org.eclipse.cdt.managedbuilder.language.settings.providers.ToolchainBuiltinSpecsDetector;
+import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -43,6 +50,8 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
private Text inputCommand;
private Button allocateConsoleCheckBox;
+ private StatusMessageLine fStatusLine;
+
@Override
public void createControl(Composite parent) {
fEditable = parent.isEnabled();
@@ -52,6 +61,7 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
createCompilerCommandInputControl(composite, provider);
createBrowseButton(composite);
createConsoleCheckbox(composite, provider);
+ createStatusLine(composite, provider);
setControl(composite);
}
@@ -157,6 +167,25 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
});
}
+ /**
+ * Create status line to display messages for user.
+ */
+ private void createStatusLine(Composite composite, AbstractBuiltinSpecsDetector provider) {
+ fStatusLine = new StatusMessageLine(composite, SWT.LEFT, 2);
+
+ if (provider instanceof ToolchainBuiltinSpecsDetector) {
+ String toolchainId = ((ToolchainBuiltinSpecsDetector) provider).getToolchainId();
+ IToolChain toolchain = ManagedBuildManager.getExtensionToolChain(toolchainId);
+ if (toolchain == null) {
+ fStatusLine.setErrorStatus(new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(),
+ IStatus.ERROR, "Toolchain support for CDT is not installed. Toolchain id=[" + toolchainId + "].", null));
+ } else if (!toolchain.isSupported()) {
+ fStatusLine.setErrorStatus(new Status(IStatus.INFO, ManagedBuilderUIPlugin.getUniqueIdentifier(), IStatus.INFO,
+ "Toolchain " + toolchain.getName() + " is not detected on this system.", null));
+ }
+ }
+ }
+
@Override
public void performApply(IProgressMonitor monitor) throws CoreException {
ILanguageSettingsProvider provider = providerTab.getProvider(providerId);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManagedBuilderUIPlugin.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManagedBuilderUIPlugin.java
index fab1586722..c22bc8b106 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManagedBuilderUIPlugin.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManagedBuilderUIPlugin.java
@@ -37,7 +37,7 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
// super();
plugin = this;
}
-
+
/**
* @return
@@ -100,7 +100,7 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
message = null;
}
} else {
- status = new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(), -1, "Internal Error: ", t); //$NON-NLS-1$
+ status = new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(), -1, "Internal Error: ", t); //$NON-NLS-1$
}
ErrorDialog.openError(shell, title, message, status);
}
@@ -114,7 +114,7 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
}
/**
- * Answers the <code>Shell</code> associated with the active workbench, or
+ * Answers the <code>Shell</code> associated with the active workbench, or
* one of the windows associated with the workbench.
* @return
*/
@@ -126,6 +126,6 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
return windows[0].getShell();
}
}
-
+
}
diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/EnvVarOperationProcessor.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/EnvVarOperationProcessor.java
index 895faf24fd..e2594ddcdf 100644
--- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/EnvVarOperationProcessor.java
+++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/EnvVarOperationProcessor.java
@@ -20,21 +20,21 @@ import org.eclipse.cdt.internal.core.envvar.EnvironmentVariableManager;
/**
- * This is an utility class that implements environment variable operations
+ * This is an utility class that implements environment variable operations
* functionality: append, prepend, replace and remove
- *
+ *
* @since 3.0
*/
public class EnvVarOperationProcessor {
/**
* performs the environment variable operation given an initial variable and
* a variable representing an operation to be performed
- * Returns a new variable the represents the result of a performed operation
- *
+ * Returns a new variable the represents the result of a performed operation
+ *
* @param initial the initial variable
* @param added the variable that specifies an operation to be performed on the
- * initial variable value
- * @return the new variable the represents the result of a performed operation
+ * initial variable value
+ * @return the new variable the represents the result of a performed operation
*/
static public IEnvironmentVariable performOperation(IEnvironmentVariable initial, IEnvironmentVariable added){
if(initial == null){
@@ -42,9 +42,9 @@ public class EnvVarOperationProcessor {
}
if(added == null)
return initial;
-
+
String name = added.getName();
-
+
switch(added.getOperation()){
case IEnvironmentVariable.ENVVAR_REMOVE:
return new EnvironmentVariable(name,null,IEnvironmentVariable.ENVVAR_REMOVE,null);
@@ -82,24 +82,24 @@ public class EnvVarOperationProcessor {
return addValue;
if(addValue == null)
return initialValue;
-
+
if(delimiter == null || "".equals(delimiter)){ //$NON-NLS-1$
return prepend ? addValue + initialValue : initialValue + addValue;
}
-
+
List<String> value = convertToList(initialValue, delimiter);
List<String> added = convertToList(addValue, delimiter);
value = removeDuplicates(value, added);
-
+
if(prepend)
value.addAll(0,added);
else
value.addAll(added);
-
+
return convertToString(value, delimiter);
}
-
+
/**
* performs append given an initial String, a string to be appended and a delimiter
* Returns a String representing the result of the operation
@@ -111,7 +111,7 @@ public class EnvVarOperationProcessor {
static public String performAppend(String initialValue, String addValue, String delimiter){
return performAppendPrepend(initialValue,addValue,delimiter,false);
}
-
+
/**
* performs prepend given an initial String, a string to be prepended and a delimiter
* Returns a String representing the result of the operation
@@ -123,7 +123,7 @@ public class EnvVarOperationProcessor {
static public String performPrepend(String initialValue, String addValue, String delimiter){
return performAppendPrepend(initialValue,addValue,delimiter,true);
}
-
+
/**
* performs an environment variable operation
* Returns String representing the result of the operation
@@ -141,7 +141,7 @@ public class EnvVarOperationProcessor {
return performPrepend(initialValue,newValue,delimiter);
case IEnvironmentVariable.ENVVAR_APPEND:
return performAppend(initialValue,newValue,delimiter);
- case IEnvironmentVariable.ENVVAR_REPLACE:
+ case IEnvironmentVariable.ENVVAR_REPLACE:
default:
return initialValue;
}
@@ -175,8 +175,8 @@ public class EnvVarOperationProcessor {
return list;
}
-
- /*
+
+ /**
* removes duplicates
*/
static public List<String> removeDuplicates(List<String> value, List<String> duplicates){
@@ -198,7 +198,7 @@ public class EnvVarOperationProcessor {
}
return list;
}
-
+
/**
* Converts list to a single String using a given delimiter to separate
* the list value in the resulting String
@@ -209,18 +209,18 @@ public class EnvVarOperationProcessor {
static public String convertToString(List<String> list, String delimiter){
Iterator<String> iter = list.iterator();
StringBuffer buffer = new StringBuffer();
-
+
while(iter.hasNext()){
buffer.append(iter.next());
-
+
if(iter.hasNext())
buffer.append(delimiter);
}
-
+
return buffer.toString();
}
-
- /*
+
+ /**
* normalizes the variable name. That is: removes prepended and appended spaces
* and converts the name to upper-case for Win32 systems
* @return the normalized name or <code>null</code> in case the name is not valid
@@ -234,12 +234,12 @@ public class EnvVarOperationProcessor {
name = name.toUpperCase();
return name;
}
-
+
static public IEnvironmentVariable[] filterVariables(IEnvironmentVariable variables[], String remove[]){
-
+
if(variables == null || variables.length == 0)
return variables;
-
+
IEnvironmentVariable filtered[] = new IEnvironmentVariable[variables.length];
int filteredNum = 0;
for (IEnvironmentVariable var : variables) {
diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.core/src/org/eclipse/cdt/managedbuilder/xlc/core/XlcBuiltinSpecsDetector.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.core/src/org/eclipse/cdt/managedbuilder/xlc/core/XlcBuiltinSpecsDetector.java
index fe92bbb583..71c66643a3 100644
--- a/xlc/org.eclipse.cdt.managedbuilder.xlc.core/src/org/eclipse/cdt/managedbuilder/xlc/core/XlcBuiltinSpecsDetector.java
+++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.core/src/org/eclipse/cdt/managedbuilder/xlc/core/XlcBuiltinSpecsDetector.java
@@ -51,7 +51,7 @@ public class XlcBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
};
@Override
- protected String getToolchainId() {
+ public String getToolchainId() {
return XLC_TOOLCHAIN_ID;
}

Back to the top