]> git.proxmox.com Git - mirror_edk2.git/blob - 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
1 /*
2 *
3 * Copyright 2001-2004 The Ant-Contrib project
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package net.sf.antcontrib.cpptasks.ibm;
18 import java.io.File;
19 import java.util.Vector;
20
21 import net.sf.antcontrib.cpptasks.compiler.LinkType;
22 import net.sf.antcontrib.cpptasks.compiler.Linker;
23 import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler;
24 import net.sf.antcontrib.cpptasks.OptimizationEnum;
25
26 import org.apache.tools.ant.types.Environment;
27 /**
28 * Adapter for the IBM(r) Visual Age(tm) C++ compiler for AIX(tm)
29 *
30 * @author Curt Arnold
31 */
32 public final class VisualAgeCCompiler extends GccCompatibleCCompiler {
33 private static final VisualAgeCCompiler instance = new VisualAgeCCompiler(
34 "xlC", false, null);
35 /**
36 * Gets singleton instance of this class
37 */
38 public static VisualAgeCCompiler getInstance() {
39 return instance;
40 }
41 private String identifier;
42 private File[] includePath;
43 /**
44 * Private constructor. Use getInstance() to get singleton instance of this
45 * class.
46 */
47 private VisualAgeCCompiler(String command, boolean newEnvironment,
48 Environment env) {
49 super(command, "-help", false, null, newEnvironment, env);
50 }
51 public void addImpliedArgs(final Vector args,
52 final boolean debug,
53 final boolean multithreaded,
54 final boolean exceptions,
55 final LinkType linkType,
56 final Boolean rtti,
57 final OptimizationEnum optimization) {
58 args.addElement("-c");
59 if (debug) {
60 args.addElement("-g");
61 }
62 if (linkType.isSharedLibrary()) {
63 args.addElement("-fpic");
64 }
65 if (rtti != null) {
66 if (rtti.booleanValue()) {
67 args.addElement("-qrtti=all");
68 } else {
69 args.addElement("-qnortti");
70 }
71 }
72 }
73 public void addWarningSwitch(Vector args, int level) {
74 switch (level) {
75 case 0 :
76 args.addElement("-w");
77 break;
78 case 1 :
79 args.addElement("-qflag=s:s");
80 break;
81 case 2 :
82 args.addElement("-qflag=e:e");
83 break;
84 case 3 :
85 args.addElement("-qflag=w:w");
86 break;
87 case 4 :
88 args.addElement("-qflag=i:i");
89 break;
90 case 5 :
91 args.addElement("-qhalt=w:w");
92 break;
93 }
94 }
95 public Linker getLinker(LinkType linkType) {
96 return VisualAgeLinker.getInstance().getLinker(linkType);
97 }
98 public int getMaximumCommandLength() {
99 return Integer.MAX_VALUE;
100 }
101 /**
102 * Gets identifier for the compiler.
103 *
104 * Initial attempt at extracting version information
105 * would lock up. Using a stock response.
106 */
107 public String getIdentifier() {
108 return "VisualAge compiler - unidentified version";
109 }
110
111 }