diff options
Diffstat (limited to 'src/net/sf/antcontrib/cpptasks/compiler')
7 files changed, 41 insertions, 4 deletions
diff --git a/src/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java b/src/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java index e61bd64..a572930 100644 --- a/src/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java +++ b/src/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java @@ -41,6 +41,7 @@ public abstract class AbstractCompiler extends AbstractProcessor Compiler { private static final String[] emptyIncludeArray = new String[0]; private String outputSuffix; + private static String outputFilePrefix; protected AbstractCompiler(String[] sourceExtensions, String[] headerExtensions, String outputSuffix) { super(sourceExtensions, headerExtensions); @@ -205,4 +206,8 @@ public abstract class AbstractCompiler extends AbstractProcessor } return false; } + + public void setOutputFilePrefix(String outputFilePrefix){ + this.outputFilePrefix = outputFilePrefix; + } } diff --git a/src/net/sf/antcontrib/cpptasks/compiler/AbstractLinker.java b/src/net/sf/antcontrib/cpptasks/compiler/AbstractLinker.java index 9de9491..5b5beaf 100644 --- a/src/net/sf/antcontrib/cpptasks/compiler/AbstractLinker.java +++ b/src/net/sf/antcontrib/cpptasks/compiler/AbstractLinker.java @@ -32,8 +32,11 @@ import org.apache.tools.ant.types.Environment; * @author Adam Murdoch */ public abstract class AbstractLinker extends AbstractProcessor - implements - Linker { + implements Linker { + + protected static String outputFilePrefix = null; + + public AbstractLinker(String[] objExtensions, String[] ignoredExtensions) { super(objExtensions, ignoredExtensions); } @@ -64,13 +67,16 @@ public abstract class AbstractLinker extends AbstractProcessor } return bid; } + public Processor changeEnvironment(boolean newEnvironment, Environment env) { return this; } + abstract protected LinkerConfiguration createConfiguration(CCTask task, LinkType linkType, ProcessorDef[] baseConfigs, LinkerDef specificConfig, TargetDef targetPlatform, VersionInfo versionInfo); + public ProcessorConfiguration createConfiguration(CCTask task, LinkType linkType, ProcessorDef[] baseConfigs, ProcessorDef specificConfig, @@ -82,11 +88,17 @@ public abstract class AbstractLinker extends AbstractProcessor return createConfiguration(task, linkType, baseConfigs, (LinkerDef) specificConfig, targetPlatform, versionInfo); } + public String getLibraryKey(File libfile) { return libfile.getName(); } + public abstract String[] getOutputFileNames(String fileName, VersionInfo versionInfo); + public void setOutputFilePrefix(String outputFilePrefix){ + this.outputFilePrefix = outputFilePrefix; + + } /** * Adds source or object files to the bidded fileset to diff --git a/src/net/sf/antcontrib/cpptasks/compiler/CommandLineCompilerConfiguration.java b/src/net/sf/antcontrib/cpptasks/compiler/CommandLineCompilerConfiguration.java index 38492ea..2295a5c 100644 --- a/src/net/sf/antcontrib/cpptasks/compiler/CommandLineCompilerConfiguration.java +++ b/src/net/sf/antcontrib/cpptasks/compiler/CommandLineCompilerConfiguration.java @@ -47,6 +47,7 @@ public final class CommandLineCompilerConfiguration private/* final */ProcessorParam[] params; private/* final */boolean rebuild; private/* final */File[] sysIncludePath; + private static String outputFilePrefix; public CommandLineCompilerConfiguration(CommandLineCompiler compiler, String identifier, File[] includePath, File[] sysIncludePath, File[] envIncludePath, String includePathIdentifier, String[] args, @@ -223,4 +224,7 @@ public final class CommandLineCompilerConfiguration public String getCommand() { return compiler.getCommand(); } + public void setOutputFilePrefix(String outputFilePrefix){ + this.outputFilePrefix = outputFilePrefix; + } } diff --git a/src/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java b/src/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java index f9e4761..52b0d67 100644 --- a/src/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java +++ b/src/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java @@ -54,17 +54,25 @@ public abstract class CommandLineLinker extends AbstractLinker private boolean newEnvironment = false; private String outputSuffix; + protected String outputPrefix; + + public void setOutputPrefix(String outputPrefix){ + this.outputPrefix = outputPrefix; + } + + /** Creates a comand line linker invocation */ public CommandLineLinker(String command, String identifierArg, String[] extensions, - String[] ignoredExtensions, String outputSuffix, + String[] ignoredExtensions, String outputPrefix, String outputSuffix, boolean isLibtool, CommandLineLinker libtoolLinker) { super(extensions, ignoredExtensions); this.command = command; this.identifierArg = identifierArg; + this.outputPrefix = outputPrefix; this.outputSuffix = outputSuffix; this.isLibtool = isLibtool; this.libtoolLinker = libtoolLinker; diff --git a/src/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java b/src/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java index f0aad67..d67ffd3 100644 --- a/src/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java +++ b/src/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java @@ -87,8 +87,13 @@ public final class CommandLineLinkerConfiguration return map; } public String[] getOutputFileNames(String inputFile, VersionInfo versionInfo) { - return linker.getOutputFileNames(inputFile, versionInfo); + return linker.getOutputFileNames(inputFile, versionInfo); } + + public void setOutputFilePrefix(String outputFilePrefix) { + linker.setOutputFilePrefix(outputFilePrefix); + } + public LinkerParam getParam(String name) { for (int i = 0; i < params.length; i++) { if (name.equals(params[i].getName())) diff --git a/src/net/sf/antcontrib/cpptasks/compiler/Linker.java b/src/net/sf/antcontrib/cpptasks/compiler/Linker.java index 672a0e3..32c29ef 100644 --- a/src/net/sf/antcontrib/cpptasks/compiler/Linker.java +++ b/src/net/sf/antcontrib/cpptasks/compiler/Linker.java @@ -77,4 +77,6 @@ public interface Linker extends Processor { final boolean isDebug, final File objDir, final TargetMatcher matcher) throws IOException; + + public void setOutputFilePrefix(String outputFilePrefix); } diff --git a/src/net/sf/antcontrib/cpptasks/compiler/LinkerConfiguration.java b/src/net/sf/antcontrib/cpptasks/compiler/LinkerConfiguration.java index ff7ac5d..c6fe2dc 100644 --- a/src/net/sf/antcontrib/cpptasks/compiler/LinkerConfiguration.java +++ b/src/net/sf/antcontrib/cpptasks/compiler/LinkerConfiguration.java @@ -28,6 +28,7 @@ import org.apache.tools.ant.BuildException; public interface LinkerConfiguration extends ProcessorConfiguration { public LinkerParam getParam(String name); void link(CCTask task, TargetInfo linkTarget) throws BuildException; + public void setOutputFilePrefix(String outputFilePrefix); Linker getLinker(); boolean isDebug(); } |