mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
RESOLVED - bug 193605: need scanner config support for XL compiler toolchains
https://bugs.eclipse.org/bugs/show_bug.cgi?id=193605
This commit is contained in:
parent
f497803515
commit
790670050d
10 changed files with 110 additions and 18 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.make.xlc.core;singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.make.xlc.core;singleton:=true
|
||||||
Bundle-Version: 4.0.3.qualifier
|
Bundle-Version: 5.0.0.qualifier
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
Require-Bundle: org.eclipse.cdt.make.core,
|
Require-Bundle: org.eclipse.cdt.make.core,
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.make.xlc.core.scannerconfig.xl;
|
package org.eclipse.cdt.make.xlc.core.scannerconfig;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
|
@ -36,7 +36,7 @@ public class XlCSpecsRunSIProvider extends GCCSpecsRunSIProvider {
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
try {
|
try {
|
||||||
this.fCompileCommand = new Path(BuildMacroProvider.getDefault()
|
this.fCompileCommand = new Path(ManagedBuildManager.getBuildMacroProvider()
|
||||||
.resolveValue(
|
.resolveValue(
|
||||||
this.fCompileCommand.toString(),
|
this.fCompileCommand.toString(),
|
||||||
EMPTY_STRING,
|
EMPTY_STRING,
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.xlc.core;singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.xlc.core;singleton:=true
|
||||||
Bundle-Version: 4.0.3.qualifier
|
Bundle-Version: 5.0.0.qualifier
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
Require-Bundle: org.eclipse.cdt.managedbuilder.core,
|
Require-Bundle: org.eclipse.cdt.managedbuilder.core,
|
||||||
|
|
|
@ -15,4 +15,5 @@ providerName=Eclipse.org
|
||||||
|
|
||||||
objectFileName=Object File
|
objectFileName=Object File
|
||||||
|
|
||||||
profileName=XL C/C++ managed make per project SCD profile
|
profileName=XL C managed make per project scanner discovery profile
|
||||||
|
profileNameCPP=XL C++ managed make per project scanner discovery profile
|
|
@ -29,7 +29,7 @@
|
||||||
<!-- The output for C or C++ projects will be different as the ScannerInfoProvider substitute the ${specs_file} variable below with a dummy "c" file or "cpp" file -->
|
<!-- The output for C or C++ projects will be different as the ScannerInfoProvider substitute the ${specs_file} variable below with a dummy "c" file or "cpp" file -->
|
||||||
<run
|
<run
|
||||||
arguments="-E -v ${plugin_state_location}/${specs_file}"
|
arguments="-E -v ${plugin_state_location}/${specs_file}"
|
||||||
command="xlc"
|
command="${XL_compilerRoot}/xlc"
|
||||||
class="org.eclipse.cdt.make.xlc.core.scannerconfig.XlCSpecsRunSIProvider">
|
class="org.eclipse.cdt.make.xlc.core.scannerconfig.XlCSpecsRunSIProvider">
|
||||||
</run>
|
</run>
|
||||||
<!-- Specifies the parser for the output generated by the compiler with the above command line -->
|
<!-- Specifies the parser for the output generated by the compiler with the above command line -->
|
||||||
|
@ -39,5 +39,41 @@
|
||||||
</scannerInfoProvider>
|
</scannerInfoProvider>
|
||||||
|
|
||||||
</extension>
|
</extension>
|
||||||
|
<!-- -->
|
||||||
|
<!-- Xl C ScannerConfigurationDiscoveryProfile definitions -->
|
||||||
|
<!-- -->
|
||||||
|
|
||||||
|
<!-- We have to extend the core of CDT's make so that we can define a new ScannerConfigurationDiscoveryProfile -->
|
||||||
|
<!-- A ScannerConfigurationDiscoveryProfile is used to discover information about the standard options used by the compiler, e.g. the standard include directories -->
|
||||||
|
|
||||||
|
<!-- Xl C Managed Make Per Project Profile -->
|
||||||
|
<!-- The Profile gathers together information about the standard include directories and standard definitions used by the compiler -->
|
||||||
|
<extension
|
||||||
|
id="XLCManagedMakePerProjectProfileCPP"
|
||||||
|
name="%profileNameCPP"
|
||||||
|
point="org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile">
|
||||||
|
|
||||||
|
<!-- The ScannerInfoCollector manages the information generated by the Profile so that it can be easily accessed afterwards -->
|
||||||
|
<scannerInfoCollector
|
||||||
|
class="org.eclipse.cdt.make.xlc.core.scannerconfig.DefaultXlCScannerInfoCollector"
|
||||||
|
scope="project">
|
||||||
|
</scannerInfoCollector>
|
||||||
|
|
||||||
|
<!-- The ScannerInfoProvider search for the information needed by the profile and send it to the ScannerInfoCollector -->
|
||||||
|
<scannerInfoProvider providerId="specsFile">
|
||||||
|
<!-- Specifies the compiler command that returns the information about standard include directories and standard definitions -->
|
||||||
|
<!-- The compiler command used will be always a C compiler command -->
|
||||||
|
<!-- The output for C or C++ projects will be different as the ScannerInfoProvider substitute the ${specs_file} variable below with a dummy "c" file or "cpp" file -->
|
||||||
|
<run
|
||||||
|
arguments="-E -v ${plugin_state_location}/${specs_file}"
|
||||||
|
command="${XL_compilerRoot}/xlC"
|
||||||
|
class="org.eclipse.cdt.make.xlc.core.scannerconfig.XlCSpecsRunSIProvider">
|
||||||
|
</run>
|
||||||
|
<!-- Specifies the parser for the output generated by the compiler with the above command line -->
|
||||||
|
<scannerInfoConsoleParser
|
||||||
|
class="org.eclipse.cdt.make.xlc.core.scannerconfig.XlCSpecsConsoleParser">
|
||||||
|
</scannerInfoConsoleParser>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
|
||||||
|
</extension>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.xlc.ui; singleton := true
|
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.xlc.ui; singleton := true
|
||||||
Bundle-Version: 4.0.1.qualifier
|
Bundle-Version: 5.0.0.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin
|
Bundle-Activator: org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
Require-Bundle: org.eclipse.ui,
|
Require-Bundle: org.eclipse.ui,
|
||||||
|
@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.ui,
|
||||||
org.eclipse.core.resources,
|
org.eclipse.core.resources,
|
||||||
org.eclipse.cdt.managedbuilder.ui,
|
org.eclipse.cdt.managedbuilder.ui,
|
||||||
org.eclipse.cdt.ui,
|
org.eclipse.cdt.ui,
|
||||||
org.eclipse.ui.ide
|
org.eclipse.ui.ide,
|
||||||
|
org.eclipse.core.variables
|
||||||
Eclipse-LazyStart: true
|
Eclipse-LazyStart: true
|
||||||
Export-Package: org.eclipse.cdt.managedbuilder.xlc.ui,
|
Export-Package: org.eclipse.cdt.managedbuilder.xlc.ui,
|
||||||
org.eclipse.cdt.managedbuilder.xlc.ui.preferences,
|
org.eclipse.cdt.managedbuilder.xlc.ui.preferences,
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
pluginName = XL C/C++ Managed Build UI Plugin
|
pluginName = XL C/C++ Managed Build UI Plugin
|
||||||
providerName = Eclipse.org
|
providerName = Eclipse.org
|
||||||
|
|
||||||
|
variableName = XL C/C++ Compiler Root Location
|
||||||
|
|
||||||
#Build model names
|
#Build model names
|
||||||
TargetName.xlc.exe=Executable (XL C/C++)
|
TargetName.xlc.exe=Executable (XL C/C++)
|
||||||
TargetName.xlc.so=Shared Library (XL C/C++)
|
TargetName.xlc.so=Shared Library (XL C/C++)
|
||||||
|
|
|
@ -229,11 +229,12 @@
|
||||||
outputFlag="-o"
|
outputFlag="-o"
|
||||||
superClass="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractCompiler">
|
superClass="org.eclipse.cdt.managedbuilder.xlc.ui.tool.abstractCompiler">
|
||||||
<inputType
|
<inputType
|
||||||
sourceContentType="org.eclipse.cdt.core.cxxSource"
|
dependencyContentType="org.eclipse.cdt.core.cxxHeader"
|
||||||
sources="c,C,cc,cxx,cpp"
|
dependencyExtensions="h,H,hpp"
|
||||||
dependencyContentType="org.eclipse.cdt.core.cxxHeader"
|
id="cdt.managedbuild.tool.xlc.cpp.compiler.input"
|
||||||
dependencyExtensions="h,H,hpp"
|
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"
|
||||||
id="cdt.managedbuild.tool.xlc.cpp.compiler.input">
|
sourceContentType="org.eclipse.cdt.core.cxxSource"
|
||||||
|
sources="c,C,cc,cxx,cpp">
|
||||||
</inputType>
|
</inputType>
|
||||||
<option
|
<option
|
||||||
category="xlc.c.compiler.category.Input"
|
category="xlc.c.compiler.category.Input"
|
||||||
|
@ -2847,11 +2848,12 @@
|
||||||
|
|
||||||
|
|
||||||
<inputType
|
<inputType
|
||||||
sourceContentType="org.eclipse.cdt.core.cSource"
|
dependencyContentType="org.eclipse.cdt.core.cHeader"
|
||||||
sources="c"
|
dependencyExtensions="h"
|
||||||
dependencyContentType="org.eclipse.cdt.core.cHeader"
|
id="cdt.managedbuild.tool.xlc.c.compiler.input"
|
||||||
dependencyExtensions="h"
|
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"
|
||||||
id="cdt.managedbuild.tool.xlc.c.compiler.input">
|
sourceContentType="org.eclipse.cdt.core.cSource"
|
||||||
|
sources="c">
|
||||||
</inputType>
|
</inputType>
|
||||||
<outputType
|
<outputType
|
||||||
outputs="o"
|
outputs="o"
|
||||||
|
@ -3159,6 +3161,15 @@
|
||||||
</projectType>
|
</projectType>
|
||||||
</wizardPage>
|
</wizardPage>
|
||||||
</extension>
|
</extension>
|
||||||
|
<extension
|
||||||
|
point="org.eclipse.core.variables.dynamicVariables">
|
||||||
|
<variable
|
||||||
|
description="%variableDescription"
|
||||||
|
name="XL_compilerRoot"
|
||||||
|
resolver="org.eclipse.cdt.managedbuilder.xlc.ui.variables.DynamicVariableResolver"
|
||||||
|
supportsArgument="false">
|
||||||
|
</variable>
|
||||||
|
</extension>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2008 IBM Corporation 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:
|
||||||
|
* IBM Corporation - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.managedbuilder.xlc.ui.variables;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin;
|
||||||
|
import org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceConstants;
|
||||||
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.variables.IDynamicVariable;
|
||||||
|
import org.eclipse.core.variables.IDynamicVariableResolver;
|
||||||
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author crecoskie
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class DynamicVariableResolver implements IDynamicVariableResolver {
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
|
||||||
|
*/
|
||||||
|
public String resolveValue(IDynamicVariable variable, String argument)
|
||||||
|
throws CoreException {
|
||||||
|
|
||||||
|
if (variable.getName().equals((PreferenceConstants.P_XL_COMPILER_ROOT))) {
|
||||||
|
IPreferenceStore prefStore = XLCUIPlugin.getDefault()
|
||||||
|
.getPreferenceStore();
|
||||||
|
return prefStore.getString(PreferenceConstants.P_XL_COMPILER_ROOT);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue