* src/vm/properties.c (errno.h): Added.
[WITH_JRE_LAYOUT] (libgen.h): Likewise.
(properties_set) [WITH_CLASSPATH_SUN]: Set sun.boot.library.path
property.
* src/native/vm/nativevm.c (vm/properties.h): Added.
(nativevm_preinit) [WITH_CLASSPATH_SUN]: Use properties_get to get
sun.boot.library.path.
# include "native/native.h"
+# include "vm/properties.h"
# include "vm/vm.h"
# include "vmcore/class.h"
# elif defined(WITH_CLASSPATH_SUN)
- char *path;
+ char *boot_library_path;
int len;
+ char *p;
utf *u;
lt_dlhandle handle;
+ boot_library_path = properties_get("sun.boot.library.path");
+
len =
- strlen(classpath_libdir) +
+ strlen(boot_library_path) +
strlen("/libjava.so") +
strlen("0");
- path = MNEW(char, len);
+ p = MNEW(char, len);
- strcpy(path, classpath_libdir);
- strcat(path, "/libjava.so");
+ strcpy(p, boot_library_path);
+ strcat(p, "/libjava.so");
- u = utf_new_char(path);
+ u = utf_new_char(p);
- MFREE(path, char, len);
+ MFREE(p, char, len);
handle = native_library_open(u);
native_library_add(u, NULL, handle);
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: properties.c 8399 2007-08-22 18:24:23Z twisti $
+ $Id: properties.c 8401 2007-08-22 18:45:31Z twisti $
*/
#include "config.h"
+#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/utsname.h>
+#if defined(WITH_JRE_LAYOUT)
+# include <libgen.h>
+#endif
+
#include "vm/types.h"
#include "mm/memory.h"
strcat(java_home, "/..");
}
+ /* Set the path to Java core native libraries. */
+
+ len = strlen(java_home) + strlen("/lib/"JAVA_ARCH) + strlen("0");
+
+ boot_library_path = MNEW(char, len);
+
+ strcpy(boot_library_path, java_home);
+ strcat(boot_library_path, "/lib/"JAVA_ARCH);
+
# else
# error unknown classpath configuration
# endif
# elif defined(WITH_CLASSPATH_SUN)
- /* Nothing to do. */
+ /* Actually this property is set by OpenJDK, but we need it in
+ nativevm_preinit(). */
+
+ properties_add("sun.boot.library.path", boot_library_path);
# else
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: vm.c 8399 2007-08-22 18:24:23Z twisti $
+ $Id: vm.c 8401 2007-08-22 18:45:31Z twisti $
*/
#include <stdint.h>
#include <stdlib.h>
-#if defined(WITH_JRE_LAYOUT)
-# include <libgen.h>
-# include <unistd.h>
-#endif
-
#include "vm/types.h"
#include "arch.h"