com.github.maven_nar.cpptasks.gcc
Class AbstractLdLinker

java.lang.Object
  extended by com.github.maven_nar.cpptasks.compiler.AbstractProcessor
      extended by com.github.maven_nar.cpptasks.compiler.AbstractLinker
          extended by com.github.maven_nar.cpptasks.compiler.CommandLineLinker
              extended by com.github.maven_nar.cpptasks.gcc.AbstractLdLinker
All Implemented Interfaces:
Linker, Processor, Cloneable
Direct Known Subclasses:
aCCLinker, ForteCCLinker, GccLinker, GccLinker, GccLinker, GppLinker, GppLinker, GppLinker, IntelLinux32CLinker, IntelLinux32Linker, IntelLinux64CLinker, 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 com.github.maven_nar.cpptasks.compiler.AbstractProcessor
DEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID
 
Constructor Summary
protected AbstractLdLinker(String command, String identifierArg, String[] extensions, String[] ignoredExtensions, String outputPrefix, String outputSuffix, boolean isLibtool, AbstractLdLinker libtoolLinker)
           
 
Method Summary
protected  void addBase(CCTask task, long base, Vector args)
           
protected  void addEntry(CCTask task, String entry, Vector args)
           
protected  void addImpliedArgs(CCTask task, boolean debug, LinkType linkType, Vector args)
           
protected  void addIncremental(CCTask task, boolean incremental, Vector args)
           
protected  int addLibraryPatterns(String[] libnames, StringBuffer buf, String prefix, String extension, String[] patterns, int offset)
           
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)
           
 String getCommandFileSwitch(String commandFile)
           
protected  String getDynamicLibFlag()
           
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)
           
protected  String getStaticLibFlag()
           
 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 com.github.maven_nar.cpptasks.compiler.CommandLineLinker
addFixed, createConfiguration, decorateLinkerOption, getCommand, getCommandWithPath, getIdentifier, getLibtoolLinker, getOutputFileSwitch, getStartupObject, link, prepareFilename, prepareResponseFile, quoteFilename, runCommand, setCommand
 
Methods inherited from class com.github.maven_nar.cpptasks.compiler.AbstractLinker
addVersionFiles, bid, changeEnvironment, createConfiguration
 
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
getLinker
 

Constructor Detail

AbstractLdLinker

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

addBase

protected void addBase(CCTask task,
                       long base,
                       Vector args)
Overrides:
addBase in class CommandLineLinker

addImpliedArgs

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

addIncremental

protected void addIncremental(CCTask task,
                              boolean incremental,
                              Vector args)
Overrides:
addIncremental in class CommandLineLinker

addLibraryPatterns

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

addLibrarySets

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

addMap

protected void addMap(CCTask task,
                      boolean map,
                      Vector args)
Overrides:
addMap in class CommandLineLinker

addStack

protected void addStack(CCTask task,
                        int stack,
                        Vector args)
Overrides:
addStack in class CommandLineLinker

addEntry

protected void addEntry(CCTask task,
                        String entry,
                        Vector args)
Overrides:
addEntry in class CommandLineLinker

getCommandFileSwitch

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

getEnvironmentIncludePath

protected File[] getEnvironmentIncludePath()
Returns library path.


getLibraryKey

public String getLibraryKey(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 File[] getLibraryPath()
Returns library path.


getLibraryPatterns

public String[] getLibraryPatterns(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 String[] getOutputFileNames(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 String[] getOutputFileSwitch(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 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 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 String getDynamicLibFlag()

getStaticLibFlag

protected String getStaticLibFlag()


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.