diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-25 03:28:00 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-25 03:28:00 +0000 |
commit | 0df28fe6545b9b9b67650db7cc802f09a7b666c1 (patch) | |
tree | 243b0dfebdb97fccd2f16106858d75fb715cf163 /libjava/java | |
parent | 61b43324ae6cb68262dda8356f38fb6e6f494391 (diff) | |
download | ppe42-gcc-0df28fe6545b9b9b67650db7cc802f09a7b666c1.tar.gz ppe42-gcc-0df28fe6545b9b9b67650db7cc802f09a7b666c1.zip |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58520 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/natRuntime.cc | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc index d0a64e7bb1d..0dcf5786d2f 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 * |