]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java
Restructuring for better separation of Tool packages.
[mirror_edk2.git] / Tools / Java / Source / Cpptasks / net / sf / antcontrib / cpptasks / ibm / VisualAgeLinker.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.ibm;
18 import java.util.Vector;
19
20 import net.sf.antcontrib.cpptasks.compiler.LinkType;
21 import net.sf.antcontrib.cpptasks.compiler.Linker;
22 import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
23 import net.sf.antcontrib.cpptasks.gcc.GccLibrarian;
24 /**
25 * Adapter for IBM(r) Visual Age(tm) Linker for AIX(tm)
26 *
27 * @author Curt Arnold
28 */
29 public final class VisualAgeLinker extends AbstractLdLinker {
30 private static final String[] discardFiles = new String[]{};
31 private static final String[] objFiles = new String[]{".o", ".a", ".lib",
32 ".dll", ".so", ".sl"};
33 private static final VisualAgeLinker dllLinker = new VisualAgeLinker(
34 "makeC++SharedLib", objFiles, discardFiles, "lib", ".so");
35 private static final VisualAgeLinker instance = new VisualAgeLinker("xlC",
36 objFiles, discardFiles, "", "");
37 public static VisualAgeLinker getInstance() {
38 return instance;
39 }
40 private VisualAgeLinker(String command, String[] extensions,
41 String[] ignoredExtensions, String outputPrefix, String outputSuffix) {
42 //
43 // just guessing that -? might display something useful
44 //
45 super(command, "-?", extensions, ignoredExtensions, outputPrefix,
46 outputSuffix, false, null);
47 }
48 public void addImpliedArgs(boolean debug, LinkType linkType, Vector args) {
49 if (debug) {
50 //args.addElement("-g");
51 }
52 if (linkType.isSharedLibrary()) {
53 //args.addElement("-G");
54 }
55 }
56 public Linker getLinker(LinkType type) {
57 if (type.isStaticLibrary()) {
58 return GccLibrarian.getInstance();
59 }
60 if (type.isSharedLibrary()) {
61 return dllLinker;
62 }
63 return instance;
64 }
65 /**
66 * Gets identifier for the compiler.
67 *
68 * Initial attempt at extracting version information
69 * would lock up. Using a stock response.
70 */
71 public String getIdentifier() {
72 return "VisualAge linker - unidentified version";
73 }
74
75 }