3 * Copyright 2001-2004 The Ant-Contrib project
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package net
.sf
.antcontrib
.cpptasks
.ibm
;
18 import java
.util
.Vector
;
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
;
25 * Adapter for IBM(r) Visual Age(tm) Linker for AIX(tm)
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() {
40 private VisualAgeLinker(String command
, String
[] extensions
,
41 String
[] ignoredExtensions
, String outputPrefix
, String outputSuffix
) {
43 // just guessing that -? might display something useful
45 super(command
, "-?", extensions
, ignoredExtensions
, outputPrefix
,
46 outputSuffix
, false, null);
48 public void addImpliedArgs(boolean debug
, LinkType linkType
, Vector args
) {
50 //args.addElement("-g");
52 if (linkType
.isSharedLibrary()) {
53 //args.addElement("-G");
56 public Linker
getLinker(LinkType type
) {
57 if (type
.isStaticLibrary()) {
58 return GccLibrarian
.getInstance();
60 if (type
.isSharedLibrary()) {
66 * Gets identifier for the compiler.
68 * Initial attempt at extracting version information
69 * would lock up. Using a stock response.
71 public String
getIdentifier() {
72 return "VisualAge linker - unidentified version";