about summary refs log tree commit diff stats
path: root/src/main.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-07-14 10:41:27 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-07-14 10:41:27 +0200
commite7478f33908793f79ca197a10744d112f707410f (patch)
tree69556c3f978349e05c8737337b3361f278d12c7e /src/main.c
parent9be89e8ba26dcffc4ae2a6477459dd2c115d1a5b (diff)
downloadbox64-e7478f33908793f79ca197a10744d112f707410f.tar.gz
box64-e7478f33908793f79ca197a10744d112f707410f.zip
Make library loaded with absolute path not wrapped (unless BOX64_PREFER_WRAPPED=1 is used)
Diffstat (limited to 'src/main.c')
-rwxr-xr-xsrc/main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 5f4e2cf8..d504b2a0 100755
--- a/src/main.c
+++ b/src/main.c
@@ -56,6 +56,7 @@ int box64_dynarec_trace = 0;
 int x11threads = 0;
 int x11glx = 1;
 int allow_missing_libs = 0;
+int box64_prefer_wrapped = 0;
 int fix_64bit_inodes = 0;
 int box64_zoom = 0;
 int box64_steam = 0;
@@ -423,7 +424,7 @@ int GatherEnv(char*** dest, const char** env, const char* prog)
         (*dest)[idx++] = strdup("BOX64_PATH=.:bin");
     }
     if(!ld_path) {
-        (*dest)[idx++] = strdup("BOX64_LD_LIBRARY_PATH=.:lib");
+        (*dest)[idx++] = strdup("BOX64_LD_LIBRARY_PATH=.:lib:lib64");
     }
     // add "_=prog" at the end...
     if(prog) {
@@ -448,7 +449,8 @@ void PrintHelp() {
     printf("    '-h'|'--help'    to print box64 help and quit\n");
     printf("You can also set some environment variables:\n");
     printf(" BOX64_PATH is the box64 version of PATH (default is '.:bin')\n");
-    printf(" BOX64_LD_LIBRARY_PATH is the box64 version LD_LIBRARY_PATH (default is '.:lib')\n");
+    printf(" BOX64_LD_LIBRARY_PATH is the box64 version LD_LIBRARY_PATH (default is '.:lib:lib64')\n");
+    printf(" BOX64_PREFER_WRAPPED if box64 will use wrapped libs even if the lib is specified with absolute path\n");
     printf(" BOX64_LOG with 0/1/2/3 or NONE/INFO/DEBUG/DUMP to set the printed debug info (level 3 is level 2 + BOX64_DUMP)\n");
     printf(" BOX64_DUMP with 0/1 to dump elf infos\n");
     printf(" BOX64_NOBANNER with 0/1 to enable/disable the printing of box64 version and build at start\n");
@@ -506,6 +508,11 @@ void LoadEnvVars(box64context_t *context)
             printf_log(LOG_INFO, "\n");
         }
     }
+    if(getenv("BOX64_PREFER_WRAPPED")) {
+        if (strcmp(getenv("BOX64_PREFER_WRAPPED"), "1")==0)
+            box64_prefer_wrapped = 1;
+            printf_log(LOG_INFO, "BOX64: Prefer Wrapped libs\n");
+    }
 
     if(getenv("BOX64_NOSIGSEGV")) {
         if (strcmp(getenv("BOX64_NOSIGSEGV"), "1")==0)