1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-16 13:35:22 +02:00

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.
This commit is contained in:
Doug Schaefer 2007-08-31 19:27:59 +00:00
parent 5e002f83a2
commit f6ea2409a4
3 changed files with 59 additions and 11 deletions

View file

@ -1662,12 +1662,13 @@
</toolChain>
<toolChain
archList="all"
osList="win32"
name="%ToolChainName.Cygwin"
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.cygwin.GnuCygwinConfigurationEnvironmentSupplier"
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base;cdt.managedbuild.tool.gnu.c.linker.cygwin.base;cdt.managedbuild.tool.gnu.archiver"
id="cdt.managedbuild.toolchain.gnu.cygwin.base">
archList="all"
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.cygwin.GnuCygwinConfigurationEnvironmentSupplier"
id="cdt.managedbuild.toolchain.gnu.cygwin.base"
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.cygwin.IsGnuCygwinToolChainSupported"
name="%ToolChainName.Cygwin"
osList="win32"
targetTool="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base;cdt.managedbuild.tool.gnu.c.linker.cygwin.base;cdt.managedbuild.tool.gnu.archiver">
<targetPlatform
id="cdt.managedbuild.target.gnu.platform.cygwin.base"
name="%PlatformName.Dbg"
@ -1733,6 +1734,7 @@
archList="all"
configurationEnvironmentSupplier="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwEnvironmentVariableSupplier"
id="cdt.managedbuild.toolchain.gnu.mingw.base"
isToolChainSupported="org.eclipse.cdt.managedbuilder.gnu.mingw.MingwIsToolChainSupported"
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">

View file

@ -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,

View file

@ -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;
}
}