]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/ibm/VisualAgeCCompiler.java
Changed spelling to manifest
[mirror_edk2.git] / Tools / Source / Cpptasks / net / sf / antcontrib / cpptasks / ibm / VisualAgeCCompiler.java
CommitLineData
878ddf1f 1/*\r
2 * \r
3 * Copyright 2001-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
17package net.sf.antcontrib.cpptasks.ibm;\r
18import java.io.File;\r
19import java.util.Vector;\r
20\r
21import net.sf.antcontrib.cpptasks.compiler.LinkType;\r
22import net.sf.antcontrib.cpptasks.compiler.Linker;\r
23import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler;\r
24import net.sf.antcontrib.cpptasks.OptimizationEnum;\r
25\r
26import org.apache.tools.ant.types.Environment;\r
27/**\r
28 * Adapter for the IBM(r) Visual Age(tm) C++ compiler for AIX(tm)\r
29 * \r
30 * @author Curt Arnold\r
31 */\r
32public final class VisualAgeCCompiler extends GccCompatibleCCompiler {\r
33 private static final VisualAgeCCompiler instance = new VisualAgeCCompiler(\r
34 "xlC", false, null);\r
35 /**\r
36 * Gets singleton instance of this class\r
37 */\r
38 public static VisualAgeCCompiler getInstance() {\r
39 return instance;\r
40 }\r
41 private String identifier;\r
42 private File[] includePath;\r
43 /**\r
44 * Private constructor. Use getInstance() to get singleton instance of this\r
45 * class.\r
46 */\r
47 private VisualAgeCCompiler(String command, boolean newEnvironment,\r
48 Environment env) {\r
49 super(command, "-help", false, null, newEnvironment, env);\r
50 }\r
51 public void addImpliedArgs(final Vector args, \r
52 final boolean debug,\r
53 final boolean multithreaded, \r
54 final boolean exceptions, \r
55 final LinkType linkType,\r
56 final Boolean rtti,\r
57 final OptimizationEnum optimization) {\r
58 args.addElement("-c");\r
59 if (debug) {\r
60 args.addElement("-g");\r
61 }\r
62 if (linkType.isSharedLibrary()) {\r
63 args.addElement("-fpic");\r
64 }\r
65 if (rtti != null) {\r
66 if (rtti.booleanValue()) {\r
67 args.addElement("-qrtti=all");\r
68 } else {\r
69 args.addElement("-qnortti");\r
70 }\r
71 }\r
72 }\r
73 public void addWarningSwitch(Vector args, int level) {\r
74 switch (level) {\r
75 case 0 :\r
76 args.addElement("-w");\r
77 break;\r
78 case 1 :\r
79 args.addElement("-qflag=s:s");\r
80 break;\r
81 case 2 :\r
82 args.addElement("-qflag=e:e");\r
83 break;\r
84 case 3 :\r
85 args.addElement("-qflag=w:w");\r
86 break;\r
87 case 4 :\r
88 args.addElement("-qflag=i:i");\r
89 break;\r
90 case 5 :\r
91 args.addElement("-qhalt=w:w");\r
92 break;\r
93 }\r
94 }\r
95 public Linker getLinker(LinkType linkType) {\r
96 return VisualAgeLinker.getInstance().getLinker(linkType);\r
97 }\r
98 public int getMaximumCommandLength() {\r
99 return Integer.MAX_VALUE;\r
100 }\r
101 /**\r
102 * Gets identifier for the compiler.\r
103 * \r
104 * Initial attempt at extracting version information\r
105 * would lock up. Using a stock response.\r
106 */\r
107 public String getIdentifier() {\r
108 return "VisualAge compiler - unidentified version";\r
109 }\r
110 \r
111}\r