Skip to content

Commit

Permalink
Call (camlp4 -where) instead of (ocamlfind query camlp4) for camlp4di…
Browse files Browse the repository at this point in the history
…r setup

This supersedes the ocamlfind-dependent logic of ocaml/ocaml#117,
which raised warning messages in an ocamlfind-less setting.
  • Loading branch information
gasche committed Jan 4, 2016
1 parent 77691ae commit 826f4e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Changes
Expand Up @@ -18,8 +18,8 @@ OCamlbuild NEXT_RELEASE
- Changed OCamlbuild's license to LGPLv2 with static linking exception.
- OGPR#219: speedup target-already-built builds
(ygrek)
- MPR#6605, OGPR#117: use ocamlfind, if available, to discover camlp4 path
(Vincent Laporte)
- MPR#6605, OGPR#117: un-hardcode camlp4 library path
(Vincent Laporte and Gabriel Scherer)
- #20: add -dot and -man-related ocamldoc options
(Gabriel Scherer)
- #10, PR#21: Fix manpages generation: properly pass the "manpage" tag.
Expand Down
15 changes: 7 additions & 8 deletions src/ocaml_specific.ml
Expand Up @@ -748,14 +748,13 @@ ocaml_lib ~extern:true ~dir:"+ocamldoc" "ocamldoc";;
ocaml_lib ~extern:true ~dir:"+ocamlbuild" ~tag_name:"use_ocamlbuild" "ocamlbuildlib";;

let camlp4dir =
Findlib.(
try
if sys_command "sh -c 'ocamlfind list >/dev/null' 2>/dev/null" != 0
then raise (Findlib_error Cannot_run_ocamlfind);
(query "camlp4").location
with Findlib_error _ ->
"+camlp4"
);;
let where cmd =
(* may raise a Failure exception *)
String.chomp
(My_unix.run_and_read
(cmd ^ " -where 2>/dev/null")) in
try where "camlp4" with _ -> "+camlp4"
;;

ocaml_lib ~extern:true ~dir:camlp4dir ~tag_name:"use_camlp4" "camlp4lib";;
ocaml_lib ~extern:true ~dir:camlp4dir ~tag_name:"use_old_camlp4" "camlp4";;
Expand Down

0 comments on commit 826f4e1

Please sign in to comment.