--- /dev/null
+/*\r
+ * \r
+ * Copyright 2002-2004 The Ant-Contrib project\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package net.sf.antcontrib.cpptasks.compaq;\r
+import java.util.Vector;\r
+\r
+import net.sf.antcontrib.cpptasks.compiler.LinkType;\r
+import net.sf.antcontrib.cpptasks.compiler.Linker;\r
+import net.sf.antcontrib.cpptasks.devstudio.DevStudioCompatibleLinker;\r
+/**\r
+ * Adapter for the Compaq(r) Visual Fortran linker.\r
+ * \r
+ * @author Curt Arnold\r
+ */\r
+public final class CompaqVisualFortranLinker extends DevStudioCompatibleLinker {\r
+ private static final CompaqVisualFortranLinker dllLinker = new CompaqVisualFortranLinker(\r
+ ".dll");\r
+ private static final CompaqVisualFortranLinker instance = new CompaqVisualFortranLinker(\r
+ ".exe");\r
+ public static CompaqVisualFortranLinker getInstance() {\r
+ return instance;\r
+ }\r
+ private CompaqVisualFortranLinker(String outputSuffix) {\r
+ super("DF", "__bogus__.xxx", outputSuffix);\r
+ }\r
+ protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args) {\r
+ args.addElement("/NOLOGO");\r
+ boolean staticRuntime = linkType.isStaticRuntime();\r
+ if (staticRuntime) {\r
+ args.addElement("/libs:static");\r
+ } else {\r
+ args.addElement("/libs:dll");\r
+ }\r
+ if (debug) {\r
+ args.addElement("/debug");\r
+ } else {\r
+ }\r
+ if (linkType.isSharedLibrary()) {\r
+ args.addElement("/dll");\r
+ } else {\r
+ args.addElement("/exe");\r
+ }\r
+ }\r
+ public Linker getLinker(LinkType type) {\r
+ if (type.isStaticLibrary()) {\r
+ return CompaqVisualFortranLibrarian.getInstance();\r
+ }\r
+ if (type.isSharedLibrary()) {\r
+ return dllLinker;\r
+ }\r
+ return instance;\r
+ }\r
+ public String[] getOutputFileSwitch(String outputFile) {\r
+ StringBuffer buf = new StringBuffer("/OUT:");\r
+ if (outputFile.indexOf(' ') >= 0) {\r
+ buf.append('"');\r
+ buf.append(outputFile);\r
+ buf.append('"');\r
+ } else {\r
+ buf.append(outputFile);\r
+ }\r
+ return new String[]{buf.toString()};\r
+ }\r
+}\r