3 * Copyright 2002-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
.compaq
;
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
.devstudio
.DevStudioCompatibleLinker
;
24 * Adapter for the Compaq(r) Visual Fortran linker.
28 public final class CompaqVisualFortranLinker
extends DevStudioCompatibleLinker
{
29 private static final CompaqVisualFortranLinker dllLinker
= new CompaqVisualFortranLinker(
31 private static final CompaqVisualFortranLinker instance
= new CompaqVisualFortranLinker(
33 public static CompaqVisualFortranLinker
getInstance() {
36 private CompaqVisualFortranLinker(String outputSuffix
) {
37 super("DF", "__bogus__.xxx", outputSuffix
);
39 protected void addImpliedArgs(boolean debug
, LinkType linkType
, Vector args
) {
40 args
.addElement("/NOLOGO");
41 boolean staticRuntime
= linkType
.isStaticRuntime();
43 args
.addElement("/libs:static");
45 args
.addElement("/libs:dll");
48 args
.addElement("/debug");
51 if (linkType
.isSharedLibrary()) {
52 args
.addElement("/dll");
54 args
.addElement("/exe");
57 public Linker
getLinker(LinkType type
) {
58 if (type
.isStaticLibrary()) {
59 return CompaqVisualFortranLibrarian
.getInstance();
61 if (type
.isSharedLibrary()) {
66 public String
[] getOutputFileSwitch(String outputFile
) {
67 StringBuffer buf
= new StringBuffer("/OUT:");
68 if (outputFile
.indexOf(' ') >= 0) {
70 buf
.append(outputFile
);
73 buf
.append(outputFile
);
75 return new String
[]{buf
.toString()};