summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ocamlbuild/ocaml_utils.ml3
-rw-r--r--ocamlbuild/options.ml9
2 files changed, 8 insertions, 4 deletions
diff --git a/ocamlbuild/ocaml_utils.ml b/ocamlbuild/ocaml_utils.ml
index fc9833811..7726825c1 100644
--- a/ocamlbuild/ocaml_utils.ml
+++ b/ocamlbuild/ocaml_utils.ml
@@ -29,8 +29,7 @@ let flag_and_dep tags cmd_spec =
dep tags ps
let stdlib_dir = lazy begin
- (* FIXME *)
- let ocamlc_where = sprintf "%s/ocamlc.where" !Options.build_dir in
+ let ocamlc_where = !Options.build_dir / (Pathname.mk "ocamlc.where") in
let () = Command.execute ~quiet:true (Cmd(S[!Options.ocamlc; A"-where"; Sh">"; P ocamlc_where])) in
String.chomp (read_file ocamlc_where)
end
diff --git a/ocamlbuild/options.ml b/ocamlbuild/options.ml
index e547d44e3..b0ca59d27 100644
--- a/ocamlbuild/options.ml
+++ b/ocamlbuild/options.ml
@@ -22,7 +22,7 @@ open Format
open Command
let entry = ref None
-let build_dir = ref "_build"
+let build_dir = ref (Filename.concat (Sys.getcwd ()) "_build")
let include_dirs = ref []
let exclude_dirs = ref []
let nothing_should_be_rebuilt = ref false
@@ -126,7 +126,12 @@ let add_to' rxs x =
else
()
let set_cmd rcmd = String (fun s -> rcmd := Sh s)
-let set_build_dir s = make_links := false; build_dir := s
+let set_build_dir s =
+ make_links := false;
+ if Filename.is_relative s then
+ build_dir := Filename.concat (Sys.getcwd ()) s
+ else
+ build_dir := s
let spec = ref (
Arg.align
[