Skip to content

Commit

Permalink
[TERMUX] Library path and rc file load fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagabe19 committed Dec 4, 2023
1 parent 5710df0 commit b245e34
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ void LoadEnvVars(box86context_t *context)
AddPath("/mnt/utmp/box86/lib/i386-linux-gnu", &context->box86_ld_lib, 1);
//TODO: add relative path to box86 location
#endif
#ifndef TERMUX
if(FileExist("/lib/box86", 0))
AddPath("/lib/box86", &context->box86_ld_lib, 1);
if(FileExist("/usr/lib/box86", 0))
Expand All @@ -971,6 +972,12 @@ void LoadEnvVars(box86context_t *context)
AddPath("/usr/lib/i686-pc-linux-gnu", &context->box86_ld_lib, 1);
if(FileExist("/usr/lib32", 0))
AddPath("/usr/lib32", &context->box86_ld_lib, 1);
#else
if(FileExist("/data/data/com.termux/files/usr/lib/i386-linux-gnu", 0))
AddPath("/data/data/com.termux/files/usr/lib/i386-linux-gnu", &context->box86_ld_lib, 1);
if(FileExist("/data/data/com.termux/files/usr/lib/i686-linux-gnu", 0))
AddPath("/data/data/com.termux/files/usr/lib/i686-linux-gnu", &context->box86_ld_lib, 1);
#endif
if(getenv("LD_LIBRARY_PATH"))
PrependList(&context->box86_ld_lib, getenv("LD_LIBRARY_PATH"), 1); // in case some of the path are for x86 world
if(getenv("BOX86_EMULATED_LIBS")) {
Expand Down Expand Up @@ -1180,8 +1187,13 @@ void endBox86()

static void load_rcfiles()
{
#ifndef TERMUX
if(FileExist("/etc/box86.box86rc", IS_FILE))
LoadRCFile("/etc/box86.box86rc");
#else
if(FileExist("/data/data/com.termux/files/usr/etc/box86.box86rc", IS_FILE))
LoadRCFile("/data/data/com.termux/files/usr/etc/box86.box86rc");
#endif
#ifdef PANDORA
if(FileExist("/mnt/utmp/codeblocks/usr/etc/box86.box86rc", IS_FILE))
LoadRCFile("/mnt/utmp/codeblocks/usr/etc/box86.box86rc");
Expand Down

0 comments on commit b245e34

Please sign in to comment.