Index: build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java =================================================================== --- build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java (revision 0) +++ build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java (revision 0) @@ -0,0 +1,208 @@ +/* + * + * Copyright 2002-2004 The Ant-Contrib project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.sf.antcontrib.cpptasks.compiler; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.util.Vector; +import net.sf.antcontrib.cpptasks.CCTask; +import net.sf.antcontrib.cpptasks.CUtil; +import net.sf.antcontrib.cpptasks.CompilerDef; +import net.sf.antcontrib.cpptasks.DependencyInfo; +import net.sf.antcontrib.cpptasks.ProcessorDef; +import net.sf.antcontrib.cpptasks.parser.Parser; +import net.sf.antcontrib.cpptasks.TargetDef; +import net.sf.antcontrib.cpptasks.VersionInfo; + +/** + * An abstract compiler implementation. + * + * @author Adam Murdoch + * @author Curt Arnold + */ +public abstract class AbstractCompiler extends AbstractProcessor + implements + Compiler { + private static final String[] emptyIncludeArray = new String[0]; + private String outputSuffix; + protected AbstractCompiler(String[] sourceExtensions, + String[] headerExtensions, String outputSuffix) { + super(sourceExtensions, headerExtensions); + this.outputSuffix = outputSuffix; + } + /** + * Checks file name to see if parse should be attempted + * + * Default implementation returns false for files with extensions '.dll', + * 'tlb', '.res' + * + */ + protected boolean canParse(File sourceFile) { + String sourceName = sourceFile.toString(); + int lastPeriod = sourceName.lastIndexOf('.'); + if (lastPeriod >= 0 && lastPeriod == sourceName.length() - 4) { + String ext = sourceName.substring(lastPeriod).toUpperCase(); + if (ext.equals(".DLL") || ext.equals(".TLB") || ext.equals(".RES")) { + return false; + } + } + return true; + } + abstract protected CompilerConfiguration createConfiguration(CCTask task, + LinkType linkType, ProcessorDef[] baseConfigs, + CompilerDef specificConfig, TargetDef targetPlatform, + VersionInfo versionInfo); + public ProcessorConfiguration createConfiguration(CCTask task, + LinkType linkType, ProcessorDef[] baseConfigs, + ProcessorDef specificConfig, TargetDef targetPlatform, + VersionInfo versionInfo) { + if (specificConfig == null) { + throw new NullPointerException("specificConfig"); + } + return createConfiguration(task, linkType, baseConfigs, + (CompilerDef) specificConfig, targetPlatform, versionInfo); + } + abstract protected Parser createParser(File sourceFile); + protected String getBaseOutputName(String inputFile) { + int lastSlash = inputFile.lastIndexOf('/'); + int lastReverse = inputFile.lastIndexOf('\\'); + int lastSep = inputFile.lastIndexOf(File.separatorChar); + if (lastReverse > lastSlash) { + lastSlash = lastReverse; + } + if (lastSep > lastSlash) { + lastSlash = lastSep; + } + int lastPeriod = inputFile.lastIndexOf('.'); + if (lastPeriod < 0) { + lastPeriod = inputFile.length(); + } + return inputFile.substring(lastSlash + 1, lastPeriod); + } + public String[] getOutputFileNames(String inputFile, VersionInfo versionInfo) { + // + // if a recognized input file + // + if (bid(inputFile) > 1) { + String baseName = getBaseOutputName(inputFile); + return new String[] { baseName + outputSuffix }; + } + return new String[0]; + } + /** + * Returns dependency info for the specified source file + * + * @param task + * task for any diagnostic output + * @param source + * file to be parsed + * @param includePath + * include path to be used to resolve included files + * + * @param sysIncludePath + * sysinclude path from build file, files resolved using + * sysInclude path will not participate in dependency analysis + * + * @param envIncludePath + * include path from environment variable, files resolved with + * envIncludePath will not participate in dependency analysis + * + * @param baseDir + * used to produce relative paths in DependencyInfo + * @param includePathIdentifier + * used to distinguish DependencyInfo's from different include + * path settings + * + * @author Curt Arnold + */ + public final DependencyInfo parseIncludes(CCTask task, File source, + File[] includePath, File[] sysIncludePath, File[] envIncludePath, + File baseDir, String includePathIdentifier) { + // + // if any of the include files can not be identified + // change the sourceLastModified to Long.MAX_VALUE to + // force recompilation of anything that depends on it + long sourceLastModified = source.lastModified(); + File[] sourcePath = new File[1]; + sourcePath[0] = new File(source.getParent()); + Vector onIncludePath = new Vector(); + Vector onSysIncludePath = new Vector(); + String baseDirPath; + try { + baseDirPath = baseDir.getCanonicalPath(); + } catch (IOException ex) { + baseDirPath = baseDir.toString(); + } + String relativeSource = CUtil.getRelativePath(baseDirPath, source); + String[] includes = emptyIncludeArray; + if (canParse(source)) { + Parser parser = createParser(source); + try { + Reader reader = new BufferedReader(new FileReader(source)); + parser.parse(reader); + includes = parser.getIncludes(); + } catch (IOException ex) { + task.log("Error parsing " + source.toString() + ":" + + ex.toString()); + includes = new String[0]; + } + } + for (int i = 0; i < includes.length; i++) { + String includeName = includes[i]; + if (!resolveInclude(includeName, sourcePath, onIncludePath)) { + if (!resolveInclude(includeName, includePath, onIncludePath)) { + if (!resolveInclude(includeName, sysIncludePath, + onSysIncludePath)) { + if (!resolveInclude(includeName, envIncludePath, + onSysIncludePath)) { + // + // this should be enough to require us to reparse + // the file with the missing include for dependency + // information without forcing a rebuild + sourceLastModified += 2 * CUtil.FILETIME_EPSILON; + } + } + } + } + } + for (int i = 0; i < onIncludePath.size(); i++) { + String relativeInclude = CUtil.getRelativePath(baseDirPath, + (File) onIncludePath.elementAt(i)); + onIncludePath.setElementAt(relativeInclude, i); + } + for (int i = 0; i < onSysIncludePath.size(); i++) { + String relativeInclude = CUtil.getRelativePath(baseDirPath, + (File) onSysIncludePath.elementAt(i)); + onSysIncludePath.setElementAt(relativeInclude, i); + } + return new DependencyInfo(includePathIdentifier, relativeSource, + sourceLastModified, onIncludePath, onSysIncludePath); + } + protected boolean resolveInclude(String includeName, File[] includePath, + Vector onThisPath) { + for (int i = 0; i < includePath.length; i++) { + File includeFile = new File(includePath[i], includeName); + if (includeFile.exists()) { + onThisPath.addElement(includeFile); + return true; + } + } + return false; + } +} Index: build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin64CCompiler.java =================================================================== --- build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin64CCompiler.java (revision 0) +++ build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin64CCompiler.java (revision 0) @@ -0,0 +1,53 @@ +/* + * + * Copyright 2002-2004 The Ant-Contrib project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.sf.antcontrib.cpptasks.intel; +import net.sf.antcontrib.cpptasks.compiler.LinkType; +import net.sf.antcontrib.cpptasks.compiler.Linker; +import net.sf.antcontrib.cpptasks.compiler.Processor; +import net.sf.antcontrib.cpptasks.devstudio.DevStudioCompatibleCCompiler; + +import org.apache.tools.ant.types.Environment; +/** + * Adapter for the Intel C++ compiler for Itanium(TM) Applications + * + * @author Curt Arnold + */ +public final class IntelWin64CCompiler extends DevStudioCompatibleCCompiler { + private static final IntelWin64CCompiler instance = new IntelWin64CCompiler( + false, null); + public static IntelWin64CCompiler getInstance() { + return instance; + } + private IntelWin64CCompiler(boolean newEnvironment, Environment env) { + super("ecl", "", newEnvironment, env); + } + public Processor changeEnvironment(boolean newEnvironment, Environment env) { + if (newEnvironment || env != null) { + return new IntelWin64CCompiler(newEnvironment, env); + } + return this; + } + public Linker getLinker(LinkType type) { + // + // currently the Intel Win32 and Win64 linkers + // are command line equivalent + return IntelWin32Linker.getInstance().getLinker(type); + } + public int getMaximumCommandLength() { + return 32767; + } +} Index: build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin32Librarian.java =================================================================== --- build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin32Librarian.java (revision 0) +++ build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin32Librarian.java (revision 0) @@ -0,0 +1,38 @@ +/* + * + * Copyright 2002-2004 The Ant-Contrib project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.sf.antcontrib.cpptasks.intel; +import net.sf.antcontrib.cpptasks.compiler.LinkType; +import net.sf.antcontrib.cpptasks.compiler.Linker; +import net.sf.antcontrib.cpptasks.devstudio.DevStudioCompatibleLibrarian; +/** + * Adapter for the xilib from the Intel(r) C++ Compiler for IA-32 or IA-64 + * systems running Microsoft (r) operating systems + * + * @author Curt Arnold + */ +public class IntelWin32Librarian extends DevStudioCompatibleLibrarian { + private static final IntelWin32Librarian instance = new IntelWin32Librarian(); + public static IntelWin32Librarian getInstance() { + return instance; + } + protected IntelWin32Librarian() { + super("xilib", ""); + } + public Linker getLinker(LinkType type) { + return IntelWin32Linker.getInstance().getLinker(type); + } +} Index: build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux64CCompiler.java =================================================================== --- build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux64CCompiler.java (revision 0) +++ build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux64CCompiler.java (revision 0) @@ -0,0 +1,58 @@ +/* + * + * Copyright 2002-2004 The Ant-Contrib project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.sf.antcontrib.cpptasks.intel; +import net.sf.antcontrib.cpptasks.compiler.LinkType; +import net.sf.antcontrib.cpptasks.compiler.Linker; +import net.sf.antcontrib.cpptasks.compiler.Processor; +import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler; + +import org.apache.tools.ant.types.Environment; +/** + * Adapter for the Intel (r) C/C++ compiler for IA-64 Linux (r) + * + * The Intel C/C++ compiler for IA-64 Linux mimics the command options for gcc + * compiler. + * + * @author Curt Arnold + */ +public final class IntelLinux64CCompiler extends GccCompatibleCCompiler { + private static final IntelLinux64CCompiler instance = new IntelLinux64CCompiler( + false, new IntelLinux64CCompiler(true, null, false, null), false, + null); + public static IntelLinux64CCompiler getInstance() { + return instance; + } + private IntelLinux64CCompiler(boolean isLibtool, + IntelLinux64CCompiler libtoolCompiler, boolean newEnvironment, + Environment env) { + super("ecc", "-V", isLibtool, libtoolCompiler, newEnvironment, env); + } + public Processor changeEnvironment(boolean newEnvironment, Environment env) { + if (newEnvironment || env != null) { + return new IntelLinux64CCompiler(getLibtool(), + (IntelLinux64CCompiler) this.getLibtoolCompiler(), + newEnvironment, env); + } + return this; + } + public Linker getLinker(LinkType type) { + return IntelLinux64Linker.getInstance().getLinker(type); + } + public int getMaximumCommandLength() { + return Integer.MAX_VALUE; + } +} Index: build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin32Linker.java =================================================================== --- build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin32Linker.java (revision 0) +++ build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin32Linker.java (revision 0) @@ -0,0 +1,46 @@ +/* + * + * Copyright 2002-2004 The Ant-Contrib project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.sf.antcontrib.cpptasks.intel; +import net.sf.antcontrib.cpptasks.compiler.LinkType; +import net.sf.antcontrib.cpptasks.compiler.Linker; +import net.sf.antcontrib.cpptasks.devstudio.DevStudioCompatibleLinker; +/** + * Adapter for the Intel (r) linker for 32-bit applications + * + * @author Curt Arnold + */ +public final class IntelWin32Linker extends DevStudioCompatibleLinker { + private static final IntelWin32Linker dllLinker = new IntelWin32Linker( + ".dll"); + private static final IntelWin32Linker instance = new IntelWin32Linker( + ".exe"); + public static IntelWin32Linker getInstance() { + return instance; + } + private IntelWin32Linker(String outputSuffix) { + super("xilink", "", outputSuffix); + } + public Linker getLinker(LinkType type) { + if (type.isStaticLibrary()) { + return IntelWin32Librarian.getInstance(); + } + if (type.isSharedLibrary()) { + return dllLinker; + } + return instance; + } +} Index: build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux32Linker.java =================================================================== --- build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux32Linker.java (revision 0) +++ build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux32Linker.java (revision 0) @@ -0,0 +1,55 @@ +/* + * + * Copyright 2002-2004 The Ant-Contrib project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.sf.antcontrib.cpptasks.intel; +import net.sf.antcontrib.cpptasks.compiler.LinkType; +import net.sf.antcontrib.cpptasks.compiler.Linker; +import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker; +import net.sf.antcontrib.cpptasks.gcc.GccLibrarian; +/** + * Adapter for the Intel (r) Linker for Linux (r) for IA-32 + * + * @author Curt Arnold + */ +public final class IntelLinux32Linker extends AbstractLdLinker { + private static final String[] discardFiles = new String[0]; + private static final String[] libtoolObjFiles = new String[]{".fo", ".a", + ".lib", ".dll", ".so", ".sl"}; + private static final String[] objFiles = new String[]{".o", ".a", ".lib", + ".dll", ".so", ".sl"}; + private static final IntelLinux32Linker dllLinker = new IntelLinux32Linker( + "lib", ".so", false, new IntelLinux32Linker("lib", ".so", true, + null)); + private static final IntelLinux32Linker instance = new IntelLinux32Linker( + "", "", false, null); + public static IntelLinux32Linker getInstance() { + return instance; + } + private IntelLinux32Linker(String outputPrefix, String outputSuffix, + boolean isLibtool, IntelLinux32Linker libtoolLinker) { + super("icc", "-V", objFiles, discardFiles, outputPrefix, outputSuffix, + isLibtool, libtoolLinker); + } + public Linker getLinker(LinkType type) { + if (type.isStaticLibrary()) { + return GccLibrarian.getInstance(); + } + if (type.isSharedLibrary()) { + return dllLinker; + } + return instance; + } +} Index: build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux64Linker.java =================================================================== --- build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux64Linker.java (revision 0) +++ build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux64Linker.java (revision 0) @@ -0,0 +1,55 @@ +/* + * + * Copyright 2002-2004 The Ant-Contrib project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.sf.antcontrib.cpptasks.intel; +import net.sf.antcontrib.cpptasks.compiler.LinkType; +import net.sf.antcontrib.cpptasks.compiler.Linker; +import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker; +import net.sf.antcontrib.cpptasks.gcc.GccLibrarian; +/** + * Adapter for the Intel (r) linker for Linux for IA-64 + * + * @author Curt Arnold + */ +public final class IntelLinux64Linker extends AbstractLdLinker { + private static final String[] discardFiles = new String[0]; + private static final String[] libtoolObjFiles = new String[]{".fo", ".a", + ".lib", ".dll", ".so", ".sl"}; + private static final String[] objFiles = new String[]{".o", ".a", ".lib", + ".dll", ".so", ".sl"}; + private static final IntelLinux64Linker dllLinker = new IntelLinux64Linker( + "lib", ".so", false, new IntelLinux64Linker("lib", ".so", true, + null)); + private static final IntelLinux64Linker instance = new IntelLinux64Linker( + "", "", false, null); + public static IntelLinux64Linker getInstance() { + return instance; + } + private IntelLinux64Linker(String outputPrefix, String outputSuffix, + boolean isLibtool, IntelLinux64Linker libtoolLinker) { + super("ecc", "-V", objFiles, discardFiles, outputPrefix, outputSuffix, + isLibtool, libtoolLinker); + } + public Linker getLinker(LinkType type) { + if (type.isStaticLibrary()) { + return GccLibrarian.getInstance(); + } + if (type.isSharedLibrary()) { + return dllLinker; + } + return instance; + } +} Index: build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelProcessor.java =================================================================== --- build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelProcessor.java (revision 0) +++ build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelProcessor.java (revision 0) @@ -0,0 +1,51 @@ +/* + * + * Copyright 2002-2004 The Ant-Contrib project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.sf.antcontrib.cpptasks.intel; +import java.util.Vector; + +import net.sf.antcontrib.cpptasks.devstudio.DevStudioProcessor; +/** + * A add-in class for Intel (r) compilers and linkers + * + * + */ +public class IntelProcessor { + public static void addWarningSwitch(Vector args, int level) { + DevStudioProcessor.addWarningSwitch(args, level); + } + public static String getCommandFileSwitch(String cmdFile) { + return DevStudioProcessor.getCommandFileSwitch(cmdFile); + } + public static void getDefineSwitch(StringBuffer buffer, String define, + String value) { + DevStudioProcessor.getDefineSwitch(buffer, define, value); + } + public static String getIncludeDirSwitch(String includeDir) { + return DevStudioProcessor.getIncludeDirSwitch(includeDir); + } + public static String[] getOutputFileSwitch(String outPath) { + return DevStudioProcessor.getOutputFileSwitch(outPath); + } + public static void getUndefineSwitch(StringBuffer buffer, String define) { + DevStudioProcessor.getUndefineSwitch(buffer, define); + } + public static boolean isCaseSensitive() { + return false; + } + private IntelProcessor() { + } +} Index: build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin32CCompiler.java =================================================================== --- build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin32CCompiler.java (revision 0) +++ build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelWin32CCompiler.java (revision 0) @@ -0,0 +1,52 @@ +/* + * + * Copyright 2002-2004 The Ant-Contrib project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.sf.antcontrib.cpptasks.intel; +import net.sf.antcontrib.cpptasks.compiler.LinkType; +import net.sf.antcontrib.cpptasks.compiler.Linker; +import net.sf.antcontrib.cpptasks.compiler.Processor; +import net.sf.antcontrib.cpptasks.devstudio.DevStudioCompatibleCCompiler; +import org.apache.tools.ant.types.Environment; +/** + * Adapter for the Intel (r) C++ compiler for 32-bit applications + * + * The Intel (r) C++ compiler for IA32 Windows mimics the command options for + * the Microsoft (r) C++ compiler. + * + * @author Curt Arnold + */ +public final class IntelWin32CCompiler extends DevStudioCompatibleCCompiler { + private static final IntelWin32CCompiler instance = new IntelWin32CCompiler( + false, null); + public static IntelWin32CCompiler getInstance() { + return instance; + } + private IntelWin32CCompiler(boolean newEnvironment, Environment env) { + super("icl", "", newEnvironment, env); + } + public Processor changeEnvironment(boolean newEnvironment, Environment env) { + if (newEnvironment || env != null) { + return new IntelWin32CCompiler(newEnvironment, env); + } + return this; + } + public Linker getLinker(LinkType type) { + return IntelWin32Linker.getInstance().getLinker(type); + } + public int getMaximumCommandLength() { + return 32767; + } +} Index: build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux32CCompiler.java =================================================================== --- build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux32CCompiler.java (revision 0) +++ build/patches/common/CPPTASKS/src/net/sf/antcontrib/cpptasks/intel/IntelLinux32CCompiler.java (revision 0) @@ -0,0 +1,58 @@ +/* + * + * Copyright 2002-2004 The Ant-Contrib project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.sf.antcontrib.cpptasks.intel; +import net.sf.antcontrib.cpptasks.compiler.LinkType; +import net.sf.antcontrib.cpptasks.compiler.Linker; +import net.sf.antcontrib.cpptasks.compiler.Processor; +import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler; + +import org.apache.tools.ant.types.Environment; +/** + * Adapter for the Intel (r) C/C++ compiler for IA-32 Linux (r) + * + * The Intel (r) C/C++ compiler for IA32 Linux mimics the command options for + * gcc compiler. + * + * @author Curt Arnold + */ +public final class IntelLinux32CCompiler extends GccCompatibleCCompiler { + private static final IntelLinux32CCompiler instance = new IntelLinux32CCompiler( + false, new IntelLinux32CCompiler(true, null, false, null), false, + null); + public static IntelLinux32CCompiler getInstance() { + return instance; + } + private IntelLinux32CCompiler(boolean isLibtool, + IntelLinux32CCompiler libtoolCompiler, boolean newEnvironment, + Environment env) { + super("icc", "-V", isLibtool, libtoolCompiler, newEnvironment, env); + } + public Processor changeEnvironment(boolean newEnvironment, Environment env) { + if (newEnvironment || env != null) { + return new IntelLinux32CCompiler(getLibtool(), + (IntelLinux32CCompiler) getLibtoolCompiler(), + newEnvironment, env); + } + return this; + } + public Linker getLinker(LinkType type) { + return IntelLinux32Linker.getInstance().getLinker(type); + } + public int getMaximumCommandLength() { + return Integer.MAX_VALUE; + } +}