Browse files

add support for dynlink (bytecode only)

  • Loading branch information...
1 parent 81ed1ea commit 5e94b829219f239582819c871d65bc3413c355a9 @avsm avsm committed Jul 7, 2012
Showing with 10 additions and 0 deletions.
  1. +1 −0 examples/c_binding/app/_tags
  2. +6 −0 examples/c_binding/app/bardyn.ml
  3. +3 −0 examples/c_binding/build.sh
View
1 examples/c_binding/app/_tags
@@ -1 +1,2 @@
true: use_foo
+<bardyn.*>: use_dynlink
View
6 examples/c_binding/app/bardyn.ml
@@ -0,0 +1,6 @@
+open Dynlink
+let _ =
+ allow_unsafe_modules true;
+ try loadfile (adapt_filename "bar.cma")
+ with Error e ->
+ Printf.eprintf "EXN: %s\n%!" (error_message e)
View
3 examples/c_binding/build.sh
@@ -22,3 +22,6 @@ ocamlbuild -clean
ocamlbuild -classic-display bar.native bar.byte
./_build/bar.native
env CAML_LD_LIBRARY_PATH=${INSTALL_DIR} ./_build/bar.byte
+ocamlbuild -classic-display bardyn.byte bar.cmxs bar.cma
+cd _build
+env CAML_LD_LIBRARY_PATH=${INSTALL_DIR} ./bardyn.byte

0 comments on commit 5e94b82

Please sign in to comment.