net.sf.antcontrib.cpptasks.borland
Class BorlandLibrarian

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.borland.BorlandLibrarian
All Implemented Interfaces:
java.lang.Cloneable, Linker, Processor

public class BorlandLibrarian
extends CommandLineLinker

Adapter for the Borland(r) tlib Librarian

Author:
Curt Arnold

Field Summary
 
Fields inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
DEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID
 
Method Summary
protected  void addBase(long base, java.util.Vector args)
           
protected  void addEntry(java.lang.String entry, java.util.Vector args)
           
protected  void addFixed(java.lang.Boolean fixed, java.util.Vector args)
           
protected  void addImpliedArgs(boolean debug, LinkType linkType, java.util.Vector args)
           
protected  void addIncremental(boolean incremental, java.util.Vector args)
           
protected  void addMap(boolean map, java.util.Vector args)
           
protected  void addStack(int stack, java.util.Vector args)
           
protected  java.lang.String getCommandFileSwitch(java.lang.String cmdFile)
           
 java.lang.String getIdentifier()
          Gets identifier for the linker.
static BorlandLibrarian getInstance()
           
 java.io.File[] getLibraryPath()
          returns the library path for the linker
 java.lang.String[] getLibraryPatterns(java.lang.String[] libnames, LibraryTypeEnum libType)
          Returns a set of filename patterns corresponding to library names.
 Linker getLinker(LinkType type)
          Gets the linker for the specified link type.
 int getMaximumCommandLength()
           
 java.lang.String[] getOutputFileSwitch(java.lang.String outFile)
           
 boolean isCaseSensitive()
          Returns true if the linker is case-sensitive
 void link(CCTask task, java.io.File outputFile, java.lang.String[] sourceFiles, CommandLineLinkerConfiguration config)
          Builds a library
protected  java.lang.String[] prepareArguments(CCTask task, java.lang.String outputDir, java.lang.String outputName, java.lang.String[] sourceFiles, CommandLineLinkerConfiguration config)
          Prepares argument list for exec command.
protected  java.lang.String[] prepareResponseFile(java.io.File outputFile, java.lang.String[] args)
          Prepares argument list to execute the linker using a response file.
protected  java.lang.String quoteFilename(java.lang.StringBuffer buf, java.lang.String filename)
          Encloses problematic file names within quotes.
 
Methods inherited from class net.sf.antcontrib.cpptasks.compiler.CommandLineLinker
addLibrarySets, createConfiguration, decorateLinkerOption, getCommand, getLibtoolLinker, getOutputFileNames, getOutputFileSwitch, getStartupObject, prepareFilename, runCommand, setCommand
 
Methods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractLinker
addVersionFiles, bid, changeEnvironment, createConfiguration, getLibraryKey
 
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
 

Method Detail

getInstance

public static BorlandLibrarian getInstance()

addBase

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

addFixed

protected 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

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

addMap

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

addStack

protected 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

protected java.lang.String getCommandFileSwitch(java.lang.String cmdFile)
Specified by:
getCommandFileSwitch in class CommandLineLinker

getLibraryPath

public java.io.File[] getLibraryPath()
Description copied from interface: Linker
returns the library path for the linker


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

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

getMaximumCommandLength

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

getOutputFileSwitch

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

isCaseSensitive

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


getIdentifier

public java.lang.String getIdentifier()
Gets identifier for the linker. TLIB will lockup when attempting to get version information. Since the Librarian version isn't critical just return a stock response.

Specified by:
getIdentifier in interface Processor
Overrides:
getIdentifier in class CommandLineLinker

prepareArguments

protected java.lang.String[] prepareArguments(CCTask task,
                                              java.lang.String outputDir,
                                              java.lang.String outputName,
                                              java.lang.String[] sourceFiles,
                                              CommandLineLinkerConfiguration config)
Prepares argument list for exec command.

Overrides:
prepareArguments in class CommandLineLinker
Parameters:
outputDir - linker output directory
outputName - linker output name
sourceFiles - linker input files (.obj, .o, .res)
config - linker configuration
task - compilation task.
Returns:
arguments for runTask

prepareResponseFile

protected java.lang.String[] prepareResponseFile(java.io.File outputFile,
                                                 java.lang.String[] args)
                                          throws java.io.IOException
Prepares argument list to execute the linker using a response file.

Overrides:
prepareResponseFile in class CommandLineLinker
Parameters:
outputFile - linker output file
args - output of prepareArguments
Returns:
arguments for runTask
Throws:
java.io.IOException

link

public void link(CCTask task,
                 java.io.File outputFile,
                 java.lang.String[] sourceFiles,
                 CommandLineLinkerConfiguration config)
          throws org.apache.tools.ant.BuildException
Builds a library

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

quoteFilename

protected java.lang.String quoteFilename(java.lang.StringBuffer buf,
                                         java.lang.String filename)
Encloses problematic file names within quotes.

Overrides:
quoteFilename in class CommandLineLinker
Parameters:
buf - string buffer
filename - source file name
Returns:
filename potentially enclosed in quotes.


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