net.sf.antcontrib.cpptasks.gcc

Class AbstractLdLinker

Implemented Interfaces:
Cloneable, Linker, Processor
Known Direct Subclasses:
aCCLinker, ForteCCLinker, GccLinker, GccLinker, GccLinker, GppLinker, GppLinker, GppLinker, IntelLinux32Linker, IntelLinux64Linker, LdLinker, LdLinker, LdLinker, VisualAgeLinker

public abstract class AbstractLdLinker
extends CommandLineLinker

Abstract adapter for ld-like linkers
Author:
Curt Arnold

Field Summary

Fields inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor

DEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID

Constructor Summary

AbstractLdLinker(String command, String identifierArg, String[] extensions, String[] ignoredExtensions, String outputPrefix, String outputSuffix, boolean isLibtool, AbstractLdLinker libtoolLinker)

Method Summary

void
addBase(long base, Vector args)
protected void
addEntry(String entry, Vector args)
void
addFixed(Boolean fixed, Vector args)
protected void
addImpliedArgs(boolean debug, LinkType linkType, Vector args)
void
addIncremental(boolean incremental, Vector args)
protected int
addLibraryPatterns(String[] libnames, StringBuffer buf, String prefix, String extension, String[] patterns, int offset)
String[]
addLibrarySets(CCTask task, LibrarySet[] libsets, Vector preargs, Vector midargs, Vector endargs)
void
addMap(boolean map, Vector args)
void
addStack(int stack, Vector args)
String
getCommandFileSwitch(String commandFile)
protected File[]
getEnvironmentIncludePath()
Returns library path.
String
getLibraryKey(File libfile)
Extracts the significant part of a library name to ensure there aren't collisions
File[]
getLibraryPath()
Returns library path.
String[]
getLibraryPatterns(String[] libnames, LibraryTypeEnum libType)
Returns a set of filename patterns corresponding to library names.
int
getMaximumCommandLength()
String[]
getOutputFileNames(String baseName, VersionInfo versionInfo)
Output file name (no path components) corresponding to source file
String[]
getOutputFileSwitch(String outputFile)
boolean
isCaseSensitive()
Returns true if the linker is case-sensitive
protected boolean
isHPUX()
String[]
prepareArguments(CCTask task, String outputDir, String outputFile, String[] sourceFiles, CommandLineLinkerConfiguration config)
Prepares argument list for exec command.

Methods inherited from class net.sf.antcontrib.cpptasks.compiler.CommandLineLinker

addBase, addEntry, addFixed, addImpliedArgs, addIncremental, addLibrarySets, addMap, addStack, createConfiguration, decorateLinkerOption, getCommand, getCommandFileSwitch, getIdentifier, getLibtoolLinker, getMaximumCommandLength, getOutputFileNames, getOutputFileSwitch, getOutputFileSwitch, getStartupObject, link, prepareArguments, prepareFilename, prepareResponseFile, quoteFilename, runCommand, setCommand

Methods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractLinker

addVersionFiles, bid, changeEnvironment, createConfiguration, createConfiguration, getLibraryKey, getOutputFileNames

Methods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor

bid, changeEnvironment, clone, getHeaderExtensions, getIdentifier, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, toString

Constructor Details

AbstractLdLinker

protected AbstractLdLinker(String command,
                           String identifierArg,
                           String[] extensions,
                           String[] ignoredExtensions,
                           String outputPrefix,
                           String outputSuffix,
                           boolean isLibtool,
                           AbstractLdLinker libtoolLinker)

Method Details

addBase

public void addBase(long base,
                    Vector args)
Overrides:
addBase in interface CommandLineLinker

addEntry

protected void addEntry(String entry,
                        Vector args)
Overrides:
addEntry in interface CommandLineLinker

addFixed

public void addFixed(Boolean fixed,
                     Vector args)
Overrides:
addFixed in interface CommandLineLinker

addImpliedArgs

protected void addImpliedArgs(boolean debug,
                              LinkType linkType,
                              Vector args)
Overrides:
addImpliedArgs in interface CommandLineLinker

addIncremental

public void addIncremental(boolean incremental,
                           Vector args)
Overrides:
addIncremental in interface CommandLineLinker

addLibraryPatterns

protected int addLibraryPatterns(String[] libnames,
                                 StringBuffer buf,
                                 String prefix,
                                 String extension,
                                 String[] patterns,
                                 int offset)

addLibrarySets

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

addMap

public void addMap(boolean map,
                   Vector args)
Overrides:
addMap in interface CommandLineLinker

addStack

public void addStack(int stack,
                     Vector args)
Overrides:
addStack in interface CommandLineLinker

getCommandFileSwitch

public String getCommandFileSwitch(String commandFile)
Overrides:
getCommandFileSwitch in interface CommandLineLinker

getEnvironmentIncludePath

protected File[] getEnvironmentIncludePath()
Returns library path.

getLibraryKey

public String getLibraryKey(File libfile)
Extracts the significant part of a library name to ensure there aren't collisions
Specified by:
getLibraryKey in interface Linker
Overrides:
getLibraryKey in interface AbstractLinker

getLibraryPath

public File[] getLibraryPath()
Returns library path.
Specified by:
getLibraryPath in interface Linker

getLibraryPatterns

public String[] getLibraryPatterns(String[] libnames,
                                   LibraryTypeEnum libType)
Returns a set of filename patterns corresponding to library names. For example, "advapi32" would be expanded to "advapi32.dll" by DevStudioLinker and to "libadvapi32.a" and "libadvapi32.so" by GccLinker.
Specified by:
getLibraryPatterns in interface Linker
Parameters:
libnames - array of library names

getMaximumCommandLength

public int getMaximumCommandLength()
Overrides:
getMaximumCommandLength in interface CommandLineLinker

getOutputFileNames

public String[] getOutputFileNames(String baseName,
                                   VersionInfo versionInfo)
Output file name (no path components) corresponding to source file
Specified by:
getOutputFileNames in interface Processor
Overrides:
getOutputFileNames in interface CommandLineLinker
Parameters:
Returns:
output file name or null if no output file or name not determined by input file

getOutputFileSwitch

public String[] getOutputFileSwitch(String outputFile)
Overrides:
getOutputFileSwitch in interface CommandLineLinker

isCaseSensitive

public boolean isCaseSensitive()
Returns true if the linker is case-sensitive
Specified by:
isCaseSensitive in interface Linker

isHPUX

protected boolean isHPUX()

prepareArguments

public String[] prepareArguments(CCTask task,
                                 String outputDir,
                                 String outputFile,
                                 String[] sourceFiles,
                                 CommandLineLinkerConfiguration config)
Prepares argument list for exec command. Will return null if command line would exceed allowable command line buffer.
Overrides:
prepareArguments in interface CommandLineLinker
Parameters:
outputFile - linker output file
sourceFiles - linker input files (.obj, .o, .res)
Returns:
arguments for runTask

Copyright B) 2001-2006 Ant-Contrib project. All Rights Reserved.