diff options
author | darius42 <[email protected]> | 2007-09-21 17:57:00 +0000 |
---|---|---|
committer | darius42 <[email protected]> | 2007-09-21 17:57:00 +0000 |
commit | 669990903206d83b4f2c11974cc29dce576a5789 (patch) | |
tree | 7386878e21a208ec5f1633d15fa94cd2d46ca213 /src/main/java/net | |
parent | 91b61f8842a491f1bf9cb6d59f648b6eb5f16190 (diff) |
Fix for bug 1794867 - LinkerDef wasn't correctly handling references.
Refactored code so that it relies on the correct behavior in ProcessorDef.
git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/cpptasks/trunk@145 32d7a393-a5a9-423c-abd3-5d954feb1f2f
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/sf/antcontrib/cpptasks/LinkerDef.java | 30 | ||||
-rw-r--r-- | src/main/java/net/sf/antcontrib/cpptasks/ProcessorDef.java | 13 |
2 files changed, 18 insertions, 25 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/LinkerDef.java b/src/main/java/net/sf/antcontrib/cpptasks/LinkerDef.java index af1d307..b2e39d7 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/LinkerDef.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/LinkerDef.java @@ -115,30 +115,6 @@ public class LinkerDef extends ProcessorDef { sysLibrarySets.addElement(libset); } - - public ProcessorConfiguration createConfiguration(CCTask task, - LinkType linkType, ProcessorDef baseDef, - TargetDef targetPlatform, - VersionInfo versionInfo) { - // - // must combine some local context (the linkType) - // with the referenced element - // - // get a pointer to the definition (either local or referenced) - ProcessorDef thisDef = this; - if (isReference()) { - thisDef = ((ProcessorDef) getCheckedRef(ProcessorDef.class, - "ProcessorDef")); - } - // - // find the appropriate processor (combines local linkType - // with possibly remote linker name) - Processor proc = getProcessor(); - proc = proc.getLinker(linkType); - ProcessorDef[] defaultProviders = getDefaultProviders(baseDef); - return proc.createConfiguration(task, linkType, defaultProviders, - thisDef, targetPlatform, versionInfo); - } public void execute() throws org.apache.tools.ant.BuildException { throw new org.apache.tools.ant.BuildException( "Not an actual task, but looks like one for documentation purposes"); @@ -281,6 +257,12 @@ public class LinkerDef extends ProcessorDef { } return linker; } + + public Processor getProcessor(LinkType linkType) { + Processor proc = getProcessor(); + return proc.getLinker(linkType); + } + public int getStack(LinkerDef[] defaultProviders, int index) { if (isReference()) { return ((LinkerDef) getCheckedRef(LinkerDef.class, "LinkerDef")) diff --git a/src/main/java/net/sf/antcontrib/cpptasks/ProcessorDef.java b/src/main/java/net/sf/antcontrib/cpptasks/ProcessorDef.java index 334efa6..864be59 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/ProcessorDef.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/ProcessorDef.java @@ -188,7 +188,7 @@ public abstract class ProcessorDef extends DataType { baseDef, targetPlatform, versionInfo); } ProcessorDef[] defaultProviders = getDefaultProviders(baseDef); - Processor proc = getProcessor(); + Processor proc = getProcessor(linkType); return proc.createConfiguration(task, linkType, defaultProviders, this, targetPlatform, versionInfo); } /** @@ -358,6 +358,17 @@ public abstract class ProcessorDef extends DataType { } return processor; } + + /** + * Obtains the appropriate processor (compiler, linker) based on the + * LinkType. + * + * @return processor + */ + protected Processor getProcessor(LinkType linkType) { + // by default ignore the linkType. + return getProcessor(); + } /** * Gets a boolean value indicating whether all targets must be rebuilt * regardless of dependency analysis. |