about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-04-29 11:23:35 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-04-29 11:23:35 +0200
commitf256c48505690dfa39405156f626ca8762d8f1d5 (patch)
tree54446bbea1144aa8520b15df63a2ccffd706bfa9 /src
parent71c5447b8ad534f2507c0405a348d902e9374517 (diff)
downloadbox64-f256c48505690dfa39405156f626ca8762d8f1d5.tar.gz
box64-f256c48505690dfa39405156f626ca8762d8f1d5.zip
Fixed non-dynarec build by introducing BOX64_JVM to replace BOX64_DYNAREC_JVM
Diffstat (limited to 'src')
-rw-r--r--src/core.c15
-rw-r--r--src/include/debug.h2
-rw-r--r--src/librarian/library.c2
-rw-r--r--src/tools/rcfile.c4
4 files changed, 18 insertions, 5 deletions
diff --git a/src/core.c b/src/core.c
index 6b96d37d..9e61cb49 100644
--- a/src/core.c
+++ b/src/core.c
@@ -79,7 +79,6 @@ int box64_dynarec_fastround = 1;
 int box64_dynarec_safeflags = 1;
 int box64_dynarec_callret = 0;
 int box64_dynarec_bleeding_edge = 1;
-int box64_dynarec_jvm = 1;
 int box64_dynarec_tbb = 1;
 int box64_dynarec_wait = 1;
 int box64_dynarec_missing = 0;
@@ -123,6 +122,7 @@ int la64_scq = 0;
 int box64_dynarec = 0;
 #endif
 int box64_libcef = 1;
+int box64_jvm = 1;
 int box64_sdl2_jguid = 0;
 int dlsym_error = 0;
 int cycle_log = 0;
@@ -727,9 +727,9 @@ void LoadLogEnv()
     if(p) {
         if(strlen(p)==1) {
             if(p[0]>='0' && p[0]<='1')
-                box64_dynarec_jvm = p[0]-'0';
+                box64_jvm = p[0]-'0';
         }
-        if(!box64_dynarec_jvm)
+        if(!box64_jvm)
             printf_log(LOG_INFO, "Dynarec will not detect libjvm\n");
     }
     p = getenv("BOX64_DYNAREC_TBB");
@@ -845,6 +845,15 @@ void LoadLogEnv()
         if(!box64_libcef)
             printf_log(LOG_INFO, "BOX64 will not detect libcef\n");
     }
+    p = getenv("BOX64_JVM");
+    if(p) {
+        if(strlen(p)==1) {
+            if(p[0]>='0' && p[0]<='1')
+                box64_jvm = p[0]-'0';
+        }
+        if(!box64_jvm)
+            printf_log(LOG_INFO, "BOX64 will not detect libjvm\n");
+    }
     p = getenv("BOX64_SDL2_JGUID");
     if(p) {
         if(strlen(p)==1) {
diff --git a/src/include/debug.h b/src/include/debug.h
index 8d75a5c5..c4ea7ab1 100644
--- a/src/include/debug.h
+++ b/src/include/debug.h
@@ -30,7 +30,6 @@ extern int box64_dynarec_div0;
 extern int box64_dynarec_safeflags;
 extern int box64_dynarec_callret;
 extern int box64_dynarec_bleeding_edge;
-extern int box64_dynarec_jvm;
 extern int box64_dynarec_tbb;
 extern int box64_dynarec_wait;
 extern int box64_dynarec_missing;
@@ -69,6 +68,7 @@ extern int la64_scq;
 #endif
 #endif
 extern int box64_libcef;
+extern int box64_jvm;
 extern int box64_sdl2_jguid;
 extern int dlsym_error;    // log dlsym error
 extern int cycle_log;      // if using rolling logs
diff --git a/src/librarian/library.c b/src/librarian/library.c
index 3466e017..127339af 100644
--- a/src/librarian/library.c
+++ b/src/librarian/library.c
@@ -339,7 +339,7 @@ static int loadEmulatedLib(const char* libname, library_t *lib, box64context_t*
             box64_dynarec_strongmem = 3;
         }
         #endif
-        if(libname && box64_dynarec_jvm && strstr(libname, "libjvm.so")) {
+        if(libname && box64_jvm && strstr(libname, "libjvm.so")) {
             #ifdef DYNAREC
             printf_dump(LOG_INFO, "libjvm detected, disable Dynarec BigBlock and enable Dynarec StrongMem, hide SSE 4.2\n");
             box64_dynarec_bigblock = 0;
diff --git a/src/tools/rcfile.c b/src/tools/rcfile.c
index 9098f9dc..191badad 100644
--- a/src/tools/rcfile.c
+++ b/src/tools/rcfile.c
@@ -106,6 +106,7 @@ ENTRYBOOL(BOX64_CEFDISABLEGPU, box64_cefdisablegpu)     \
 ENTRYBOOL(BOX64_CEFDISABLEGPUCOMPOSITOR, box64_cefdisablegpucompositor)\
 ENTRYBOOL(BOX64_EXIT, want_exit)                        \
 ENTRYBOOL(BOX64_LIBCEF, box64_libcef)                   \
+ENTRYBOOL(BOX64_JVM, box64_jvm)                         \
 ENTRYBOOL(BOX64_SDL2_JGUID, box64_sdl2_jguid)           \
 ENTRYINT(BOX64_MALLOC_HACK, box64_malloc_hack, 0, 2, 2) \
 ENTRYINTPOS(BOX64_MAXCPU, new_maxcpu)                   \
@@ -500,6 +501,7 @@ void ApplyParams(const char* name)
         return;
     int new_cycle_log = cycle_log;
     int new_maxcpu = box64_maxcpu;
+    int box64_dynarec_jvm = box64_jvm;
     if(!strcmp(name, old_name)) {
         return;
     }
@@ -547,6 +549,8 @@ void ApplyParams(const char* name)
         cycle_log = new_cycle_log;
         initCycleLog(my_context);
     }
+    if(param->is_box64_dynarec_jvm_present && !param->is_box64_jvm_present)
+        box64_jvm = box64_dynarec_jvm;
     if(!box64_maxcpu_immutable) {
         if(new_maxcpu!=box64_maxcpu && box64_maxcpu && box64_maxcpu<new_maxcpu) {
         printf_log(LOG_INFO, "Not applying BOX64_MAXCPU=%d because a lesser value is already active: %d\n", new_maxcpu, box64_maxcpu);