summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-11-20 16:33:19 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-11-20 16:33:19 +0000
commit52a6839cf1893c00c95443e8cde212eb19efd75d (patch)
tree19e54818433de355c21ad1aa2e9b0b748a021131
downloadrtems-eclipse-plug-in-initial-import.tar.bz2
Initial import.baseinitial-import
-rw-r--r--org.rtems.cdt.toolchain/.classpath9
-rw-r--r--org.rtems.cdt.toolchain/.project34
-rw-r--r--org.rtems.cdt.toolchain/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--org.rtems.cdt.toolchain/LICENSE7
-rw-r--r--org.rtems.cdt.toolchain/META-INF/MANIFEST.MF16
-rw-r--r--org.rtems.cdt.toolchain/build.properties8
-rw-r--r--org.rtems.cdt.toolchain/plugin.properties81
-rw-r--r--org.rtems.cdt.toolchain/plugin.xml759
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/Activator.java52
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/IsRtemsToolChainSupported.java21
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsBspDefinedSymbolsValueHandler.java58
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsCommandLineGenerator.java89
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsEnvironmentVariableSupplier.java301
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsInstallBspDirectoryValueHandler.java101
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsLinkCommandLineInfo.java23
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsManagerRelocationLinkHandler.java177
-rw-r--r--org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsScannerInfoCollector.java127
-rw-r--r--org.rtems.cdt.toolchain/templates/serial/src/Basename.c162
-rw-r--r--org.rtems.cdt.toolchain/templates/serial/template.properties3
-rw-r--r--org.rtems.cdt.toolchain/templates/serial/template.xml69
20 files changed, 2104 insertions, 0 deletions
diff --git a/org.rtems.cdt.toolchain/.classpath b/org.rtems.cdt.toolchain/.classpath
new file mode 100644
index 0000000..2409da5
--- /dev/null
+++ b/org.rtems.cdt.toolchain/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="lib" path="C:/java/eclipseSDK/plugins/org.eclipse.cdt.core.lrparser_5.0.1.200809120802.jar"/>
+ <classpathentry kind="lib" path="C:/java/eclipseSDK/plugins/org.eclipse.cdt.core.parser.upc_5.0.0.200809120802.jar"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.rtems.cdt.toolchain/.project b/org.rtems.cdt.toolchain/.project
new file mode 100644
index 0000000..1fdd4d5
--- /dev/null
+++ b/org.rtems.cdt.toolchain/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.rtems.cdt.toolchain</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.rtems.cdt.toolchain/.settings/org.eclipse.jdt.core.prefs b/org.rtems.cdt.toolchain/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..f8a6e50
--- /dev/null
+++ b/org.rtems.cdt.toolchain/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Fri Nov 07 00:24:21 PST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/org.rtems.cdt.toolchain/LICENSE b/org.rtems.cdt.toolchain/LICENSE
new file mode 100644
index 0000000..4e04964
--- /dev/null
+++ b/org.rtems.cdt.toolchain/LICENSE
@@ -0,0 +1,7 @@
+#
+# $Id$
+#
+
+All rights are temporarily reserved by author Robert Fu until
+author consults with RTEMS community and decides the final license
+to use for this RTEMS Eclipse Plug-in.
diff --git a/org.rtems.cdt.toolchain/META-INF/MANIFEST.MF b/org.rtems.cdt.toolchain/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..16cbe62
--- /dev/null
+++ b/org.rtems.cdt.toolchain/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: RTEMS Toolchain Plug-in
+Bundle-SymbolicName: org.rtems.cdt.toolchain;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.rtems.cdt.toolchain.Activator
+Bundle-Vendor: RobertF
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.eclipse.cdt.core,
+ org.eclipse.cdt.managedbuilder.core;bundle-version="5.0.1"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.core.resources
+Bundle-Localization: plugin
+Export-Package: org.rtems.cdt.toolchain
diff --git a/org.rtems.cdt.toolchain/build.properties b/org.rtems.cdt.toolchain/build.properties
new file mode 100644
index 0000000..675404c
--- /dev/null
+++ b/org.rtems.cdt.toolchain/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ templates/,\
+ LICENSE
diff --git a/org.rtems.cdt.toolchain/plugin.properties b/org.rtems.cdt.toolchain/plugin.properties
new file mode 100644
index 0000000..8b31be6
--- /dev/null
+++ b/org.rtems.cdt.toolchain/plugin.properties
@@ -0,0 +1,81 @@
+###############################################################################
+# Note about steps of updating plugin.properties:
+#
+# 0. clean then rebuild
+# 1. remove the old plugin by deleting the jar file
+# 2. start Eclipse, and then close it
+# (w/o this step, somehow it remembers old plugin, so you cannot see your
+# changes)
+# 3. copy new plugin jar file into Eclipse plugins directory
+# 4. restart Eclipse
+###############################################################################
+
+RTEMS.Debug=Debug
+RTEMS.Release=Release
+
+RTEMS.C.Linker.Shared.Libgcc=Shared libgcc (-shared-libgcc)
+RTEMS.CPP.Linker.Shared.Libgcc=Shared libgcc (-shared-libgcc)
+
+RTEMS.C.Linker.Start.Address=Start Address (-Wl,-Ttext,)
+RTEMS.CPP.Linker.Start.Address=Start Address (-Wl,-Ttext,)
+
+RTEMS.C.Compiler.CPU.Type=CPU Type (-mtune=)
+RTEMS.CPP.Compiler.CPU.Type=CPU Type (-mtune=)
+RTEMS.C.Linker.CPU.Type=CPU Type (-mtune=)
+RTEMS.CPP.Linker.CPU.Type=CPU Type (-mtune=)
+
+RTEMS.C.Compiler.Search.Path=Search Path (-B)
+RTEMS.CPP.Compiler.Search.Path=Search Path (-B)
+RTEMS.C.Link.Search.Path=Search Path (-B)
+RTEMS.CPP.Link.Search.Path=Search Path (-B)
+
+RTEMS.C.Compiler.Specs=Specs (-specs=)
+RTEMS.CPP.Compiler.Specs=Specs (-specs=)
+RTEMS.C.Linker.Specs=Specs (-specs=)
+RTEMS.CPP.Linker.Specs=Specs (-specs=)
+
+C.Link.OptionCategory.RTEMS=RTEMS Specific
+CPP.Link.OptionCategory.RTEMS=RTEMS Specific
+
+RTEMS.C.Link.Option.Mgr.Barrier=Enable Barrier
+RTEMS.CPP.Link.Option.Mgr.Barrier=Enable Barrier
+
+RTEMS.C.Link.Option.Mgr.Console=Enable Console
+RTEMS.CPP.Link.Option.Mgr.Console=Enable Console
+
+RTEMS.C.Link.Option.Mgr.Dual.Ported.Memory=Enable Dual Ported Memory
+RTEMS.CPP.Link.Option.Mgr.Dual.Ported.Memory=Enable Dual Ported Memory
+
+RTEMS.C.Link.Option.Mgr.Event=Enable Event
+RTEMS.CPP.Link.Option.Mgr.Event=Enable Event
+
+RTEMS.C.Link.Option.Mgr.File.System=Enable File System
+RTEMS.CPP.Link.Option.Mgr.File.System=Enable File System
+
+RTEMS.C.Link.Option.Mgr.IO=Enable I/O
+RTEMS.CPP.Link.Option.Mgr.IO=Enable I/O
+
+RTEMS.C.Link.Option.Mgr.Multi.Processor=Enable Multi-Processor
+RTEMS.CPP.Link.Option.Mgr.Multi.Processor=Enable Multi-Processor
+
+RTEMS.C.Link.Option.Mgr.Message=Enable Message
+RTEMS.CPP.Link.Option.Mgr.Message=Enable Message
+
+RTEMS.C.Link.Option.Mgr.Partition=Enable Partition
+RTEMS.CPP.Link.Option.Mgr.Partition=Enable Partition
+
+RTEMS.C.Link.Option.Mgr.Region=Enable Region
+RTEMS.CPP.Link.Option.Mgr.Region=Enable Region
+
+RTEMS.C.Link.Option.Mgr.Rate.Monotonic=Enable Rate Monotonic
+RTEMS.CPP.Link.Option.Mgr.Rate.Monotonic=Enable Rate Monotonic
+
+RTEMS.C.Link.Option.Mgr.Semaphore=Enable Semaphore
+RTEMS.CPP.Link.Option.Mgr.Semaphore=Enable Semaphore
+
+RTEMS.C.Link.Option.Mgr.Signal=Enable Signal
+RTEMS.CPP.Link.Option.Mgr.Signal=Enable Signal
+
+RTEMS.C.Link.Option.Mgr.Timer=Enable Timer
+RTEMS.CPP.Link.Option.Mgr.Timer=Enable Timer
+
diff --git a/org.rtems.cdt.toolchain/plugin.xml b/org.rtems.cdt.toolchain/plugin.xml
new file mode 100644
index 0000000..66a67d7
--- /dev/null
+++ b/org.rtems.cdt.toolchain/plugin.xml
@@ -0,0 +1,759 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ id="org.rtems.cdt.toolchain.RtemsGccManagedMakePerProjectProfile"
+ name="RTEMS GNU C/C++ managed make per project SCD profile"
+ point="org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile">
+ <scannerInfoCollector
+ class="org.rtems.cdt.toolchain.RtemsScannerInfoCollector"
+ scope="project"/>
+ <buildOutputProvider>
+ <open/>
+ <scannerInfoConsoleParser class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedGCCScannerInfoConsoleParser"/>
+ </buildOutputProvider>
+ <scannerInfoProvider providerId="specsFile">
+ <run
+ arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}"
+ command="i386-rtems4.9-gcc"
+ class="org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider"/>
+ <scannerInfoConsoleParser class="org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser"/>
+ </scannerInfoProvider>
+ </extension>
+
+ <extension
+ id="org.rtems.cdt.toolchain.RtemsGccManagedMakePerProjectProfileC"
+ name="RTEMS GNU C/C++ managed make per project SCD profile"
+ point="org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile">
+ <scannerInfoCollector
+ class="org.rtems.cdt.toolchain.RtemsScannerInfoCollector"
+ scope="project"/>
+ <buildOutputProvider>
+ <open/>
+ <scannerInfoConsoleParser class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedGCCScannerInfoConsoleParser"/>
+ </buildOutputProvider>
+ <scannerInfoProvider providerId="specsFile">
+ <run
+ arguments="-E -P -v -dD ${plugin_state_location}/specs.c"
+ command="i386-rtems4.9-gcc"
+ class="org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider"/>
+ <scannerInfoConsoleParser class="org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser"/>
+ </scannerInfoProvider>
+ </extension>
+
+ <extension
+ id="org.rtems.cdt.toolchain.RtemsGccManagedMakePerProjectProfileCPP"
+ name="RTEMS GNU C/C++ managed make per project SCD profile"
+ point="org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile">
+ <scannerInfoCollector
+ class="org.rtems.cdt.toolchain.RtemsScannerInfoCollector"
+ scope="project"/>
+ <buildOutputProvider>
+ <open/>
+ <scannerInfoConsoleParser class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedGCCScannerInfoConsoleParser"/>
+ </buildOutputProvider>
+ <scannerInfoProvider providerId="specsFile">
+ <run
+ arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp"
+ command="i386-rtems4.9-g++"
+ class="org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider"/>
+ <scannerInfoConsoleParser class="org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser"/>
+ </scannerInfoProvider>
+ </extension>
+
+ <extension
+ id="org.rtems.cdt.toolchain"
+ name="RTEMS Toolchain"
+ point="org.eclipse.cdt.managedbuilder.core.buildDefinitions">
+
+ <toolChain
+ id="cdt.managedbuild.toolchain.gnu.rtems.base"
+ name="RTEMS Toolchain"
+ archList="all"
+ osList="win32"
+ configurationEnvironmentSupplier="org.rtems.cdt.toolchain.RtemsEnvironmentVariableSupplier"
+ isToolChainSupported="org.rtems.cdt.toolchain.IsRtemsToolChainSupported"
+ scannerConfigDiscoveryProfileId="org.rtems.cdt.toolchain.RtemsGccManagedMakePerProjectProfile"
+ targetTool="cdt.managedbuild.tool.gnu.cpp.linker.rtems.base;cdt.managedbuild.tool.gnu.c.linker.rtems.base;cdt.managedbuild.tool.gnu.archiver">
+
+ <targetPlatform
+ id="cdt.managedbuild.target.gnu.platform.rtems.base"
+ name="Target Platform RTEMS"
+ binaryParser="org.eclipse.cdt.core.PE"
+ osList="win32"
+ archList="all">
+ </targetPlatform>
+
+ <builder
+ superClass="cdt.managedbuild.target.gnu.builder"
+ id="cdt.managedbuild.tool.gnu.builder.rtems.base">
+ </builder>
+
+ <tool
+ command="i386-rtems4.9-as"
+ id="cdt.managedbuild.tool.gnu.assembler.rtems.base"
+ superClass="cdt.managedbuild.tool.gnu.assembler"
+ commandLineGenerator="org.rtems.cdt.toolchain.RtemsCommandLineGenerator">
+ </tool>
+
+ <tool
+ command="i386-rtems4.9-ar"
+ id="cdt.managedbuild.tool.gnu.archiver.rtems.base"
+ superClass="cdt.managedbuild.tool.gnu.archiver"
+ commandLineGenerator="org.rtems.cdt.toolchain.RtemsCommandLineGenerator">
+ <enablement type="ALL">
+ <checkBuildProperty
+ property="org.eclipse.cdt.build.core.buildArtefactType"
+ value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/>
+ </enablement>
+ </tool>
+
+ <tool
+ command="i386-rtems4.9-gcc"
+ id="cdt.managedbuild.tool.gnu.c.compiler.rtems.base"
+ superClass="cdt.managedbuild.tool.gnu.c.compiler"
+ commandLineGenerator="org.rtems.cdt.toolchain.RtemsCommandLineGenerator">
+ <option
+ id="rtems.gnu.c.compiler.option.preprocessor.def.symbols"
+ superClass="gnu.c.compiler.option.preprocessor.def.symbols"
+ valueHandler="org.rtems.cdt.toolchain.RtemsBspDefinedSymbolsValueHandler">
+ </option>
+ <option
+ command="-B"
+ name="%RTEMS.C.Compiler.Search.Path"
+ id="rtems.gnu.c.compiler.option.search.path"
+ category="gnu.c.compiler.category.other"
+ valueHandler="org.rtems.cdt.toolchain.RtemsInstallBspDirectoryValueHandler"
+ valueType="string"
+ browseType="directory">
+ </option>
+ <option
+ defaultValue="bsp_specs"
+ command="-specs="
+ name="%RTEMS.C.Compiler.Specs"
+ id="rtems.gnu.c.compiler.option.specs"
+ category="gnu.c.compiler.category.other"
+ valueType="string">
+ </option>
+ <option
+ defaultValue="pentiumpro"
+ command="-mtune="
+ name="%RTEMS.C.Compiler.CPU.Type"
+ id="rtems.gnu.c.compiler.option.mtune"
+ category="gnu.c.compiler.category.other"
+ valueType="string">
+ </option>
+ <option
+ defaultValue="-qrtems -D_REENTRANT -c -fmessage-length=0"
+ id="rtems.gnu.c.compiler.option.misc.other"
+ superClass="gnu.c.compiler.option.misc.other">
+ </option>
+ <inputType
+ id="cdt.managedbuild.tool.gnu.c.compiler.input.rtems"
+ superClass="cdt.managedbuild.tool.gnu.c.compiler.input"
+ scannerConfigDiscoveryProfileId="org.rtems.cdt.toolchain.RtemsGccManagedMakePerProjectProfileC"/>
+ </tool>
+
+ <tool
+ command="i386-rtems4.9-g++"
+ id="cdt.managedbuild.tool.gnu.cpp.compiler.rtems.base"
+ superClass="cdt.managedbuild.tool.gnu.cpp.compiler"
+ commandLineGenerator="org.rtems.cdt.toolchain.RtemsCommandLineGenerator">
+ <option
+ id="rtems.gnu.cpp.compiler.option.preprocessor.def"
+ superClass="gnu.cpp.compiler.option.preprocessor.def"
+ valueHandler="org.rtems.cdt.toolchain.RtemsBspDefinedSymbolsValueHandler">
+ </option>
+ <option
+ command="-B"
+ name="%RTEMS.CPP.Compiler.Search.Path"
+ id="rtems.gnu.cpp.compiler.option.search.path"
+ category="gnu.cpp.compiler.category.other"
+ valueHandler="org.rtems.cdt.toolchain.RtemsInstallBspDirectoryValueHandler"
+ valueType="string"
+ browseType="directory">
+ </option>
+ <option
+ defaultValue="bsp_specs"
+ command="-specs="
+ name="%RTEMS.CPP.Compiler.Specs"
+ id="rtems.gnu.cpp.compiler.option.specs"
+ category="gnu.cpp.compiler.category.other"
+ valueType="string">
+ </option>
+ <option
+ defaultValue="pentiumpro"
+ command="-mtune="
+ name="%RTEMS.CPP.Compiler.CPU.Type"
+ id="rtems.gnu.cpp.compiler.option.mtune"
+ category="gnu.cpp.compiler.category.other"
+ valueType="string">
+ </option>
+ <option
+ defaultValue="-qrtems -D_REENTRANT -c -fmessage-length=0"
+ id="rtems.gnu.cpp.compiler.option.other.other"
+ superClass="gnu.cpp.compiler.option.other.other">
+ </option>
+ <inputType
+ id="cdt.managedbuild.tool.gnu.cpp.compiler.input.rtems"
+ superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"
+ scannerConfigDiscoveryProfileId="org.rtems.cdt.toolchain.RtemsGccManagedMakePerProjectProfileCPP"/>
+ </tool>
+
+ <tool
+ command="i386-rtems4.9-gcc"
+ id="cdt.managedbuild.tool.gnu.c.linker.rtems.base"
+ superClass="cdt.managedbuild.tool.gnu.c.linker"
+ commandLineGenerator="org.rtems.cdt.toolchain.RtemsCommandLineGenerator">
+ <enablement type="ALL">
+ <not>
+ <checkBuildProperty
+ property="org.eclipse.cdt.build.core.buildArtefactType"
+ value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/>
+ </not>
+ </enablement>
+
+ <optionCategory
+ owner="cdt.managedbuild.tool.gnu.c.linker.rtems.base"
+ name="%C.Link.OptionCategory.RTEMS"
+ id="gnu.c.link.category.rtems">
+ </optionCategory>
+ <option
+ defaultValue="false"
+ name="%RTEMS.C.Link.Option.Mgr.Barrier"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.barrier"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="barrier"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="true"
+ name="%RTEMS.C.Link.Option.Mgr.Console"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.console"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="console"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.C.Link.Option.Mgr.Dual.Ported.Memory"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.dual.ported.memory"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="dpmem"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.C.Link.Option.Mgr.Event"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.event"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="event"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="true"
+ name="%RTEMS.C.Link.Option.Mgr.File.System"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.filesystem"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="filesystem"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="true"
+ name="%RTEMS.C.Link.Option.Mgr.IO"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.io"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="io"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.C.Link.Option.Mgr.Multi.Processor"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.multi.processor"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="mp"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.C.Link.Option.Mgr.Message"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.message"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="msg"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.C.Link.Option.Mgr.Partition"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.partition"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="part"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.C.Link.Option.Mgr.Region"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.region"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="region"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.C.Link.Option.Mgr.Rate.Monotonic"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.rate.monotonic"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="rtmon"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="true"
+ name="%RTEMS.C.Link.Option.Mgr.Semaphore"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.semaphore"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="sem"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.C.Link.Option.Mgr.Signal"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.signal"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="signal"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.C.Link.Option.Mgr.Timer"
+ category="gnu.c.link.category.rtems"
+ id="rtems.c.link.option.mgr.timer"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="timer"
+ valueType="boolean">
+ </option>
+
+ <option
+ command="-B"
+ name="%RTEMS.C.Link.Search.Path"
+ id="rtems.gnu.c.link.option.search.path"
+ category="gnu.c.link.category.other"
+ valueHandler="org.rtems.cdt.toolchain.RtemsInstallBspDirectoryValueHandler"
+ valueType="string"
+ browseType="directory">
+ </option>
+ <option
+ defaultValue="bsp_specs"
+ command="-specs="
+ name="%RTEMS.C.Linker.Specs"
+ id="rtems.gnu.c.link.option.specs"
+ category="gnu.c.link.category.other"
+ valueType="string">
+ </option>
+ <option
+ defaultValue="pentiumpro"
+ command="-mtune="
+ name="%RTEMS.C.Linker.CPU.Type"
+ id="rtems.gnu.c.link.option.mtune"
+ category="gnu.c.link.category.other"
+ valueType="string">
+ </option>
+ <option
+ defaultValue="0x00100000"
+ command="-Wl,-Ttext,"
+ name="%RTEMS.C.Linker.Start.Address"
+ id="rtems.gnu.c.link.option.start.address"
+ category="gnu.c.link.category.other"
+ valueType="string">
+ </option>
+ <option
+ defaultValue="-qrtems -D_REENTRANT"
+ id="rtems.gnu.c.link.option.ldflags"
+ superClass="gnu.c.link.option.ldflags">
+ </option>
+ <option
+ defaultValue="true"
+ name="%RTEMS.C.Linker.Shared.Libgcc"
+ category="gnu.c.link.category.shared"
+ command="-shared-libgcc"
+ id="rtems.gnu.c.link.option.shared.libgcc"
+ valueType="boolean">
+ </option>
+ <outputType
+ id="cdt.managedbuild.tool.gnu.c.linker.rtems.so.output.base"
+ superClass="cdt.managedbuild.tool.gnu.c.linker.output.so"
+ outputs="dll">
+ </outputType>
+ </tool>
+
+ <tool
+ command="i386-rtems4.9-g++"
+ id="cdt.managedbuild.tool.gnu.cpp.linker.rtems.base"
+ superClass="cdt.managedbuild.tool.gnu.cpp.linker"
+ commandLineGenerator="org.rtems.cdt.toolchain.RtemsCommandLineGenerator">
+ <enablement type="ALL">
+ <not>
+ <checkBuildProperty
+ property="org.eclipse.cdt.build.core.buildArtefactType"
+ value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/>
+ </not>
+ </enablement>
+
+ <optionCategory
+ owner="cdt.managedbuild.tool.gnu.cpp.linker.rtems.base"
+ name="%CPP.Link.OptionCategory.RTEMS"
+ id="gnu.cpp.link.category.rtems">
+ </optionCategory>
+ <option
+ defaultValue="false"
+ name="%RTEMS.CPP.Link.Option.Mgr.Barrier"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.barrier"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="barrier"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="true"
+ name="%RTEMS.CPP.Link.Option.Mgr.Console"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.console"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="console"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.CPP.Link.Option.Mgr.Dual.Ported.Memory"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.dual.ported.memory"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="dpmem"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.CPP.Link.Option.Mgr.Event"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.event"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="event"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="true"
+ name="%RTEMS.CPP.Link.Option.Mgr.File.System"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.filesystem"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="filesystem"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="true"
+ name="%RTEMS.CPP.Link.Option.Mgr.IO"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.io"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="io"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.CPP.Link.Option.Mgr.Multi.Processor"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.multi.processor"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="mp"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.CPP.Link.Option.Mgr.Message"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.message"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="msg"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.CPP.Link.Option.Mgr.Partition"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.partition"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="part"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.CPP.Link.Option.Mgr.Region"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.region"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="region"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.CPP.Link.Option.Mgr.Rate.Monotonic"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.rate.monotonic"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="rtmon"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="true"
+ name="%RTEMS.CPP.Link.Option.Mgr.Semaphore"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.semaphore"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="sem"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.CPP.Link.Option.Mgr.Signal"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.signal"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="signal"
+ valueType="boolean">
+ </option>
+ <option
+ defaultValue="false"
+ name="%RTEMS.CPP.Link.Option.Mgr.Timer"
+ category="gnu.cpp.link.category.rtems"
+ id="rtems.cpp.link.option.mgr.timer"
+ valueHandler="org.rtems.cdt.toolchain.RtemsManagerRelocationLinkHandler"
+ valueHandlerExtraArgument="timer"
+ valueType="boolean">
+ </option>
+
+
+ <option
+ command="-B"
+ name="%RTEMS.CPP.Link.Search.Path"
+ id="rtems.gnu.cpp.link.option.search.path"
+ category="gnu.cpp.link.category.other"
+ valueHandler="org.rtems.cdt.toolchain.RtemsInstallBspDirectoryValueHandler"
+ valueType="string"
+ browseType="directory">
+ </option>
+ <option
+ defaultValue="bsp_specs"
+ command="-specs="
+ name="%RTEMS.CPP.Linker.Specs"
+ id="rtems.gnu.cpp.link.option.specs"
+ category="gnu.cpp.link.category.other"
+ valueType="string">
+ </option>
+ <option
+ defaultValue="pentiumpro"
+ command="-mtune="
+ name="%RTEMS.CPP.Linker.CPU.Type"
+ id="rtems.gnu.cpp.link.option.mtune"
+ category="gnu.cpp.link.category.other"
+ valueType="string">
+ </option>
+ <option
+ defaultValue="0x00100000"
+ command="-Wl,-Ttext,"
+ name="%RTEMS.CPP.Linker.Start.Address"
+ id="rtems.gnu.cpp.link.option.start.address"
+ category="gnu.cpp.link.category.other"
+ valueType="string">
+ </option>
+ <option
+ defaultValue="-qrtems -D_REENTRANT"
+ id="rtems.gnu.cpp.link.option.other.flags"
+ superClass="gnu.cpp.link.option.flags">
+ </option>
+ <option
+ defaultValue="true"
+ name="%RTEMS.CPP.Linker.Shared.Libgcc"
+ category="gnu.cpp.link.category.shared"
+ command="-shared-libgcc"
+ id="rtems.gnu.cpp.link.option.shared.libgcc"
+ valueType="boolean">
+ </option>
+
+ <outputType
+ id="cdt.managedbuild.tool.gnu.cpp.linker.rtems.so.output.base"
+ superClass="cdt.managedbuild.tool.gnu.cpp.linker.output.so"
+ outputs="dll">
+ </outputType>
+ </tool>
+
+ </toolChain>
+
+
+ <configuration
+ id="cdt.managedbuild.config.gnu.rtems.base"
+ cleanCommand="rm -rf"
+ artifactExtension="exe">
+ <enablement type="CONTAINER_ATTRIBUTE"
+ attribute="artifactExtension"
+ value="dll"
+ extensionAdjustment="false">
+ <checkBuildProperty
+ property="org.eclipse.cdt.build.core.buildArtefactType"
+ value="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"/>
+ </enablement>
+ <enablement type="CONTAINER_ATTRIBUTE"
+ attribute="artifactExtension"
+ value="a"
+ extensionAdjustment="false">
+ <checkBuildProperty
+ property="org.eclipse.cdt.build.core.buildArtefactType"
+ value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"/>
+ </enablement>
+ </configuration>
+
+ <projectType
+ buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe"
+ id="cdt.managedbuild.target.gnu.rtems.exe"
+ isAbstract="false"
+ isTest="false"
+ >
+ <configuration
+ name="%RTEMS.Debug"
+ cleanCommand="rm -rf"
+ id="cdt.managedbuild.config.gnu.rtems.exe.debug"
+ parent="cdt.managedbuild.config.gnu.rtems.base"
+ buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug">
+ <toolChain
+ superClass="cdt.managedbuild.toolchain.gnu.rtems.base"
+ id="cdt.managedbuild.toolchain.gnu.rtems.exe.debug">
+ <targetPlatform
+ id="cdt.managedbuild.target.gnu.platform.rtems.exe.debug"
+ superClass="cdt.managedbuild.target.gnu.platform.rtems.base">
+ </targetPlatform>
+ <tool
+ id="cdt.managedbuild.tool.gnu.cpp.compiler.rtems.exe.debug"
+ superClass="cdt.managedbuild.tool.gnu.cpp.compiler.rtems.base">
+ <option
+ id="gnu.cpp.compiler.rtems.exe.debug.option.optimization.level"
+ superClass="gnu.cpp.compiler.option.optimization.level">
+ </option>
+ <option
+ id="gnu.cpp.compiler.rtems.exe.debug.option.debugging.level"
+ superClass="gnu.cpp.compiler.option.debugging.level">
+ </option>
+ </tool>
+ <tool
+ id="cdt.managedbuild.tool.gnu.c.compiler.rtems.exe.debug"
+ superClass="cdt.managedbuild.tool.gnu.c.compiler.rtems.base">
+ <option
+ id="gnu.c.compiler.rtems.exe.debug.option.optimization.level"
+ superClass="gnu.c.compiler.option.optimization.level">
+ </option>
+ <option
+ id="gnu.c.compiler.rtems.exe.debug.option.debugging.level"
+ superClass="gnu.c.compiler.option.debugging.level">
+ </option>
+ </tool>
+ <tool
+ id="cdt.managedbuild.tool.gnu.c.linker.rtems.exe.debug"
+ superClass="cdt.managedbuild.tool.gnu.c.linker.rtems.base">
+ </tool>
+ <tool
+ id="cdt.managedbuild.tool.gnu.cpp.linker.rtems.exe.debug"
+ superClass="cdt.managedbuild.tool.gnu.cpp.linker.rtems.base">
+ </tool>
+ <tool
+ id="cdt.managedbuild.tool.gnu.assembler.rtems.exe.debug"
+ superClass="cdt.managedbuild.tool.gnu.assembler.rtems.base">
+ </tool>
+ </toolChain>
+ </configuration>
+
+ <configuration
+ name="%RTEMS.Release"
+ cleanCommand="rm -rf "
+ id="cdt.managedbuild.config.gnu.rtems.exe.release"
+ parent="cdt.managedbuild.config.gnu.rtems.base"
+ buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release">
+ <toolChain
+ id="cdt.managedbuild.toolchain.gnu.rtems.exe.release"
+ superClass="cdt.managedbuild.toolchain.gnu.rtems.base">
+ <targetPlatform
+ id="cdt.managedbuild.target.gnu.platform.rtems.exe.release"
+ superClass="cdt.managedbuild.target.gnu.platform.rtems.base">
+ </targetPlatform>
+ <tool
+ id="cdt.managedbuild.tool.gnu.cpp.compiler.rtems.exe.release"
+ superClass="cdt.managedbuild.tool.gnu.cpp.compiler.rtems.base">
+ <option
+ id="gnu.cpp.compiler.rtems.exe.release.option.optimization.level"
+ superClass="gnu.cpp.compiler.option.optimization.level">
+ </option>
+ <option
+ id="gnu.cpp.compiler.rtems.exe.release.option.debugging.level"
+ superClass="gnu.cpp.compiler.option.debugging.level">
+ </option>
+ </tool>
+ <tool
+ id="cdt.managedbuild.tool.gnu.c.compiler.rtems.exe.release"
+ superClass="cdt.managedbuild.tool.gnu.c.compiler.rtems.base">
+ <option
+ id="gnu.c.compiler.rtems.exe.release.option.optimization.level"
+ superClass="gnu.c.compiler.option.optimization.level">
+ </option>
+ <option
+ id="gnu.c.compiler.rtems.exe.release.option.debugging.level"
+ superClass="gnu.c.compiler.option.debugging.level">
+ </option>
+ </tool>
+ <tool
+ id="cdt.managedbuild.tool.gnu.c.linker.rtems.exe.release"
+ superClass="cdt.managedbuild.tool.gnu.c.linker.rtems.base">
+ </tool>
+ <tool
+ id="cdt.managedbuild.tool.gnu.cpp.linker.rtems.exe.release"
+ superClass="cdt.managedbuild.tool.gnu.cpp.linker.rtems.base">
+ </tool>
+ <tool
+ id="cdt.managedbuild.tool.gnu.assembler.rtems.exe.release"
+ superClass="cdt.managedbuild.tool.gnu.assembler.rtems.base">
+ </tool>
+ </toolChain>
+ </configuration>
+ </projectType>
+
+ </extension>
+
+ <extension
+ point="org.eclipse.cdt.core.templates">
+ <template
+ id="org.rtems.cdt.toolchain.templates.serial"
+ location="$nl$/templates/serial/template.xml"
+ filterPattern=".*"
+ projectType="org.eclipse.cdt.build.core.buildArtefactType.exe">
+ </template>
+ </extension>
+
+ <extension
+ point="org.eclipse.cdt.core.templateAssociations">
+ <template
+ id="org.rtems.cdt.toolchain.templates.serial">
+ <toolChain
+ id="cdt.managedbuild.toolchain.gnu.rtems.base">
+ </toolChain>
+ </template>
+ </extension>
+
+</plugin>
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/Activator.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/Activator.java
new file mode 100644
index 0000000..813df03
--- /dev/null
+++ b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/Activator.java
@@ -0,0 +1,52 @@
+package org.rtems.cdt.toolchain;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.rtems.cdt.toolchain";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/IsRtemsToolChainSupported.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/IsRtemsToolChainSupported.java
new file mode 100644
index 0000000..dda639d
--- /dev/null
+++ b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/IsRtemsToolChainSupported.java
@@ -0,0 +1,21 @@
+/**********************************************************************
+ * Copyright (c) 2008 RobertF.
+ * All rights reserved.
+ **********************************************************************/
+
+package org.rtems.cdt.toolchain;
+
+import org.eclipse.cdt.managedbuilder.core.IManagedIsToolChainSupported;
+import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
+
+public class IsRtemsToolChainSupported implements IManagedIsToolChainSupported {
+ public IsRtemsToolChainSupported() {
+ }
+
+ public boolean isSupported(IToolChain toolChain,
+ PluginVersionIdentifier version, String instance) {
+ return RtemsEnvironmentVariableSupplier.toolChainSupported;
+ }
+
+}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsBspDefinedSymbolsValueHandler.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsBspDefinedSymbolsValueHandler.java
new file mode 100644
index 0000000..00bed1e
--- /dev/null
+++ b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsBspDefinedSymbolsValueHandler.java
@@ -0,0 +1,58 @@
+package org.rtems.cdt.toolchain;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
+
+import org.eclipse.cdt.managedbuilder.core.IBuildObject;
+import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
+import org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+import org.eclipse.cdt.managedbuilder.core.ManagedOptionValueHandler;
+
+public class RtemsBspDefinedSymbolsValueHandler extends ManagedOptionValueHandler
+ implements IManagedOptionValueHandler {
+ private List<String> bspDefinedSymbolList;
+
+ public RtemsBspDefinedSymbolsValueHandler() {
+ bspDefinedSymbolList = RtemsScannerInfoCollector.getBspDefinedSymbols();
+ }
+
+ /**
+ * Handles transfer between values between UI element and
+ * back-end in different circumstances.
+ *
+ * @param configuration build configuration of option
+ * (may be IConfiguration or IResourceConfiguration)
+ * @param holder contains the holder of the option
+ * @param option the option that is handled
+ * @param extraArgument extra argument for handler
+ * @param event event to be handled, one of the following:
+ * (EVENT_OPEN = 1, EVENT_CLOSE = 2,
+ * EVENT_SETDEFAULT = 3,
+ * EVENT_APPLY = 4, EVENT_LOAD = 5)
+ *
+ * @return True when the event was handled, false otherwise.
+ * This enables default event handling can take place.
+ */
+ public boolean handleValue(IBuildObject configuration, IHoldsOptions holder,
+ IOption option, String extraArgument, int event) {
+ if (event == EVENT_CLOSE) return false;
+
+ try {
+ Object defaultValue = option.getDefaultValue();
+
+ if ( defaultValue==null
+ || ( defaultValue instanceof List
+ && ((List)defaultValue).size()<=0
+ )
+ ) {
+ option.setDefaultValue(bspDefinedSymbolList);
+ }
+ } catch (Exception e) {
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsCommandLineGenerator.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsCommandLineGenerator.java
new file mode 100644
index 0000000..1e52f85
--- /dev/null
+++ b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsCommandLineGenerator.java
@@ -0,0 +1,89 @@
+package org.rtems.cdt.toolchain;
+
+import java.util.HashMap;
+
+import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator;
+import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
+import org.eclipse.cdt.managedbuilder.core.ITool;
+import org.eclipse.cdt.managedbuilder.internal.core.ManagedCommandLineGenerator;
+
+public class RtemsCommandLineGenerator extends ManagedCommandLineGenerator
+ implements IManagedCommandLineGenerator {
+
+ public static final String ENV_RTEMS_TOOLSET = "RTEMS_TOOLSET";
+
+ public static final String TOOL_AR = "ar";
+ public static final String TOOL_AS = "as";
+ public static final String TOOL_GCC = "gcc";
+ public static final String TOOL_GPP = "g++";
+
+ private static final String DEFAULT_RTEMS_TOOLSET =
+ "i386-rtems4.9-ar, i386-rtems4.9-as, i386-rtems4.9-gcc, i386-rtems4.9-g++";
+
+ private static HashMap<String, String> toolCmdMap = new HashMap<String, String>(10);
+ private String toolName;
+
+ static {
+ String toolset = System.getenv(ENV_RTEMS_TOOLSET);
+ if (toolset==null) toolset = DEFAULT_RTEMS_TOOLSET;
+
+ String[] tool = toolset.split(",");
+ for (int i=0; i<tool.length; i++) {
+ String cmd = tool[i].trim();
+
+ if (cmd.endsWith(TOOL_AR)) toolCmdMap.put(TOOL_AR, cmd);
+ else if (cmd.endsWith(TOOL_AS)) toolCmdMap.put(TOOL_AS, cmd);
+ else if (cmd.endsWith(TOOL_GCC)) toolCmdMap.put(TOOL_GCC, cmd);
+ else if (cmd.endsWith(TOOL_GPP)) toolCmdMap.put(TOOL_GPP, cmd);
+ }
+ }
+
+ public RtemsCommandLineGenerator() {
+ }
+
+ public IManagedCommandLineInfo generateCommandLineInfo(ITool tool,
+ String commandName, String[] flags, String outputFlag, String outputPrefix,
+ String outputName, String[] inputResources, String commandLinePattern ) {
+
+ boolean isLinker = false;
+ String cmdName = commandName;
+ String toolId = tool.getId();
+
+ if (toolId.contains("gnu.archiver")) {
+ cmdName = toolCmdMap.get(TOOL_AR);
+
+ } else if (toolId.contains("gnu.assembler")) {
+ cmdName = toolCmdMap.get(TOOL_AS);
+
+ } else if (toolId.contains("gnu.c.compiler")) {
+ cmdName = toolCmdMap.get(TOOL_GCC);
+
+ } else if (toolId.contains("gnu.c.linker")) {
+ cmdName = toolCmdMap.get(TOOL_GCC);
+ isLinker = true;
+
+ } else if (toolId.contains("gnu.cpp.compiler")) {
+ cmdName = toolCmdMap.get(TOOL_GPP);
+
+ } else if (toolId.contains("gnu.cpp.linker")) {
+ cmdName = toolCmdMap.get(TOOL_GPP);
+ isLinker = true;
+ }
+
+ tool.setToolCommand(cmdName);
+
+ IManagedCommandLineInfo cmdLineInfo = super.generateCommandLineInfo(tool,
+ cmdName, flags, outputFlag, outputPrefix,
+ outputName, inputResources, commandLinePattern);
+ if (isLinker){
+ RtemsLinkCommandLineInfo rtemsCmdLineInfo = new RtemsLinkCommandLineInfo(
+ cmdLineInfo.getCommandLine(), cmdLineInfo.getCommandLinePattern(),
+ cmdLineInfo.getCommandName(), cmdLineInfo.getFlags(),
+ cmdLineInfo.getOutputFlag(), cmdLineInfo.getOutputPrefix(),
+ cmdLineInfo.getOutput(), cmdLineInfo.getInputs() );
+
+ return rtemsCmdLineInfo;
+
+ } else return cmdLineInfo;
+ }
+}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsEnvironmentVariableSupplier.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsEnvironmentVariableSupplier.java
new file mode 100644
index 0000000..11865ec
--- /dev/null
+++ b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsEnvironmentVariableSupplier.java
@@ -0,0 +1,301 @@
+/**********************************************************************
+ * Copyright (c) 2008 RobertF.
+ * All rights reserved.
+ **********************************************************************/
+
+package org.rtems.cdt.toolchain;
+
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
+import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
+import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
+import org.eclipse.cdt.utils.WindowsRegistry;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+
+public class RtemsEnvironmentVariableSupplier implements
+ IConfigurationEnvironmentVariableSupplier {
+ public static final String ENV_RTEMS_TOOL_DIR = "RTEMS_TOOL_DIR";
+ public static final String ENV_RTEMS_TARGET_TOOL_DIR = "RTEMS_TARGET_TOOL_DIR";
+ public static final String ENV_RTEMS_TARGET_CPU_GCC_LIB_DIR = "RTEMS_TARGET_CPU_GCC_LIB_DIR";
+ public static final String ENV_RTEMS_INSTALL_DIR = "RTEMS_INSTALL_DIR";
+ public static final String ENV_RTEMS_INSTALL_BSP_DIR = "RTEMS_INSTALL_BSP_DIR";
+
+ private static IPath toolPath; // e.g., /opt/rtems-4.9
+ private static IPath targetToolPath; // e.g., /opt/rtems-4.9/i386-rtems4.9
+ private static IPath targetCpuGccLibPath; // e.g., /opt/rtems-4.9/lib/gcc/i386-rtems4.9/4.3.2/mpentiumpro
+ private static IPath installPath; // e.g., /opt/rtems_install
+ private static IPath installBspPath; // e.g., /opt/rtems_install/i386-rtems4.9/pc686/lib
+
+ private static IBuildEnvironmentVariable evBinPath = null;
+ private static IBuildEnvironmentVariable evCIncludePath = null;
+ private static IBuildEnvironmentVariable evLibPath = null;
+
+ public static boolean toolChainSupported;
+ public static boolean isOSWindows;
+ public static String pathSeparator; // ":" on UNIX
+ private static String drivePrefix; // disk drive prefix: C: for Windows a
+ // blank for other OS
+
+ private static class RtemsBuildEnvironmentVariable implements IBuildEnvironmentVariable {
+ private final String name;
+ private final String value;
+ private final int operation;
+
+ public RtemsBuildEnvironmentVariable(String name, String value, int operation) {
+ this.name = name;
+ this.value = value;
+ this.operation = operation;
+ }
+
+ public String getName() { return name; }
+ public String getValue() { return value; }
+ public int getOperation() { return operation; }
+ public String getDelimiter() { return pathSeparator; }
+ }
+
+ static {
+ /* Some useful system properties
+
+ property Description
+ -------------- ---------------------------
+ os.name Operating system name
+ os.arch Operating system architecture
+ os.version Operating system version
+ file.separator File separator ("/" on UNIX)
+ path.separator Path separator (":" on UNIX)
+ */
+ pathSeparator = System.getProperty("path.separator");
+
+ isOSWindows = false;
+ String osName = System.getProperty("os.name");
+ if (osName != null) {
+ isOSWindows = osName.indexOf("Windows") >= 0;
+ }
+
+ drivePrefix = isOSWindows ? "C:" : "";
+
+ toolPath = getRtemsToolDirectory();
+ targetToolPath = getRtemsTargetToolDirectory();
+ targetCpuGccLibPath = getRtemsTargetCpuGccLibDirectory();
+ installPath = getRtemsInstallDirectory();
+ installBspPath = getRtemsInstallBspDirectory();
+
+ toolChainSupported = toolPath != null && targetToolPath != null
+ && installPath != null && installBspPath != null
+ && targetCpuGccLibPath != null;
+
+ StringBuffer binPathBuf = new StringBuffer();
+ StringBuffer incPathBuf = new StringBuffer();
+ StringBuffer libPathBuf = new StringBuffer();
+
+ if (toolPath != null) {
+ binPathBuf = binPathBuf.append(toolPath.append("bin").toOSString());
+ }
+
+ if (targetCpuGccLibPath != null) {
+ if (libPathBuf.length()>0) libPathBuf.append(pathSeparator);
+ libPathBuf = libPathBuf.append(targetCpuGccLibPath.toOSString());
+
+
+ IPath targetGccVersionPath;
+ try {
+ targetGccVersionPath = targetCpuGccLibPath.append("..");
+
+ IPath gccIncPath = targetGccVersionPath.append("include");
+ if (!gccIncPath.toFile().isDirectory()) {
+ targetGccVersionPath = targetCpuGccLibPath;
+ }
+ } catch (Exception e) {
+ targetGccVersionPath = targetCpuGccLibPath;
+ }
+
+ if (incPathBuf.length()>0) incPathBuf.append(pathSeparator);
+ incPathBuf = incPathBuf.append(targetGccVersionPath.append("include").toOSString());
+
+ incPathBuf.append(pathSeparator);
+ incPathBuf = incPathBuf.append(targetGccVersionPath.append("include-fixed").toOSString());
+
+ }
+
+ if (targetToolPath != null) {
+ if (binPathBuf.length()>0) binPathBuf.append(pathSeparator);
+ binPathBuf = binPathBuf.append(targetToolPath.append("bin").toOSString());
+
+ if (incPathBuf.length()>0) incPathBuf.append(pathSeparator);
+ incPathBuf = incPathBuf.append(targetToolPath.append("include").toOSString());
+
+ if (libPathBuf.length()>0) libPathBuf.append(pathSeparator);
+ libPathBuf = libPathBuf.append(targetToolPath.append("lib").toOSString());
+ }
+
+ if (installPath != null) {
+ if (binPathBuf.length()>0) binPathBuf.append(pathSeparator);
+ binPathBuf = binPathBuf.append(installPath.append("bin").toOSString());
+ }
+
+ if (installBspPath != null) {
+ if (binPathBuf.length()>0) binPathBuf.append(pathSeparator);
+ binPathBuf = binPathBuf.append(installBspPath.append("build-tools").toOSString());
+
+ IPath bspLibPath = installBspPath.append("lib");
+ if (incPathBuf.length()>0) incPathBuf.append(pathSeparator);
+ incPathBuf = incPathBuf.append(bspLibPath.append("include").toOSString());
+
+ if (libPathBuf.length()>0) libPathBuf.append(pathSeparator);
+ libPathBuf = libPathBuf.append(bspLibPath.toOSString());
+ }
+
+ evBinPath = new RtemsBuildEnvironmentVariable("PATH",
+ binPathBuf.toString(),
+ IBuildEnvironmentVariable.ENVVAR_PREPEND);
+ evCIncludePath = new RtemsBuildEnvironmentVariable("C_INCLUDE_PATH",
+ incPathBuf.toString(),
+ IBuildEnvironmentVariable.ENVVAR_PREPEND);
+ //evCppIncludePath = new RtemsBuildEnvironmentVariable("CPLUS_INCLUDE_PATH",
+ // incPath.toString(),
+ // IBuildEnvironmentVariable.ENVVAR_PREPEND);
+ evLibPath = new RtemsBuildEnvironmentVariable("LIBRARY_PATH",
+ libPathBuf.toString(),
+ IBuildEnvironmentVariable.ENVVAR_PREPEND);
+ }
+
+ public RtemsEnvironmentVariableSupplier() {
+ }
+
+ public IBuildEnvironmentVariable getVariable(String variableName,
+ IConfiguration configuration, IEnvironmentVariableProvider provider) {
+ if (evBinPath != null &&
+ variableName.equals(evBinPath.getName())) {
+ return evBinPath;
+
+ } else if (evLibPath != null &&
+ variableName.equals(evLibPath.getName())) {
+ return evLibPath;
+
+ } else if (evCIncludePath != null &&
+ variableName.equals(evCIncludePath.getName())) {
+ return evCIncludePath;
+ }
+
+ return null;
+ }
+
+ public IBuildEnvironmentVariable[] getVariables(
+ IConfiguration configuration, IEnvironmentVariableProvider provider) {
+ return new IBuildEnvironmentVariable[] {
+ evBinPath, evCIncludePath, evLibPath };
+ }
+
+ public static IPath getRtemsToolDirectory() {
+ IPath path;
+
+ // Preferred way to get RTEMS Tool directory via environment variable
+ String dir = System.getenv(ENV_RTEMS_TOOL_DIR);
+ if (dir != null) {
+ path = new Path(dir);
+ if (path.toFile().isDirectory()) return path;
+ }
+
+ // Try to locate RTEMS Tool directory at /opt/rtems
+ // User can create such a soft link to point to the latest one
+ path = new Path(drivePrefix + "/opt/rtems");
+ if (path.toFile().isDirectory()) return path;
+
+ // Try RTEMS 4.9 specific tool bin directory
+ path = new Path(drivePrefix + "/opt/rtems-4.9");
+ if (path.toFile().isDirectory()) return path;
+
+ // Still not found
+ return null;
+ }
+
+ public static IPath getRtemsTargetToolDirectory() {
+ IPath path;
+
+ // Preferred way to get RTEMS Target Tool directory via environment variable
+ String dir = System.getenv(ENV_RTEMS_TARGET_TOOL_DIR);
+ if (dir != null) {
+ path = new Path(dir);
+ if (path.toFile().isDirectory()) return path;
+ }
+
+ // Try to locate RTEMS Target Tool directory at /opt/rtems/i386-rtems4.9
+ // User can create such a soft link to point to the latest one
+ path = new Path(drivePrefix + "/opt/rtems/i386-rtems4.9");
+ if (path.toFile().isDirectory()) return path;
+
+ // Try RTEMS 4.9 specific target tool bin directory
+ path = new Path(drivePrefix + "/opt/rtems-4.9/i386-rtems4.9");
+ if (path.toFile().isDirectory()) return path;
+
+ // Still not found
+ return null;
+ }
+
+ public static IPath getRtemsTargetCpuGccLibDirectory() {
+ IPath path;
+
+ // Preferred way to get RTEMS Target Tool directory via environment variable
+ String dir = System.getenv(ENV_RTEMS_TARGET_CPU_GCC_LIB_DIR);
+ if (dir != null) {
+ path = new Path(dir);
+ if (path.toFile().isDirectory()) return path;
+ }
+
+ //Try default RTEMS 4.9 Target Tool bin directory
+ path = new Path(drivePrefix + "/opt/rtems-4.9/lib/gcc/i386-rtems4.9/4.3.2/mpentiumpro");
+ if (path.toFile().isDirectory()) return path;
+
+ // Still not found
+ return null;
+ }
+
+ public static IPath getRtemsInstallDirectory() {
+ IPath path;
+
+ // Preferred way to get RTEMS Install directory via environment variable
+ String dir = System.getenv(ENV_RTEMS_INSTALL_DIR);
+ if (dir != null) {
+ path = new Path(dir);
+ if (path.toFile().isDirectory()) return path;
+ }
+
+ // Try /opt/rtems_install
+ path = new Path(drivePrefix + "/opt/rtems_install");
+ if (path.toFile().isDirectory()) return path;
+
+ // Still not found
+ return null;
+ }
+
+ public static IPath getRtemsInstallBspDirectory() {
+ IPath path;
+
+ // Preferred way to get installed target lib directory via environment variable
+ String dir = System.getenv(ENV_RTEMS_INSTALL_BSP_DIR);
+ if (dir != null) {
+ path = new Path(dir);
+ if (path.toFile().isDirectory()) return path;
+ }
+
+ // Try /opt/rtems_install/i386-rtems4.9/pc686/lib
+ path = new Path(drivePrefix + "/opt/rtems_install/i386-rtems4.9/pc686/lib");
+ if (path.toFile().isDirectory()) return path;
+
+ // Still not found
+ return null;
+ }
+
+ public static IPath getRtemsInstallBspLibDirectory() {
+ IPath installedBspLibPath = getRtemsInstallBspDirectory();
+
+ if (installedBspLibPath != null) {
+ installedBspLibPath = installedBspLibPath.append("lib");
+ }
+
+ return installedBspLibPath;
+ }
+}
+
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsInstallBspDirectoryValueHandler.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsInstallBspDirectoryValueHandler.java
new file mode 100644
index 0000000..9be247e
--- /dev/null
+++ b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsInstallBspDirectoryValueHandler.java
@@ -0,0 +1,101 @@
+package org.rtems.cdt.toolchain;
+
+import org.eclipse.cdt.managedbuilder.core.IBuildObject;
+import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
+import org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+import org.eclipse.core.runtime.IPath;
+
+public class RtemsInstallBspDirectoryValueHandler implements IManagedOptionValueHandler {
+ private IPath installedBspLibPath; // e.g., /opt/rtems_install/i386-rtems4.9/pc686/lib
+
+ public RtemsInstallBspDirectoryValueHandler() {
+ installedBspLibPath = RtemsEnvironmentVariableSupplier.getRtemsInstallBspLibDirectory();
+ }
+
+ /**
+ * Handles transfer between values between UI element and
+ * back-end in different circumstances.
+ *
+ * @param configuration build configuration of option
+ * (may be IConfiguration or IResourceConfiguration)
+ * @param holder contains the holder of the option
+ * @param option the option that is handled
+ * @param extraArgument extra argument for handler
+ * @param event event to be handled, one of the following:
+ * (EVENT_OPEN = 1, EVENT_CLOSE = 2,
+ * EVENT_SETDEFAULT = 3,
+ * EVENT_APPLY = 4, EVENT_LOAD = 5)
+ *
+ * @return True when the event was handled, false otherwise.
+ * This enables default event handling can take place.
+ */
+ public boolean handleValue(IBuildObject configuration, IHoldsOptions holder,
+ IOption option, String extraArgument, int event) {
+ if (event == EVENT_CLOSE) return false;
+
+ try {
+ String optionValue = (String) option.getValue();
+ if (optionValue==null || optionValue.trim().length()<=0) {
+ option.setValue(installedBspLibPath.toPortableString());
+ }
+ } catch (Exception e) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Checks whether the value of an option is its default value.
+ *
+ * @param configuration build configuration of option
+ * (may be IConfiguration or IResourceConfiguration)
+ * @param holder contains the holder of the option
+ * @param option the option that is handled
+ * @param extraArgument extra argument for handler
+ *
+ * The additional options besides configuration are supplied to
+ * provide enough information for querying the default value from
+ * a potential data storage back-end.
+ *
+ * @return True if the options value is its default value and
+ * False otherwise. This enables that default event handling can
+ * take place.
+ */
+ public boolean isDefaultValue(IBuildObject configuration,
+ IHoldsOptions holder, IOption option, String extraArgument) {
+ if (installedBspLibPath==null) return false;
+
+ return installedBspLibPath.toPortableString().equals(option.getValue());
+ }
+
+ /**
+ * Checks whether an enumeration value of an option is currently a
+ * valid choice. The use-case for this method is the case, where
+ * the set of valid enumerations in the plugin.xml file changes.
+ * The UI will remove entries from selection lists if the value
+ * returns false.
+ *
+ * @param configuration build configuration of option
+ * (may be IConfiguration or IResourceConfiguration)
+ * @param holder contains the holder of the option
+ * @param option the option that is handled
+ * @param extraArgument extra argument for handler
+ * @param enumValue enumeration value that is to be checked
+ *
+ * The additional options besides configuration are supplied to
+ * provide enough information for querying information from a
+ * a potential data storage back-end.
+ *
+ * @return True if the enumeration value is valid and False
+ * otherwise.
+ */
+ public boolean isEnumValueAppropriate(IBuildObject configuration,
+ IHoldsOptions holder, IOption option, String extraArgument,
+ String enumValue) {
+ // By default return true for all the enum values.
+ return true;
+ }
+
+}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsLinkCommandLineInfo.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsLinkCommandLineInfo.java
new file mode 100644
index 0000000..a19fef1
--- /dev/null
+++ b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsLinkCommandLineInfo.java
@@ -0,0 +1,23 @@
+package org.rtems.cdt.toolchain;
+
+import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
+import org.eclipse.cdt.managedbuilder.internal.core.ManagedCommandLineInfo;
+
+public class RtemsLinkCommandLineInfo extends ManagedCommandLineInfo
+ implements IManagedCommandLineInfo {
+
+ public RtemsLinkCommandLineInfo(String commandLine,
+ String commandLinePattern, String commandName, String flags,
+ String outputFlag, String outputPrefix, String outputName,
+ String inputResources) {
+ super(commandLine, commandLinePattern, commandName, flags, outputFlag,
+ outputPrefix, outputName, inputResources);
+ }
+
+ public String getCommandLine() {
+ String defaultCmdLine = super.getCommandLine();
+ String relObjs = RtemsManagerRelocationLinkHandler.getRelocationLinkObjs();
+ return defaultCmdLine + relObjs;
+ }
+
+}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsManagerRelocationLinkHandler.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsManagerRelocationLinkHandler.java
new file mode 100644
index 0000000..5d41b60
--- /dev/null
+++ b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsManagerRelocationLinkHandler.java
@@ -0,0 +1,177 @@
+package org.rtems.cdt.toolchain;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.cdt.managedbuilder.core.IBuildObject;
+import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
+import org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+
+public class RtemsManagerRelocationLinkHandler implements
+ IManagedOptionValueHandler {
+ private static HashMap<String, Boolean> defaultMgrStatusMap = new HashMap<String, Boolean>(32);
+ private static HashMap<String, Boolean> mgrStatusMap = new HashMap<String, Boolean>(32);
+ private static HashMap<String, String> no_mgr_relMap = new HashMap<String, String>(32);
+
+ private static String bspLibDir;
+ private static String relocationLinkObjs;
+
+ static {
+ bspLibDir = " " + RtemsEnvironmentVariableSupplier.
+ getRtemsInstallBspLibDirectory().toPortableString() + "/";
+
+ defaultMgrStatusMap.put("barrier", Boolean.FALSE);
+ defaultMgrStatusMap.put("console", Boolean.TRUE);
+ defaultMgrStatusMap.put("dpmem", Boolean.FALSE);
+ defaultMgrStatusMap.put("event", Boolean.FALSE);
+ defaultMgrStatusMap.put("ext", Boolean.FALSE);
+ defaultMgrStatusMap.put("filesystem", Boolean.FALSE);
+ defaultMgrStatusMap.put("io", Boolean.TRUE);
+ defaultMgrStatusMap.put("mp", Boolean.FALSE);
+ defaultMgrStatusMap.put("msg", Boolean.FALSE);
+ defaultMgrStatusMap.put("part", Boolean.FALSE);
+ defaultMgrStatusMap.put("region", Boolean.FALSE);
+ defaultMgrStatusMap.put("rtmon", Boolean.FALSE);
+ defaultMgrStatusMap.put("sem", Boolean.FALSE);
+ defaultMgrStatusMap.put("signal", Boolean.FALSE);
+ defaultMgrStatusMap.put("timer", Boolean.FALSE);
+
+ no_mgr_relMap.put("barrier" , "no-barrier.rel");
+ no_mgr_relMap.put("console" , "no-console.rel");
+ no_mgr_relMap.put("dpmem" , "no-dpmem.rel");
+ no_mgr_relMap.put("event" , "no-event.rel");
+ no_mgr_relMap.put("ext" , "no-ext.rel");
+ no_mgr_relMap.put("filesystem", "no-filesystem.rel");
+ no_mgr_relMap.put("io" , "no-io.rel");
+ no_mgr_relMap.put("mp" , "no-mp.rel");
+ no_mgr_relMap.put("msg" , "no-msg.rel");
+ no_mgr_relMap.put("part" , "no-part.rel");
+ no_mgr_relMap.put("region" , "no-region.rel");
+ no_mgr_relMap.put("rtmon" , "no-rtmon.rel");
+ no_mgr_relMap.put("sem" , "no-sem.rel");
+ no_mgr_relMap.put("signal" , "no-signal.rel");
+ no_mgr_relMap.put("timer" , "no-timer.rel");
+ }
+
+ public RtemsManagerRelocationLinkHandler() {
+ }
+
+ /**
+ * @return the relocationLinkObjs
+ */
+ public static synchronized String getRelocationLinkObjs() {
+ return relocationLinkObjs;
+ }
+
+ private static synchronized void updateRelocationLink(String selectedMgrId,
+ Boolean enabled) {
+ StringBuilder rel = new StringBuilder(1024); // relocation link builder
+ mgrStatusMap.put(selectedMgrId, enabled);
+
+ for(Iterator<Map.Entry<String, Boolean>>
+ i = mgrStatusMap.entrySet().iterator(); i.hasNext(); ) {
+ Map.Entry<String, Boolean> entry = (Map.Entry<String, Boolean>) i.next();
+
+ String mgrId = (String)entry.getKey();
+ Boolean mgrEnabled = (Boolean) entry.getValue();
+
+ if (!mgrEnabled.booleanValue()) {
+ rel = rel.append(bspLibDir).append( no_mgr_relMap.get(mgrId) );
+ }
+ }
+
+ relocationLinkObjs = rel.toString();
+ }
+
+ /**
+ * Handles transfer between values between UI element and
+ * back-end in different circumstances.
+ *
+ * @param configuration build configuration of option
+ * (may be IConfiguration or IResourceConfiguration)
+ * @param holder contains the holder of the option
+ * @param option the option that is handled
+ * @param extraArgument extra argument for handler
+ * @param event event to be handled, one of the following:
+ * (EVENT_OPEN = 1, EVENT_CLOSE = 2,
+ * EVENT_SETDEFAULT = 3,
+ * EVENT_APPLY = 4, EVENT_LOAD = 5)
+ *
+ * @return True when the event was handled, false otherwise.
+ * This enables default event handling can take place.
+ */
+ public boolean handleValue(IBuildObject configuration, IHoldsOptions holder,
+ IOption option, String extraArgument, int event) {
+ if (event == EVENT_CLOSE) return false;
+
+ try {
+ String mgrId = extraArgument;
+ Boolean enabled = (Boolean) option.getValue();
+
+ if (enabled==null) {
+ enabled = defaultMgrStatusMap.get(mgrId);
+ option.setValue(enabled.booleanValue());
+ }
+
+ updateRelocationLink(mgrId, enabled);
+ } catch (Exception e) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Checks whether the value of an option is its default value.
+ *
+ * @param configuration build configuration of option
+ * (may be IConfiguration or IResourceConfiguration)
+ * @param holder contains the holder of the option
+ * @param option the option that is handled
+ * @param extraArgument extra argument for handler
+ *
+ * The additional options besides configuration are supplied to
+ * provide enough information for querying the default value from
+ * a potential data storage back-end.
+ *
+ * @return True if the options value is its default value and
+ * False otherwise. This enables that default event handling can
+ * take place.
+ */
+ public boolean isDefaultValue(IBuildObject configuration,
+ IHoldsOptions holder, IOption option, String extraArgument) {
+ String mgrId = extraArgument;
+ return defaultMgrStatusMap.get(mgrId).equals(option.getValue());
+ }
+
+ /**
+ * Checks whether an enumeration value of an option is currently a
+ * valid choice. The use-case for this method is the case, where
+ * the set of valid enumerations in the plugin.xml file changes.
+ * The UI will remove entries from selection lists if the value
+ * returns false.
+ *
+ * @param configuration build configuration of option
+ * (may be IConfiguration or IResourceConfiguration)
+ * @param holder contains the holder of the option
+ * @param option the option that is handled
+ * @param extraArgument extra argument for handler
+ * @param enumValue enumeration value that is to be checked
+ *
+ * The additional options besides configuration are supplied to
+ * provide enough information for querying information from a
+ * a potential data storage back-end.
+ *
+ * @return True if the enumeration value is valid and False
+ * otherwise.
+ */
+ public boolean isEnumValueAppropriate(IBuildObject configuration,
+ IHoldsOptions holder, IOption option, String extraArgument,
+ String enumValue) {
+ // By default return true for all the enum values.
+ return true;
+ }
+
+}
diff --git a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsScannerInfoCollector.java b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsScannerInfoCollector.java
new file mode 100644
index 0000000..e074544
--- /dev/null
+++ b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsScannerInfoCollector.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 RobertF
+ * 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:
+ * RobertF - Initial API and implementation
+ *******************************************************************************/
+package org.rtems.cdt.toolchain;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+
+import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
+import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
+import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
+import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
+import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
+import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
+
+/**
+ * Implementation class for gathering the built-in compiler settings for
+ * Rtems-based targets.
+ *
+ * @since 5.0.1
+ */
+public class RtemsScannerInfoCollector extends PerProjectSICollector
+ implements IScannerInfoCollector3, IManagedScannerInfoCollector {
+ // extends DefaultGCCScannerInfoCollector <- has restriction, cannot be used
+ public static final String ENV_RTEMS_BSP_DEFINED_SYMBOLS = "RTEMS_BSP_DEFINED_SYMBOLS";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(java.lang.Object, java.util.Map)
+ */
+ public void contributeToScannerConfig(Object resource, Map scannerInfo) {
+
+ List filteredIncludes = (List) scannerInfo.get(ScannerInfoTypes.INCLUDE_PATHS);
+
+ // This method will be called by the parser each time there is a new value
+ Iterator pathIter = filteredIncludes.listIterator();
+ while (pathIter.hasNext()) {
+ String incPath = (String) pathIter.next();
+ // Could find the switch to disable auto discovery, so filtered
+ // out MinGW and Cygwin default includes
+ if (incPath.contains("MinGW") || incPath.contains("mingw")
+ || incPath.contains("Cygwin") || incPath.contains("cygwin")) {
+ pathIter.remove();
+ }
+ }
+ //scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, filteredIncludes);
+
+ List definedSymbols = (List) scannerInfo.get(ScannerInfoTypes.SYMBOL_DEFINITIONS);
+
+ addBspDefinedSymbols(definedSymbols);
+
+ //scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, definedSymbols);
+
+ super.contributeToScannerConfig(resource, scannerInfo);
+ }
+
+ private static void addBspDefinedSymbols(List definedSymbols) {
+ if (definedSymbols==null) return;
+
+ String bspSymbols = System.getenv(ENV_RTEMS_BSP_DEFINED_SYMBOLS);
+ // e.g., "STDC_HEADERS,HAVE_SYS_TYPES_H,HAVE_SYS_STAT_H,HAVE_STDLIB_H..."
+ if (bspSymbols != null) {
+ String[] macro = bspSymbols.split(",");
+ for (int i=0; i<macro.length; i++) {
+ String symbol = macro[i].trim() + "=1";
+ if (!definedSymbols.contains(symbol)) definedSymbols.add(symbol);
+ }
+ }
+ }
+
+ public static List<String> getBspDefinedSymbols() {
+ ArrayList<String> definedSymbols = new ArrayList<String>();
+
+ addBspDefinedSymbols(definedSymbols);
+
+ return definedSymbols;
+ }
+
+ /**
+ * Answers a map of collected defines that the the compiler uses by default.
+ * The symbols are defined in the map as a (macro, value) pair as follows
+ * <p><p><code>-DFOO</code> will be stored as ("FOO","")
+ * <p><code>-DFOO=BAR</code> will be stored as ("FOO","BAR")
+ * <p><p>Duplicates will not be stored in the map and any whitespaces in
+ * the macro or value will be trimmed out.
+ *
+ * @return a <code>Map</code> of defined symbols and values
+ */
+ /*
+ public Map getDefinedSymbols() {
+ HashMap symbolMap = new HashMap();
+
+ String bspSymbols = System.getenv(ENV_RTEMS_BSP_DEFINED_SYMBOLS);
+ //String bspSymbols ="STDC_HEADERS,HAVE_SYS_TYPES_H,HAVE_SYS_STAT_H,HAVE_STDLIB_H,HAVE_STRING_H,HAVE_INTTYPES_H,HAVE_STDINT_H,HAVE_UNISTD_H,HAVE_CSTDIO,HAVE_CSTDLIB,HAVE_IOSTREAM";
+
+ if (bspSymbols != null) {
+ String[] macro = bspSymbols.split(",");
+ for (int i=0; i<macro.length; i++) {
+ symbolMap.put(macro[i].trim(), "1");
+ }
+ }
+
+ return symbolMap;
+ }
+ */
+
+ public void setProject(IProject project) {
+ super.setProject(project);
+ }
+
+ public void setInfoContext(InfoContext context) {
+ super.setInfoContext(context);
+ }
+}
diff --git a/org.rtems.cdt.toolchain/templates/serial/src/Basename.c b/org.rtems.cdt.toolchain/templates/serial/src/Basename.c
new file mode 100644
index 0000000..def460a
--- /dev/null
+++ b/org.rtems.cdt.toolchain/templates/serial/src/Basename.c
@@ -0,0 +1,162 @@
+/*
+ * File Name : $(baseName).c
+ * Author : $(author)
+ * Version :
+ * Description : A simple serial and shell test program if defined TEST_COM1;
+ * A serial remote debug test program otherwise
+ * Copyright : $(copyright)
+ */
+
+#define CONFIGURE_INIT
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <string.h> /* String function definitions */
+#include <unistd.h> /* UNIX standard function definitions */
+#include <fcntl.h> /* File control definitions */
+#include <errno.h> /* Error number definitions */
+#include <termios.h> /* POSIX terminal control definitions */
+
+#include <rtems.h>
+#include <rtems/shell.h>
+
+// BSP specific include
+#include <bsp.h>
+#include <bsp/uart.h>
+#include <bsp/tty_drv.h>
+
+
+extern rtems_task Init(rtems_task_argument argument);
+
+#define CONFIGURE_APPLICATION_EXTRA_DRIVERS TTY1_DRIVER_TABLE_ENTRY
+
+#ifdef RTEMS_BSP_HAS_IDE_DRIVER
+#include <libchip/ata.h> /* for ata driver prototype */
+#include <libchip/ide_ctrl.h> /* for general ide driver prototype */
+#endif
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#ifdef RTEMS_BSP_HAS_IDE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
+#endif
+#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+
+/*
+ * these values are higher than needed...
+ */
+#define CONFIGURE_MAXIMUM_TASKS 20
+#define CONFIGURE_MAXIMUM_SEMAPHORES 20
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 20
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
+#define STACK_CHECKER_ON
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_EXTRA_TASK_STACKS (6 * RTEMS_MINIMUM_STACK_SIZE)
+
+#define CONFIGURE_MALLOC_STATISTICS
+
+
+#include <rtems/confdefs.h>
+
+
+#define CONFIGURE_SHELL_COMMANDS_INIT
+#define CONFIGURE_SHELL_COMMANDS_ALL
+
+#include <rtems/shellconfig.h>
+
+extern int BSPConsolePort;
+
+/* Temporarily worked around the issue with remote_debug in i386.
+ "int remote_debug;" is defined in m68k-stub.c, but only declared
+ in i386-stub.c. Also except "remote_debug = !(remote_debug);", nowhere else
+ value is assigned to remote_debug.
+ */
+int remote_debug = 1;
+
+/*
+ * Setup GDB as described in c\src\lib\libbsp\i386\shared\comm\GDB.HOWTO.
+ *
+ * Later found similar function: init_remote_gdb in
+ * c\src\lib\libbsp\i386\shared\comm\gdb_glue.c. But it does not fit with the
+ * following hardware configuration:
+ * there exist VGA console and COM1, but not COM2.
+ */
+void setupRemoteGDB(void) {
+ // Initialize GDB glue
+ /*
+ if(BSPConsolePort != BSP_UART_COM2) {
+ // If com2 is not used as console use it for debugging
+ i386_stub_glue_init(BSP_UART_COM2);
+ } else { // Otherwise use com1 */
+ i386_stub_glue_init(BSP_UART_COM1);
+ //}
+
+ // Initialize GDB stub itself
+ set_debug_traps();
+
+ // Initialize GDB break in capability
+ // It has to be called after set_debug_traps
+ i386_stub_glue_init_breakin();
+
+ // Put breakpoint in
+ breakpoint();
+}
+
+void testIO(char *devName) {
+ char buffer[256];
+
+ #ifdef TEST_COM1
+ printf("*** Simple COM1 Test (9600 8N1) ***\n");
+ #else
+ printf("*** Simple Remote Debug Test ***\n");
+ #endif
+
+ int fd = open(devName, O_RDWR | O_NOCTTY | _FNDELAY);
+
+ int numBytes = write(fd, "Hello, I'm waiting for input...\r\n", 33);
+ if (numBytes < 0) {
+ printf("\nFailed to write to %s!\n", devName);
+ }
+
+ numBytes = read(fd, buffer, 255);
+ if (numBytes < 0) {
+ printf("\nFailed to read from %s!\n", devName);
+
+ } else {
+ buffer[numBytes] = 0; // terminate
+ printf(buffer);
+ }
+
+ close(fd);
+ }
+
+void startShell(void) {
+ printf("\n====== starting shell ======\n");
+ rtems_shell_init(
+ "SHLL", /* task_name */
+ RTEMS_MINIMUM_STACK_SIZE * 4, /* task_stacksize */
+ 100, /* task_priority */
+ "/dev/console", /* devname */
+ 0, /* forever */
+ 1 /* wait */
+ );
+}
+
+rtems_task Init(rtems_task_argument ignored) {
+#ifdef TEST_COM1
+ char devName[] = "/dev/ttyS1";
+#else
+ char devName[] = "/dev/console";
+
+ setupRemoteGDB();
+#endif
+
+ testIO(devName);
+
+ startShell();
+
+ exit( 0 );
+}
diff --git a/org.rtems.cdt.toolchain/templates/serial/template.properties b/org.rtems.cdt.toolchain/templates/serial/template.properties
new file mode 100644
index 0000000..17bc9b2
--- /dev/null
+++ b/org.rtems.cdt.toolchain/templates/serial/template.properties
@@ -0,0 +1,3 @@
+#Template Default Values
+RTEMS.Serial.Template.Label=RTEMS Serial Remote Debug Project
+RTEMS.Serial.Template.Label.Description=A skeletal RTEMS serial remote debug project. Creates a folder for sources and another for include.
diff --git a/org.rtems.cdt.toolchain/templates/serial/template.xml b/org.rtems.cdt.toolchain/templates/serial/template.xml
new file mode 100644
index 0000000..39f32b1
--- /dev/null
+++ b/org.rtems.cdt.toolchain/templates/serial/template.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template type="ProjTempl" version="1.0"
+ supplier="RobertF" revision="1.0"
+ author=""
+ copyright=""
+ id="SerialRemoteDebugProject"
+ label="%RTEMS.Serial.Template.Label"
+ description="%RTEMS.Serial.Template.Label.Description"
+ help="help.html">
+
+ <property-group id="basics" label="Basic Settings" description="Basic properties" type="PAGES-ONLY" help="help.html">
+ <property id="author"
+ label="Author"
+ description="Name of the author"
+ type="input"
+ pattern=".*"
+ default="Your name here"
+ hidden="false"
+ persist="true"/>
+ <property id="copyright"
+ label="Copyright notice"
+ description="Your copyright notice"
+ type="input"
+ pattern=".*"
+ default="Your copyright notice"
+ hidden="false"
+ persist="true"/>
+ <property id="message"
+ label="message"
+ description="message"
+ type="input"
+ pattern=".*"
+ default="Hello, I'm waiting for input...\r\n"
+ hidden="false"
+ persist="true"/>
+ <property id="sourceDir"
+ label="Source"
+ description="Directory for project source files"
+ type="input"
+ default="src"
+ pattern="[a-zA-Z0-9]+"
+ mandatory="false"
+ persist="true"/>
+ </property-group>
+
+ <process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject">
+ <simple name="name" value="$(projectName)" />
+ <simple name="artifactExtension" value="exe" />
+ <simple name="isCProject" value="true" />
+ </process>
+
+ <process type="org.eclipse.cdt.core.CreateSourceFolder">
+ <simple name="projectName" value="$(projectName)"/>
+ <simple name="path" value="$(sourceDir)"/>
+ </process>
+
+ <process type="org.eclipse.cdt.core.AddFiles">
+ <simple name="projectName" value="$(projectName)"/>
+ <complex-array name="files">
+ <element>
+ <simple name="source" value="src/Basename.c"/>
+ <simple name="target" value="$(sourceDir)/$(projectName).c"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ </complex-array>
+ </process>
+
+</template>
+