Skip to content

Commit

Permalink
Merge pull request #325 from avsm/master
Browse files Browse the repository at this point in the history
release 2.0.1
  • Loading branch information
avsm committed Nov 21, 2014
2 parents 285f1fd + c43d180 commit 97833d7
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 129 deletions.
4 changes: 2 additions & 2 deletions CHANGES
@@ -1,7 +1,7 @@
trunk (unreleased):
2.0.1 (2014-11-21):
* Add `register ~tracing` to enable tracing with mirage-profile at start-up (#321).
* Update Dockerfile for latest libraries (#320).
* Only build mirage-types if Io_page is also installed.
* Only build mirage-types if Io_page is also installed (#324).

2.0.0 (2014-11-05):
* [types]: backwards incompatible change: CONSOLE is now a FLOW;
Expand Down
2 changes: 1 addition & 1 deletion _oasis
@@ -1,6 +1,6 @@
OASISFormat: 0.3
Name: mirage
Version: 2.0.0
Version: 2.0.1
Synopsis: Mirage configuration tool
Authors: Thomas Gazagnaire, Anil Madhavapeddy
License: ISC
Expand Down
19 changes: 10 additions & 9 deletions _tags
@@ -1,8 +1,9 @@
# OASIS_START
# DO NOT EDIT (digest: faddbf53eff71e4790cbe626b35876bb)
# DO NOT EDIT (digest: ecc4e98cbd79286e16bc704f8d3eddd7)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
true: annot, bin_annot
<**/.svn>: -traverse
<**/.svn>: not_hygienic
".bzr": -traverse
Expand All @@ -24,13 +25,13 @@
<lib/main.{native,byte}>: pkg_mirage-types.lwt
<lib/main.{native,byte}>: pkg_unix
<lib/main.{native,byte}>: use_mirage
<lib/*.ml{,i}>: pkg_cmdliner
<lib/*.ml{,i}>: pkg_dynlink
<lib/*.ml{,i}>: pkg_ipaddr
<lib/*.ml{,i}>: pkg_lwt
<lib/*.ml{,i}>: pkg_mirage-types
<lib/*.ml{,i}>: pkg_mirage-types.lwt
<lib/*.ml{,i}>: pkg_unix
<lib/*.ml{,i}>: use_mirage
<lib/*.ml{,i,y}>: pkg_cmdliner
<lib/*.ml{,i,y}>: pkg_dynlink
<lib/*.ml{,i,y}>: pkg_ipaddr
<lib/*.ml{,i,y}>: pkg_lwt
<lib/*.ml{,i,y}>: pkg_mirage-types
<lib/*.ml{,i,y}>: pkg_mirage-types.lwt
<lib/*.ml{,i,y}>: pkg_unix
<lib/*.ml{,i,y}>: use_mirage
# OASIS_STOP
true: debug, bin_annot, annot, principal
4 changes: 2 additions & 2 deletions lib/META
@@ -1,6 +1,6 @@
# OASIS_START
# DO NOT EDIT (digest: f45cc1fc5851b3d926220776a0a6e659)
version = "2.0.0"
# DO NOT EDIT (digest: cf507a9827b13dd2860f1ed6206fe9bc)
version = "2.0.1"
description = "Mirage configuration tool"
requires = "ipaddr unix dynlink lwt mirage-types mirage-types.lwt"
archive(byte) = "mirage.cma"
Expand Down
88 changes: 51 additions & 37 deletions myocamlbuild.ml
@@ -1,5 +1,5 @@
(* OASIS_START *)
(* DO NOT EDIT (digest: c48ff08599a96293f73f901110e1b056) *)
(* DO NOT EDIT (digest: 663301e27c9f27b13a0af355328ed818) *)
module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.ml" *)

Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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. *)
Expand All @@ -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
Expand All @@ -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. *)
Expand Down Expand Up @@ -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 *)
Expand Down Expand Up @@ -580,18 +592,18 @@ 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 =
{
Expand All @@ -602,8 +614,10 @@ let package_default =
}
;;

let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}

let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;

# 608 "myocamlbuild.ml"
# 622 "myocamlbuild.ml"
(* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;;

0 comments on commit 97833d7

Please sign in to comment.