From 165e9f5dd2194d80c9378b338eab24d1253efcc5 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 11 Jul 2008 07:00:56 +0000 Subject: [PATCH] More cases whete includeJavaRuntime="false" may fail for gcj. PR 34638. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@675842 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 5 +++++ docs/manual/CoreTasks/javac.html | 6 +++++- src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index ef1917752..2644bdd46 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -84,6 +84,11 @@ Fixed bugs: * Length task did not process nonexistent Resources even though these might conceivably still carry file length information. Bugzilla report 45271. + * 's includeJavaRuntime="false" should work for gcj now. Note + that you may need to set includeAntRuntime to false in order to + have full control. + Bugzilla Report 34638. + Other changes: -------------- diff --git a/docs/manual/CoreTasks/javac.html b/docs/manual/CoreTasks/javac.html index 0d5f9c63a..c3593af2e 100644 --- a/docs/manual/CoreTasks/javac.html +++ b/docs/manual/CoreTasks/javac.html @@ -295,7 +295,11 @@ invoking the compiler.

includeJavaRuntime Whether to include the default run-time libraries from the executing VM in the classpath; - defaults to no. + defaults to no.
+ Note: In some setups the run-time libraries may be part + of the "Ant run-time libraries" so you may need to explicitly + set includeAntRuntime to false to ensure that the Java + run-time libraries are not included. No diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java index 160d3fcdc..cae497fbd 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java @@ -66,7 +66,9 @@ public class Gcj extends DefaultCompilerAdapter { // gcj doesn't support an extension dir (-extdir) // so we'll emulate it for compatibility and convenience. - classpath.addExtdirs(extdirs); + if (extdirs != null || includeJavaRuntime) { + classpath.addExtdirs(extdirs); + } classpath.append(getCompileClasspath());