build system

This commit is contained in:
Simon Cruanes 2014-04-09 00:22:52 +02:00
parent 10b72019d7
commit cfed1c44a9
8 changed files with 215 additions and 90 deletions

View file

@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: 7b2408909643717852b95f994b273fee)
# DO NOT EDIT (digest: a3c674b4239234cbbe53afe090018954)
SETUP = ocaml setup.ml
@ -33,6 +33,9 @@ distclean:
setup.data:
$(SETUP) -configure $(CONFIGUREFLAGS)
configure:
$(SETUP) -configure $(CONFIGUREFLAGS)
.PHONY: build doc test all install uninstall reinstall clean distclean configure
# OASIS_STOP

3
_oasis
View file

@ -40,7 +40,8 @@ Library "containers"
Vector, Bij, PiCalculus, Bencode, Sexp, RAL, MultiSet,
UnionFind, SmallSet, Leftistheap, AbsSet, CSM, MultiMap,
ActionMan, BV, QCheck, BencodeOnDisk, Show, TTree,
HGraph, Automaton, Conv, Levenshtein, Bidir, Iteratee
HGraph, Automaton, Conv, Levenshtein, Bidir, Iteratee,
Ty
BuildDepends: unix
Library "containers_thread"

3
_tags
View file

@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: fd2094ebb8dc920dfd422597f0857b18)
# DO NOT EDIT (digest: 1f820e710eb0e25ebe36cbb436da1e21)
# 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
@ -57,6 +57,7 @@
"levenshtein.cmx": for-pack(Containers)
"bidir.cmx": for-pack(Containers)
"iteratee.cmx": for-pack(Containers)
"ty.cmx": for-pack(Containers)
# Library containers_thread
"threads/containers_thread.cmxs": use_containers_thread
<threads/*.ml{,i}>: package(threads)

View file

@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: aaae13bc67b3330cd57981dd937f5914)
# DO NOT EDIT (digest: a57e9337d5ca2ca5de2c29c113a55d57)
Cache
Deque
Gen
@ -42,4 +42,5 @@ Conv
Levenshtein
Bidir
Iteratee
Ty
# OASIS_STOP

View file

@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: aaae13bc67b3330cd57981dd937f5914)
# DO NOT EDIT (digest: a57e9337d5ca2ca5de2c29c113a55d57)
Cache
Deque
Gen
@ -42,4 +42,5 @@ Conv
Levenshtein
Bidir
Iteratee
Ty
# OASIS_STOP

View file

@ -164,10 +164,14 @@ module type S = sig
end
end
(** {2 Functor} *)
module Make(Str : STRING) : S
with type string_ = Str.t
and type char_ = Str.char_
(** {2 Default instance: string} *)
include S with type char_ = char and type string_ = string
val debug_print : out_channel -> automaton -> unit

View file

@ -1,5 +1,5 @@
(* OASIS_START *)
(* DO NOT EDIT (digest: 5aa8431a34ac4b8eb107bbd4e50b9c49) *)
(* DO NOT EDIT (digest: d29ffdfaf6a1a8b5374c77f1680535e9) *)
module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.ml" *)
@ -259,6 +259,31 @@ module MyOCamlbuildFindlib = struct
Ocamlbuild_pack.Lexers.blank_sep_strings
let exec_from_conf exec =
let exec =
let env_filename = Pathname.basename BaseEnvLight.default_filename in
let env = BaseEnvLight.load ~filename:env_filename ~allow_empty:true () in
try
BaseEnvLight.var_get exec env
with Not_found ->
Printf.eprintf "W: Cannot get variable %s\n" exec;
exec
in
let fix_win32 str =
if Sys.os_type = "Win32" then begin
let buff = Buffer.create (String.length str) in
(* Adapt for windowsi, ocamlbuild + win32 has a hard time to handle '\\'.
*)
String.iter
(fun c -> Buffer.add_char buff (if c = '\\' then '/' else c))
str;
Buffer.contents buff
end else begin
str
end
in
fix_win32 exec
let split s ch =
let buf = Buffer.create 13 in
let x = ref [] in
@ -286,17 +311,7 @@ module MyOCamlbuildFindlib = struct
with Not_found -> s
(* ocamlfind command *)
let ocamlfind x =
let ocamlfind_prog =
let env_filename = Pathname.basename BaseEnvLight.default_filename in
let env = BaseEnvLight.load ~filename:env_filename ~allow_empty:true () in
try
BaseEnvLight.var_get "ocamlfind" env
with Not_found ->
Printf.eprintf "W: Cannot get variable ocamlfind";
"ocamlfind"
in
S[Sh ocamlfind_prog; x]
let ocamlfind x = S[Sh (exec_from_conf "ocamlfind"); x]
(* This lists all supported packages. *)
let find_packages () =
@ -325,7 +340,7 @@ module MyOCamlbuildFindlib = struct
let dispatch =
function
| Before_options ->
| After_options ->
(* By using Before_options one let command line options have an higher
* priority on the contrary using After_options will guarantee to have
* the higher priority override default commands by ocamlfind ones *)
@ -476,7 +491,7 @@ module MyOCamlbuildBase = struct
try
opt := no_trailing_dot (BaseEnvLight.var_get var env)
with Not_found ->
Printf.eprintf "W: Cannot get variable %s" var)
Printf.eprintf "W: Cannot get variable %s\n" var)
[
Options.ext_obj, "ext_obj";
Options.ext_lib, "ext_lib";
@ -576,7 +591,7 @@ module MyOCamlbuildBase = struct
end
# 579 "myocamlbuild.ml"
# 594 "myocamlbuild.ml"
open Ocamlbuild_plugin;;
let package_default =
{
@ -595,6 +610,6 @@ let package_default =
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
# 599 "myocamlbuild.ml"
# 614 "myocamlbuild.ml"
(* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;;

167
setup.ml
View file

@ -1,9 +1,9 @@
(* setup.ml generated for the first time by OASIS v0.3.0 *)
(* OASIS_START *)
(* DO NOT EDIT (digest: ab136fb2303cc599d52ecdf4cdcf9067) *)
(* DO NOT EDIT (digest: 607ac444249450197cccc8d204000609) *)
(*
Regenerated by OASIS v0.4.2
Regenerated by OASIS v0.4.4
Visit http://oasis.forge.ocamlcore.org for more information and
documentation about functions used in this file.
*)
@ -258,29 +258,62 @@ module OASISUtils = struct
open OASISGettext
module MapString = Map.Make(String)
module MapExt =
struct
module type S =
sig
include Map.S
val add_list: 'a t -> (key * 'a) list -> 'a t
val of_list: (key * 'a) list -> 'a t
val to_list: 'a t -> (key * 'a) list
end
module Make (Ord: Map.OrderedType) =
struct
include Map.Make(Ord)
let rec add_list t =
function
| (k, v) :: tl -> add_list (add k v t) tl
| [] -> t
let of_list lst = add_list empty lst
let to_list t = fold (fun k v acc -> (k, v) :: acc) t []
end
end
let map_string_of_assoc assoc =
List.fold_left
(fun acc (k, v) -> MapString.add k v acc)
MapString.empty
assoc
module MapString = MapExt.Make(String)
module SetString = Set.Make(String)
module SetExt =
struct
module type S =
sig
include Set.S
val add_list: t -> elt list -> t
val of_list: elt list -> t
val to_list: t -> elt list
end
module Make (Ord: Set.OrderedType) =
struct
include Set.Make(Ord)
let rec add_list t =
function
| e :: tl -> add_list (add e t) tl
| [] -> t
let of_list lst = add_list empty lst
let to_list = elements
end
end
let set_string_add_list st lst =
List.fold_left
(fun acc e -> SetString.add e acc)
st
lst
let set_string_of_list =
set_string_add_list
SetString.empty
module SetString = SetExt.Make(String)
let compare_csl s1 s2 =
@ -300,7 +333,7 @@ module OASISUtils = struct
end)
module SetStringCsl =
Set.Make
SetExt.Make
(struct
type t = string
let compare = compare_csl
@ -1047,6 +1080,21 @@ module OASISExpr = struct
end
module OASISText = struct
(* # 22 "src/oasis/OASISText.ml" *)
type elt =
| Para of string
| Verbatim of string
| BlankLine
type t = elt list
end
module OASISTypes = struct
(* # 22 "src/oasis/OASISTypes.ml" *)
@ -1293,7 +1341,7 @@ module OASISTypes = struct
authors: string list;
homepage: url option;
synopsis: string;
description: string option;
description: OASISText.t option;
categories: url list;
conf_type: [`Configure] plugin;
@ -1312,6 +1360,7 @@ module OASISTypes = struct
files_ab: unix_filename list;
sections: section list;
plugins: [`Extra] plugin list;
disable_oasis_section: unix_filename list;
schema_data: PropList.Data.t;
plugin_data: plugin_data;
}
@ -1367,6 +1416,24 @@ module OASISFeatures = struct
let plugin_version plugin_kind plugin_name t =
MapPlugin.find (plugin_kind, plugin_name) t.plugin_versions
let to_string t =
Printf.sprintf
"oasis_version: %s; alpha_features: %s; beta_features: %s; \
plugins_version: %s"
(OASISVersion.string_of_version t.oasis_version)
(String.concat ", " t.alpha_features)
(String.concat ", " t.beta_features)
(String.concat ", "
(MapPlugin.fold
(fun (_, plg) ver_opt acc ->
(plg^
(match ver_opt with
| Some v ->
" "^(OASISVersion.string_of_version v)
| None -> ""))
:: acc)
t.plugin_versions []))
end
type origin =
@ -1407,6 +1474,17 @@ module OASISFeatures = struct
let beta = InDev Beta
let to_string t =
Printf.sprintf
"feature: %s; plugin: %s; publication: %s"
t.name
(match t.plugin with
| None -> "<none>"
| Some (_, nm, _) -> nm)
(match t.publication with
| InDev stage -> string_of_stage stage
| SinceVersion ver -> ">= "^(OASISVersion.string_of_version ver))
let data_check t data origin =
let no_message = "no message" in
@ -1639,6 +1717,18 @@ module OASISFeatures = struct
create "dynrun_for_release" alpha
(fun () ->
s_ "Make '-setup-update dynamic' suitable for releasing project.")
let compiled_setup_ml =
create "compiled_setup_ml" alpha
(fun () ->
s_ "It compiles the setup.ml and speed-up actions done with it.")
let disable_oasis_section =
create "disable_oasis_section" alpha
(fun () ->
s_ "Allows the OASIS section comments and digest to be omitted in \
generated files.")
end
module OASISUnixPath = struct
@ -2727,13 +2817,16 @@ module OASISFileUtil = struct
let rmdir ~ctxt tgt =
if Sys.readdir tgt = [||] then
begin
if Sys.readdir tgt = [||] then begin
match Sys.os_type with
| "Win32" ->
OASISExec.run ~ctxt "rd" [q tgt]
| _ ->
OASISExec.run ~ctxt "rm" ["-r"; q tgt]
end else begin
OASISMessage.error ~ctxt
(f_ "Cannot remove directory '%s': not empty.")
tgt
end
@ -2782,7 +2875,7 @@ module OASISFileUtil = struct
end
# 2785 "setup.ml"
# 2878 "setup.ml"
module BaseEnvLight = struct
(* # 22 "src/base/BaseEnvLight.ml" *)
@ -2887,7 +2980,7 @@ module BaseEnvLight = struct
end
# 2890 "setup.ml"
# 2983 "setup.ml"
module BaseContext = struct
(* # 22 "src/base/BaseContext.ml" *)
@ -5298,7 +5391,7 @@ module BaseSetup = struct
end
# 5301 "setup.ml"
# 5394 "setup.ml"
module InternalConfigurePlugin = struct
(* # 22 "src/plugins/internal/InternalConfigurePlugin.ml" *)
@ -6147,7 +6240,7 @@ module InternalInstallPlugin = struct
end
# 6150 "setup.ml"
# 6243 "setup.ml"
module OCamlbuildCommon = struct
(* # 22 "src/plugins/ocamlbuild/OCamlbuildCommon.ml" *)
@ -6520,7 +6613,7 @@ module OCamlbuildDocPlugin = struct
end
# 6523 "setup.ml"
# 6616 "setup.ml"
module CustomPlugin = struct
(* # 22 "src/plugins/custom/CustomPlugin.ml" *)
@ -6668,7 +6761,7 @@ module CustomPlugin = struct
end
# 6671 "setup.ml"
# 6764 "setup.ml"
open OASISTypes;;
let setup_t =
@ -6756,7 +6849,10 @@ let setup_t =
synopsis = "A bunch of modules, including polymorphic containers.";
description =
Some
"A bunch of useful modules, including polymorphic containers, graph\nabstractions, serialization systems, testing systems and various\nexperiments.";
[
OASISText.Para
"A bunch of useful modules, including polymorphic containers, graph abstractions, serialization systems, testing systems and various experiments."
];
categories = [];
conf_type = (`Configure, "internal", Some "0.4");
conf_custom =
@ -6904,7 +7000,8 @@ let setup_t =
"Conv";
"Levenshtein";
"Bidir";
"Iteratee"
"Iteratee";
"Ty"
];
lib_pack = true;
lib_internal_modules = [];
@ -7285,12 +7382,14 @@ let setup_t =
];
plugins =
[(`Extra, "META", Some "0.3"); (`Extra, "DevFiles", Some "0.3")];
disable_oasis_section = [];
schema_data = PropList.Data.create ();
plugin_data = []
};
oasis_fn = Some "_oasis";
oasis_version = "0.4.2";
oasis_digest = Some "[\227\135\169\022E\142\218xei\139\218Ha\163";
oasis_version = "0.4.4";
oasis_digest =
Some "\234\208\170\146/\020\006\020k\186\024\145\237\193\148\145";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false
@ -7298,6 +7397,6 @@ let setup_t =
let setup () = BaseSetup.setup setup_t;;
# 7302 "setup.ml"
# 7401 "setup.ml"
(* OASIS_STOP *)
let () = setup ();;