Permalink
Browse files

First successful test of dynamically linked Batteries Included.

  • Loading branch information...
1 parent 43f4c3c commit 81c80573f2ac83454f9d16da053514ba968ad16a David Teller committed Feb 15, 2009
Showing with 11 additions and 6 deletions.
  1. +5 −5 doc/batteries/myocamlbuild.ml
  2. +1 −1 src/main/threads/run.ml
  3. +2 −0 tests/dynlink/_tags
  4. +2 −0 tests/dynlink/hello.ml
  5. +1 −0 tests/dynlink/myocamlbuild.ml
@@ -195,17 +195,17 @@ let binary = Findlib.resolve_path \"@batteries_nothreads/run.byte\";; (*Note: we
(*Prepare command-line*)
let buf = Buffer.create 80;;
-Printf.bprintf buf \"%S %S -- \" binary "
-(Pathname.concat Pathname.current_dir_name cma)(*Should do one of the following:
+Printf.bprintf buf \"%S %S -- \" binary (Filename.concat (Filename.dirname (Sys.argv.(0)))" cma
+(*(Pathname.concat Pathname.current_dir_name cma)(*Should do one of the following:
- replace this with the complete path
- build the path at run-time from [Sys.argv.(0)]
- - find a way to embed the plug-in inside the .byte *)
-";;\nfor i = 1 to Array.length Sys.argv - 1 do
+ - find a way to embed the plug-in inside the .byte *)*)
+");;\nfor i = 1 to Array.length Sys.argv - 1 do
Printf.bprintf buf \"%S \" Sys.argv.(i)
done;;
let command = Buffer.contents buf in
- Printf.eprintf \"Launching\\t%s\\n...\\n\" command;
+ Printf.eprintf \"Requesting load of %S\\n...\\n%!\" command;
Sys.command command
"
in Echo ([contents], dest)
@@ -38,6 +38,6 @@ invisible_args := !invisible_args + hide_args;;
Arg.current := !Arg.current + hide_args;;
foreach (List.enum plugins) **>
fun arg ->
- Printf.eprintf "Launching %S\n" arg;
+ Printf.eprintf "Loading %S\n" arg;
Dynlink.loadfile arg
View
@@ -0,0 +1,2 @@
+<hello.ml>: use_batteries
+<hello.dyn.*>:pkg_findlib
@@ -0,0 +1,2 @@
+String.println stdout "Hello, world";;
+

0 comments on commit 81c8057

Please sign in to comment.