|
@@ -1,7 +1,7 @@
|
|
|
(* OASIS_START *)
|
|
|
-(* DO NOT EDIT (digest: 4f240f06ff7a70bb4e3be1240a180aab) *)
|
|
|
+(* DO NOT EDIT (digest: 2b686a81cec9fb16d1640bda36a68fbd) *)
|
|
|
module OASISGettext = struct
|
|
|
-(* # 22 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/oasis/OASISGettext.ml" *)
|
|
|
+(* # 22 "src/oasis/OASISGettext.ml" *)
|
|
|
|
|
|
|
|
|
let ns_ str =
|
|
@@ -30,7 +30,7 @@ module OASISGettext = struct
|
|
|
end
|
|
|
|
|
|
module OASISExpr = struct
|
|
|
-(* # 22 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/oasis/OASISExpr.ml" *)
|
|
|
+(* # 22 "src/oasis/OASISExpr.ml" *)
|
|
|
|
|
|
|
|
|
|
|
@@ -39,10 +39,10 @@ module OASISExpr = struct
|
|
|
open OASISGettext
|
|
|
|
|
|
|
|
|
- type test = string
|
|
|
+ type test = string
|
|
|
|
|
|
|
|
|
- type flag = string
|
|
|
+ type flag = string
|
|
|
|
|
|
|
|
|
type t =
|
|
@@ -52,10 +52,10 @@ module OASISExpr = struct
|
|
|
| EOr of t * t
|
|
|
| EFlag of flag
|
|
|
| ETest of test * string
|
|
|
-
|
|
|
|
|
|
|
|
|
- type 'a choices = (t * 'a) list
|
|
|
+
|
|
|
+ type 'a choices = (t * 'a) list
|
|
|
|
|
|
|
|
|
let eval var_get t =
|
|
@@ -131,7 +131,7 @@ end
|
|
|
|
|
|
# 132 "myocamlbuild.ml"
|
|
|
module BaseEnvLight = struct
|
|
|
-(* # 22 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/base/BaseEnvLight.ml" *)
|
|
|
+(* # 22 "src/base/BaseEnvLight.ml" *)
|
|
|
|
|
|
|
|
|
module MapString = Map.Make(String)
|
|
@@ -236,7 +236,7 @@ end
|
|
|
|
|
|
# 237 "myocamlbuild.ml"
|
|
|
module MyOCamlbuildFindlib = struct
|
|
|
-(* # 22 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
|
|
|
+(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
|
|
|
|
|
|
|
|
|
(** OCamlbuild extension, copied from
|
|
@@ -249,6 +249,9 @@ module MyOCamlbuildFindlib = struct
|
|
|
*)
|
|
|
open Ocamlbuild_plugin
|
|
|
|
|
|
+ type conf =
|
|
|
+ { no_automatic_syntax: bool;
|
|
|
+ }
|
|
|
|
|
|
(* these functions are not really officially exported *)
|
|
|
let run_and_read =
|
|
@@ -315,7 +318,7 @@ module MyOCamlbuildFindlib = struct
|
|
|
|
|
|
(* This lists all supported packages. *)
|
|
|
let find_packages () =
|
|
|
- List.map before_space (split_nl & run_and_read "ocamlfind list")
|
|
|
+ List.map before_space (split_nl & run_and_read (exec_from_conf "ocamlfind" ^ " list"))
|
|
|
|
|
|
|
|
|
(* Mock to list available syntaxes. *)
|
|
@@ -338,7 +341,7 @@ module MyOCamlbuildFindlib = struct
|
|
|
]
|
|
|
|
|
|
|
|
|
- let dispatch =
|
|
|
+ let dispatch conf =
|
|
|
function
|
|
|
| After_options ->
|
|
|
(* By using Before_options one let command line options have an higher
|
|
@@ -357,31 +360,39 @@ module MyOCamlbuildFindlib = struct
|
|
|
* -linkpkg *)
|
|
|
flag ["ocaml"; "link"; "program"] & A"-linkpkg";
|
|
|
|
|
|
- (* For each ocamlfind package one inject the -package option when
|
|
|
- * compiling, computing dependencies, generating documentation and
|
|
|
- * linking. *)
|
|
|
- List.iter
|
|
|
- begin fun pkg ->
|
|
|
- let base_args = [A"-package"; A pkg] in
|
|
|
- (* TODO: consider how to really choose camlp4o or camlp4r. *)
|
|
|
- let syn_args = [A"-syntax"; A "camlp4o"] in
|
|
|
- let args =
|
|
|
- (* Heuristic to identify syntax extensions: whether they end in
|
|
|
- ".syntax"; some might not.
|
|
|
- *)
|
|
|
- if Filename.check_suffix pkg "syntax" ||
|
|
|
- List.mem pkg well_known_syntax then
|
|
|
- syn_args @ base_args
|
|
|
- else
|
|
|
- base_args
|
|
|
- in
|
|
|
- flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
|
|
|
- flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
|
|
|
- flag ["ocaml"; "doc"; "pkg_"^pkg] & S args;
|
|
|
- flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args;
|
|
|
- flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
|
|
|
- end
|
|
|
- (find_packages ());
|
|
|
+ if not (conf.no_automatic_syntax) then begin
|
|
|
+ (* For each ocamlfind package one inject the -package option when
|
|
|
+ * compiling, computing dependencies, generating documentation and
|
|
|
+ * linking. *)
|
|
|
+ List.iter
|
|
|
+ begin fun pkg ->
|
|
|
+ let base_args = [A"-package"; A pkg] in
|
|
|
+ (* TODO: consider how to really choose camlp4o or camlp4r. *)
|
|
|
+ let syn_args = [A"-syntax"; A "camlp4o"] in
|
|
|
+ let (args, pargs) =
|
|
|
+ (* Heuristic to identify syntax extensions: whether they end in
|
|
|
+ ".syntax"; some might not.
|
|
|
+ *)
|
|
|
+ if Filename.check_suffix pkg "syntax" ||
|
|
|
+ List.mem pkg well_known_syntax then
|
|
|
+ (syn_args @ base_args, syn_args)
|
|
|
+ else
|
|
|
+ (base_args, [])
|
|
|
+ in
|
|
|
+ flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
|
|
|
+ flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
|
|
|
+ flag ["ocaml"; "doc"; "pkg_"^pkg] & S args;
|
|
|
+ flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args;
|
|
|
+ flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
|
|
|
+
|
|
|
+ (* TODO: Check if this is allowed for OCaml < 3.12.1 *)
|
|
|
+ flag ["ocaml"; "compile"; "package("^pkg^")"] & S pargs;
|
|
|
+ flag ["ocaml"; "ocamldep"; "package("^pkg^")"] & S pargs;
|
|
|
+ flag ["ocaml"; "doc"; "package("^pkg^")"] & S pargs;
|
|
|
+ flag ["ocaml"; "infer_interface"; "package("^pkg^")"] & S pargs;
|
|
|
+ end
|
|
|
+ (find_packages ());
|
|
|
+ end;
|
|
|
|
|
|
(* Like -package but for extensions syntax. Morover -syntax is useless
|
|
|
* when linking. *)
|
|
@@ -415,7 +426,7 @@ module MyOCamlbuildFindlib = struct
|
|
|
end
|
|
|
|
|
|
module MyOCamlbuildBase = struct
|
|
|
-(* # 22 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
|
|
|
+(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
|
|
|
|
|
|
|
|
|
(** Base functions for writing myocamlbuild.ml
|
|
@@ -430,13 +441,13 @@ module MyOCamlbuildBase = struct
|
|
|
module OC = Ocamlbuild_pack.Ocaml_compiler
|
|
|
|
|
|
|
|
|
- type dir = string
|
|
|
- type file = string
|
|
|
- type name = string
|
|
|
- type tag = string
|
|
|
+ type dir = string
|
|
|
+ type file = string
|
|
|
+ type name = string
|
|
|
+ type tag = string
|
|
|
|
|
|
|
|
|
-(* # 62 "/home/lwzukw/.opam/4.01.0/build/oasis.0.4.4/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
|
|
|
+(* # 62 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
|
|
|
|
|
|
|
|
|
type t =
|
|
@@ -448,7 +459,7 @@ module MyOCamlbuildBase = struct
|
|
|
* directory.
|
|
|
*)
|
|
|
includes: (dir * dir list) list;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
let env_filename =
|
|
@@ -546,12 +557,13 @@ module MyOCamlbuildBase = struct
|
|
|
|
|
|
(* When ocaml link something that use the C library, then one
|
|
|
need that file to be up to date.
|
|
|
+ This holds both for programs and for libraries.
|
|
|
*)
|
|
|
- dep ["link"; "ocaml"; "program"; tag_libstubs lib]
|
|
|
- [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
|
|
|
+ dep ["link"; "ocaml"; tag_libstubs lib]
|
|
|
+ [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
|
|
|
|
|
|
- dep ["compile"; "ocaml"; "program"; tag_libstubs lib]
|
|
|
- [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
|
|
|
+ dep ["compile"; "ocaml"; tag_libstubs lib]
|
|
|
+ [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
|
|
|
|
|
|
(* TODO: be more specific about what depends on headers *)
|
|
|
(* Depends on .h files *)
|
|
@@ -580,25 +592,27 @@ module MyOCamlbuildBase = struct
|
|
|
()
|
|
|
|
|
|
|
|
|
- let dispatch_default t =
|
|
|
+ let dispatch_default conf t =
|
|
|
dispatch_combine
|
|
|
[
|
|
|
dispatch t;
|
|
|
- MyOCamlbuildFindlib.dispatch;
|
|
|
+ MyOCamlbuildFindlib.dispatch conf;
|
|
|
]
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
-# 594 "myocamlbuild.ml"
|
|
|
+# 606 "myocamlbuild.ml"
|
|
|
open Ocamlbuild_plugin;;
|
|
|
let package_default =
|
|
|
{MyOCamlbuildBase.lib_ocaml = []; lib_c = []; flags = []; includes = []}
|
|
|
;;
|
|
|
|
|
|
-let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
|
|
|
+let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}
|
|
|
+
|
|
|
+let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;
|
|
|
|
|
|
-# 603 "myocamlbuild.ml"
|
|
|
+# 617 "myocamlbuild.ml"
|
|
|
(* OASIS_STOP *)
|
|
|
Ocamlbuild_plugin.dispatch dispatch_default;;
|