Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

regenerated with slightly newer oasis

  • Loading branch information...
commit 945604bbc8aecf7727397f326b00a48afad7dc17 1 parent 564ce84
@rgrinberg rgrinberg authored
Showing with 56 additions and 31 deletions.
  1. +56 −31 myocamlbuild.ml
View
87 myocamlbuild.ml
@@ -1,5 +1,5 @@
(* OASIS_START *)
-(* DO NOT EDIT (digest: 2131cda2c081f329ffaf426d52c6b626) *)
+(* DO NOT EDIT (digest: 8f30152875e428261b93e96009209dc5) *)
module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.ml" *)
@@ -204,26 +204,27 @@ module BaseEnvLight = struct
end
- let var_get name env =
- let rec var_expand str =
- let buff =
- Buffer.create ((String.length str) * 2)
- in
- Buffer.add_substitute
- buff
- (fun var ->
- try
- var_expand (MapString.find var env)
- with Not_found ->
- failwith
- (Printf.sprintf
- "No variable %s defined when trying to expand %S."
- var
- str))
- str;
- Buffer.contents buff
+ let rec var_expand str env =
+ let buff =
+ Buffer.create ((String.length str) * 2)
in
- var_expand (MapString.find name env)
+ Buffer.add_substitute
+ buff
+ (fun var ->
+ try
+ var_expand (MapString.find var env) env
+ with Not_found ->
+ failwith
+ (Printf.sprintf
+ "No variable %s defined when trying to expand %S."
+ var
+ str))
+ str;
+ Buffer.contents buff
+
+
+ let var_get name env =
+ var_expand (MapString.find name env) env
let var_choose lst env =
@@ -233,7 +234,7 @@ module BaseEnvLight = struct
end
-# 236 "myocamlbuild.ml"
+# 237 "myocamlbuild.ml"
module MyOCamlbuildFindlib = struct
(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
@@ -306,6 +307,22 @@ module MyOCamlbuildFindlib = struct
let find_syntaxes () = ["camlp4o"; "camlp4r"]
+ let well_known_syntax = [
+ "camlp4.quotations.o";
+ "camlp4.quotations.r";
+ "camlp4.exceptiontracer";
+ "camlp4.extend";
+ "camlp4.foldgenerator";
+ "camlp4.listcomprehension";
+ "camlp4.locationstripper";
+ "camlp4.macro";
+ "camlp4.mapgenerator";
+ "camlp4.metagenerator";
+ "camlp4.profiler";
+ "camlp4.tracer"
+ ]
+
+
let dispatch =
function
| Before_options ->
@@ -331,13 +348,17 @@ module MyOCamlbuildFindlib = struct
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"
- then syn_args @ base_args
- else base_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;
@@ -531,10 +552,14 @@ module MyOCamlbuildBase = struct
(* Add flags *)
List.iter
(fun (tags, cond_specs) ->
- let spec =
- BaseEnvLight.var_choose cond_specs env
+ let spec = BaseEnvLight.var_choose cond_specs env in
+ let rec eval_specs =
+ function
+ | S lst -> S (List.map eval_specs lst)
+ | A str -> A (BaseEnvLight.var_expand str env)
+ | spec -> spec
in
- flag tags & spec)
+ flag tags & (eval_specs spec))
t.flags
| _ ->
()
@@ -551,7 +576,7 @@ module MyOCamlbuildBase = struct
end
-# 554 "myocamlbuild.ml"
+# 579 "myocamlbuild.ml"
open Ocamlbuild_plugin;;
let package_default =
{
@@ -577,7 +602,7 @@ let package_default =
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
-# 581 "myocamlbuild.ml"
+# 606 "myocamlbuild.ml"
(* OASIS_STOP *)
open Ocamlbuild_plugin
Please sign in to comment.
Something went wrong with that request. Please try again.