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]

Patch: java/lang/natRuntime.cc


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I wrote a little patch to java/lang/natRuntime.cc to set the property 
java.library.path like SUNs JDK does it.

Please review and comment.

Okay for commit ?


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/Qcj+WSOgCCdjSDsRAs8CAKCR++fJLP0YB5E1vh+E/0/JuYKywACfQ1an
52bxiPn4/gzgSUodokCJEyg=
=6Z7V
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2102
diff -u -b -B -r1.2102 ChangeLog
--- ChangeLog	13 Aug 2003 17:20:08 -0000	1.2102
+++ ChangeLog	18 Aug 2003 06:45:16 -0000
@@ -1,3 +1,8 @@
+2003-08-19  Michael Koch  <konqueror@gmx.de>
+
+	* java/lang/natRuntime.cc
+	(insertSystemProperties): Set java.library.path property correctly.
+
 2003-08-13  Tom Tromey  <tromey@redhat.com>
 
 	* gij.cc (help): Document -? and -X.
Index: java/lang/natRuntime.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natRuntime.cc,v
retrieving revision 1.39
diff -u -b -B -r1.39 natRuntime.cc
--- java/lang/natRuntime.cc	8 Aug 2003 16:26:00 -0000	1.39
+++ java/lang/natRuntime.cc	18 Aug 2003 06:45:16 -0000
@@ -609,9 +609,21 @@
   else
     {
       // Set a value for user code to see.
-      // FIXME: JDK sets this to the actual path used, including
-      // LD_LIBRARY_PATH, etc.
-      SET ("java.library.path", "");
+      char* libraryPath = ::getenv ("LD_LIBRARY_PATH");
+      java::lang::StringBuffer *sb = new java::lang::StringBuffer();
+
+      // Initialize with prefix.
+      sb->append (JvNewStringLatin1 (PREFIX "/lib"));
+
+      // Add value of LD_LIBRARY_PATH when available.
+      if (libraryPath)
+        {
+          sb->append (_Jv_platform_path_separator);
+          sb->append (JvNewStringLatin1 (libraryPath));
+        }
+
+      newprops->put (JvNewStringLatin1 ("java.library.path"),
+                     sb->toString());
     }
 }
 

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