diff options
author | Daron Chabot <daron.chabot@gmail.com> | 2008-11-24 03:01:03 +0000 |
---|---|---|
committer | Daron Chabot <daron.chabot@gmail.com> | 2008-11-24 03:01:03 +0000 |
commit | f124b043df9b420e881bf58801a8a85b894982a0 (patch) | |
tree | 9fe522dd5331ef30b8d9e44001051677c8cafa51 /org.rtems.cdt.toolchain | |
parent | Remove unnecessary dependencies from ".settings". (diff) | |
download | rtems-eclipse-plug-in-f124b043df9b420e881bf58801a8a85b894982a0.tar.bz2 |
Clean up of plugin.xml and addition of simpler, "Hello World" template.
Removed shared-lib option from c/c++ linker tools: RTEMS doesn't support shared libs.
Removed -D_REENTRANT flag. I've no idea where that came from: it's not in RTEMS or newlib.
Added more stringent test for empty RTEMS_BSP_DEFINED_SYMBOLS environment variable.
NOTE: none of the defs (provided by Robert) for this variable are necessary.
Diffstat (limited to 'org.rtems.cdt.toolchain')
6 files changed, 186 insertions, 39 deletions
diff --git a/org.rtems.cdt.toolchain/plugin.xml b/org.rtems.cdt.toolchain/plugin.xml index 66a67d7..7dde72a 100644 --- a/org.rtems.cdt.toolchain/plugin.xml +++ b/org.rtems.cdt.toolchain/plugin.xml @@ -70,18 +70,18 @@ id="cdt.managedbuild.toolchain.gnu.rtems.base"
name="RTEMS Toolchain"
archList="all"
- osList="win32"
+ osList="all"
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">
+ archList="all"
+ binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.PE"
+ id="cdt.managedbuild.target.gnu.platform.rtems.base"
+ name="Target Platform RTEMS"
+ osList="other">
</targetPlatform>
<builder
@@ -144,7 +144,7 @@ valueType="string">
</option>
<option
- defaultValue="-qrtems -D_REENTRANT -c -fmessage-length=0"
+ defaultValue="-qrtems -c -fmessage-length=0"
id="rtems.gnu.c.compiler.option.misc.other"
superClass="gnu.c.compiler.option.misc.other">
</option>
@@ -190,7 +190,7 @@ valueType="string">
</option>
<option
- defaultValue="-qrtems -D_REENTRANT -c -fmessage-length=0"
+ defaultValue="-qrtems -c -fmessage-length=0"
id="rtems.gnu.cpp.compiler.option.other.other"
superClass="gnu.cpp.compiler.option.other.other">
</option>
@@ -379,23 +379,10 @@ valueType="string">
</option>
<option
- defaultValue="-qrtems -D_REENTRANT"
+ defaultValue="-qrtems"
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
@@ -578,24 +565,11 @@ valueType="string">
</option>
<option
- defaultValue="-qrtems -D_REENTRANT"
- id="rtems.gnu.cpp.link.option.other.flags"
- superClass="gnu.cpp.link.option.flags">
+ defaultValue="-qrtems"
+ id="rtems.gnu.cpp.link.option.ldflags"
+ superClass="gnu.c.link.option.ldflags">
</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>
@@ -744,6 +718,12 @@ filterPattern=".*"
projectType="org.eclipse.cdt.build.core.buildArtefactType.exe">
</template>
+ <template
+ filterPattern=".*"
+ id="org.rtems.cdt.toolchain.templates.hello"
+ location="$nl$/templates/hello/template.xml"
+ projectType="org.eclipse.cdt.build.core.buildArtefactType.exe">
+ </template>
</extension>
<extension
@@ -754,6 +734,12 @@ id="cdt.managedbuild.toolchain.gnu.rtems.base">
</toolChain>
</template>
+ <template
+ id="org.rtems.cdt.toolchain.templates.hello">
+ <toolChain
+ id="cdt.managedbuild.toolchain.gnu.rtems.base">
+ </toolChain>
+ </template>
</extension>
</plugin>
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 index e074544..0f35fc9 100644 --- a/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsScannerInfoCollector.java +++ b/org.rtems.cdt.toolchain/src/org/rtems/cdt/toolchain/RtemsScannerInfoCollector.java @@ -72,7 +72,8 @@ public class RtemsScannerInfoCollector extends PerProjectSICollector 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) { + //NOTE: it's insufficient to test for a non-null string, thus the test for length>0 + if (bspSymbols != null && bspSymbols.length() > 0) { String[] macro = bspSymbols.split(","); for (int i=0; i<macro.length; i++) { String symbol = macro[i].trim() + "=1"; diff --git a/org.rtems.cdt.toolchain/templates/hello/src/init.c b/org.rtems.cdt.toolchain/templates/hello/src/init.c new file mode 100644 index 0000000..e02a23c --- /dev/null +++ b/org.rtems.cdt.toolchain/templates/hello/src/init.c @@ -0,0 +1,36 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is called from init_exec and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * Input parameters: NONE + * + * Output parameters: NONE + * + * COPYRIGHT (c) 1989-1999. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#define CONFIGURE_INIT +#include "system.h" +#include <stdio.h> +#include <stdlib.h> + +rtems_task Init( + rtems_task_argument ignored +) +{ + printf( "\n\n*** HELLO WORLD TEST ***\n" ); + printf( "Hello World\n" ); + printf( "*** END OF HELLO WORLD TEST ***\n" ); + exit( 0 ); +} diff --git a/org.rtems.cdt.toolchain/templates/hello/src/system.h b/org.rtems.cdt.toolchain/templates/hello/src/system.h new file mode 100644 index 0000000..a4ac1a5 --- /dev/null +++ b/org.rtems.cdt.toolchain/templates/hello/src/system.h @@ -0,0 +1,40 @@ +/* system.h + * + * This include file contains information that is included in every + * function in the test set. + * + * COPYRIGHT (c) 1989-1999. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#include <rtems.h> + +/* functions */ + +rtems_task Init( + rtems_task_argument argument +); + +/* configuration information */ + +#include <bsp.h> /* for device driver prototypes */ + +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM + +#include <rtems/confdefs.h> + +/* end of include file */ diff --git a/org.rtems.cdt.toolchain/templates/hello/template.properties b/org.rtems.cdt.toolchain/templates/hello/template.properties new file mode 100644 index 0000000..9445db7 --- /dev/null +++ b/org.rtems.cdt.toolchain/templates/hello/template.properties @@ -0,0 +1,3 @@ +#Template Default Values +RTEMS.Hello.Template.Label=RTEMS Hello-World Project +RTEMS.Hello.Template.Label.Description=The prototypical "Hello World" project. Creates a folder for sources and another for include. diff --git a/org.rtems.cdt.toolchain/templates/hello/template.xml b/org.rtems.cdt.toolchain/templates/hello/template.xml new file mode 100644 index 0000000..62f5c89 --- /dev/null +++ b/org.rtems.cdt.toolchain/templates/hello/template.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<template type="ProjTempl" version="1.0" + supplier="www.rtems.com" revision="1.0" + author="chabotd" + copyright="" + id="RTEMSHelloWorldProject" + label="%RTEMS.Hello.Template.Label" + description="%RTEMS.Hello.Template.Label.Description" + help="help.html"> + + <property-group id="basics" label="RTEMS Preferences Overrides" description="Specify per-project RTEMS-preference page overrides." type="PAGES-ONLY" help="help.html"> + <property id="RTEMSInstallDir" + label="RTEMS install directory" + description="This is where the user could override Preference settings" + type="browse" + pattern=".*" + default="/opt/rtems" + hidden="false" + persist="true"/> + <property id="RTEMSTargetArch" + label="Target Architecture" + description="This is where the user could override Preference settings" + type="select" + pattern=".*" + hidden="false" + persist="true"> + <item label="i386" selected="true" name="i386"/> + <item label="m68k" selected="false" name="m68k"/> + <item label="ppc" selected="false" name="ppc"/> + <item label="sparc" selected="false" name="sparc"/> + </property> + <property id="RTEMSBSP" + label="Target BSP" + description="This is where the user could override Preference settings" + type="select" + pattern=".*" + hidden="false" + persist="true"> + <item label="pc386" selected="true" name="pc386"/> + <item label="pc586" selected="false" name="pc586"/> + <item label="pc686" selected="false" name="pc686"/> + </property> + <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/init.c"/> + <simple name="target" value="$(sourceDir)/$(projectName).c"/> + <simple name="replaceable" value="true"/> + </element> + <element> + <simple name="source" value="src/system.h"/> + <simple name="target" value="$(sourceDir)/system.h"/> + <simple name="replaceable" value="true"/> + </element> + </complex-array> + </process> + +</template> + |