View Javadoc

1   /*
2    * #%L
3    * Native ARchive plugin for Maven
4    * %%
5    * Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
6    * %%
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   * 
11   * http://www.apache.org/licenses/LICENSE-2.0
12   * 
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * #L%
19   */
20  package com.github.maven_nar.cpptasks.compaq;
21  
22  import java.io.File;
23  import java.util.Vector;
24  
25  import com.github.maven_nar.cpptasks.CCTask;
26  import com.github.maven_nar.cpptasks.compiler.CommandLineLinker;
27  import com.github.maven_nar.cpptasks.compiler.LinkType;
28  import com.github.maven_nar.cpptasks.compiler.Linker;
29  import com.github.maven_nar.cpptasks.msvc.MsvcLibrarian;
30  import com.github.maven_nar.cpptasks.msvc.MsvcProcessor;
31  import com.github.maven_nar.cpptasks.types.LibraryTypeEnum;
32  
33  /**
34   * Adapter for the Compaq(r) Visual Fortran Librarian
35   *
36   * @author Curt Arnold
37   */
38  public class CompaqVisualFortranLibrarian extends CommandLineLinker {
39    private static final CompaqVisualFortranLibrarian instance = new CompaqVisualFortranLibrarian();
40  
41    public static CompaqVisualFortranLibrarian getInstance() {
42      return instance;
43    }
44  
45    private CompaqVisualFortranLibrarian() {
46      super("lib", "/bogus", new String[] {
47        ".obj"
48      }, new String[0], ".lib", false, null);
49    }
50  
51    @Override
52    protected void addImpliedArgs(final CCTask task, final boolean debug, final LinkType linkType,
53        final Vector<String> args) {
54      args.addElement("/nologo");
55    }
56  
57    @Override
58    protected String getCommandFileSwitch(final String commandFile) {
59      return MsvcProcessor.getCommandFileSwitch(commandFile);
60    }
61  
62    @Override
63    public File[] getLibraryPath() {
64      return new File[0];
65    }
66  
67    @Override
68    public String[] getLibraryPatterns(final String[] libnames, final LibraryTypeEnum libType) {
69      return new String[0];
70    }
71  
72    @Override
73    public Linker getLinker(final LinkType type) {
74      return CompaqVisualFortranLinker.getInstance().getLinker(type);
75    }
76  
77    @Override
78    protected int getMaximumCommandLength() {
79      return MsvcLibrarian.getInstance().getMaximumCommandLength();
80    }
81  
82    @Override
83    protected String[] getOutputFileSwitch(final String outputFile) {
84      return MsvcLibrarian.getInstance().getOutputFileSwitch(outputFile);
85    }
86  
87    @Override
88    public boolean isCaseSensitive() {
89      return false;
90    }
91  }