net.sf.antcontrib.cpptasks.gcc
Class AbstractLdLinker

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
All Implemented Interfaces:
java.lang.Cloneable, Linker, Processor
Direct Known 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
protected AbstractLdLinker(java.lang.String command, java.lang.String identifierArg, java.lang.String[] extensions, java.lang.String[] ignoredExtensions, java.lang.String outputPrefix, java.lang.String outputSuffix, boolean isLibtool, AbstractLdLinker libtoolLinker)
           
 
Method Summary
 void addBase(long base, java.util.Vector args)
           
protected  void addEntry(java.lang.String entry, java.util.Vector args)
           
 void addFixed(java.lang.Boolean fixed, java.util.Vector args)
           
protected  void addImpliedArgs(boolean debug, LinkType linkType, java.util.Vector args)
           
 void addIncremental(boolean incremental, java.util.Vector args)
           
protected  int addLibraryPatterns(java.lang.String[] libnames, java.lang.StringBuffer buf, java.lang.String prefix, java.lang.String extension, java.lang.String[] patterns, int offset)
           
 java.lang.String[] addLibrarySets(CCTask task, LibrarySet[] libsets, java.util.Vector preargs, java.util.Vector midargs, java.util.Vector endargs)
           
 void addMap(boolean map, java.util.Vector args)
           
 void addStack(int stack, java.util.Vector args)
           
 java.lang.String getCommandFileSwitch(java.lang.String commandFile)
           
protected  java.lang.String getDynamicLibFlag()
           
protected  java.io.File[] getEnvironmentIncludePath()
          Returns library path.
 java.lang.String getLibraryKey(java.io.File libfile)
          Extracts the significant part of a library name to ensure there aren't collisions
 java.io.File[] getLibraryPath()
          Returns library path.
 java.lang.String[] getLibraryPatterns(java.lang.String[] libnames, LibraryTypeEnum libType)
          Returns a set of filename patterns corresponding to library names.
 int getMaximumCommandLength()
           
 java.lang.String[] getOutputFileNames(java.lang.String baseName, VersionInfo versionInfo)
          Output file name (no path components) corresponding to source file
 java.lang.String[] getOutputFileSwitch(java.lang.String outputFile)
           
protected  java.lang.String getStaticLibFlag()
           
 boolean isCaseSensitive()
          Returns true if the linker is case-sensitive
protected  boolean isHPUX()
           
 java.lang.String[] prepareArguments(CCTask task, java.lang.String outputDir, java.lang.String outputFile, java.lang.String[] sourceFiles, CommandLineLinkerConfiguration config)
          Prepares argument list for exec command.
 
Methods inherited from class net.sf.antcontrib.cpptasks.compiler.CommandLineLinker
createConfiguration, decorateLinkerOption, getCommand, getIdentifier, getLibtoolLinker, getOutputFileSwitch, getStartupObject, link, 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
clone, getHeaderExtensions, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.antcontrib.cpptasks.compiler.Linker
getLinker
 

Constructor Detail

AbstractLdLinker

protected AbstractLdLinker(java.lang.String command,
                           java.lang.String identifierArg,
                           java.lang.String[] extensions,
                           java.lang.String[] ignoredExtensions,
                           java.lang.String outputPrefix,
                           java.lang.String outputSuffix,
                           boolean isLibtool,
                           AbstractLdLinker libtoolLinker)
Method Detail

addBase

public void addBase(long base,
                    java.util.Vector args)
Specified by:
addBase in class CommandLineLinker

addFixed

public void addFixed(java.lang.Boolean fixed,
                     java.util.Vector args)
Specified by:
addFixed in class CommandLineLinker

addImpliedArgs

protected void addImpliedArgs(boolean debug,
                              LinkType linkType,
                              java.util.Vector args)
Specified by:
addImpliedArgs in class CommandLineLinker

addIncremental

public void addIncremental(boolean incremental,
                           java.util.Vector args)
Specified by:
addIncremental in class CommandLineLinker

addLibraryPatterns

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

addLibrarySets

public java.lang.String[] addLibrarySets(CCTask task,
                                         LibrarySet[] libsets,
                                         java.util.Vector preargs,
                                         java.util.Vector midargs,
                                         java.util.Vector endargs)
Overrides:
addLibrarySets in class CommandLineLinker

addMap

public void addMap(boolean map,
                   java.util.Vector args)
Specified by:
addMap in class CommandLineLinker

addStack

public void addStack(int stack,
                     java.util.Vector args)
Specified by:
addStack in class CommandLineLinker

addEntry

protected void addEntry(java.lang.String entry,
                        java.util.Vector args)
Specified by:
addEntry in class CommandLineLinker

getCommandFileSwitch

public java.lang.String getCommandFileSwitch(java.lang.String commandFile)
Specified by:
getCommandFileSwitch in class CommandLineLinker

getEnvironmentIncludePath

protected java.io.File[] getEnvironmentIncludePath()
Returns library path.


getLibraryKey

public java.lang.String getLibraryKey(java.io.File libfile)
Description copied from interface: Linker
Extracts the significant part of a library name to ensure there aren't collisions

Specified by:
getLibraryKey in interface Linker
Overrides:
getLibraryKey in class AbstractLinker

getLibraryPath

public java.io.File[] getLibraryPath()
Returns library path.


getLibraryPatterns

public java.lang.String[] getLibraryPatterns(java.lang.String[] libnames,
                                             LibraryTypeEnum libType)
Description copied from interface: Linker
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.

Parameters:
libnames - array of library names

getMaximumCommandLength

public int getMaximumCommandLength()
Specified by:
getMaximumCommandLength in class CommandLineLinker

getOutputFileNames

public java.lang.String[] getOutputFileNames(java.lang.String baseName,
                                             VersionInfo versionInfo)
Description copied from interface: Processor
Output file name (no path components) corresponding to source file

Specified by:
getOutputFileNames in interface Processor
Overrides:
getOutputFileNames in class CommandLineLinker
Parameters:
baseName - input file
Returns:
output file name or null if no output file or name not determined by input file

getOutputFileSwitch

public java.lang.String[] getOutputFileSwitch(java.lang.String outputFile)
Specified by:
getOutputFileSwitch in class CommandLineLinker

isCaseSensitive

public boolean isCaseSensitive()
Description copied from interface: Linker
Returns true if the linker is case-sensitive


isHPUX

protected boolean isHPUX()

prepareArguments

public java.lang.String[] prepareArguments(CCTask task,
                                           java.lang.String outputDir,
                                           java.lang.String outputFile,
                                           java.lang.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 class CommandLineLinker
Parameters:
outputFile - linker output file
sourceFiles - linker input files (.obj, .o, .res)
config - linker configuration
task - compilation task.
Returns:
arguments for runTask

getDynamicLibFlag

protected java.lang.String getDynamicLibFlag()

getStaticLibFlag

protected java.lang.String getStaticLibFlag()


Copyright © 2001-2008 Ant-Contrib Project. All Rights Reserved.