about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-09-14 14:11:22 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-09-14 14:11:22 +0200
commitf077b2845902ef5a69a10cd7ce764f08675acd31 (patch)
tree8a0d874ea9e6c9a8bec51334eb69907225fa4672 /src
parentc08fb5d53d993dd431cbedd28c0191a2962f6dc5 (diff)
downloadbox64-f077b2845902ef5a69a10cd7ce764f08675acd31.tar.gz
box64-f077b2845902ef5a69a10cd7ce764f08675acd31.zip
Small improvment in steam handling
Diffstat (limited to 'src')
-rw-r--r--src/steam.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/steam.c b/src/steam.c
index 57da0c0c..c59647fb 100644
--- a/src/steam.c
+++ b/src/steam.c
@@ -115,7 +115,25 @@ void pressure_vessel(int argc, const char** argv, int nextarg, const char* prog)
             if(system(tmp)<0) printf_log(LOG_INFO, "%s failed\n", tmp);
             // setup LD_LIBRARY_PATH
             const char* ld = getenv("LD_LIBRARY_PATH");
-            snprintf(tmp, sizeof(tmp), "%s/lib/x86_64-linux-gnu:%s/lib/i386-linux-gnu:%s/lib:%s/lib64:%s/lib32:%s", sniper, sniper, sniper, sniper, sniper, ld?ld:"");
+            char tmp2[4096];
+            tmp[0] = '\0';
+            #define GO(A, B) \
+            snprintf(tmp2, sizeof(tmp2), A, B);     \
+            if(FileExist(tmp2, 0)) {                \
+                strncat(tmp, tmp2, sizeof(tmp)-1);  \
+                strncat(tmp, ":", sizeof(tmp)-1);   \
+            }
+            GO("%s/lib/x86_64-linux-gnu", sniper)
+            GO("%s/lib/i386-linux-gnu", sniper)
+            GO("%s/lib/x86_64-linux-gnu/openblas", sniper)
+            GO("%s/lib/i386-linux-gnu/openblas", sniper)
+            GO("%s/lib/x86_64-linux-gnu/openblas-pthread", sniper)
+            GO("%s/lib/i386-linux-gnu/openblas-pthread", sniper)
+            GO("%s/lib", sniper)
+            GO("%s/lib64", sniper)
+            GO("%s/lib32", sniper)
+            #undef GO
+            if(ld) strncat(tmp, ld, sizeof(tmp)-1);
             setenv("LD_LIBRARY_PATH", tmp, 1);
             printf_log(LOG_DEBUG, "setenv(%s, %s, 1)\n", "LD_LIBRARY_PATH", tmp);
         }