about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-10-18 14:53:13 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-10-18 14:53:13 +0200
commitcdf81eb1d7adb3faf8d0050798810742947e09af (patch)
treede4aa5dc44973cf7ba2fd17758420b6bc2306d37
parent97491658c69ebd7081f05ae90aee07a540b13b40 (diff)
downloadbox64-cdf81eb1d7adb3faf8d0050798810742947e09af.tar.gz
box64-cdf81eb1d7adb3faf8d0050798810742947e09af.zip
Now x86_64 bash can be installed as box64-bash and will be automaticly used if present
-rw-r--r--CMakeLists.txt12
-rw-r--r--src/core.c4
-rw-r--r--system/box64.box64rc5
-rwxr-xr-xtests/box64-bash (renamed from tests/bash)bin1230360 -> 1230360 bytes
4 files changed, 16 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 780a11cf..3809a5d9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1127,11 +1127,15 @@ endif()
 
 if(NOT _x86 AND NOT _x86_64)
   if(NOT TERMUX)
-   install(TARGETS ${BOX64}
-    RUNTIME DESTINATION bin)
+   install(TARGETS ${BOX64} RUNTIME DESTINATION bin)
+   if(NOT NO_LIB_INSTALL)
+    install(PROGRAMS ${CMAKE_SOURCE_DIR}/tests/box64-bash DESTINATION bin)
+   endif()
   else()
-   install(TARGETS ${BOX64}
-    RUNTIME DESTINATION ${TERMUX_PATH}/usr/bin)
+   install(TARGETS ${BOX64} RUNTIME DESTINATION ${TERMUX_PATH}/usr/bin)
+   if(NOT NO_LIB_INSTALL)
+    install(PROGRAMS ${CMAKE_SOURCE_DIR}/tests/box64-bash DESTINATION ${TERMUX_PATH}/usr/bin)
+   endif()
   endif()
   if(NOT NO_CONF_INSTALL)
     configure_file(system/box64.conf.cmake system/box64.conf)
diff --git a/src/core.c b/src/core.c
index ef6c473a..157dd204 100644
--- a/src/core.c
+++ b/src/core.c
@@ -2102,7 +2102,7 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
         box64_zoom = 1;
     }
     // special case for bash (add BOX86_NOBANNER=1 if not there)
-    if(!strcmp(prgname, "bash")) {
+    if(!strcmp(prgname, "bash") || !strcmp(prgname, "box64-bash")) {
         printf_log(LOG_INFO, "bash detected, disabling banner\n");
         if (!box64_nobanner) {
             setenv("BOX86_NOBANNER", "1", 0);
@@ -2113,6 +2113,8 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
             setenv("BOX64_BASH", prog, 1);
         }
     }
+    if(!bashpath)
+        bashpath = ResolveFile("box64-bash", &my_context->box64_path);
     if(bashpath)
         my_context->bashpath = box_strdup(bashpath);
 
diff --git a/system/box64.box64rc b/system/box64.box64rc
index fb4131c2..ad24fa5f 100644
--- a/system/box64.box64rc
+++ b/system/box64.box64rc
@@ -56,6 +56,11 @@ BOX64_PREFER_EMULATED=1
 BOX64_LOG=0
 BOX64_DYNAREC_ALIGNED_ATOMICS=1
 
+[box64-bash]
+# LOG tend to mess up script execution in bash
+BOX64_LOG=0
+BOX64_DYNAREC_ALIGNED_ATOMICS=1
+
 [beyond-all-reason]
 BOX64_MALLOC_HACK=2
 
diff --git a/tests/bash b/tests/box64-bash
index 67e625b5..67e625b5 100755
--- a/tests/bash
+++ b/tests/box64-bash
Binary files differ