Skip to content

Commit

Permalink
64 bit lib detection (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeWaka authored Feb 5, 2025
1 parent c2f762e commit 09a94ca
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions dmsrc/main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,25 @@
/* This comment bypasses grep checks */ /var/__rust_g

/proc/__detect_rust_g()
var/arch_suffix = null
#ifdef OPENDREAM
arch_suffix = "64"
#endif
if (world.system_type == UNIX)
if (fexists("./librust_g.so"))
if (fexists("./librust_g[arch_suffix].so"))
// No need for LD_LIBRARY_PATH badness.
return __rust_g = "./librust_g.so"
else if (fexists("./rust_g"))
return __rust_g = "./librust_g[arch_suffix].so"
else if (fexists("./rust_g[arch_suffix]"))
// Old dumb filename.
return __rust_g = "./rust_g"
else if (fexists("[world.GetConfig("env", "HOME")]/.byond/bin/rust_g"))
return __rust_g = "./rust_g[arch_suffix]"
else if (fexists("[world.GetConfig("env", "HOME")]/.byond/bin/rust_g[arch_suffix]"))
// Old dumb filename in `~/.byond/bin`.
return __rust_g = "rust_g"
return __rust_g = "rust_g[arch_suffix]"
else
// It's not in the current directory, so try others
return __rust_g = "librust_g.so"
return __rust_g = "librust_g[arch_suffix].so"
else
return __rust_g = "rust_g"
return __rust_g = "rust_g[arch_suffix]"

#define RUST_G (__rust_g || __detect_rust_g())
#endif
Expand Down

0 comments on commit 09a94ca

Please sign in to comment.