/** * Performs a compile using the gcj compiler. * @return true if the compilation succeeded * @throws BuildException on error */ @Override public boolean execute() throws BuildException { attributes.log("Using gcj compiler", Project.MSG_VERBOSE); Commandline cmd = setupGCJCommand(); int firstFileName = cmd.size(); logAndAddFilesToCompile(cmd); return executeExternalCompile(cmd.getCommandline(), firstFileName) == 0; }
/** * Whether any of the arguments given via <compilerarg> * implies that compilation to native code is requested. * @return true if compilation to native code is requested * @since Ant 1.6.2 */ public boolean isNativeBuild() { boolean nativeBuild = false; String[] additionalArguments = getJavac().getCurrentCompilerArgs(); int argsLength = 0; while (!nativeBuild && argsLength < additionalArguments.length) { int conflictLength = 0; while (!nativeBuild && conflictLength < CONFLICT_WITH_DASH_C.length) { nativeBuild = additionalArguments[argsLength] .startsWith(CONFLICT_WITH_DASH_C[conflictLength]); conflictLength++; } argsLength++; } return nativeBuild; }
Path p = getBootClassPath(); if (!p.isEmpty()) { classpath.append(p); classpath.append(getCompileClasspath()); String exec = getJavac().getExecutable(); cmd.setExecutable(exec == null ? "gcj" : exec); if (!isNativeBuild()) { cmd.createArgument().setValue("-C"); addCurrentCompilerArgs(cmd);
return new Gcj();