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