-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ocaml: add local copy of the ocamlbuild patch
- Loading branch information
Showing
2 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Author: Vincent Laporte <[email protected]> | ||
Date: Sun Feb 1 11:19:50 2015 +0100 | ||
|
||
ocamlbuild: use ocamlfind to discover camlp4 path | ||
|
||
and default to `+camlp4` | ||
|
||
diff --git a/ocamlbuild/ocaml_specific.ml b/ocamlbuild/ocaml_specific.ml | ||
index b902810..a73b7a5 100644 | ||
--- a/ocamlbuild/ocaml_specific.ml | ||
+++ b/ocamlbuild/ocaml_specific.ml | ||
@@ -698,15 +698,25 @@ ocaml_lib ~extern:true ~tag_name:"use_toplevel" "toplevellib";; | ||
ocaml_lib ~extern:true ~dir:"+ocamldoc" "ocamldoc";; | ||
ocaml_lib ~extern:true ~dir:"+ocamlbuild" ~tag_name:"use_ocamlbuild" "ocamlbuildlib";; | ||
|
||
-ocaml_lib ~extern:true ~dir:"+camlp4" ~tag_name:"use_camlp4" "camlp4lib";; | ||
-ocaml_lib ~extern:true ~dir:"+camlp4" ~tag_name:"use_old_camlp4" "camlp4";; | ||
-ocaml_lib ~extern:true ~dir:"+camlp4" ~tag_name:"use_camlp4_full" "camlp4fulllib";; | ||
+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" | ||
+ );; | ||
+ | ||
+ocaml_lib ~extern:true ~dir:camlp4dir ~tag_name:"use_camlp4" "camlp4lib";; | ||
+ocaml_lib ~extern:true ~dir:camlp4dir ~tag_name:"use_old_camlp4" "camlp4";; | ||
+ocaml_lib ~extern:true ~dir:camlp4dir ~tag_name:"use_camlp4_full" "camlp4fulllib";; | ||
flag ["ocaml"; "compile"; "use_camlp4_full"] | ||
- (S[A"-I"; A"+camlp4/Camlp4Parsers"; | ||
- A"-I"; A"+camlp4/Camlp4Printers"; | ||
- A"-I"; A"+camlp4/Camlp4Filters"]);; | ||
-flag ["ocaml"; "use_camlp4_bin"; "link"; "byte"] (A"+camlp4/Camlp4Bin.cmo");; | ||
-flag ["ocaml"; "use_camlp4_bin"; "link"; "native"] (A"+camlp4/Camlp4Bin.cmx");; | ||
+ (S[A"-I"; A(camlp4dir^"/Camlp4Parsers"); | ||
+ A"-I"; A(camlp4dir^"/Camlp4Printers"); | ||
+ A"-I"; A(camlp4dir^"/Camlp4Filters")]);; | ||
+flag ["ocaml"; "use_camlp4_bin"; "link"; "byte"] (A(camlp4dir^"/Camlp4Bin.cmo"));; | ||
+flag ["ocaml"; "use_camlp4_bin"; "link"; "native"] (A(camlp4dir^"/Camlp4Bin.cmx"));; | ||
|
||
flag ["ocaml"; "debug"; "compile"; "byte"] (A "-g");; | ||
flag ["ocaml"; "debug"; "link"; "byte"; "program"] (A "-g");; |