]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /*\r |
2 | * \r | |
3 | * Copyright 2001-2004 The Ant-Contrib project\r | |
4 | *\r | |
5 | * Licensed under the Apache License, Version 2.0 (the "License");\r | |
6 | * you may not use this file except in compliance with the License.\r | |
7 | * You may obtain a copy of the License at\r | |
8 | *\r | |
9 | * http://www.apache.org/licenses/LICENSE-2.0\r | |
10 | *\r | |
11 | * Unless required by applicable law or agreed to in writing, software\r | |
12 | * distributed under the License is distributed on an "AS IS" BASIS,\r | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r | |
14 | * See the License for the specific language governing permissions and\r | |
15 | * limitations under the License.\r | |
16 | */\r | |
17 | package net.sf.antcontrib.cpptasks.ibm;\r | |
18 | import java.util.Vector;\r | |
19 | \r | |
20 | import net.sf.antcontrib.cpptasks.compiler.LinkType;\r | |
21 | import net.sf.antcontrib.cpptasks.compiler.Linker;\r | |
22 | import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;\r | |
23 | import net.sf.antcontrib.cpptasks.gcc.GccLibrarian;\r | |
24 | /**\r | |
25 | * Adapter for IBM(r) Visual Age(tm) Linker for AIX(tm)\r | |
26 | * \r | |
27 | * @author Curt Arnold\r | |
28 | */\r | |
29 | public final class VisualAgeLinker extends AbstractLdLinker {\r | |
30 | private static final String[] discardFiles = new String[]{};\r | |
31 | private static final String[] objFiles = new String[]{".o", ".a", ".lib",\r | |
32 | ".dll", ".so", ".sl"};\r | |
33 | private static final VisualAgeLinker dllLinker = new VisualAgeLinker(\r | |
34 | "makeC++SharedLib", objFiles, discardFiles, "lib", ".so");\r | |
35 | private static final VisualAgeLinker instance = new VisualAgeLinker("xlC",\r | |
36 | objFiles, discardFiles, "", "");\r | |
37 | public static VisualAgeLinker getInstance() {\r | |
38 | return instance;\r | |
39 | }\r | |
40 | private VisualAgeLinker(String command, String[] extensions,\r | |
41 | String[] ignoredExtensions, String outputPrefix, String outputSuffix) {\r | |
42 | //\r | |
43 | // just guessing that -? might display something useful\r | |
44 | //\r | |
45 | super(command, "-?", extensions, ignoredExtensions, outputPrefix,\r | |
46 | outputSuffix, false, null);\r | |
47 | }\r | |
48 | public void addImpliedArgs(boolean debug, LinkType linkType, Vector args) {\r | |
49 | if (debug) {\r | |
50 | //args.addElement("-g");\r | |
51 | }\r | |
52 | if (linkType.isSharedLibrary()) {\r | |
53 | //args.addElement("-G");\r | |
54 | }\r | |
55 | }\r | |
56 | public Linker getLinker(LinkType type) {\r | |
57 | if (type.isStaticLibrary()) {\r | |
58 | return GccLibrarian.getInstance();\r | |
59 | }\r | |
60 | if (type.isSharedLibrary()) {\r | |
61 | return dllLinker;\r | |
62 | }\r | |
63 | return instance;\r | |
64 | }\r | |
65 | /**\r | |
66 | * Gets identifier for the compiler.\r | |
67 | * \r | |
68 | * Initial attempt at extracting version information\r | |
69 | * would lock up. Using a stock response.\r | |
70 | */\r | |
71 | public String getIdentifier() {\r | |
72 | return "VisualAge linker - unidentified version";\r | |
73 | }\r | |
74 | \r | |
75 | }\r |