diff options
author | Doug Schaefer | 2007-08-31 19:27:59 +0000 |
---|---|---|
committer | Doug Schaefer | 2007-08-31 19:27:59 +0000 |
commit | f6ea2409a4e2ba41e05e8e178c13109e98be038f (patch) | |
tree | 77048c1031878a06994b6f6f1df079ad0af983d1 /build/org.eclipse.cdt.managedbuilder.gnu.ui/src | |
parent | 5e002f83a23b6e1caa655ec54d1fcb5e9caeb7aa (diff) | |
download | org.eclipse.cdt-f6ea2409a4e2ba41e05e8e178c13109e98be038f.tar.gz org.eclipse.cdt-f6ea2409a4e2ba41e05e8e178c13109e98be038f.tar.xz org.eclipse.cdt-f6ea2409a4e2ba41e05e8e178c13109e98be038f.zip |
Bug 194641 - reattach the isToolchainSupported to the cygwin toolchain. Also created one for mingw.
Bug 201579 - added the msys directory to the mingw toolchain path if it resides next to the mingw in the eclipse install location's parent.
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.gnu.ui/src')
2 files changed, 51 insertions, 5 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java index dde8d8b1752..3c0ee110e6b 100644 --- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java +++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java @@ -89,13 +89,23 @@ public class MingwEnvironmentVariableSupplier implements return null; } + public static IPath getMsysBinDir() { + // Just look in the install location parent dir + IPath installPath = new Path(Platform.getInstallLocation().getURL().getFile()).removeLastSegments(1); + IPath msysBinPath = installPath.append("msys\\bin"); + return msysBinPath.toFile().isDirectory() ? msysBinPath : null; + } + public MingwEnvironmentVariableSupplier() { IPath binPath = getBinDir(); - if (binPath != null) - path = new MingwBuildEnvironmentVariable( - "PATH", - binPath.toOSString(), - IBuildEnvironmentVariable.ENVVAR_PREPEND); + if (binPath != null) { + String pathStr = binPath.toOSString(); + IPath msysBinPath = getMsysBinDir(); + if (msysBinPath != null) + pathStr += ';' + msysBinPath.toOSString(); + + path = new MingwBuildEnvironmentVariable("PATH", pathStr, IBuildEnvironmentVariable.ENVVAR_PREPEND); + } } public IBuildEnvironmentVariable getVariable(String variableName, diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwIsToolChainSupported.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwIsToolChainSupported.java new file mode 100644 index 00000000000..310204ec846 --- /dev/null +++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwIsToolChainSupported.java @@ -0,0 +1,36 @@ +/********************************************************************** + * Copyright (c) 2007 QNX Software Systems 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: + * QNX Software Systems - Initial API and implementation + **********************************************************************/ + +package org.eclipse.cdt.managedbuilder.gnu.mingw; + +import org.eclipse.cdt.managedbuilder.core.IManagedIsToolChainSupported; +import org.eclipse.cdt.managedbuilder.core.IToolChain; +import org.eclipse.core.runtime.PluginVersionIdentifier; + +/** + * @author Doug Schaefer + * + */ +public class MingwIsToolChainSupported implements IManagedIsToolChainSupported { + + private final boolean supported; + + public MingwIsToolChainSupported() { + // Only supported if we can find the mingw bin dir to run the compiler + supported = MingwEnvironmentVariableSupplier.getBinDir() != null; + } + + public boolean isSupported(IToolChain toolChain, + PluginVersionIdentifier version, String instance) { + return supported; + } + +} |