]>
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.devstudio;\r | |
18 | import java.io.File;\r | |
19 | import java.util.Vector;\r | |
20 | \r | |
21 | import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;\r | |
22 | import net.sf.antcontrib.cpptasks.compiler.LinkType;\r | |
23 | import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;\r | |
24 | /**\r | |
25 | * Abstract base adapter for librarians with command line options compatible\r | |
26 | * with the Microsoft(r) Library Manager\r | |
27 | * \r | |
28 | * @author Curt Arnold\r | |
29 | */\r | |
30 | public abstract class DevStudioCompatibleLibrarian extends CommandLineLinker {\r | |
31 | private static String[] defaultflags = new String[]{"/nologo"};\r | |
32 | public DevStudioCompatibleLibrarian(String command, String identifierArg) {\r | |
33 | super(command, identifierArg, new String[]{".obj"}, new String[0],\r | |
34 | ".lib", false, null);\r | |
35 | }\r | |
36 | protected void addBase(long base, Vector args) {\r | |
37 | }\r | |
38 | protected void addFixed(Boolean fixed, Vector args) {\r | |
39 | }\r | |
40 | protected void addImpliedArgs(boolean debug, LinkType linkType, \r | |
41 | Vector args, Boolean defaultflag) {\r | |
42 | if(defaultflag != null && defaultflag.booleanValue()){\r | |
43 | for (int i = 0; i < defaultflags.length; i++) {\r | |
44 | args.addElement(defaultflags[i]);\r | |
45 | }\r | |
46 | }\r | |
47 | }\r | |
48 | protected void addIncremental(boolean incremental, Vector args) {\r | |
49 | }\r | |
50 | protected void addMap(boolean map, Vector args) {\r | |
51 | }\r | |
52 | protected void addStack(int stack, Vector args) {\r | |
53 | }\r | |
54 | /* (non-Javadoc)\r | |
55 | * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)\r | |
56 | */\r | |
57 | protected void addEntry(String entry, Vector args) {\r | |
58 | }\r | |
59 | \r | |
60 | protected String getCommandFileSwitch(String cmdFile) {\r | |
61 | return "@" + cmdFile;\r | |
62 | }\r | |
63 | public File[] getLibraryPath() {\r | |
64 | return new File[0];\r | |
65 | }\r | |
66 | public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {\r | |
67 | return new String[0];\r | |
68 | }\r | |
69 | public int getMaximumCommandLength() {\r | |
70 | return 4096;\r | |
71 | }\r | |
72 | public String[] getOutputFileSwitch(String outFile) {\r | |
73 | StringBuffer buf = new StringBuffer("/OUT:");\r | |
74 | if (outFile.indexOf(' ') >= 0) {\r | |
75 | buf.append('"');\r | |
76 | buf.append(outFile);\r | |
77 | buf.append('"');\r | |
78 | } else {\r | |
79 | buf.append(outFile);\r | |
80 | }\r | |
81 | return new String[]{buf.toString()};\r | |
82 | }\r | |
83 | public boolean isCaseSensitive() {\r | |
84 | return false;\r | |
85 | }\r | |
86 | }\r |