+++ /dev/null
-/*\r
- * \r
- * Copyright 2001-2004 The Ant-Contrib project\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package net.sf.antcontrib.cpptasks.hp;\r
-import java.io.File;\r
-import java.util.Vector;\r
-\r
-import net.sf.antcontrib.cpptasks.CUtil;\r
-import net.sf.antcontrib.cpptasks.compiler.LinkType;\r
-import net.sf.antcontrib.cpptasks.compiler.Linker;\r
-import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler;\r
-import net.sf.antcontrib.cpptasks.OptimizationEnum;\r
-\r
-import org.apache.tools.ant.types.Environment;\r
-/**\r
- * Adapter for the HP aC++ C++ compiler\r
- * \r
- * @author Curt Arnold\r
- */\r
-public final class aCCCompiler extends GccCompatibleCCompiler {\r
- private static final aCCCompiler instance = new aCCCompiler("aCC", false,\r
- null);\r
- /**\r
- * Gets singleton instance of this class\r
- */\r
- public static aCCCompiler getInstance() {\r
- return instance;\r
- }\r
- private String identifier;\r
- private File[] includePath;\r
- /**\r
- * Private constructor. Use GccCCompiler.getInstance() to get singleton\r
- * instance of this class.\r
- */\r
- private aCCCompiler(String command, boolean newEnvironment, Environment env) {\r
- super(command, "-help", false, null, newEnvironment, env);\r
- }\r
- public void addImpliedArgs(Vector args, boolean debug,\r
- boolean multithreaded, boolean exceptions, LinkType linkType,\r
- final Boolean rtti,\r
- final OptimizationEnum optimization) {\r
- args.addElement("-c");\r
- if (debug) {\r
- args.addElement("-g");\r
- }\r
- /*\r
- * if (multithreaded) { args.addElement("-mt"); }\r
- */\r
- if (linkType.isSharedLibrary()) {\r
- args.addElement("+z");\r
- }\r
- }\r
- public void addWarningSwitch(Vector args, int level) {\r
- switch (level) {\r
- case 0 :\r
- args.addElement("-w");\r
- break;\r
- case 1 :\r
- case 2 :\r
- args.addElement("+w");\r
- break;\r
- /*\r
- * case 3: case 4: case 5: args.addElement("+w2"); break;\r
- */\r
- }\r
- }\r
- public File[] getEnvironmentIncludePath() {\r
- if (includePath == null) {\r
- File ccLoc = CUtil.getExecutableLocation("aCC");\r
- if (ccLoc != null) {\r
- File compilerIncludeDir = new File(\r
- new File(ccLoc, "../include").getAbsolutePath());\r
- if (compilerIncludeDir.exists()) {\r
- includePath = new File[2];\r
- includePath[0] = compilerIncludeDir;\r
- }\r
- }\r
- if (includePath == null) {\r
- includePath = new File[1];\r
- }\r
- includePath[includePath.length - 1] = new File("/usr/include");\r
- }\r
- return includePath;\r
- }\r
- public Linker getLinker(LinkType linkType) {\r
- return aCCLinker.getInstance().getLinker(linkType);\r
- }\r
- public int getMaximumCommandLength() {\r
- return Integer.MAX_VALUE;\r
- }\r
-}\r