summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2012-03-05 16:34:57 +0000
committerDamien Doligez <damien.doligez-inria.fr>2012-03-05 16:34:57 +0000
commitc204b4ae3ecf3c47e669d1548819ed51a98c4525 (patch)
tree659310c52e345399bb1b734bdf02778e1039901e
parent60dca0a103670161a8c2fb2b0edb4452567ec039 (diff)
PR#5503: proper fix
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12191 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-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
[