]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerEnum.java
Added code to check if "cmd" attribute is valid or not. This is to make error report...
[mirror_edk2.git] / Tools / Java / Source / Cpptasks / net / sf / antcontrib / cpptasks / CompilerEnum.java
CommitLineData
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
17package net.sf.antcontrib.cpptasks;\r
18import net.sf.antcontrib.cpptasks.arm.ADSCCompiler;\r
19import net.sf.antcontrib.cpptasks.borland.BorlandCCompiler;\r
20import net.sf.antcontrib.cpptasks.borland.BorlandResourceCompiler;\r
21import net.sf.antcontrib.cpptasks.compaq.CompaqVisualFortranCompiler;\r
22import net.sf.antcontrib.cpptasks.compiler.Compiler;\r
23import net.sf.antcontrib.cpptasks.devstudio.DevStudioCCompiler;\r
24import net.sf.antcontrib.cpptasks.devstudio.DevStudioMIDLCompiler;\r
25import net.sf.antcontrib.cpptasks.devstudio.DevStudioResourceCompiler;\r
26import net.sf.antcontrib.cpptasks.gcc.GccCCompiler;\r
27import net.sf.antcontrib.cpptasks.hp.aCCCompiler;\r
28import net.sf.antcontrib.cpptasks.ibm.VisualAgeCCompiler;\r
29import net.sf.antcontrib.cpptasks.intel.IntelLinux32CCompiler;\r
30import net.sf.antcontrib.cpptasks.intel.IntelLinux64CCompiler;\r
31import net.sf.antcontrib.cpptasks.intel.IntelWin32CCompiler;\r
32import net.sf.antcontrib.cpptasks.intel.IntelWin64CCompiler;\r
33import net.sf.antcontrib.cpptasks.os390.OS390CCompiler;\r
34import net.sf.antcontrib.cpptasks.os400.IccCompiler;\r
35import net.sf.antcontrib.cpptasks.sun.C89CCompiler;\r
36import net.sf.antcontrib.cpptasks.sun.ForteCCCompiler;\r
37import net.sf.antcontrib.cpptasks.ti.ClxxCCompiler;\r
38\r
39import org.apache.tools.ant.types.EnumeratedAttribute;\r
40/**\r
41 * Enumeration of supported compilers\r
42 * \r
43 * <table width="100%" border="1"> <thead>Supported compilers </thead>\r
44 * <tr>\r
45 * <td>gcc (default)</td>\r
46 * <td>GCC C++ compiler</td>\r
47 * </tr>\r
48 * <tr>\r
49 * <td>g++</td>\r
50 * <td>GCC C++ compiler</td>\r
51 * </tr>\r
52 * <tr>\r
53 * <td>c++</td>\r
54 * <td>GCC C++ compiler</td>\r
55 * </tr>\r
56 * <tr>\r
57 * <td>g77</td>\r
58 * <td>GNU FORTRAN compiler</td>\r
59 * </tr>\r
60 * <tr>\r
61 * <td>msvc</td>\r
62 * <td>Microsoft Visual C++</td>\r
63 * </tr>\r
64 * <tr>\r
65 * <td>bcc</td>\r
66 * <td>Borland C++ Compiler</td>\r
67 * </tr>\r
68 * <tr>\r
69 * <td>msrc</td>\r
70 * <td>Microsoft Resource Compiler</td>\r
71 * </tr>\r
72 * <tr>\r
73 * <td>brc</td>\r
74 * <td>Borland Resource Compiler</td>\r
75 * </tr>\r
76 * <tr>\r
77 * <td>df</td>\r
78 * <td>Compaq Visual Fortran Compiler</td>\r
79 * </tr>\r
80 * <tr>\r
81 * <td>midl</td>\r
82 * <td>Microsoft MIDL Compiler</td>\r
83 * </tr>\r
84 * <tr>\r
85 * <td>icl</td>\r
86 * <td>Intel C++ compiler for Windows (IA-32)</td>\r
87 * </tr>\r
88 * <tr>\r
89 * <td>ecl</td>\r
90 * <td>Intel C++ compiler for Windows (IA-64)</td>\r
91 * </tr>\r
92 * <tr>\r
93 * <td>icc</td>\r
94 * <td>Intel C++ compiler for Linux (IA-32)</td>\r
95 * </tr>\r
96 * <tr>\r
97 * <td>ecc</td>\r
98 * <td>Intel C++ compiler for Linux (IA-64)</td>\r
99 * </tr>\r
100 * <tr>\r
101 * <td>CC</td>\r
102 * <td>Sun ONE C++ compiler</td>\r
103 * </tr>\r
104 * <tr>\r
105 * <td>aCC</td>\r
106 * <td>HP aC++ C++ Compiler</td>\r
107 * </tr>\r
108 * <tr>\r
109 * <td>os390</td>\r
110 * <td>OS390 C Compiler</td>\r
111 * </tr>\r
112 * <tr>\r
113 * <td>os400</td>\r
114 * <td>Icc Compiler</td>\r
115 * </tr>\r
116 * <tr>\r
117 * <td>sunc89</td>\r
118 * <td>Sun C89 C Compiler</td>\r
119 * </tr>\r
120 * <tr>\r
121 * <td>xlC</td>\r
122 * <td>VisualAge C Compiler</td>\r
123 * </tr>\r
124 * <tr>\r
125 * <td>cl6x</td>\r
126 * <td>TI TMS320C6000 Optimizing Compiler</td>\r
127 * </tr>\r
128 * <tr>\r
129 * <td>cl55</td>\r
130 * <td>TI TMS320C55x Optimizing C/C++ Compiler</td>\r
131 * </tr>\r
132 * <tr>\r
133 * <td>armcpp</td>\r
134 * <td>ARM 32-bit C++ compiler</td>\r
135 * </tr>\r
136 * <tr>\r
137 * <td>armcc</td>\r
138 * <td>ARM 32-bit C compiler</td>\r
139 * </tr>\r
140 * <tr>\r
141 * <td>tcpp</td>\r
142 * <td>ARM 16-bit C++ compiler</td>\r
143 * </tr>\r
144 * <tr>\r
145 * <td>tcc</td>\r
146 * <td>ARM 16-bit C compiler</td>\r
147 * </tr>\r
148 * </table>\r
149 * \r
150 * @author Curt Arnold\r
151 * \r
152 */\r
153public class CompilerEnum extends EnumeratedAttribute {\r
154 private final static ProcessorEnumValue[] compilers = new ProcessorEnumValue[]{\r
155 new ProcessorEnumValue("gcc", GccCCompiler.getInstance()),\r
156 new ProcessorEnumValue("g++", GccCCompiler.getGppInstance()),\r
157 new ProcessorEnumValue("c++", GccCCompiler.getCppInstance()),\r
158 new ProcessorEnumValue("g77", GccCCompiler.getG77Instance()),\r
159 new ProcessorEnumValue("msvc", DevStudioCCompiler.getInstance()),\r
160 new ProcessorEnumValue("bcc", BorlandCCompiler.getInstance()),\r
161 new ProcessorEnumValue("msrc", DevStudioResourceCompiler\r
162 .getInstance()),\r
163 new ProcessorEnumValue("brc", BorlandResourceCompiler.getInstance()),\r
164 new ProcessorEnumValue("df", CompaqVisualFortranCompiler\r
165 .getInstance()),\r
166 new ProcessorEnumValue("midl", DevStudioMIDLCompiler.getInstance()),\r
167 new ProcessorEnumValue("icl", IntelWin32CCompiler.getInstance()),\r
168 new ProcessorEnumValue("ecl", IntelWin64CCompiler.getInstance()),\r
169 new ProcessorEnumValue("icc", IntelLinux32CCompiler.getInstance()),\r
170 new ProcessorEnumValue("ecc", IntelLinux64CCompiler.getInstance()),\r
171 new ProcessorEnumValue("CC", ForteCCCompiler.getInstance()),\r
172 new ProcessorEnumValue("aCC", aCCCompiler.getInstance()),\r
173 new ProcessorEnumValue("os390", OS390CCompiler.getInstance()),\r
174 new ProcessorEnumValue("os400", IccCompiler.getInstance()),\r
175 new ProcessorEnumValue("sunc89", C89CCompiler.getInstance()),\r
176 new ProcessorEnumValue("xlC", VisualAgeCCompiler.getInstance()),\r
177 new ProcessorEnumValue("cl6x", ClxxCCompiler.getCl6xInstance()),\r
178 new ProcessorEnumValue("cl55", ClxxCCompiler.getCl55Instance()),\r
179 new ProcessorEnumValue("armcc", ADSCCompiler.getArmCC()),\r
180 new ProcessorEnumValue("armcpp", ADSCCompiler.getArmCpp()),\r
181 new ProcessorEnumValue("tcc", ADSCCompiler.getThumbCC()),\r
182 new ProcessorEnumValue("tcpp", ADSCCompiler.getThumbCpp()),\r
183 // userdefined\r
184 //new ProcessorEnumValue("userdefine", UserdefineCompiler.getInstance()),\r
185 // GCC Cross Compilers\r
186 new ProcessorEnumValue(\r
187 "sparc-sun-solaris2-gcc",\r
188 net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.GccCCompiler\r
189 .getInstance()),\r
190 new ProcessorEnumValue(\r
191 "sparc-sun-solaris2-g++",\r
192 net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.GccCCompiler\r
193 .getGppInstance()),\r
194 new ProcessorEnumValue(\r
195 "sparc-sun-solaris2-c++",\r
196 net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.GccCCompiler\r
197 .getCppInstance()),\r
198 new ProcessorEnumValue(\r
199 "sparc-sun-solaris2-g77",\r
200 net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.GccCCompiler\r
201 .getG77Instance()),\r
202 // GCC Cross Compilers\r
203 new ProcessorEnumValue("gcc-cross",\r
204 net.sf.antcontrib.cpptasks.gcc.cross.GccCCompiler\r
205 .getInstance()),\r
206 new ProcessorEnumValue("g++-cross",\r
207 net.sf.antcontrib.cpptasks.gcc.cross.GccCCompiler\r
208 .getGppInstance()),\r
209 new ProcessorEnumValue("c++-cross",\r
210 net.sf.antcontrib.cpptasks.gcc.cross.GccCCompiler\r
211 .getCppInstance()),\r
212 new ProcessorEnumValue("g77-cross",\r
213 net.sf.antcontrib.cpptasks.gcc.cross.GccCCompiler\r
214 .getG77Instance()),};\r
215 public Compiler getCompiler() {\r
216 return (Compiler) compilers[getIndex()].getProcessor();\r
217 }\r
218 public String[] getValues() {\r
219 return ProcessorEnumValue.getValues(compilers);\r
220 }\r
221}\r