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  package com.github.maven_nar.cpptasks.intel;
21  
22  import org.apache.tools.ant.types.Environment;
23  
24  import com.github.maven_nar.cpptasks.compiler.LinkType;
25  import com.github.maven_nar.cpptasks.compiler.Linker;
26  import com.github.maven_nar.cpptasks.compiler.Processor;
27  import com.github.maven_nar.cpptasks.gcc.GccCompatibleCCompiler;
28  
29  /**
30   * Adapter for the Intel (r) C/C++ compiler for IA-32 Linux (r)
31   *
32   * The Intel (r) C/C++ compiler for IA32 Linux mimics the command options for
33   * gcc compiler.
34   *
35   * @author Curt Arnold
36   */
37  public final class IntelLinux32CCompiler extends GccCompatibleCCompiler {
38    private static final IntelLinux32CCompiler instance = new IntelLinux32CCompiler(false, new IntelLinux32CCompiler(
39        true, null, false, null), false, null);
40  
41    public static IntelLinux32CCompiler getInstance() {
42      return instance;
43    }
44  
45    private IntelLinux32CCompiler(final boolean isLibtool, final IntelLinux32CCompiler libtoolCompiler,
46        final boolean newEnvironment, final Environment env) {
47      super("icc", "-V", isLibtool, libtoolCompiler, newEnvironment, env);
48    }
49  
50    @Override
51    public Processor changeEnvironment(final boolean newEnvironment, final Environment env) {
52      if (newEnvironment || env != null) {
53        return new IntelLinux32CCompiler(getLibtool(), (IntelLinux32CCompiler) getLibtoolCompiler(), newEnvironment, env);
54      }
55      return this;
56    }
57  
58    @Override
59    public Linker getLinker(final LinkType type) {
60      // FREEHEP
61      return IntelLinux32CLinker.getInstance().getLinker(type);
62    }
63  
64    @Override
65    public int getMaximumCommandLength() {
66      return Integer.MAX_VALUE;
67    }
68  }