diff options
Diffstat (limited to 'org.rtems.cdt.toolchain2/org/rtems/cdt/build/CommandLineGenerator.java')
-rw-r--r-- | org.rtems.cdt.toolchain2/org/rtems/cdt/build/CommandLineGenerator.java | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/org.rtems.cdt.toolchain2/org/rtems/cdt/build/CommandLineGenerator.java b/org.rtems.cdt.toolchain2/org/rtems/cdt/build/CommandLineGenerator.java index 4147e61..fbe7420 100644 --- a/org.rtems.cdt.toolchain2/org/rtems/cdt/build/CommandLineGenerator.java +++ b/org.rtems.cdt.toolchain2/org/rtems/cdt/build/CommandLineGenerator.java @@ -24,7 +24,7 @@ public class CommandLineGenerator extends ManagedCommandLineGenerator implements public IManagedCommandLineInfo generateCommandLineInfo( ITool tool, String commandName, - String [] flags, + String [] userOptions, String outputFlag, String outputPrefix, String outputName, @@ -34,32 +34,37 @@ public class CommandLineGenerator extends ManagedCommandLineGenerator implements // Get associated project of the tool IProject project = (IProject) tool.getParentResourceInfo().getParent().getOwner(); - // Determine main command name via the tool ID + // Determine tool key via the tool ID String id = tool.getId(); - String name = "-gcc"; + String toolKey = "gcc"; if (id.contains( "archiver")) { - name = "-ar"; + toolKey = Constants.TOOL_ARCHIVER_KEY; } else if (id.contains( "assembler")) { - name = "-as"; + toolKey = Constants.TOOL_ASSEMBLER_KEY; + } else if (id.contains( "c.compiler")) { + toolKey = Constants.TOOL_COMPILER_C_KEY; } else if (id.contains( "cpp.compiler")) { - name = "-g++"; + toolKey = Constants.TOOL_COMPILER_CPP_KEY; + } else if (id.contains( "c.linker")) { + toolKey = Constants.TOOL_LINKER_C_KEY; } else if (id.contains( "cpp.linker")) { - name = "-g++"; + toolKey = Constants.TOOL_LINKER_CPP_KEY; } - // Create and set command name - commandName = new String( - Storage.getProperty( project, Constants.TARGET_KEY) - + "-rtems" - + Storage.getProperty( project, Constants.VERSION_KEY) - + name - ); + // Set command name + commandName = Storage.getProperty( project, toolKey); tool.setToolCommand( commandName); + + // Combine tool and user options + String [] toolOptions = Storage.getToolOptions( project, toolKey); + String options [] = new String [toolOptions.length + userOptions.length]; + System.arraycopy( toolOptions, 0, options, 0, toolOptions.length); + System.arraycopy( userOptions, 0, options, toolOptions.length, userOptions.length); return super.generateCommandLineInfo( tool, commandName, - flags, + options, outputFlag, outputPrefix, outputName, |