This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

CLASSPATH setting for native binaries (Was: GCC 4.0 RC1 Available)


Hi,

This wasn't send to the patches list yet since I hadn't bootstrapped and
ran all te tests.

On Tue, 2005-04-12 at 21:32 -0700, Mark Mitchell wrote:
> Per Bothner wrote:
> > Mark Wielaard wrote:
> >>
> >> 2005-04-02  Mark Wielaard  <mark@klomp.org>
> >>
> >>         * java/lang/natRuntime.cc (insertSystemProperties): Set
> >>         java.class.path to CLASSPATH if not already set.
> > 
> > Yes, Kawa builds with this patch.  Thanks!
> 
> This is OK for 4.0 if approved for mainline.

Could I get formal approval for mainline?

It passes make bootstrap on branch and mainline and make check doesn't
give any new failures (Array_3 -O3 on the branch and all -O3 on mainline
FAIL as before). Some quick tests against fully interpreted, fully
native and using gij with gnu.gcj.precompiled.db.path seem to indicate
things work as expected.

Cheers,

Mark

Index: java/lang/natRuntime.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natRuntime.cc,v
retrieving revision 1.53
diff -u -r1.53 natRuntime.cc
--- java/lang/natRuntime.cc	2 Apr 2005 02:26:51 -0000	1.53
+++ java/lang/natRuntime.cc	12 Apr 2005 22:05:23 -0000
@@ -593,6 +593,18 @@
       // LD_LIBRARY_PATH, etc.
       SET ("java.library.path", "");
     }
+
+  // If java.class.path is still not set then set it according to the
+  // CLASSPATH environment variable if given.  See gij.cc main () and
+  // prims.cc _Jv_CreateJavaVM () for all the ways this could have
+  // been set much earlier.
+  path = newprops->getProperty(JvNewStringLatin1("java.class.path"));
+  if (!path)
+    {
+      char *classpath = getenv("CLASSPATH");
+      if (classpath)
+	SET ("java.class.path", classpath);
+    }
 }
 
 java::lang::Process *

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]