+ /* add /jre to java.home property */
+
+ len = strlen(env_java_home) + strlen("/jre") + strlen("0");
+
+ java_home = MNEW(char, len);
+
+ strcpy(java_home, env_java_home);
+ strcat(java_home, "/jre");
+
+ properties_add("java.home", java_home);
+
+ properties_add("java.vm.specification.version", "1.0");
+ properties_add("java.vm.specification.vendor", "Sun Microsystems Inc.");
+ properties_add("java.vm.specification.name", "Java Virtual Machine Specification");
+ properties_add("java.vm.version", VERSION);
+ properties_add("java.vm.vendor", "CACAO Team");
+ properties_add("java.vm.name", "CACAO");
+ properties_add("java.specification.version", "1.5");
+ properties_add("java.specification.vendor", "Sun Microsystems Inc.");
+ properties_add("java.specification.name", "Java Platform API Specification");
+ properties_add("java.class.version", CLASS_VERSION);
+ properties_add("java.class.path", _Jv_classpath);
+
+ properties_add("java.runtime.version", VERSION);
+ properties_add("java.runtime.name", "CACAO");
+
+ /* Set bootclasspath properties. One for GNU classpath and the
+ other for compatibility with Sun (required by most
+ applications). */
+
+ properties_add("java.boot.class.path", _Jv_bootclasspath);
+ properties_add("sun.boot.class.path", _Jv_bootclasspath);
+
+#if defined(WITH_STATIC_CLASSPATH)
+ properties_add("gnu.classpath.boot.library.path", ".");
+ properties_add("java.library.path" , ".");
+#else
+ /* fill gnu.classpath.boot.library.path with GNU Classpath library
+ path */
+
+ properties_add("gnu.classpath.boot.library.path", classpath_libdir);
+ properties_add("java.library.path", _Jv_java_library_path);
+#endif
+
+ properties_add("java.io.tmpdir", "/tmp");
+
+#if defined(ENABLE_INTRP)
+ if (opt_intrp) {
+ /* XXX We don't support java.lang.Compiler */
+/* properties_add("java.compiler", "cacao.intrp"); */
+ properties_add("java.vm.info", "interpreted mode");
+ properties_add("gnu.java.compiler.name", "cacao.intrp");
+ }
+ else
+#endif
+ {
+ /* XXX We don't support java.lang.Compiler */
+/* properties_add("java.compiler", "cacao.jit"); */
+ properties_add("java.vm.info", "JIT mode");
+ properties_add("gnu.java.compiler.name", "cacao.jit");
+ }
+
+ /* set the java.ext.dirs property */
+
+ len = strlen(env_java_home) + strlen("/jre/lib/ext") + strlen("0");
+
+ extdirs = MNEW(char, len);
+
+ strcpy(extdirs, env_java_home);
+ strcat(extdirs, "/jre/lib/ext");
+
+ properties_add("java.ext.dirs", extdirs);
+
+ properties_add("java.endorsed.dirs", ""CACAO_PREFIX"/jre/lib/endorsed");
+
+#if defined(DISABLE_GC)
+ /* When we disable the GC, we mmap the whole heap to a specific
+ address, so we can compare call traces. For this reason we have
+ to add the same properties on different machines, otherwise
+ more memory may be allocated (e.g. strlen("i386")
+ vs. strlen("alpha"). */
+
+ properties_add("os.arch", "unknown");
+ properties_add("os.name", "unknown");
+ properties_add("os.version", "unknown");
+#else
+ /* We need to set the os.arch hardcoded to be compatible with SUN. */
+
+# if defined(__I386__)
+ /* map all x86 architectures (i386, i486, i686) to i386 */
+
+ properties_add("os.arch", "i386");
+# elif defined(__POWERPC__)
+ properties_add("os.arch", "ppc");
+# elif defined(__X86_64__)
+ properties_add("os.arch", "amd64");
+# else
+ /* default to what uname returns */
+
+ properties_add("os.arch", utsnamebuf->machine);
+# endif
+
+ properties_add("os.name", utsnamebuf->sysname);
+ properties_add("os.version", utsnamebuf->release);
+#endif
+
+ properties_add("file.separator", "/");
+ properties_add("path.separator", ":");
+ properties_add("line.separator", "\n");
+ properties_add("user.name", env_user ? env_user : "null");
+ properties_add("user.home", env_home ? env_home : "null");
+ properties_add("user.dir", cwd ? cwd : "null");
+
+#if defined(WITH_STATIC_CLASSPATH)
+ /* This is just for debugging purposes and can cause troubles in
+ GNU Classpath. */
+
+ properties_add("gnu.cpu.endian", "unknown");
+#else
+# if WORDS_BIGENDIAN == 1
+ properties_add("gnu.cpu.endian", "big");
+# else
+ properties_add("gnu.cpu.endian", "little");
+# endif
+#endif
+
+ /* get locale */
+
+ if (env_lang != NULL) {
+ /* get the local stuff from the environment */
+
+ if (strlen(env_lang) <= 2) {
+ properties_add("user.language", env_lang);
+ }
+ else {
+ if ((env_lang[2] == '_') && (strlen(env_lang) >= 5)) {
+ lang = MNEW(char, 3);
+ strncpy(lang, (char *) &env_lang[0], 2);
+ lang[2] = '\0';
+
+ country = MNEW(char, 3);
+ strncpy(country, (char *) &env_lang[3], 2);
+ country[2] = '\0';
+
+ properties_add("user.language", lang);
+ properties_add("user.country", country);
+ }
+ }
+ }
+ else {
+ /* if no default locale was specified, use `en_US' */