]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLinker.java
Restructuring for better separation of Tool packages.
[mirror_edk2.git] / Tools / Java / Source / Cpptasks / net / sf / antcontrib / cpptasks / ti / ClxxLinker.java
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLinker.java
new file mode 100644 (file)
index 0000000..43ee7c0
--- /dev/null
@@ -0,0 +1,181 @@
+/*\r
+ * \r
+ * Copyright 2001-2004 The Ant-Contrib project\r
+ *\r
+ *  Licensed under the Apache License, Version 2.0 (the "License");\r
+ *  you may not use this file except in compliance with the License.\r
+ *  You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ *  Unless required by applicable law or agreed to in writing, software\r
+ *  distributed under the License is distributed on an "AS IS" BASIS,\r
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ *  See the License for the specific language governing permissions and\r
+ *  limitations under the License.\r
+ */\r
+package net.sf.antcontrib.cpptasks.ti;\r
+import java.io.File;\r
+import java.util.Vector;\r
+\r
+import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;\r
+import net.sf.antcontrib.cpptasks.compiler.LinkType;\r
+import net.sf.antcontrib.cpptasks.compiler.Linker;\r
+import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;\r
+\r
+/**\r
+ * Adapter for TI DSP linkers\r
+ *  *\r
+ * @author CurtA\r
+ *  \r
+ */\r
+public class ClxxLinker extends CommandLineLinker {\r
+    private static final ClxxLinker cl55DllInstance = new ClxxLinker("lnk55",\r
+            ".dll");\r
+    private static final ClxxLinker cl55Instance = new ClxxLinker("lnk55",\r
+            ".exe");\r
+    private static final ClxxLinker cl6xDllInstance = new ClxxLinker("lnk6x",\r
+            ".dll");\r
+    private static final ClxxLinker cl6xInstance = new ClxxLinker("lnk6x",\r
+            ".exe");\r
+    public static ClxxLinker getCl55DllInstance() {\r
+        return cl55DllInstance;\r
+    }\r
+    public static ClxxLinker getCl55Instance() {\r
+        return cl55Instance;\r
+    }\r
+    public static ClxxLinker getCl6xDllInstance() {\r
+        return cl6xDllInstance;\r
+    }\r
+    public static ClxxLinker getCl6xInstance() {\r
+        return cl6xInstance;\r
+    }\r
+    private ClxxLinker(String command, String outputSuffix) {\r
+        super(command, "-h", new String[]{".o", ".lib", ".res"}, new String[]{\r
+                ".map", ".pdb", ".lnk"}, outputSuffix, false, null);\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addBase(long,\r
+     *      java.util.Vector)\r
+     */\r
+    protected void addBase(long base, Vector args) {\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addFixed(java.lang.Boolean,\r
+     *      java.util.Vector)\r
+     */\r
+    protected void addFixed(Boolean fixed, Vector args) {\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addImpliedArgs(boolean,\r
+     *      net.sf.antcontrib.cpptasks.compiler.LinkType, java.util.Vector)\r
+     */\r
+    protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {\r
+        if (linkType.isSharedLibrary()) {\r
+            args.addElement("-abs");\r
+        }\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addIncremental(boolean,\r
+     *      java.util.Vector)\r
+     */\r
+    protected void addIncremental(boolean incremental, Vector args) {\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addMap(boolean,\r
+     *      java.util.Vector)\r
+     */\r
+    protected void addMap(boolean map, Vector args) {\r
+        if (map) {\r
+            args.addElement("-m");\r
+        }\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addStack(int,\r
+     *      java.util.Vector)\r
+     */\r
+    protected void addStack(int stack, Vector args) {\r
+    }\r
+    /* (non-Javadoc)\r
+     * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)\r
+     */\r
+    protected void addEntry(String entry, Vector args) {\r
+    }\r
+    \r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getCommandFileSwitch(java.lang.String)\r
+     */\r
+    protected String getCommandFileSwitch(String commandFile) {\r
+        return "@" + commandFile;\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPath()\r
+     */\r
+    public File[] getLibraryPath() {\r
+        return new File[0];\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPatterns(java.lang.String[])\r
+     */\r
+    public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {\r
+       //\r
+       //  TODO: Looks bogus, should be .a or .so's not .o's\r
+       //\r
+       String[] libpats = new String[libnames.length];\r
+        for (int i = 0; i < libnames.length; i++) {\r
+            libpats[i] = libnames[i] + ".o";\r
+        }\r
+        return libpats;\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.Processor#getLinker(net.sf.antcontrib.cpptasks.compiler.LinkType)\r
+     */\r
+    public Linker getLinker(LinkType linkType) {\r
+        return this;\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getMaximumCommandLength()\r
+     */\r
+    protected int getMaximumCommandLength() {\r
+        return 1024;\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getOutputFileSwitch(java.lang.String)\r
+     */\r
+    protected String[] getOutputFileSwitch(String outputFile) {\r
+        return new String[]{"-o", outputFile};\r
+    }\r
+    /*\r
+     * (non-Javadoc)\r
+     * \r
+     * @see net.sf.antcontrib.cpptasks.compiler.Linker#isCaseSensitive()\r
+     */\r
+    public boolean isCaseSensitive() {\r
+        // TODO Auto-generated method stub\r
+        return false;\r
+    }\r
+}\r