net.sf.antcontrib.cpptasks.gcc.cross
Class GppLinker

java.lang.Object
  extended by net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
      extended by net.sf.antcontrib.cpptasks.compiler.AbstractLinker
          extended by net.sf.antcontrib.cpptasks.compiler.CommandLineLinker
              extended by net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker
                  extended by net.sf.antcontrib.cpptasks.gcc.cross.GppLinker
All Implemented Interfaces:
Cloneable, Linker, Processor

public class GppLinker
extends AbstractLdLinker

Adapter for the g++ variant of the GCC linker

Rating red

Field Summary
protected static String[] discardFiles
           
protected static String[] libtoolObjFiles
           
protected static String[] objFiles
           
 
Fields inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
DEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID
 
Constructor Summary
protected GppLinker(String command, String[] extensions, String[] ignoredExtensions, String outputPrefix, String outputSuffix, boolean isLibtool, GppLinker libtoolLinker)
           
 
Method Summary
protected  void addImpliedArgs(boolean debug, LinkType linkType, Vector args)
           
 String[] addLibrarySets(CCTask task, LibrarySet[] libsets, Vector preargs, Vector midargs, Vector endargs)
           
protected  Object clone()
          Create a copy of this object, using a shallow copy.
 String decorateLinkerOption(StringBuffer buf, String arg)
          Allows drived linker to decorate linker option.
static GppLinker getInstance()
           
 File[] getLibraryPath()
          Returns library path.
 Linker getLinker(LinkType type)
          Gets the linker for the specified link type.
 void link(CCTask task, File outputFile, String[] sourceFiles, CommandLineLinkerConfiguration config)
          Performs a link using a command line linker
 
Methods inherited from class net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker
addBase, addEntry, addFixed, addIncremental, addLibraryPatterns, addMap, addStack, getCommandFileSwitch, getEnvironmentIncludePath, getLibraryKey, getLibraryPatterns, getMaximumCommandLength, getOutputFileName, getOutputFileSwitch, isCaseSensitive, isHPUX, prepareArguments
 
Methods inherited from class net.sf.antcontrib.cpptasks.compiler.CommandLineLinker
createConfiguration, getCommand, getIdentifier, getLibtoolLinker, getOutputFileSwitch, getStartupObject, prepareFilename, prepareResponseFile, quoteFilename, runCommand, setCommand
 
Methods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractLinker
bid, changeEnvironment, createConfiguration
 
Methods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
getHeaderExtensions, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

discardFiles

protected static final String[] discardFiles

objFiles

protected static final String[] objFiles

libtoolObjFiles

protected static final String[] libtoolObjFiles
Constructor Detail

GppLinker

protected GppLinker(String command,
                    String[] extensions,
                    String[] ignoredExtensions,
                    String outputPrefix,
                    String outputSuffix,
                    boolean isLibtool,
                    GppLinker libtoolLinker)
Method Detail

getInstance

public static GppLinker getInstance()

addImpliedArgs

protected void addImpliedArgs(boolean debug,
                              LinkType linkType,
                              Vector args)
Overrides:
addImpliedArgs in class AbstractLdLinker

addLibrarySets

public String[] addLibrarySets(CCTask task,
                               LibrarySet[] libsets,
                               Vector preargs,
                               Vector midargs,
                               Vector endargs)
Overrides:
addLibrarySets in class AbstractLdLinker

clone

protected Object clone()
                throws CloneNotSupportedException
Description copied from class: Object
Create a copy of this object, using a shallow copy.

Overrides:
clone in class AbstractProcessor
Returns:
The new copy of the Object
Throws:
CloneNotSupportedException

decorateLinkerOption

public String decorateLinkerOption(StringBuffer buf,
                                   String arg)
Allows drived linker to decorate linker option. Override by GppLinker to prepend a "-Wl," to pass option to through gcc to linker.

Overrides:
decorateLinkerOption in class CommandLineLinker
Parameters:
buf - buffer that may be used and abused in the decoration process, must not be null.
arg - linker argument

getLibraryPath

public File[] getLibraryPath()
Returns library path.

Specified by:
getLibraryPath in interface Linker
Overrides:
getLibraryPath in class AbstractLdLinker

getLinker

public Linker getLinker(LinkType type)
Description copied from interface: Linker
Gets the linker for the specified link type.

Returns:
appropriate linker or null, will return this if this linker can handle the specified link type

link

public void link(CCTask task,
                 File outputFile,
                 String[] sourceFiles,
                 CommandLineLinkerConfiguration config)
          throws org.apache.tools.ant.BuildException
Description copied from class: CommandLineLinker
Performs a link using a command line linker

Overrides:
link in class CommandLineLinker
Throws:
org.apache.tools.ant.BuildException