diff options
author | Chris Recoskie | 2007-09-20 17:46:29 +0000 |
---|---|---|
committer | Chris Recoskie | 2007-09-20 17:46:29 +0000 |
commit | 853d98c8dd8482b3f60ba15e36ea0e634dfd69f3 (patch) | |
tree | 4c0fda9abfc864ed71d98cda0ffbcf63982f6fc9 /xlc | |
parent | f9cb175dee658ddd9ee13794e8e8b2ede2ff9a8d (diff) | |
download | org.eclipse.cdt-853d98c8dd8482b3f60ba15e36ea0e634dfd69f3.tar.gz org.eclipse.cdt-853d98c8dd8482b3f60ba15e36ea0e634dfd69f3.tar.xz org.eclipse.cdt-853d98c8dd8482b3f60ba15e36ea0e634dfd69f3.zip |
RESOLVED - bug 201296: add support for XL C/C++ v9.0
https://bugs.eclipse.org/bugs/show_bug.cgi?id=201296
Diffstat (limited to 'xlc')
17 files changed, 1674 insertions, 132 deletions
diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/.settings/org.eclipse.jdt.core.prefs b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..d0ca27be35e --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,22 @@ +#/******************************************************************************* +# * Copyright (c) 2007 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 +# *******************************************************************************/ +#Thu Sep 20 11:01:49 EDT 2007 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.source=1.4 diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/META-INF/MANIFEST.MF b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/META-INF/MANIFEST.MF index 1ba4bd9d1c1..5d376a977f6 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/META-INF/MANIFEST.MF +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/META-INF/MANIFEST.MF @@ -2,13 +2,17 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.xlc.ui; singleton := true -Bundle-Version: 4.0.0.qualifier -Bundle-Activator: org.eclipse.cdt.managedbuilder.xlc.ui.XlcUIPlugin +Bundle-Version: 4.0.1.qualifier +Bundle-Activator: org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin Bundle-Localization: plugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.cdt.managedbuilder.core, - org.eclipse.cdt.core + org.eclipse.cdt.core, + org.eclipse.core.resources, + org.eclipse.cdt.managedbuilder.ui, + org.eclipse.cdt.ui, + org.eclipse.ui.ide Eclipse-LazyStart: true Export-Package: org.eclipse.cdt.managedbuilder.xlc.ui Bundle-Vendor: %providerName diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.properties b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.properties index 5b9604515cc..09ad04e0ea1 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.properties +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.properties @@ -1,14 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 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 - *******************************************************************************/ -pluginName = XL C/C++ Managed Build Plugin +#/******************************************************************************* +# * Copyright (c) 2006, 2007 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 +# *******************************************************************************/ +pluginName = XL C/C++ Managed Build UI Plugin providerName = Eclipse.org #Build model names @@ -55,6 +55,7 @@ OptionCategory.Optimize=Optimization OptionCategory.Comp = Compatibility OptionCategory.Misc=Miscellaneous OptionCategory.Assembler=Assembler Options +OptionCategory.General=General # generic names used by multiple options @@ -119,6 +120,7 @@ Option.Trace=Preview the steps for compilation(-#) Option.bmaxdata=Maximum size of the area shared by the static data ans the heap (-bmaxdata=) Option.c=Pass the source files through compiler component only(-c) Option.PreprocOnly=Preprocess the source files and create an output preprocessed source file (-E) +Option.PreprocRemoveComments=Remove comments from preprocessed output (-C!) Option.M=Create an output file that contains targets for the make command (-M) Option.ma=Substitute inline code for calls to alloca (-ma) Option.o=Specify an output location for the files created by the compiler (-o) @@ -211,6 +213,7 @@ Option.optimization.arch.ppcgr = PowerPC® with graphics instructions Option.optimization.arch.ppc64gr = PowerPC® 64-bit with graphics instructions Option.optimization.arch.ppc64grsq = PowerPC® 64-bit with graphics and square root instructions Option.optimization.arch.ppc64v = PowerPC® 64-bit with AltiVec +Option.optimization.tune = Specify the processor architecture to tune code for (-qtune=) Option.optimization.assert = Assert program behaviours (-qassert=) Option.optimization.Cache = Specify the cache configuration (-qcache=option1:option2:...:optionN) Option.compact = Avoid transformations that lead to code expansion (-qcompact) @@ -304,7 +307,10 @@ Option.rndflt = Control compile-time rounding mode of floating point expressions Option.rndflt.nearest = Nearest Option.rndflt.minusinf = Minus infinity Option.rndflt.plusinf = Plus infinity -Option.rndflt.zero = Zero +Option.rndflt.zero = Zero +Option.dfp = Decimal floating-point support for types and literals +Option.dfp.enabled = Enabled (-qdfp) +Option.dfp.disabled = Disabled (-qnodfp) # Compiler Customization options Option.B = Determine substitute program path name (-B) @@ -349,10 +355,12 @@ Option.xref = Produce a cross reference listing of identifiers (-qxref) Option.xref.noxref = Do not report identifiers in the program (-qnoxref) Option.xref.fullxref = Report all the identifiers in the program (-qxref = full) Option.xref.xref = Report only those identifiers which are used (-qxref) -Option.warnfourcharconsts = Enable warning of four-character constants in source +Option.warnfourcharconsts = Enable warning of four-character constants in source +Option.report = Produce listing files that show how sections of code have been optimized (-qreport) # Error Checking and Debugging Option.g = Generate debugging information (-g) +Option.optdebug = Enable debugging of optimized code (-qoptdebug) Option.DebugLevel=Debug Level Option.Debug.Min=Minimal (-g1) Option.Debug.Def=Default (-g) diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.xml b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.xml index a1b4663e79c..c30e87e7e91 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.xml +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.xml @@ -13,7 +13,7 @@ </managedBuildRevision> <tool - command="xlc" + command="${XL_compilerRoot}/xlc" id="cdt.managedbuild.tool.xlc.c.linker" name="%ToolName.linker.xlc.c" natureFilter="cnature" @@ -21,7 +21,7 @@ </tool> <tool - command="xlC" + command="${XL_compilerRoot}/xlC" id="cdt.managedbuild.tool.xlc.cpp.linker" name="%ToolName.linker.xlc.cpp" natureFilter="ccnature" @@ -69,7 +69,7 @@ </outputType> </tool> <tool - command="xlc" + command="${XL_compilerRoot}/xlc" id="cdt.managedbuild.tool.xlc.c.linker.so" isAbstract="false" name="%ToolName.linker.xlc.c.so" @@ -77,7 +77,7 @@ superClass="org.eclipse.cdt.managedbuilder.xlc.ui.tool.linker.abstractSOLinker"> </tool> <tool - command="xlC" + command="${XL_compilerRoot}/xlC" id="cdt.managedbuild.tool.xlc.cpp.linker.so" isAbstract="false" name="%ToolName.linker.xlc.cpp.so" @@ -126,7 +126,7 @@ </outputType> </tool> <tool - command="xlc" + command="${XL_compilerRoot}/xlc" id="cdt.managedbuild.tool.xlc.c.compiler" isAbstract="true" name="%ToolName.compiler.xlc.c" @@ -221,7 +221,7 @@ </option> </tool> <tool - command="xlC" + command="${XL_compilerRoot}/xlC" id="cdt.managedbuild.tool.xlc.cpp.compiler" isAbstract="true" name="%ToolName.compiler.xlc.cpp" @@ -439,7 +439,8 @@ id="cdt.managedbuild.target.xlc.exe" isAbstract="false" isTest="false" - name="%TargetName.xlc.exe"> + name="%TargetName.xlc.exe" + projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier"> <configuration name="%ConfigName.Dbg" artifactExtension="exe" @@ -457,7 +458,7 @@ id="cdt.managedbuild.target.xlc.platform.exe.debug" name="%PlatformName.Dbg" binaryParser="org.eclipse.cdt.core.XCOFF32" - osList="aix" + osList="all" archList="all"> </targetPlatform> <builder @@ -514,7 +515,7 @@ id="cdt.managedbuild.config.xlc.exe.release"> <toolChain archList="all" - osList="aix" + osList="all" name="%ToolChainName.Rel" targetTool="cdt.managedbuild.tool.xlc.c.linker.exe.release;cdt.managedbuild.tool.xlc.cpp.linker.exe.release" id="cdt.managedbuild.toolchain.xlc.exe.release"> @@ -522,7 +523,7 @@ id="cdt.managedbuild.target.xlc.platform.exe.release" name="%PlatformName.Rel" binaryParser="org.eclipse.cdt.core.XCOFF32" - osList="aix" + osList="all" archList="all"> </targetPlatform> <builder @@ -578,7 +579,8 @@ id="cdt.managedbuild.target.xlc.so" isAbstract="false" isTest="false" - name="%TargetName.xlc.so"> + name="%TargetName.xlc.so" + projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier"> <configuration name="%ConfigName.Dbg" cleanCommand="rm -rf" @@ -593,7 +595,7 @@ id="cdt.managedbuild.target.xlc.platform.so.debug" name="%PlatformName.Dbg" binaryParser="org.eclipse.cdt.core.XCOFF32" - osList="aix" + osList="all" archList="all"> </targetPlatform> <builder @@ -656,7 +658,7 @@ id="cdt.managedbuild.target.xlc.platform.so.release" name="%PlatformName.Rel" binaryParser="org.eclipse.cdt.core.XCOFF32" - osList="aix" + osList="all" archList="all"> </targetPlatform> <builder @@ -712,7 +714,8 @@ id="cdt.managedbuild.target.xlc.lib" isAbstract="false" isTest="false" - name="%TargetName.xlc.lib"> + name="%TargetName.xlc.lib" + projectMacroSupplier="org.eclipse.cdt.managedbuilder.xlc.ui.XLCProjectMacroSupplier"> <configuration name="%ConfigName.Dbg" cleanCommand="rm -rf" @@ -727,7 +730,7 @@ id="cdt.managedbuild.target.xlc.platform.lib.debug" name="%PlatformName.Dbg" binaryParser="org.eclipse.cdt.core.XCOFF32" - osList="aix" + osList="all" archList="all"> </targetPlatform> <builder @@ -786,7 +789,7 @@ id="cdt.managedbuild.target.xlc.platform.lib.release" name="%PlatformName.Rel" binaryParser="org.eclipse.cdt.core.XCOFF32" - osList="aix" + osList="all" archList="all"> </targetPlatform> <builder @@ -894,18 +897,18 @@ id="xlc.c.compiler.option.input.asm" valueType="enumerated"> <enumeratedOptionValue - id="org.eclipse.cdt.managedbuilder.xlc.ui.enumeratedOptionValue2" + id="xlc.c.compiler.option.input.asm.default" isDefault="true" name="Default"> </enumeratedOptionValue> <enumeratedOptionValue command="-qasm=stdcpp" - id="org.eclipse.cdt.managedbuilder.xlc.ui.enumeratedOptionValue6" + id="xlc.c.compiler.option.input.asm.stdcpp" name="Standard (-qasm=stdcpp)"> </enumeratedOptionValue> <enumeratedOptionValue command="-qasm=gcc" - id="org.eclipse.cdt.managedbuilder.xlc.ui.enumeratedOptionValue4" + id="xlc.c.compiler.option.input.asm.gcc" name="GCC (-qasm=gcc)"> </enumeratedOptionValue> </option> @@ -915,7 +918,7 @@ name="%Option.qcomplexgccincl" category="xlc.c.compiler.category.Input" command="-qcomplexgccincl" - id="xlc.c.compiler.option.include.qcomplexgccincl" + id="xlc.c.compiler.option.input.qcomplexgccincl" valueType="includePath" browseType="directory"> </option> @@ -925,7 +928,7 @@ name="%Option.Mbcs" category="xlc.c.compiler.category.Input" command="-qmbcs" - id="xlc.c.compiler.option.misc.mbcs" + id="xlc.c.compiler.option.input.mbcs" valueType="boolean"> </option> @@ -934,7 +937,7 @@ name="%Option.Digraph" category="xlc.c.compiler.category.Input" command="-qdigraph" - id="xlc.c.compiler.option.misc.digraph" + id="xlc.c.compiler.option.input.digraph" valueType="boolean"> </option> @@ -943,7 +946,7 @@ name="%Option.Dollar" category="xlc.c.compiler.category.Input" command="-qdollar" - id="xlc.c.compiler.option.misc.dollar" + id="xlc.c.compiler.option.input.dollar" valueType="boolean"> </option> @@ -952,7 +955,7 @@ name="%Option.Incdirfirst" category="xlc.c.compiler.category.Input" command="-qidirfirst" - id="xlc.c.compiler.option.include.dirfirst" + id="xlc.c.compiler.option.input.dirfirst" valueType="boolean"> </option> @@ -1000,7 +1003,7 @@ <option category="xlc.c.compiler.category.Input" command="-qkeyword=" - id="xlc.c.compiler.option.misc.keyword" + id="xlc.c.compiler.option.input.keyword" name="%Option.Keyword" valueType="boolean"> </option> @@ -1076,7 +1079,7 @@ name="%Option.Macpstr" category="xlc.c.compiler.category.Input" command="-qmacpstr" - id="xlc.c.compiler.option.misc.macpstr" + id="xlc.c.compiler.option.input.macpstr" valueType="boolean"> </option> @@ -1118,7 +1121,7 @@ <option category="xlc.c.compiler.category.Input" command="-qstdframework" - id="org.eclipse.cdt.managedbuilder.xlc.ui.option2" + id="xlc.c.compiler.option.input.qstdframework" isAbstract="false" name="%Option.stdframework" resourceFilter="all" @@ -1126,7 +1129,7 @@ </option> <option command="-qframeworkdir" - id="org.eclipse.cdt.managedbuilder.xlc.ui.option4" + id="xlc.c.compiler.option.input.qframeworkdir" isAbstract="false" name="%Option.frameworkdirs" resourceFilter="all" @@ -1138,7 +1141,7 @@ name="%Option.Input" category="xlc.c.compiler.category.Input" command="-qnostdinc" - id="xlc.c.compiler.option.preprocessor.nostdinc" + id="xlc.c.compiler.option.input.nostdinc" valueType="boolean"> </option> @@ -1147,7 +1150,7 @@ name="%Option.Trigraph" category="xlc.c.compiler.category.Input" command="-qtrigraph" - id="xlc.c.compiler.option.misc.trigraph" + id="xlc.c.compiler.option.input.trigraph" valueType="boolean"> </option> <option @@ -1155,7 +1158,7 @@ name="%Option.Utf" category="xlc.c.compiler.category.Input" command="-qutf" - id="xlc.c.compiler.option.misc.utf" + id="xlc.c.compiler.option.input.utf" valueType="boolean"> </option> @@ -1180,7 +1183,7 @@ valueType="string"> </option> <option - applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.HiddenOptionApplicabilityCalculator" + applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.HiddenOptionApplicabilityCalculator" category="xlc.c.compiler.category.output" command="-c" defaultValue="true" @@ -1201,7 +1204,7 @@ name="%Option.M" category="xlc.c.compiler.category.output" command="-M" - id="xlc.c.compiler.option.preprocessor.M" + id="xlc.c.compiler.option.output.M" valueType="boolean"> </option> @@ -1210,7 +1213,7 @@ name="%Option.P" category="xlc.c.compiler.category.output" command="-P" - id="xlc.c.compiler.option.preprocessor.P" + id="xlc.c.compiler.option.output.P" valueType="boolean"> </option> @@ -1219,7 +1222,7 @@ name="%Option.Assem" category="xlc.c.compiler.category.output" command="-S" - id="xlc.c.compiler.option.misc.assem" + id="xlc.c.compiler.option.output.assem" valueType="boolean"> </option> @@ -1236,7 +1239,7 @@ name="%Option.64" category="xlc.c.compiler.category.output" command="-q64" - id="xlc.c.compiler.option.misc.64" + id="xlc.c.compiler.option.output.64" valueType="boolean"> </option> <option @@ -1291,7 +1294,7 @@ name="%Option.alloca" category="xlc.c.compiler.category.output" command="-qalloca" - id="xlc.c.compiler.option.misc.alloca" + id="xlc.c.compiler.option.output.alloca" valueType="boolean"> </option> @@ -1299,21 +1302,21 @@ defaultValue="false" name="%Option.Bitfields" category="xlc.c.compiler.category.output" - id="xlc.c.compiler.option.signedness.bitfields" + id="xlc.c.compiler.option.output.bitfields" valueType="enumerated"> <enumeratedOptionValue - id="xlc.c.compiler.option.signedness.bitfields.default" + id="xlc.c.compiler.option.output.bitfields.default" isDefault="true" name="%Option.default"> </enumeratedOptionValue> <enumeratedOptionValue command="-qbitfields=signed" - id="xlc.c.compiler.option.signedness.bitfields.signed" + id="xlc.c.compiler.option.output.bitfields.signed" name="%Option.Bitfields.signed"> </enumeratedOptionValue> <enumeratedOptionValue command="-qbitfields=unsigned" - id="xlc.c.compiler.option.signedness.bitfields.unsigned" + id="xlc.c.compiler.option.output.bitfields.unsigned" name="%Option.Bitfields.unsigned"> </enumeratedOptionValue> </option> @@ -1322,20 +1325,20 @@ defaultValue="false" name="%Option.Chars" category="xlc.c.compiler.category.output" - id="xlc.c.compiler.option.signedness.chars" + id="xlc.c.compiler.option.output.chars" valueType="enumerated"> <enumeratedOptionValue - id="xlc.c.compiler.option.signedness.chars.default" + id="xlc.c.compiler.option.output.chars.default" name="%Option.default"> </enumeratedOptionValue> <enumeratedOptionValue command="-qchars=signed" - id="org.eclipse.cdt.managedbuilder.xlc.ui.enumeratedOptionValue2" + id="xlc.c.compiler.option.output.chars.signed" name="%Option.chars.signed"> </enumeratedOptionValue> <enumeratedOptionValue command="-qchars=unsigned" - id="org.eclipse.cdt.managedbuilder.xlc.ui.enumeratedOptionValue4" + id="xlc.c.compiler.option.output.chars.unsigned" name="%Option.chars.unsigned"> </enumeratedOptionValue> </option> @@ -1344,84 +1347,84 @@ name="%Option.enablevmx" category="xlc.c.compiler.category.output" command="-qenablevmx" - id="xlc.c.compiler.option.objectcode.enablevmx" + id="xlc.c.compiler.option.output.enablevmx" valueType="boolean"> </option> <option name="%Option.Enum" category="xlc.c.compiler.category.output" - id="xlc.c.compiler.option.alignment.enum" + id="xlc.c.compiler.option.output.alignment.enum" valueType="enumerated"> <enumeratedOptionValue name="%Option.none" isDefault="false" - id="xlc.c.alignment.enum.none"> + id="xlc.c.option.output.alignment.enum.none"> </enumeratedOptionValue> <enumeratedOptionValue name="%Option.enum.Int" isDefault="false" command="-qenum=int" - id="xlc.c.alignment.enum.int"> + id="xlc.c.option.output.alignment.enum.int"> </enumeratedOptionValue> <enumeratedOptionValue name="%Option.enum.Intlong" isDefault="false" command="-qenum=intlong" - id="xlc.c.alignment.enum.intlong"> + id="xlc.c.option.output.alignment.enum.intlong"> </enumeratedOptionValue> <enumeratedOptionValue name="%Option.enum.small" isDefault="false" command="-qenum=small" - id="xlc.c.alignment.enum.small"> + id="xlc.c.option.output.alignment.enum.small"> </enumeratedOptionValue> <enumeratedOptionValue name="%Option.enum.1" isDefault="false" command="-qenum=1" - id="xlc.c.alignment.enum.1"> + id="xlc.c.option.output.alignment.enum.1"> </enumeratedOptionValue> <enumeratedOptionValue name="%Option.enum.2" isDefault="false" command="-qenum=2" - id="xlc.c.alignment.enum.2"> + id="xlc.c.option.output.alignment.enum.2"> </enumeratedOptionValue> <enumeratedOptionValue name="%Option.enum.4" isDefault="false" command="-qenum=4" - id="xlc.c.alignment.enum.4"> + id="xlc.c.option.output.alignment.enum.4"> </enumeratedOptionValue> <enumeratedOptionValue name="%Option.enum.8" isDefault="false" command="-qenum=8" - id="xlc.c.alignment.enum.8"> + id="xlc.c.option.output.alignment.enum.8"> </enumeratedOptionValue> </option> <option name="%Option.Pic" category="xlc.c.compiler.category.output" - id="xlc.c.compiler.option.objectcode.pic" + id="xlc.c.compiler.option.output.pic" valueType="enumerated"> <enumeratedOptionValue name="%Option.none" isDefault="false" - id="xlc.c.objectcode.pic.none"> + id="xlc.c.output.pic.none"> </enumeratedOptionValue> <enumeratedOptionValue name="%Option.Pic.Small" isDefault="false" command="-qpic=small" - id="xlc.c.objectcode.pic.small"> + id="xlc.c.output.pic.small"> </enumeratedOptionValue> <enumeratedOptionValue name="%Option.Pic.Large" isDefault="false" command="-qpic=large" - id="xlc.c.objectcode.pic.large"> + id="xlc.c.output.pic.large"> </enumeratedOptionValue> </option> @@ -1429,7 +1432,7 @@ category="xlc.c.compiler.category.output" command="-qfuncset" defaultValue="false" - id="xlc.c.compiler.option.objectcode.funcset" + id="xlc.c.compiler.option.output.funcset" name="%Option.funcset" valueType="boolean"> </option> @@ -1437,7 +1440,7 @@ category="xlc.c.compiler.category.output" command="-qppline" defaultValue="false" - id="xlc.c.compiler.option.objectcode.ppline" + id="xlc.c.compiler.option.output.ppline" name="%Option.ppline" valueType="boolean"> </option> @@ -1445,7 +1448,7 @@ category="xlc.c.compiler.category.output" command="-qnoro" defaultValue="false" - id="xlc.c.compiler.option.objectcode.noro" + id="xlc.c.compiler.option.output.noro" name="%Option.noro" valueType="boolean"> </option> @@ -1453,7 +1456,7 @@ category="xlc.c.compiler.category.output" command="-qnoroconst" defaultValue="false" - id="xlc.c.compiler.option.objectcode.noroconst" + id="xlc.c.compiler.option.output.noroconst" name="%Option.noroconst" valueType="boolean"> </option> @@ -1461,7 +1464,7 @@ category="xlc.c.compiler.category.output" command="-qroptr" defaultValue="false" - id="xlc.c.compiler.option.objectcode.roptr" + id="xlc.c.compiler.option.output.roptr" name="%Option.roptr" valueType="boolean"> </option> @@ -1469,7 +1472,7 @@ category="xlc.c.compiler.category.output" command="-qsaveopt" defaultValue="false" - id="xlc.c.compiler.option.objectcode.saveopt" + id="xlc.c.compiler.option.output.saveopt" name="%Option.saveopt" valueType="boolean"> </option> @@ -1477,7 +1480,7 @@ category="xlc.c.compiler.category.output" command="-qstaticinline" defaultValue="false" - id="xlc.c.compiler.option.objectcode.staticinline" + id="xlc.c.compiler.option.output.staticinline" name="%Option.staticinline" valueType="boolean"> </option> @@ -1485,7 +1488,7 @@ category="xlc.c.compiler.category.output" command="-qstatsym" defaultValue="false" - id="xlc.c.compiler.option.objectcode.statsym" + id="xlc.c.compiler.option.output.statsym" name="%Option.statsym" valueType="boolean"> </option> @@ -1493,7 +1496,7 @@ category="xlc.c.compiler.category.output" command="-qthreaded" defaultValue="false" - id="xlc.c.compiler.option.objectcode.threaded" + id="xlc.c.compiler.option.output.threaded" name="%Option.threaded" valueType="boolean"> </option> @@ -1501,7 +1504,7 @@ category="xlc.c.compiler.category.output" command="-qvrsave" defaultValue="false" - id="xlc.c.compiler.option.objectcode.vrsave" + id="xlc.c.compiler.option.output.vrsave" name="%Option.vrsave" valueType="boolean"> </option> @@ -1509,7 +1512,7 @@ category="xlc.c.compiler.category.output" command="-qweaksymbol" defaultValue="false" - id="xlc.c.compiler.option.objectcode.weaksymbol" + id="xlc.c.compiler.option.output.weaksymbol" name="%Option.weaksymbol" valueType="boolean"> </option> @@ -1517,7 +1520,7 @@ category="xlc.c.compiler.category.output" command="-qxcall" defaultValue="false" - id="xlc.c.compiler.option.objectcode.xcall" + id="xlc.c.compiler.option.output.xcall" name="%Option.xcall" valueType="boolean"> </option> @@ -1569,55 +1572,27 @@ valueType="enumerated" > <enumeratedOptionValue - id="org.eclipse.cdt.managedbuilder.xlc.ui.enumeratedOptionValue12" + id="xlc.c.compiler.option.optimization.inlining.default" isDefault="true" name="%Option.default"> </enumeratedOptionValue> <enumeratedOptionValue command="-Q" - id="org.eclipse.cdt.managedbuilder.xlc.ui.enumeratedOptionValue14" + id="xlc.c.compiler.option.optimization.inlining.Q" name="%Option.inlining.Q"> </enumeratedOptionValue> <enumeratedOptionValue command="-Q!" - id="org.eclipse.cdt.managedbuilder.xlc.ui.enumeratedOptionValue16" + id="xlc.c.compiler.option.optimization.inlining.Qexclamation" name="%Option.inlining.Qexclamation"> </enumeratedOptionValue> </option> - <option - name="%Option.aggrcopy" - category="xlc.c.compiler.category.optimization" - id="xlc.c.compiler.option.optimization.aggrcopy" - valueType="enumerated"> - <enumeratedOptionValue - name="%Option.none" - isDefault="false" - id="xlc.c.optimization.aggrcopy.none"> - </enumeratedOptionValue> - <enumeratedOptionValue - name="%Option.aggrcopy.nooverlap" - command="-qaggrcopy=nooverlap" - id="xlc.c.optimization.aggrcopy.nooverlap"> - </enumeratedOptionValue> - <enumeratedOptionValue - name="%Option.aggrcopy.overlap" - command="-qaggrcopy=overlap" - id="xlc.c.optimization.aggrcopy.overlap"> - </enumeratedOptionValue> - </option> - - <option - name="%Option.alias" - category="xlc.c.compiler.category.optimization" - command="-qalias=" - id="xlc.c.compiler.option.optimization.alias" - valueType="string"> - </option> - <option - name="%Option.optimization.arch" - category="xlc.c.compiler.category.optimization" - id="xlc.c.compiler.option.optimization.arch" - valueType="enumerated"> + <option + applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv8ApplicabiltyCalculator" + category="xlc.c.compiler.category.optimization" + id="xlc.c.compiler.option.optimization.arch" + name="%Option.optimization.arch" + valueType="enumerated"> <enumeratedOptionValue id="xlc.c.compiler.option.optimization.arch.default" isDefault="true" @@ -1744,6 +1719,357 @@ name="RS64III"> </enumeratedOptionValue> </option> + <option + applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv9ApplicabilityCalculator" + category="xlc.c.compiler.category.optimization" + id="xlc.c.compiler.option.optimization.arch.9.0" + name="%Option.optimization.arch" + valueType="enumerated"> + <enumeratedOptionValue + id="xlc.c.compiler.option.optimization.arch.default" + isDefault="true" + name="%Option.default"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=auto" + id="xlc.c.compiler.option.optimization.arch.auto" + name="auto"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=403" + id="xlc.c.compiler.option.optimization.arch.403" + name="PowerPC® 403"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=604" + id="xlc.c.compiler.option.optimization.arch.604" + name="PowerPC® 604"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=pwr3" + id="xlc.c.compiler.option.optimization.arch.pwr3" + name="POWER3(TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=pwr4" + id="xlc.c.compiler.option.optimization.arch.pwr4" + name="POWER4(TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=pwr5" + id="xlc.c.compiler.option.optimization.arch.pwr5" + name="POWER5(TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=ppc" + id="xlc.c.compiler.option.optimization.arch.ppc" + name="PowerPC®"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=ppc64" + id="xlc.c.compiler.option.optimization.arch.ppc64" + name="%Option.optimization.arch.ppc64"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=ppcgr" + id="xlc.c.compiler.option.optimization.arch.ppcgr" + name="%Option.optimization.arch.ppcgr"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=ppc64gr" + id="xlc.c.compiler.option.optimization.arch.ppc64gr" + name="%Option.optimization.arch.ppc64gr"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=ppcs4grsq" + id="xlc.c.compiler.option.optimization.arch.ppc64grsq" + name="%Option.optimization.arch.ppc64grsq"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=ppc64v" + id="xlc.c.compiler.option.optimization.arch.ppc64v" + name="%Option.optimization.arch.ppc64v"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=ppc970" + id="xlc.c.compiler.option.optimization.arch.ppc970" + name="PowerPC® 970"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=rs64a" + id="xlc.c.compiler.option.optimization.arch.rs64a" + name="RS64I"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=rs64b" + id="xlc.c.compiler.option.optimization.arch.rs64b" + name="RS64II"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=rs64c" + id="xlc.c.compiler.option.optimization.arch.rs64c" + name="RS64III"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=pwr6" + id="xlc.c.compiler.option.optimization.arch.pwr6" + name="POWER6 (TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qarch=pwr6e" + id="xlc.c.compiler.option.optimization.arch.pwr6e" + name="POWER6 (TM) e"> + </enumeratedOptionValue> + </option> + <option + applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv8ApplicabiltyCalculator" + category="xlc.c.compiler.category.optimization" + id="xlc.c.compiler.option.optimization.tune" + name="%Option.optimization.tune" + valueType="enumerated"> + <enumeratedOptionValue + id="xlc.c.compiler.option.optimization.tune.default" + isDefault="true" + name="%Option.default"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=auto" + id="xlc.c.compiler.option.optimization.tune.auto" + name="auto"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=403" + id="xlc.c.compiler.option.optimization.tune.403" + name="PowerPC® 403"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=601" + id="xlc.c.compiler.option.optimization.tune.601" + name="PowerPC® 601"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=602" + id="xlc.c.compiler.option.optimization.tune.602" + name="PowerPC® 602"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=603" + id="xlc.c.compiler.option.optimization.tune.603" + name="PowerPC® 603"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=604" + id="xlc.c.compiler.option.optimization.tune.604" + name="PowerPC® 604"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=pwr" + id="xlc.c.compiler.option.optimization.tune.pwr" + name="POWER(TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=pwr2" + id="xlc.c.compiler.option.optimization.tune.pwr2" + name="POWER2(TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=pwr2s" + id="xlc.c.compiler.option.optimization.tune.pwr2s" + name="POWER2(TM) s"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=pwr2sc" + id="xlc.c.compiler.option.optimization.tune.pwr2sc" + name="POWER2(TM) Super Chip"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=pwr3" + id="xlc.c.compiler.option.optimization.tune.pwr3" + name="POWER3(TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=pwr4" + id="xlc.c.compiler.option.optimization.tune.pwr4" + name="POWER4(TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=pwr5" + id="xlc.c.compiler.option.optimization.tune.pwr5" + name="POWER5(TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppc" + id="xlc.c.compiler.option.optimization.tune.ppc" + name="PowerPC®"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppc64" + id="xlc.c.compiler.option.optimization.tune.ppc64" + name="%Option.optimization.arch.ppc64"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppcgr" + id="xlc.c.compiler.option.optimization.tune.ppcgr" + name="%Option.optimization.arch.ppcgr"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppc64gr" + id="xlc.c.compiler.option.optimization.tune.ppc64gr" + name="%Option.optimization.arch.ppc64gr"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppcs4grsq" + id="xlc.c.compiler.option.optimization.tune.ppc64grsq" + name="%Option.optimization.arch.ppc64grsq"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppc64v" + id="xlc.c.compiler.option.optimization.tune.ppc64v" + name="%Option.optimization.arch.ppc64v"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppc970" + id="xlc.c.compiler.option.optimization.tune.ppc970" + name="PowerPC® 970"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=rs64a" + id="xlc.c.compiler.option.optimization.tune.rs64a" + name="RS64I"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=rs64b" + id="xlc.c.compiler.option.optimization.tune.rs64b" + name="RS64II"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=rs64c" + id="xlc.c.compiler.option.optimization.tune.rs64c" + name="RS64III"> + </enumeratedOptionValue> + </option> + <option + applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv9ApplicabilityCalculator" + category="xlc.c.compiler.category.optimization" + id="xlc.c.compiler.option.optimization.tune.9.0" + name="%Option.optimization.tune" + valueType="enumerated"> + <enumeratedOptionValue + id="xlc.c.compiler.option.optimization.tune.default" + isDefault="true" + name="%Option.default"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=auto" + id="xlc.c.compiler.option.optimization.tune.auto" + name="auto"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=403" + id="xlc.c.compiler.option.optimization.tune.403" + name="PowerPC® 403"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=604" + id="xlc.c.compiler.option.optimization.tune.604" + name="PowerPC® 604"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=pwr3" + id="xlc.c.compiler.option.optimization.tune.pwr3" + name="POWER3(TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=pwr4" + id="xlc.c.compiler.option.optimization.tune.pwr4" + name="POWER4(TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=pwr5" + id="xlc.c.compiler.option.optimization.tune.pwr5" + name="POWER5(TM)"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppc" + id="xlc.c.compiler.option.optimization.tune.ppc" + name="PowerPC®"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppc64" + id="xlc.c.compiler.option.optimization.tune.ppc64" + name="%Option.optimization.arch.ppc64"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppcgr" + id="xlc.c.compiler.option.optimization.tune.ppcgr" + name="%Option.optimization.arch.ppcgr"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppc64gr" + id="xlc.c.compiler.option.optimization.tune.ppc64gr" + name="%Option.optimization.arch.ppc64gr"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppcs4grsq" + id="xlc.c.compiler.option.optimization.tune.ppc64grsq" + name="%Option.optimization.arch.ppc64grsq"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppc64v" + id="xlc.c.compiler.option.optimization.tune.ppc64v" + name="%Option.optimization.arch.ppc64v"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=ppc970" + id="xlc.c.compiler.option.optimization.tune.ppc970" + name="PowerPC® 970"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=rs64a" + id="xlc.c.compiler.option.optimization.tune.rs64a" + name="RS64I"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=rs64b" + id="xlc.c.compiler.option.optimization.tune.rs64b" + name="RS64II"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qtune=rs64c" + id="xlc.c.compiler.option.optimization.tune.rs64c" + name="RS64III"> + </enumeratedOptionValue> + </option> + + <option + name="%Option.aggrcopy" + category="xlc.c.compiler.category.optimization" + id="xlc.c.compiler.option.optimization.aggrcopy" + valueType="enumerated"> + <enumeratedOptionValue + name="%Option.none" + isDefault="false" + id="xlc.c.optimization.aggrcopy.none"> + </enumeratedOptionValue> + <enumeratedOptionValue + name="%Option.aggrcopy.nooverlap" + command="-qaggrcopy=nooverlap" + id="xlc.c.optimization.aggrcopy.nooverlap"> + </enumeratedOptionValue> + <enumeratedOptionValue + name="%Option.aggrcopy.overlap" + command="-qaggrcopy=overlap" + id="xlc.c.optimization.aggrcopy.overlap"> + </enumeratedOptionValue> + </option> + + <option + name="%Option.alias" + category="xlc.c.compiler.category.optimization" + command="-qalias=" + id="xlc.c.compiler.option.optimization.alias" + valueType="string"> + </option> <option name="%Option.optimization.Cache" category="xlc.c.compiler.category.optimization" @@ -2474,6 +2800,51 @@ id="xlc.c.compiler.option.misc.other" valueType="string"> </option> + + + <!-- Version 9 Options --> + <option + applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv9ApplicabilityCalculator" + category="xlc.c.compiler.category.ifp" + id="xlc.c.compiler.option.ifp.dfp" + name="%Option.dfp" + valueType="enumerated"> + <enumeratedOptionValue + id="xlc.c.compiler.option.ifp.dfp.default" + isDefault="true" + name="%Option.default"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qdfp" + id="xlc.c.compiler.option.ifp.dfp.enabled" + name="%Option.dfp.enabled"> + </enumeratedOptionValue> + <enumeratedOptionValue + command="-qnodfp" + id="xlc.c.compiler.option.ifp.dfp.disabled" + name="%Option.dfp.disabled"> + </enumeratedOptionValue> + </option> + + <option + applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv9ApplicabilityCalculator" + category="xlc.c.compiler.category.output" + command="-C!" + defaultValue="false" + id="xlc.c.compiler.option.preprocessor.PreprocessRemoveComments" + name="%Option.PreprocRemoveComments" + valueType="boolean"> + </option> + <option + applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCv9ApplicabilityCalculator" + category="xlc.c.compiler.category.ecd" + command="-qoptdebug" + defaultValue="false" + id="xlc.c.compiler.option.ecd.optdebug" + name="%Option.optdebug" + valueType="boolean"> + </option> + <inputType sourceContentType="org.eclipse.cdt.core.cSource" @@ -2639,7 +3010,7 @@ category="xlc.c.compiler.category.linking" command="-qmkshrobj" id="xlc.c.link.option.mkshrobj" - applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.HiddenOptionApplicabilityCalculator" + applicabilityCalculator="org.eclipse.cdt.managedbuilder.xlc.ui.properties.HiddenOptionApplicabilityCalculator" valueType="boolean"> </option> <option @@ -2725,7 +3096,69 @@ id="cdt.managedbuild.tool.xlc.c.linker.so.debug.output"> </outputType> </tool> + + + + + </extension> + <extension + point="org.eclipse.ui.preferencePages"> + <page + category="org.eclipse.cdt.ui.preferences.CPluginPreferencePage" + class="org.eclipse.cdt.managedbuilder.xlc.ui.preferences.XLCompilerPreferencePage" + id="org.eclipse.cdt.managedbuilder.xlc.ui.preferences.XLCompilerPreferencePage" + name="XL C/C++ Compiler"> + </page> + </extension> + <extension + point="org.eclipse.core.runtime.preferences"> + <initializer + class="org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceInitializer"> + </initializer> + </extension> + <extension + point="org.eclipse.ui.propertyPages"> + <page + category="org.eclipse.cdt.managedbuilder.ui.properties.Page_head_build" + class="org.eclipse.cdt.managedbuilder.xlc.ui.properties.XLCompilerPropertyPage" + id="org.eclipse.cdt.managedbuilder.xlc.ui.properties.samplePropertyPage" + name="XL C/C++ Compiler"> + <filter + name="projectNature" + value="org.eclipse.cdt.managedbuilder.core.managedBuildNature"> + </filter> + <enabledWhen> + <or> + <instanceof value="org.eclipse.core.resources.IProject"/> + <instanceof value="org.eclipse.cdt.core.model.ICProject"/> + + <instanceof value="org.eclipse.core.resources.IFolder"/> + <instanceof value="org.eclipse.cdt.core.model.ICContainer"/> + + <instanceof value="org.eclipse.cdt.core.model.ITranslationUnit"/> + <instanceof value="org.eclipse.core.resources.IFile"/> + </or> + </enabledWhen> + </page> + </extension> + <extension + point="org.eclipse.cdt.managedbuilder.ui.newWizardPages"> + <wizardPage + ID="org.eclipse.cdt.managedbuilder.xlc.ui.XlcSettingsWizardPage" + operationClass="org.eclipse.cdt.managedbuilder.xlc.ui.wizards.XLCSettingsWizardRunnable" + pageClass="org.eclipse.cdt.managedbuilder.xlc.ui.wizards.XLCSettingsWizardPage"> + <projectType + projectTypeID="cdt.managedbuild.target.xlc.exe"> + </projectType> + <projectType + projectTypeID="cdt.managedbuild.target.xlc.so"> + </projectType> + <projectType + projectTypeID="cdt.managedbuild.target.xlc.lib"> + </projectType> + </wizardPage> + </extension> </plugin> diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/Messages.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/Messages.java new file mode 100644 index 00000000000..61bf3e2db07 --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/Messages.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2007 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; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.xlc.ui.messages"; //$NON-NLS-1$ + public static String XLCompilerPreferencePage_0; + public static String XLCompilerPreferencePage_1; + public static String XLCompilerPreferencePage_2; + public static String XLCompilerPropertyPage_0; + public static String XLCompilerPropertyPage_1; + public static String XLCSettingsWizardPage_0; + public static String XLCSettingsWizardPage_1; + public static String XLCSettingsWizardPage_2; + public static String XLCSettingsWizardPage_3; + public static String XLCSettingsWizardPage_4; + public static String XLCSettingsWizardPage_5; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCProjectMacroSupplier.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCProjectMacroSupplier.java new file mode 100644 index 00000000000..80db6253dd7 --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCProjectMacroSupplier.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (c) 2007 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; + +import org.eclipse.cdt.core.cdtvariables.ICdtVariable; +import org.eclipse.cdt.managedbuilder.core.IManagedProject; +import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacro; +import org.eclipse.cdt.managedbuilder.macros.IBuildMacro; +import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider; +import org.eclipse.cdt.managedbuilder.macros.IProjectBuildMacroSupplier; +import org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceConstants; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.QualifiedName; +import org.eclipse.jface.preference.IPreferenceStore; + +/** + * @author crecoskie + * + */ +public class XLCProjectMacroSupplier implements IProjectBuildMacroSupplier { + + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.macros.IProjectBuildMacroSupplier#getMacro(java.lang.String, org.eclipse.cdt.managedbuilder.core.IManagedProject, org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider) + */ + public IBuildMacro getMacro(String macroName, IManagedProject project, + IBuildMacroProvider provider) { + + if(macroName.equals(PreferenceConstants.P_XL_COMPILER_ROOT)) { + String compilerPath = null; + + // figure out compiler path from properties and preferences + + // search for property first + IProject theProject = (IProject) project.getOwner(); + try { + compilerPath = theProject.getPersistentProperty(new QualifiedName("", + PreferenceConstants.P_XL_COMPILER_ROOT)); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if(compilerPath == null) { + // use the workbench preference + IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); + compilerPath = prefStore.getString(PreferenceConstants.P_XL_COMPILER_ROOT); + } + + BuildMacro macro = new BuildMacro(macroName, ICdtVariable.VALUE_PATH_DIR, + compilerPath); + + return macro; + } + + else + return provider.getMacro(macroName, IBuildMacroProvider.CONTEXT_PROJECT, project, true); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.macros.IProjectBuildMacroSupplier#getMacros(org.eclipse.cdt.managedbuilder.core.IManagedProject, org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider) + */ + public IBuildMacro[] getMacros(IManagedProject project, + IBuildMacroProvider provider) { + + String macroName = PreferenceConstants.P_XL_COMPILER_ROOT; + + String compilerPath = null; + + // figure out compiler path from properties and preferences + + // search for property first + IProject theProject = (IProject) project.getOwner(); + try { + compilerPath = theProject.getPersistentProperty(new QualifiedName("", + PreferenceConstants.P_XL_COMPILER_ROOT)); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if(compilerPath == null) { + // use the workbench preference + IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); + compilerPath = prefStore.getString(PreferenceConstants.P_XL_COMPILER_ROOT); + } + + BuildMacro macro = new BuildMacro(macroName, ICdtVariable.VALUE_PATH_DIR, + compilerPath); + + // our array consists of our macro, plus all the macros from our parent + IBuildMacro[] parentMacros = provider.getMacros(IBuildMacroProvider.CONTEXT_PROJECT, project, true); + + int numMacros = parentMacros.length + 1; // +1 for our macro + + IBuildMacro[] macros = new IBuildMacro[numMacros]; + + macros[0] = macro; + + for(int k = 1; k < macros.length; k++) { + macros[k] = parentMacros[k-1]; + } + + return macros; + + } + +} diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XlcUIPlugin.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCUIPlugin.java index 40ae8e94834..76ab0a8704b 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XlcUIPlugin.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/XLCUIPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. + * Copyright (c) 2006 2007 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 @@ -12,22 +12,23 @@ package org.eclipse.cdt.managedbuilder.xlc.ui; import org.eclipse.core.runtime.Plugin; +import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; import java.util.*; /** * The main plugin class to be used in the desktop. */ -public class XlcUIPlugin extends Plugin { +public class XLCUIPlugin extends AbstractUIPlugin { //The shared instance. - private static XlcUIPlugin plugin; + private static XLCUIPlugin plugin; //Resource bundle. private ResourceBundle resourceBundle; /** * The constructor. */ - public XlcUIPlugin() { + public XLCUIPlugin() { super(); plugin = this; } @@ -51,7 +52,7 @@ public class XlcUIPlugin extends Plugin { /** * Returns the shared instance. */ - public static XlcUIPlugin getDefault() { + public static XLCUIPlugin getDefault() { return plugin; } @@ -60,7 +61,7 @@ public class XlcUIPlugin extends Plugin { * or 'key' if not found. */ public static String getResourceString(String key) { - ResourceBundle bundle = XlcUIPlugin.getDefault().getResourceBundle(); + ResourceBundle bundle = XLCUIPlugin.getDefault().getResourceBundle(); try { return (bundle != null) ? bundle.getString(key) : key; } catch (MissingResourceException e) { diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties new file mode 100644 index 00000000000..d2412b9d65e --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties @@ -0,0 +1,22 @@ +#/******************************************************************************* +# * Copyright (c) 2007 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 +# *******************************************************************************/ + +XLCompilerPreferencePage_0=XL C/C++ Compiler Preferences +XLCompilerPreferencePage_1=Compiler Root Path: +XLCompilerPreferencePage_2=Compiler Version: +XLCompilerPropertyPage_0=Compiler Root Path: +XLCompilerPropertyPage_1=Compiler Version: +XLCSettingsWizardPage_0=XL C/C++ Settings +XLCSettingsWizardPage_1=Compiler Root Path: +XLCSettingsWizardPage_2=Browse... +XLCSettingsWizardPage_3=Compiler Version: +XLCSettingsWizardPage_4=Please select the path to your compiler, and the version of the compiler that you are using. +XLCSettingsWizardPage_5=XL Compiler Settings diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java new file mode 100644 index 00000000000..a9ac3654a93 --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2007 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.preferences; + +/** + * Constant definitions for plug-in preferences + */ +public class PreferenceConstants { + + public static final String P_XL_COMPILER_ROOT = "XL_compilerRoot"; //$NON-NLS-1$ + + public static final String P_XLC_COMPILER_VERSION = "XLC_compilerVersion"; //$NON-NLS-1$ + + public static final String P_XL_COMPILER_VERSION_8_NAME = "v8.0"; //$NON-NLS-1$ + public static final String P_XL_COMPILER_VERSION_9_NAME = "v9.0"; //$NON-NLS-1$ + +} diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java new file mode 100644 index 00000000000..dd719712809 --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2007 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.preferences; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; + +import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin; + +/** + * Class used to initialize default preference values. + */ +public class PreferenceInitializer extends AbstractPreferenceInitializer { + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() + */ + public void initializeDefaultPreferences() { + IPreferenceStore store = XLCUIPlugin.getDefault().getPreferenceStore(); + store.setDefault(PreferenceConstants.P_XL_COMPILER_ROOT, "/opt/ibmcmp"); //$NON-NLS-1$ + store.setDefault(PreferenceConstants.P_XLC_COMPILER_VERSION, PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME); + } + +} diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java new file mode 100644 index 00000000000..ef4b4ea6699 --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * Copyright (c) 2007 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.preferences; + +import org.eclipse.jface.preference.*; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.IWorkbench; +import org.eclipse.cdt.managedbuilder.xlc.ui.Messages; +import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin; + +/** + * This class represents a preference page that + * is contributed to the Preferences dialog. By + * subclassing <samp>FieldEditorPreferencePage</samp>, we + * can use the field support built into JFace that allows + * us to create a page that is small and knows how to + * save, restore and apply itself. + * <p> + * This page is used to modify preferences only. They + * are stored in the preference store that belongs to + * the main plug-in class. That way, preferences can + * be accessed directly via the preference store. + */ + +public class XLCompilerPreferencePage + extends FieldEditorPreferencePage + implements IWorkbenchPreferencePage { + + public XLCompilerPreferencePage() { + super(FLAT); + setPreferenceStore(XLCUIPlugin.getDefault().getPreferenceStore()); + setDescription(Messages.XLCompilerPreferencePage_0); + } + + /** + * Creates the field editors. Field editors are abstractions of + * the common GUI blocks needed to manipulate various types + * of preferences. Each field editor knows how to save and + * restore itself. + */ + public void createFieldEditors() { + addField(new DirectoryFieldEditor(PreferenceConstants.P_XL_COMPILER_ROOT, + Messages.XLCompilerPreferencePage_1, getFieldEditorParent())); + + String[][] versionEntries = {{PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME, "v8.0"}, //$NON-NLS-1$ + {PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME, "v9.0"}}; //$NON-NLS-1$ + + addField(new ComboFieldEditor(PreferenceConstants.P_XLC_COMPILER_VERSION, + Messages.XLCompilerPreferencePage_2, versionEntries, getFieldEditorParent())); + + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) + */ + public void init(IWorkbench workbench) { + } + +}
\ No newline at end of file diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/HiddenOptionApplicabilityCalculator.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/HiddenOptionApplicabilityCalculator.java index a0c159d6c48..02da2ad7940 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/HiddenOptionApplicabilityCalculator.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/HiddenOptionApplicabilityCalculator.java @@ -9,7 +9,7 @@ * IBM Corporation - initial API and implementation *******************************************************************************/ -package org.eclipse.cdt.managedbuilder.xlc.ui; +package org.eclipse.cdt.managedbuilder.xlc.ui.properties; import org.eclipse.cdt.managedbuilder.core.IBuildObject; import org.eclipse.cdt.managedbuilder.core.IHoldsOptions; diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java new file mode 100644 index 00000000000..71ade735e23 --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java @@ -0,0 +1,163 @@ +/******************************************************************************* + * Copyright (c) 2007 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.properties; + +import org.eclipse.cdt.managedbuilder.ui.properties.BuildOptionComboFieldEditor; +import org.eclipse.cdt.managedbuilder.xlc.ui.Messages; +import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin; +import org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceConstants; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.QualifiedName; +import org.eclipse.jface.preference.DirectoryFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IWorkbenchPropertyPage; + +public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage { + + /* (non-Javadoc) + * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() + */ + protected void createFieldEditors() { + + Composite parent = getFieldEditorParent(); + + fPathEditor = new DirectoryFieldEditor(PreferenceConstants.P_XL_COMPILER_ROOT, + Messages.XLCompilerPropertyPage_0, parent); + addField(fPathEditor); + + IProject project = ((IResource) getElement()).getProject(); + + String currentPath = null; + + try { + currentPath = project.getPersistentProperty(new QualifiedName("", //$NON-NLS-1$ + PreferenceConstants.P_XL_COMPILER_ROOT)); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if(currentPath == null) { + // if the property isn't set, then use the workbench preference + IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); + currentPath = prefStore.getString(PreferenceConstants.P_XL_COMPILER_ROOT); + } + + fPathEditor.setStringValue(currentPath); + + String[] versionEntries = {PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME, + PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME}; + + Composite versionParent = getFieldEditorParent(); + + fVersionEditor = new BuildOptionComboFieldEditor(PreferenceConstants.P_XLC_COMPILER_VERSION, + Messages.XLCompilerPropertyPage_1, null, versionEntries, null, versionParent); + + addField(fVersionEditor); + + String currentVersion = null; + try { + currentVersion = project.getPersistentProperty(new QualifiedName("", //$NON-NLS-1$ + PreferenceConstants.P_XLC_COMPILER_VERSION)); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if(currentVersion == null) { + // if the property isn't set, then use the workbench preference + IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); + currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); + } + + Combo versionCombo = fVersionEditor.getComboControl(versionParent); + versionCombo.setText(currentVersion); + + } + + private DirectoryFieldEditor fPathEditor; + + private BuildOptionComboFieldEditor fVersionEditor; + + //private Composite parent; + + + /** + * Constructor for SamplePropertyPage. + */ + public XLCompilerPropertyPage() { + super(FieldEditorPreferencePage.FLAT); + } + + + protected void performDefaults() { + // default to whatever is set on the workbench preference + IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); + String currentPath = prefStore.getString(PreferenceConstants.P_XL_COMPILER_ROOT); + String currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); + + fPathEditor.setStringValue(currentPath); + + fVersionEditor.getComboControl(getFieldEditorParent()).setText(currentVersion); + + } + + /* (non-Javadoc) + * @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk() + */ + public boolean performOk() { + // store the value in the owner text field + try { + IProject project = ((IResource) getElement()).getProject(); + + project.setPersistentProperty(new QualifiedName("", //$NON-NLS-1$ + PreferenceConstants.P_XL_COMPILER_ROOT), fPathEditor + .getStringValue()); + + project.setPersistentProperty(new QualifiedName("", //$NON-NLS-1$ + PreferenceConstants.P_XLC_COMPILER_VERSION), fVersionEditor + .getSelection()); + } catch (CoreException e) { + return false; + } + return true; + } + + /** + * The element. + */ + private IAdaptable element; + + /* + * (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchPropertyPage#getElement() + */ + public IAdaptable getElement() { + return element; + } + + /** + * Sets the element that owns properties shown on this page. + * + * @param element + * the element + */ + public void setElement(IAdaptable element) { + this.element = element; + } + +}
\ No newline at end of file diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java new file mode 100644 index 00000000000..000af9e110d --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (c) 2007 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.properties; + +import org.eclipse.cdt.managedbuilder.core.IBuildObject; +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.IFolderInfo; +import org.eclipse.cdt.managedbuilder.core.IHoldsOptions; +import org.eclipse.cdt.managedbuilder.core.IManagedProject; +import org.eclipse.cdt.managedbuilder.core.IOption; +import org.eclipse.cdt.managedbuilder.core.IOptionApplicability; +import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin; +import org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceConstants; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.QualifiedName; +import org.eclipse.jface.preference.IPreferenceStore; + +/** + * @author crecoskie + * + */ +public class XLCv8ApplicabiltyCalculator implements IOptionApplicability { + + private boolean isVersion8(IBuildObject configuration) { + // first we check the preference for this project, if it exists + if(configuration instanceof IConfiguration) { + IConfiguration config = (IConfiguration) configuration; + IManagedProject managedProject = config.getManagedProject(); + + IProject project = (IProject) managedProject.getOwner(); + + String currentVersion = null; + try { + currentVersion = project.getPersistentProperty(new QualifiedName("", + PreferenceConstants.P_XLC_COMPILER_VERSION)); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if(currentVersion == null) { + // if the property isn't set, then use the workbench preference + IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); + currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); + } + + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME)) + return true; + } + + if(configuration instanceof IFolderInfo) { + IFolderInfo folderInfo = (IFolderInfo) configuration; + + IConfiguration config = folderInfo.getParent(); + + IManagedProject managedProject = config.getManagedProject(); + + IProject project = (IProject) managedProject.getOwner(); + + String currentVersion = null; + try { + currentVersion = project.getPersistentProperty(new QualifiedName("", + PreferenceConstants.P_XLC_COMPILER_VERSION)); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if(currentVersion == null) { + // if the property isn't set, then use the workbench preference + IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); + currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); + } + + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME)) + return true; + + } + + return false; + + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionEnabled(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) + */ + public boolean isOptionEnabled(IBuildObject configuration, + IHoldsOptions holder, IOption option) { + return isVersion8(configuration); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionUsedInCommandLine(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) + */ + public boolean isOptionUsedInCommandLine(IBuildObject configuration, + IHoldsOptions holder, IOption option) { + return isVersion8(configuration); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionVisible(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) + */ + public boolean isOptionVisible(IBuildObject configuration, + IHoldsOptions holder, IOption option) { + return isVersion8(configuration); + } +} diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java new file mode 100644 index 00000000000..9d713dd5ed8 --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java @@ -0,0 +1,119 @@ +/******************************************************************************* + * Copyright (c) 2007 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.properties; + +import org.eclipse.cdt.managedbuilder.core.IBuildObject; +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.IFolderInfo; +import org.eclipse.cdt.managedbuilder.core.IHoldsOptions; +import org.eclipse.cdt.managedbuilder.core.IManagedProject; +import org.eclipse.cdt.managedbuilder.core.IOption; +import org.eclipse.cdt.managedbuilder.core.IOptionApplicability; +import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin; +import org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceConstants; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.QualifiedName; +import org.eclipse.jface.preference.IPreferenceStore; + +/** + * @author crecoskie + * + * This applicability calculator hides/shows options that are specific to the XL compilers, v9.0 + * + */ +public class XLCv9ApplicabilityCalculator implements IOptionApplicability { + + private boolean isVersion9(IBuildObject configuration) { + // first we check the preference for this project, if it exists + if(configuration instanceof IConfiguration) { + IConfiguration config = (IConfiguration) configuration; + IManagedProject managedProject = config.getManagedProject(); + + IProject project = (IProject) managedProject.getOwner(); + + String currentVersion = null; + try { + currentVersion = project.getPersistentProperty(new QualifiedName("", + PreferenceConstants.P_XLC_COMPILER_VERSION)); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if(currentVersion == null) { + // if the property isn't set, then use the workbench preference + IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); + currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); + } + + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME)) + return true; + } + + if(configuration instanceof IFolderInfo) { + IFolderInfo folderInfo = (IFolderInfo) configuration; + + IConfiguration config = folderInfo.getParent(); + + IManagedProject managedProject = config.getManagedProject(); + + IProject project = (IProject) managedProject.getOwner(); + + String currentVersion = null; + try { + currentVersion = project.getPersistentProperty(new QualifiedName("", + PreferenceConstants.P_XLC_COMPILER_VERSION)); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if(currentVersion == null) { + // if the property isn't set, then use the workbench preference + IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); + currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); + } + + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME)) + return true; + + } + + return false; + + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionEnabled(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) + */ + public boolean isOptionEnabled(IBuildObject configuration, + IHoldsOptions holder, IOption option) { + return isVersion9(configuration); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionUsedInCommandLine(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) + */ + public boolean isOptionUsedInCommandLine(IBuildObject configuration, + IHoldsOptions holder, IOption option) { + return isVersion9(configuration); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionVisible(org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption) + */ + public boolean isOptionVisible(IBuildObject configuration, + IHoldsOptions holder, IOption option) { + return isVersion9(configuration); + } + +} diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java new file mode 100644 index 00000000000..45e7b080ac5 --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java @@ -0,0 +1,300 @@ +/******************************************************************************* + * Copyright (c) 2007 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.wizards; + +import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPage; +import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager; +import org.eclipse.cdt.managedbuilder.xlc.ui.Messages; +import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin; +import org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceConstants; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.DirectoryDialog; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; + +/** + * @author crecoskie + * + */ +public class XLCSettingsWizardPage extends MBSCustomPage { + + public static final String PAGE_ID = "org.eclipse.cdt.managedbuilder.xlc.ui.XlcSettingsWizardPage"; //$NON-NLS-1$ + + private final class BrowseButtonSelectionListener implements + SelectionListener { + private final Composite composite; + + private BrowseButtonSelectionListener(Composite composite) { + this.composite = composite; + } + + public void widgetDefaultSelected(SelectionEvent e) { + // meaningless for a button... do nothing + + } + + public void widgetSelected(SelectionEvent e) { + // open a browse dialog + DirectoryDialog dirDialog = new DirectoryDialog(composite.getShell(), SWT.APPLICATION_MODAL); + String browsedDirectory = dirDialog.open(); + fDirTextBox.setText(browsedDirectory); + + } + } + + private boolean fVisited = false; + + private Composite fComposite = null; + + private Text fDirTextBox; + + private Combo fVersionCombo; + + /** + * @param pageID + */ + public XLCSettingsWizardPage(String pageID) { + super(pageID); + } + + /** + * + */ + public XLCSettingsWizardPage() { + super(PAGE_ID); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPage#isCustomPageComplete() + */ + protected boolean isCustomPageComplete() { + // Don't allow the user to finish without visiting the page. + return fVisited; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.wizard.IWizardPage#getName() + */ + public String getName() { + String name = Messages.XLCSettingsWizardPage_0; + return name; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) + */ + public void createControl(Composite parent) { + // create a new composite + fComposite = new Composite(parent, SWT.NONE); + fComposite.setBounds(parent.getBounds()); + GridLayout layout = new GridLayout(3, false); + fComposite.setLayout(layout); + fComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + + + // set the layout data for the first column, which contains labels + GridData labelGridData = new GridData(); + + + // create the first label + Label label1 = new Label(fComposite, SWT.NONE); + label1.setText(Messages.XLCSettingsWizardPage_1); + labelGridData.widthHint = 120; + label1.setLayoutData(labelGridData); + label1.setVisible(true); + + // create the text box for the path + GridData dirBoxGridData = new GridData(); + dirBoxGridData.grabExcessHorizontalSpace = true; + dirBoxGridData.horizontalAlignment = SWT.FILL; + fDirTextBox = new Text(fComposite, SWT.SINGLE | SWT.BORDER); + fDirTextBox.setLayoutData(dirBoxGridData); + fDirTextBox.setVisible(true); + + // set the default compiler location based on preferences + IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); + String compilerPath = prefStore.getString(PreferenceConstants.P_XL_COMPILER_ROOT); + fDirTextBox.setText(compilerPath); + + // update the page manager with the setting + MBSCustomPageManager.addPageProperty(PAGE_ID, PreferenceConstants.P_XL_COMPILER_ROOT, fDirTextBox.getText()); + + fDirTextBox.addModifyListener(new ModifyListener() { + + public void modifyText(ModifyEvent e) { + // update the page manager with the setting + MBSCustomPageManager.addPageProperty(PAGE_ID, PreferenceConstants.P_XL_COMPILER_ROOT, fDirTextBox.getText()); + + } + + }); + + // create the browse button + String selectedPath = null; + GridData buttonData = new GridData(); + buttonData.horizontalAlignment = SWT.RIGHT; + Button browseButton = new Button(fComposite, SWT.PUSH); + browseButton.setAlignment(SWT.CENTER); + browseButton.setText(Messages.XLCSettingsWizardPage_2); + browseButton.addSelectionListener(new BrowseButtonSelectionListener(fComposite) + ); + + browseButton.setVisible(true); + + // create the second label + Label label2 = new Label(fComposite, SWT.NONE); + label2.setText(Messages.XLCSettingsWizardPage_3); + label2.setLayoutData(labelGridData); + + label2.setVisible(true); + + // create the version dropdown + GridData comboData = new GridData(); + comboData.horizontalSpan = 2; + comboData.grabExcessHorizontalSpace = true; + comboData.horizontalAlignment = SWT.FILL; + + fVersionCombo = new Combo(fComposite, SWT.READ_ONLY); + fVersionCombo.setLayoutData(comboData); + + // populate the combo + fVersionCombo.add(PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME); + fVersionCombo.add(PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME); + + // set the default based on the workbench preference + String compilerVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); + fVersionCombo.setText(compilerVersion); + + // update the page manager with the setting + MBSCustomPageManager.addPageProperty(PAGE_ID, PreferenceConstants.P_XLC_COMPILER_VERSION, fVersionCombo.getText()); + + fVersionCombo.addModifyListener(new ModifyListener() { + + public void modifyText(ModifyEvent e) { + // update the page manager with the setting + MBSCustomPageManager.addPageProperty(PAGE_ID, PreferenceConstants.P_XLC_COMPILER_VERSION, fVersionCombo.getText()); + + } + + }); + + fVersionCombo.setVisible(true); + + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#dispose() + */ + public void dispose() { + fComposite.dispose(); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#getControl() + */ + public Control getControl() { + return fComposite; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#getDescription() + */ + public String getDescription() { + return Messages.XLCSettingsWizardPage_4; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#getErrorMessage() + */ + public String getErrorMessage() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#getImage() + */ + public Image getImage() { + return wizard.getDefaultPageImage(); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#getMessage() + */ + public String getMessage() { + return null; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#getTitle() + */ + public String getTitle() { + return Messages.XLCSettingsWizardPage_5; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#performHelp() + */ + public void performHelp() { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#setDescription(java.lang.String) + */ + public void setDescription(String description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#setImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) + */ + public void setImageDescriptor(ImageDescriptor image) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#setTitle(java.lang.String) + */ + public void setTitle(String title) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#setVisible(boolean) + */ + public void setVisible(boolean visible) { + fComposite.setVisible(visible); + if (visible) { + fVisited = true; + } + + } + +} diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardRunnable.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardRunnable.java new file mode 100644 index 00000000000..1f4bdad73fd --- /dev/null +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardRunnable.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * Copyright (c) 2007 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.wizards; + +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.cdt.ui.wizards.CDTCommonProjectWizard; +import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager; +import org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceConstants; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.QualifiedName; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.wizard.IWizardPage; + +/** + * @author crecoskie + * + */ +public class XLCSettingsWizardRunnable implements IRunnableWithProgress { + + /** + * + */ + public XLCSettingsWizardRunnable() { + + } + + /* (non-Javadoc) + * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor) + */ + public void run(IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + // take the data from the page manager, and set the project properties with it + String compilerPath = MBSCustomPageManager.getPageProperty(XLCSettingsWizardPage.PAGE_ID, PreferenceConstants.P_XL_COMPILER_ROOT).toString(); + String compilerVersion = MBSCustomPageManager.getPageProperty(XLCSettingsWizardPage.PAGE_ID, PreferenceConstants.P_XLC_COMPILER_VERSION).toString(); + + // get a handle to the wizard + IWizardPage[] pages = MBSCustomPageManager.getPages(); + + if(pages != null && pages.length > 0) { + + CDTCommonProjectWizard wizard = (CDTCommonProjectWizard) pages[0].getWizard(); + + IProject project = wizard.getLastProject(); + + try { + project.setPersistentProperty(new QualifiedName("", + PreferenceConstants.P_XL_COMPILER_ROOT), compilerPath); + + project.setPersistentProperty(new QualifiedName("", + PreferenceConstants.P_XLC_COMPILER_VERSION), compilerVersion); + + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + } + + } + +} |