]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranLinker.java
Restructuring for better separation of Tool packages.
[mirror_edk2.git] / Tools / Java / Source / Cpptasks / net / sf / antcontrib / cpptasks / compaq / CompaqVisualFortranLinker.java
1 /*
2 *
3 * Copyright 2002-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.compaq;
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.devstudio.DevStudioCompatibleLinker;
23 /**
24 * Adapter for the Compaq(r) Visual Fortran linker.
25 *
26 * @author Curt Arnold
27 */
28 public final class CompaqVisualFortranLinker extends DevStudioCompatibleLinker {
29 private static final CompaqVisualFortranLinker dllLinker = new CompaqVisualFortranLinker(
30 ".dll");
31 private static final CompaqVisualFortranLinker instance = new CompaqVisualFortranLinker(
32 ".exe");
33 public static CompaqVisualFortranLinker getInstance() {
34 return instance;
35 }
36 private CompaqVisualFortranLinker(String outputSuffix) {
37 super("DF", "__bogus__.xxx", outputSuffix);
38 }
39 protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args) {
40 args.addElement("/NOLOGO");
41 boolean staticRuntime = linkType.isStaticRuntime();
42 if (staticRuntime) {
43 args.addElement("/libs:static");
44 } else {
45 args.addElement("/libs:dll");
46 }
47 if (debug) {
48 args.addElement("/debug");
49 } else {
50 }
51 if (linkType.isSharedLibrary()) {
52 args.addElement("/dll");
53 } else {
54 args.addElement("/exe");
55 }
56 }
57 public Linker getLinker(LinkType type) {
58 if (type.isStaticLibrary()) {
59 return CompaqVisualFortranLibrarian.getInstance();
60 }
61 if (type.isSharedLibrary()) {
62 return dllLinker;
63 }
64 return instance;
65 }
66 public String[] getOutputFileSwitch(String outputFile) {
67 StringBuffer buf = new StringBuffer("/OUT:");
68 if (outputFile.indexOf(' ') >= 0) {
69 buf.append('"');
70 buf.append(outputFile);
71 buf.append('"');
72 } else {
73 buf.append(outputFile);
74 }
75 return new String[]{buf.toString()};
76 }
77 }