1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  package com.github.maven_nar.cpptasks;
21  
22  import org.apache.tools.ant.types.EnumeratedAttribute;
23  
24  import com.github.maven_nar.cpptasks.arm.ADSLinker;
25  import com.github.maven_nar.cpptasks.borland.BorlandLinker;
26  import com.github.maven_nar.cpptasks.compaq.CompaqVisualFortranLinker;
27  import com.github.maven_nar.cpptasks.compiler.Linker;
28  import com.github.maven_nar.cpptasks.gcc.GccLibrarian;
29  import com.github.maven_nar.cpptasks.gcc.GccLinker;
30  import com.github.maven_nar.cpptasks.gcc.GppLinker;
31  import com.github.maven_nar.cpptasks.gcc.LdLinker;
32  import com.github.maven_nar.cpptasks.hp.aCCLinker;
33  import com.github.maven_nar.cpptasks.ibm.VisualAgeLinker;
34  import com.github.maven_nar.cpptasks.intel.IntelLinux32CLinker;
35  import com.github.maven_nar.cpptasks.intel.IntelLinux32Linker;
36  import com.github.maven_nar.cpptasks.intel.IntelLinux64CLinker;
37  import com.github.maven_nar.cpptasks.intel.IntelLinux64Linker;
38  import com.github.maven_nar.cpptasks.intel.IntelWin32Linker;
39  import com.github.maven_nar.cpptasks.msvc.MsvcLinker;
40  import com.github.maven_nar.cpptasks.openwatcom.OpenWatcomCLinker;
41  import com.github.maven_nar.cpptasks.openwatcom.OpenWatcomFortranLinker;
42  import com.github.maven_nar.cpptasks.os390.OS390Linker;
43  import com.github.maven_nar.cpptasks.os400.IccLinker;
44  import com.github.maven_nar.cpptasks.sun.C89Linker;
45  import com.github.maven_nar.cpptasks.sun.ForteCCLinker;
46  import com.github.maven_nar.cpptasks.ti.ClxxLinker;
47  
48  
49  
50  
51  
52  
53  
54  public class LinkerEnum extends EnumeratedAttribute {
55    private final static ProcessorEnumValue[] linkers = new ProcessorEnumValue[] {
56        new ProcessorEnumValue("gcc", GccLinker.getInstance()),
57        new ProcessorEnumValue("g++", GppLinker.getInstance()),
58        new ProcessorEnumValue("clang", GccLinker.getCLangInstance()),
59        new ProcessorEnumValue("clang++", GppLinker.getCLangInstance()),
60        new ProcessorEnumValue("ld", LdLinker.getInstance()),
61        new ProcessorEnumValue("ar", GccLibrarian.getInstance()),
62        new ProcessorEnumValue("msvc", MsvcLinker.getInstance()),
63        new ProcessorEnumValue("bcc", BorlandLinker.getInstance()),
64        new ProcessorEnumValue("df", CompaqVisualFortranLinker.getInstance()),
65        new ProcessorEnumValue("icl", IntelWin32Linker.getInstance()),
66        new ProcessorEnumValue("ecl", IntelWin32Linker.getInstance()),
67        
68        new ProcessorEnumValue("icc", IntelLinux32CLinker.getInstance()),
69        new ProcessorEnumValue("ecc", IntelLinux64CLinker.getInstance()),
70        new ProcessorEnumValue("icpc", IntelLinux32Linker.getInstance()),
71        new ProcessorEnumValue("ecpc", IntelLinux64Linker.getInstance()),
72        
73        new ProcessorEnumValue("CC", ForteCCLinker.getInstance()),
74        new ProcessorEnumValue("aCC", aCCLinker.getInstance()),
75        new ProcessorEnumValue("os390", OS390Linker.getInstance()),
76        new ProcessorEnumValue("os390batch", OS390Linker.getDataSetInstance()),
77        new ProcessorEnumValue("os400", IccLinker.getInstance()),
78        new ProcessorEnumValue("sunc89", C89Linker.getInstance()),
79        new ProcessorEnumValue("xlC", VisualAgeLinker.getInstance()),
80        new ProcessorEnumValue("cl6x", ClxxLinker.getCl6xInstance()),
81        new ProcessorEnumValue("cl55", ClxxLinker.getCl55Instance()),
82        new ProcessorEnumValue("armcc", ADSLinker.getInstance()),
83        new ProcessorEnumValue("armcpp", ADSLinker.getInstance()),
84        new ProcessorEnumValue("tcc", ADSLinker.getInstance()),
85        new ProcessorEnumValue("tcpp", ADSLinker.getInstance()),
86        
87        new ProcessorEnumValue("sparc-sun-solaris2-gcc",
88            com.github.maven_nar.cpptasks.gcc.cross.sparc_sun_solaris2.GccLinker.getInstance()),
89        new ProcessorEnumValue("sparc-sun-solaris2-g++",
90            com.github.maven_nar.cpptasks.gcc.cross.sparc_sun_solaris2.GppLinker.getInstance()),
91        new ProcessorEnumValue("sparc-sun-solaris2-ld",
92            com.github.maven_nar.cpptasks.gcc.cross.sparc_sun_solaris2.LdLinker.getInstance()),
93        new ProcessorEnumValue("sparc-sun-solaris2-ar",
94            com.github.maven_nar.cpptasks.gcc.cross.sparc_sun_solaris2.GccLibrarian.getInstance()),
95        new ProcessorEnumValue("gcc-cross", com.github.maven_nar.cpptasks.gcc.cross.GccLinker.getInstance()),
96        new ProcessorEnumValue("g++-cross", com.github.maven_nar.cpptasks.gcc.cross.GppLinker.getInstance()),
97        new ProcessorEnumValue("ld-cross", com.github.maven_nar.cpptasks.gcc.cross.LdLinker.getInstance()),
98        new ProcessorEnumValue("ar-cross", com.github.maven_nar.cpptasks.gcc.cross.GccLibrarian.getInstance()),
99        new ProcessorEnumValue("wcl", OpenWatcomCLinker.getInstance()),
100       new ProcessorEnumValue("wfl", OpenWatcomFortranLinker.getInstance()),
101   };
102 
103   public Linker getLinker() {
104     return (Linker) linkers[getIndex()].getProcessor();
105   }
106 
107   @Override
108   public String[] getValues() {
109     return ProcessorEnumValue.getValues(linkers);
110   }
111 }