|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.maven_nar.cpptasks.compiler.AbstractProcessor
com.github.maven_nar.cpptasks.compiler.AbstractLinker
com.github.maven_nar.cpptasks.compiler.CommandLineLinker
public abstract class CommandLineLinker
An abstract Linker implementation that performs the link via an external command.
| Field Summary |
|---|
| Fields inherited from class com.github.maven_nar.cpptasks.compiler.AbstractProcessor |
|---|
DEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID |
| Constructor Summary | |
|---|---|
CommandLineLinker(String command,
String identifierArg,
String[] extensions,
String[] ignoredExtensions,
String outputSuffix,
boolean isLibtool,
CommandLineLinker libtoolLinker)
Creates a comand line linker invocation |
|
| Method Summary | |
|---|---|
protected void |
addBase(CCTask task,
long base,
Vector args)
|
protected void |
addEntry(CCTask task,
String entry,
Vector args)
|
protected void |
addFixed(CCTask task,
Boolean fixed,
Vector args)
|
protected void |
addImpliedArgs(CCTask task,
boolean debug,
LinkType linkType,
Vector args)
|
protected void |
addIncremental(CCTask task,
boolean incremental,
Vector args)
|
protected String[] |
addLibrarySets(CCTask task,
LibrarySet[] libsets,
Vector preargs,
Vector midargs,
Vector endargs)
|
protected void |
addMap(CCTask task,
boolean map,
Vector args)
|
protected void |
addStack(CCTask task,
int stack,
Vector args)
|
protected LinkerConfiguration |
createConfiguration(CCTask task,
LinkType linkType,
ProcessorDef[] baseDefs,
LinkerDef specificDef,
TargetDef targetPlatform,
VersionInfo versionInfo)
|
protected String |
decorateLinkerOption(StringBuffer buf,
String arg)
Allows drived linker to decorate linker option. |
protected String |
getCommand()
|
protected abstract String |
getCommandFileSwitch(String commandFile)
|
String |
getCommandWithPath(CommandLineLinkerConfiguration config)
|
String |
getIdentifier()
Retrieve an identifier that identifies the specific version of the compiler. |
CommandLineLinker |
getLibtoolLinker()
|
protected abstract int |
getMaximumCommandLength()
|
String[] |
getOutputFileNames(String baseName,
VersionInfo versionInfo)
Output file name (no path components) corresponding to source file |
protected String[] |
getOutputFileSwitch(CCTask task,
String outputFile)
|
protected abstract String[] |
getOutputFileSwitch(String outputFile)
|
protected String |
getStartupObject(LinkType linkType)
|
void |
link(CCTask task,
File outputFile,
String[] sourceFiles,
CommandLineLinkerConfiguration config)
Performs a link using a command line linker |
protected String[] |
prepareArguments(CCTask task,
String outputDir,
String outputFile,
String[] sourceFiles,
CommandLineLinkerConfiguration config)
Prepares argument list for exec command. |
protected String |
prepareFilename(StringBuffer buf,
String outputDir,
String sourceFile)
Processes filename into argument form |
protected String[] |
prepareResponseFile(File outputFile,
String[] args)
Prepares argument list to execute the linker using a response file. |
protected String |
quoteFilename(StringBuffer buf,
String filename)
|
protected int |
runCommand(CCTask task,
File workingDir,
String[] cmdline)
This method is exposed so test classes can overload and test the arguments without actually spawning the compiler |
protected void |
setCommand(String command)
|
| Methods inherited from class com.github.maven_nar.cpptasks.compiler.AbstractLinker |
|---|
addVersionFiles, bid, changeEnvironment, createConfiguration, getLibraryKey |
| Methods inherited from class com.github.maven_nar.cpptasks.compiler.AbstractProcessor |
|---|
clone, getHeaderExtensions, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, isWindows, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.github.maven_nar.cpptasks.compiler.Linker |
|---|
getLibraryPath, getLibraryPatterns, getLinker, isCaseSensitive |
| Constructor Detail |
|---|
public CommandLineLinker(String command,
String identifierArg,
String[] extensions,
String[] ignoredExtensions,
String outputSuffix,
boolean isLibtool,
CommandLineLinker libtoolLinker)
| Method Detail |
|---|
protected void addBase(CCTask task,
long base,
Vector args)
protected void addFixed(CCTask task,
Boolean fixed,
Vector args)
protected void addImpliedArgs(CCTask task,
boolean debug,
LinkType linkType,
Vector args)
protected void addIncremental(CCTask task,
boolean incremental,
Vector args)
protected String[] addLibrarySets(CCTask task,
LibrarySet[] libsets,
Vector preargs,
Vector midargs,
Vector endargs)
protected void addMap(CCTask task,
boolean map,
Vector args)
protected void addStack(CCTask task,
int stack,
Vector args)
protected void addEntry(CCTask task,
String entry,
Vector args)
protected LinkerConfiguration createConfiguration(CCTask task,
LinkType linkType,
ProcessorDef[] baseDefs,
LinkerDef specificDef,
TargetDef targetPlatform,
VersionInfo versionInfo)
createConfiguration in class AbstractLinker
protected String decorateLinkerOption(StringBuffer buf,
String arg)
buf - buffer that may be used and abused in the decoration process,
must not be null.arg - linker argumentprotected final String getCommand()
protected abstract String getCommandFileSwitch(String commandFile)
public String getCommandWithPath(CommandLineLinkerConfiguration config)
public String getIdentifier()
Processor
getIdentifier in interface ProcessorgetIdentifier in class AbstractProcessorpublic final CommandLineLinker getLibtoolLinker()
protected abstract int getMaximumCommandLength()
public String[] getOutputFileNames(String baseName,
VersionInfo versionInfo)
Processor
getOutputFileNames in interface ProcessorgetOutputFileNames in class AbstractLinkerbaseName - input file
protected String[] getOutputFileSwitch(CCTask task,
String outputFile)
protected abstract String[] getOutputFileSwitch(String outputFile)
protected String getStartupObject(LinkType linkType)
public void link(CCTask task,
File outputFile,
String[] sourceFiles,
CommandLineLinkerConfiguration config)
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
protected String[] prepareArguments(CCTask task,
String outputDir,
String outputFile,
String[] sourceFiles,
CommandLineLinkerConfiguration config)
task - compilation task.outputFile - linker output filesourceFiles - linker input files (.obj, .o, .res)config - linker configuration
protected String prepareFilename(StringBuffer buf,
String outputDir,
String sourceFile)
protected String[] prepareResponseFile(File outputFile,
String[] args)
throws IOException
outputFile - linker output fileargs - output of prepareArguments
IOException
protected String quoteFilename(StringBuffer buf,
String filename)
protected int runCommand(CCTask task,
File workingDir,
String[] cmdline)
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildExceptionprotected final void setCommand(String command)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||