Skip to content

Commit

Permalink
Now x86_64 bash can be installed as box64-bash and will be automaticl…
Browse files Browse the repository at this point in the history
…y used if present
  • Loading branch information
ptitSeb committed Oct 18, 2024
1 parent 9749165 commit cdf81eb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down
5 changes: 5 additions & 0 deletions system/box64.box64rc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.

0 comments on commit cdf81eb

Please sign in to comment.