]> git.proxmox.com Git - mirror_edk2.git/blob - 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
1 /*
2 *
3 * Copyright 2001-2004 The Ant-Contrib project
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package net.sf.antcontrib.cpptasks.ti;
18 import java.io.File;
19 import java.util.Vector;
20
21 import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
22 import net.sf.antcontrib.cpptasks.compiler.LinkType;
23 import net.sf.antcontrib.cpptasks.compiler.Linker;
24 import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
25
26 /**
27 * Adapter for TI DSP linkers
28 * *
29 * @author CurtA
30 *
31 */
32 public class ClxxLinker extends CommandLineLinker {
33 private static final ClxxLinker cl55DllInstance = new ClxxLinker("lnk55",
34 ".dll");
35 private static final ClxxLinker cl55Instance = new ClxxLinker("lnk55",
36 ".exe");
37 private static final ClxxLinker cl6xDllInstance = new ClxxLinker("lnk6x",
38 ".dll");
39 private static final ClxxLinker cl6xInstance = new ClxxLinker("lnk6x",
40 ".exe");
41 public static ClxxLinker getCl55DllInstance() {
42 return cl55DllInstance;
43 }
44 public static ClxxLinker getCl55Instance() {
45 return cl55Instance;
46 }
47 public static ClxxLinker getCl6xDllInstance() {
48 return cl6xDllInstance;
49 }
50 public static ClxxLinker getCl6xInstance() {
51 return cl6xInstance;
52 }
53 private ClxxLinker(String command, String outputSuffix) {
54 super(command, "-h", new String[]{".o", ".lib", ".res"}, new String[]{
55 ".map", ".pdb", ".lnk"}, outputSuffix, false, null);
56 }
57 /*
58 * (non-Javadoc)
59 *
60 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addBase(long,
61 * java.util.Vector)
62 */
63 protected void addBase(long base, Vector args) {
64 }
65 /*
66 * (non-Javadoc)
67 *
68 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addFixed(java.lang.Boolean,
69 * java.util.Vector)
70 */
71 protected void addFixed(Boolean fixed, Vector args) {
72 }
73 /*
74 * (non-Javadoc)
75 *
76 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addImpliedArgs(boolean,
77 * net.sf.antcontrib.cpptasks.compiler.LinkType, java.util.Vector)
78 */
79 protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
80 if (linkType.isSharedLibrary()) {
81 args.addElement("-abs");
82 }
83 }
84 /*
85 * (non-Javadoc)
86 *
87 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addIncremental(boolean,
88 * java.util.Vector)
89 */
90 protected void addIncremental(boolean incremental, Vector args) {
91 }
92 /*
93 * (non-Javadoc)
94 *
95 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addMap(boolean,
96 * java.util.Vector)
97 */
98 protected void addMap(boolean map, Vector args) {
99 if (map) {
100 args.addElement("-m");
101 }
102 }
103 /*
104 * (non-Javadoc)
105 *
106 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addStack(int,
107 * java.util.Vector)
108 */
109 protected void addStack(int stack, Vector args) {
110 }
111 /* (non-Javadoc)
112 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
113 */
114 protected void addEntry(String entry, Vector args) {
115 }
116
117 /*
118 * (non-Javadoc)
119 *
120 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getCommandFileSwitch(java.lang.String)
121 */
122 protected String getCommandFileSwitch(String commandFile) {
123 return "@" + commandFile;
124 }
125 /*
126 * (non-Javadoc)
127 *
128 * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPath()
129 */
130 public File[] getLibraryPath() {
131 return new File[0];
132 }
133 /*
134 * (non-Javadoc)
135 *
136 * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPatterns(java.lang.String[])
137 */
138 public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
139 //
140 // TODO: Looks bogus, should be .a or .so's not .o's
141 //
142 String[] libpats = new String[libnames.length];
143 for (int i = 0; i < libnames.length; i++) {
144 libpats[i] = libnames[i] + ".o";
145 }
146 return libpats;
147 }
148 /*
149 * (non-Javadoc)
150 *
151 * @see net.sf.antcontrib.cpptasks.compiler.Processor#getLinker(net.sf.antcontrib.cpptasks.compiler.LinkType)
152 */
153 public Linker getLinker(LinkType linkType) {
154 return this;
155 }
156 /*
157 * (non-Javadoc)
158 *
159 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getMaximumCommandLength()
160 */
161 protected int getMaximumCommandLength() {
162 return 1024;
163 }
164 /*
165 * (non-Javadoc)
166 *
167 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getOutputFileSwitch(java.lang.String)
168 */
169 protected String[] getOutputFileSwitch(String outputFile) {
170 return new String[]{"-o", outputFile};
171 }
172 /*
173 * (non-Javadoc)
174 *
175 * @see net.sf.antcontrib.cpptasks.compiler.Linker#isCaseSensitive()
176 */
177 public boolean isCaseSensitive() {
178 // TODO Auto-generated method stub
179 return false;
180 }
181 }