aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/natRuntime.cc
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-10-25 03:28:00 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-10-25 03:28:00 +0000
commitca7c2b85296ad76d29df2519a0977b26a5135aff (patch)
tree243b0dfebdb97fccd2f16106858d75fb715cf163 /libjava/java/lang/natRuntime.cc
parent3752ac0803ae8d51297fcd46ba2f827bf50571fb (diff)
downloadgcc-ca7c2b85296ad76d29df2519a0977b26a5135aff.zip
gcc-ca7c2b85296ad76d29df2519a0977b26a5135aff.tar.gz
gcc-ca7c2b85296ad76d29df2519a0977b26a5135aff.tar.bz2
natRuntime.cc (_Jv_SetDLLSearchPath): New function.
* java/lang/natRuntime.cc (_Jv_SetDLLSearchPath): New function. (_Jv_FindSymbolInExecutable): Removed argument name. (insertSystemProperties): Call _Jv_SetDLLSearchPath if java.library.path is set. * gij.cc (help): Document --showversion. (version): Don't exit. (main): Handle --showversion. Exit if --version given. From-SVN: r58520
Diffstat (limited to 'libjava/java/lang/natRuntime.cc')
-rw-r--r--libjava/java/lang/natRuntime.cc33
1 files changed, 32 insertions, 1 deletions
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc
index d0a64e7..0dcf578 100644
--- a/libjava/java/lang/natRuntime.cc
+++ b/libjava/java/lang/natRuntime.cc
@@ -102,14 +102,26 @@ _Jv_FindSymbolInExecutable (const char *symname)
return NULL;
}
+void
+_Jv_SetDLLSearchPath (const char *path)
+{
+ lt_dlsetsearchpath (path);
+}
+
#else
void *
-_Jv_FindSymbolInExecutable (const char *symname)
+_Jv_FindSymbolInExecutable (const char *)
{
return NULL;
}
+void
+_Jv_SetDLLSearchPath (const char *)
+{
+ // Nothing.
+}
+
#endif /* USE_LTDL */
@@ -538,6 +550,25 @@ java::lang::Runtime::insertSystemProperties (java::util::Properties *newprops)
// Allow platform specific settings and overrides.
_Jv_platform_initProperties (newprops);
+
+ // If java.library.path is set, tell libltdl so we search the new
+ // directories as well. FIXME: does this work properly on Windows?
+ String *path = newprops->getProperty(JvNewStringLatin1("java.library.path"));
+ if (path)
+ {
+ char *val = (char *) _Jv_Malloc (JvGetStringUTFLength (path) + 1);
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), val);
+ val[total] = '\0';
+ _Jv_SetDLLSearchPath (val);
+ _Jv_Free (val);
+ }
+ 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", "");
+ }
}
java::lang::Process *