From 37bbb9bb16e07454efb631e01a1d2a254a38658e Mon Sep 17 00:00:00 2001 From: Wojciech Meyer Date: Sat, 19 Jan 2013 10:44:19 +0000 Subject: [PATCH] Implement -syntax ocamlfind flag for ocamlbuild git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13262 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- ocamlbuild/main.ml | 4 ++++ ocamlbuild/options.ml | 2 ++ ocamlbuild/signatures.mli | 1 + 3 files changed, 7 insertions(+) diff --git a/ocamlbuild/main.ml b/ocamlbuild/main.ml index 627b39f1d..c65a1afb3 100644 --- a/ocamlbuild/main.ml +++ b/ocamlbuild/main.ml @@ -98,6 +98,10 @@ let proceed () = (fun pkg -> Configuration.tag_any [Param_tags.make "package" pkg]) !Options.ocaml_pkgs; + begin match !Options.ocaml_syntax with + | Some syntax -> Configuration.tag_any [Param_tags.make "syntax" syntax] + | None -> () end; + let newpwd = Sys.getcwd () in Sys.chdir Pathname.pwd; let entry_include_dirs = ref [] in diff --git a/ocamlbuild/options.ml b/ocamlbuild/options.ml index 9ad019b90..a6010fcdb 100644 --- a/ocamlbuild/options.ml +++ b/ocamlbuild/options.ml @@ -106,6 +106,7 @@ let targets_internal = ref [] let ocaml_libs_internal = ref [] let ocaml_mods_internal = ref [] let ocaml_pkgs_internal = ref [] +let ocaml_syntax = ref None let ocaml_lflags_internal = ref [] let ocaml_cflags_internal = ref [] let ocaml_docflags_internal = ref [] @@ -178,6 +179,7 @@ let spec = ref ( "-pkg", String (add_to' ocaml_pkgs_internal), " Link to this ocaml findlib package"; "-pkgs", String (add_to ocaml_pkgs_internal), " (idem)"; "-package", String (add_to' ocaml_pkgs_internal), " (idem)"; + "-syntax", String (fun syntax -> ocaml_syntax := Some syntax), " Specify syntax using ocamlfind"; "-lflag", String (add_to' ocaml_lflags_internal), " Add to ocamlc link flags"; "-lflags", String (add_to ocaml_lflags_internal), " (idem)"; "-cflag", String (add_to' ocaml_cflags_internal), " Add to ocamlc compile flags"; diff --git a/ocamlbuild/signatures.mli b/ocamlbuild/signatures.mli index 42590a00d..61a1abf77 100644 --- a/ocamlbuild/signatures.mli +++ b/ocamlbuild/signatures.mli @@ -391,6 +391,7 @@ module type OPTIONS = sig val ocaml_libs : string list ref val ocaml_mods : string list ref val ocaml_pkgs : string list ref + val ocaml_syntax : string option ref val ocaml_cflags : string list ref val ocaml_lflags : string list ref val ocaml_ppflags : string list ref