aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-05-28 00:31:11 +0000
committerEstevan Castilho <tevo@riajuu.net>2026-05-28 01:15:11 +0000
commit1378202e6b0b51d7d338a1042824860f19fcbc9b (patch)
treebd88a81d60b71e36275d712678dc623c53333972
parent9dc0391443ca16bf1ab3114d002aad83872f8a73 (diff)
downloadSakura-1378202e6b0b51d7d338a1042824860f19fcbc9b.tar.gz
Sakura-1378202e6b0b51d7d338a1042824860f19fcbc9b.zip
Link against RNT directly, rather than `dlopen`ing at runtime
-rw-r--r--lib/dune3
-rw-r--r--lib/nt_ffi.ml13
2 files changed, 3 insertions, 13 deletions
diff --git a/lib/dune b/lib/dune
index a48798f..5d3522c 100644
--- a/lib/dune
+++ b/lib/dune
@@ -17,4 +17,5 @@
ctypes
ctypes.foreign)
(preprocess
- (pps ppx_deriving.show ppx_sexp_conv ppx_protocol_conv)))
+ (pps ppx_deriving.show ppx_sexp_conv ppx_protocol_conv))
+ (flags :standard -cclib -lRNT))
diff --git a/lib/nt_ffi.ml b/lib/nt_ffi.ml
index b7e65c4..8b70150 100644
--- a/lib/nt_ffi.ml
+++ b/lib/nt_ffi.ml
@@ -4,18 +4,7 @@
open Ctypes
open Foreign
-(* Load the shared library. Set RNT_LIBRARY_PATH to the full path of
- libRNT.dylib / libRNT.so when the library is not on the default search
- path. *)
-let lib =
- let path =
- match Sys.getenv_opt "RNT_LIBRARY_PATH" with
- | Some p -> p
- | None -> "libRNT.dylib"
- in
- Dl.(dlopen ~filename:path ~flags:[ RTLD_NOW; RTLD_GLOBAL ])
-
-let fn name typ = foreign ~from:lib name typ
+let fn name typ = foreign name typ
(* Runtime ----------------------------------------------------------------- *)
let rnt_init =