View Javadoc

1   /*
2    * #%L
3    * Native ARchive plugin for Maven
4    * %%
5    * Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
6    * %%
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   * 
11   * http://www.apache.org/licenses/LICENSE-2.0
12   * 
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * #L%
19   */
20  // FREEHEP
21  package com.github.maven_nar.cpptasks.intel;
22  
23  import org.apache.tools.ant.types.Environment;
24  
25  import com.github.maven_nar.cpptasks.compiler.LinkType;
26  import com.github.maven_nar.cpptasks.compiler.Linker;
27  import com.github.maven_nar.cpptasks.compiler.Processor;
28  import com.github.maven_nar.cpptasks.gcc.GccCompatibleCCompiler;
29  
30  public final class IntelLinux32Compiler extends GccCompatibleCCompiler {
31    private static final IntelLinux32Compiler instance = new IntelLinux32Compiler(false, new IntelLinux32Compiler(true,
32        null, false, null), false, null);
33  
34    public static IntelLinux32Compiler getInstance() {
35      return instance;
36    }
37  
38    private IntelLinux32Compiler(final boolean isLibtool, final IntelLinux32Compiler libtoolCompiler,
39        final boolean newEnvironment, final Environment env) {
40      super("icpc", "-V", isLibtool, libtoolCompiler, newEnvironment, env);
41    }
42  
43    @Override
44    public Processor changeEnvironment(final boolean newEnvironment, final Environment env) {
45      if (newEnvironment || env != null) {
46        return new IntelLinux32Compiler(getLibtool(), (IntelLinux32Compiler) getLibtoolCompiler(), newEnvironment, env);
47      }
48      return this;
49    }
50  
51    @Override
52    public Linker getLinker(final LinkType type) {
53      return IntelLinux32Linker.getInstance().getLinker(type);
54    }
55  
56    @Override
57    public int getMaximumCommandLength() {
58      return Integer.MAX_VALUE;
59    }
60  }