Class GccLinker
- java.lang.Object
-
public class GccLinker extends AbstractLdLinker
Adapter for the GCC linker
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]
discardFiles
private static GccLinker
dllLinker
private static GccLinker
instance
private java.io.File[]
libDirs
private static java.lang.String[]
libtoolObjFiles
private static java.lang.String[]
linkerOptions
private static GccLinker
machBundleLinker
private static GccLinker
machDllLinker
private static java.lang.String[]
objFiles
-
Fields inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
DEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addImpliedArgs(boolean debug, LinkType linkType, java.util.Vector args)
protected java.lang.Object
clone()
java.lang.String
decorateLinkerOption(java.lang.StringBuffer buf, java.lang.String arg)
Allows drived linker to decorate linker option.static GccLinker
getInstance()
java.io.File[]
getLibraryPath()
Returns library path.Linker
getLinker(LinkType type)
Gets the linker for the specified link type.void
link(CCTask task, java.io.File outputFile, java.lang.String[] sourceFiles, CommandLineLinkerConfiguration config)
Performs a link using a command line linkerprivate void
superlink(CCTask task, java.io.File outputFile, java.lang.String[] sourceFiles, CommandLineLinkerConfiguration config)
-
Methods inherited from class net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker
addBase, addEntry, addFixed, addIncremental, addLibraryPatterns, addLibrarySets, addMap, addStack, getCommandFileSwitch, getDynamicLibFlag, getEnvironmentIncludePath, getLibraryKey, getLibraryPatterns, getMaximumCommandLength, getOutputFileNames, getOutputFileSwitch, getStaticLibFlag, 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
addVersionFiles, bid, changeEnvironment, createConfiguration
-
Methods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
getHeaderExtensions, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, toString
-
-
-
-
Field Detail
-
discardFiles
private static final java.lang.String[] discardFiles
-
objFiles
private static final java.lang.String[] objFiles
-
dllLinker
private static final GccLinker dllLinker
-
instance
private static final GccLinker instance
-
libtoolObjFiles
private static final java.lang.String[] libtoolObjFiles
-
linkerOptions
private static java.lang.String[] linkerOptions
-
machBundleLinker
private static final GccLinker machBundleLinker
-
machDllLinker
private static final GccLinker machDllLinker
-
libDirs
private java.io.File[] libDirs
-
-
Constructor Detail
-
GccLinker
protected GccLinker(java.lang.String command, java.lang.String[] extensions, java.lang.String[] ignoredExtensions, java.lang.String outputPrefix, java.lang.String outputSuffix, boolean isLibtool, GccLinker libtoolLinker)
-
-
Method Detail
-
getInstance
public static GccLinker getInstance()
-
addImpliedArgs
protected void addImpliedArgs(boolean debug, LinkType linkType, java.util.Vector args)
- Overrides:
addImpliedArgs
in classAbstractLdLinker
-
clone
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classAbstractProcessor
- Throws:
java.lang.CloneNotSupportedException
-
decorateLinkerOption
public java.lang.String decorateLinkerOption(java.lang.StringBuffer buf, java.lang.String arg)
Allows drived linker to decorate linker option. Override by GccLinker to prepend a "-Wl," to pass option to through gcc to linker.- Overrides:
decorateLinkerOption
in classCommandLineLinker
- Parameters:
buf
- buffer that may be used and abused in the decoration process, must not be null.arg
- linker argument
-
getLibraryPath
public java.io.File[] getLibraryPath()
Returns library path.- Specified by:
getLibraryPath
in interfaceLinker
- Overrides:
getLibraryPath
in classAbstractLdLinker
-
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, java.io.File outputFile, java.lang.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 classCommandLineLinker
- Throws:
org.apache.tools.ant.BuildException
-
superlink
private void superlink(CCTask task, java.io.File outputFile, java.lang.String[] sourceFiles, CommandLineLinkerConfiguration config) throws org.apache.tools.ant.BuildException
- Throws:
org.apache.tools.ant.BuildException
-
-