Permalink
Browse files

regenerate with oasis 0.4.4

  • Loading branch information...
1 parent f228ca5 commit 9bc2cdbc4ec21a4c9b4fa8ae39f675f72bf966f6 @avsm committed Jun 6, 2014
Showing with 435 additions and 279 deletions.
  1. +1 −0 .gitignore
  2. +15 −15 _tags
  3. +4 −0 async/async_cstruct.mldylib
  4. +8 −10 lib/META
  5. +4 −0 lib/cstruct.mldylib
  6. +4 −0 lwt/lwt_cstruct.mldylib
  7. +93 −53 myocamlbuild.ml
  8. +298 −201 setup.ml
  9. +4 −0 syntax/cstruct-syntax.mldylib
  10. +4 −0 unix/unix_cstruct.mldylib
View
1 .gitignore
@@ -4,3 +4,4 @@ setup.log
_build/
dist/
*.docdir
+*.byte
View
30 _tags
@@ -1,7 +1,7 @@
true: inline(10)
true: debug
# OASIS_START
-# DO NOT EDIT (digest: 623ae0a45fad2527c26cc490691b077a)
+# DO NOT EDIT (digest: cf7382094a64bb443a07a02beeb4573e)
# 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
@@ -28,45 +28,45 @@ true: debug
"lib/cstruct_stubs.c": pkg_ocplib-endian.bigstring
# Library async_cstruct
"async/async_cstruct.cmxs": use_async_cstruct
-<async/*.ml{,i}>: use_cstruct
-<async/*.ml{,i}>: pkg_bigarray
<async/*.ml{,i}>: pkg_async
-<async/*.ml{,i}>: pkg_threads
+<async/*.ml{,i}>: pkg_bigarray
<async/*.ml{,i}>: pkg_ocplib-endian
<async/*.ml{,i}>: pkg_ocplib-endian.bigstring
+<async/*.ml{,i}>: pkg_threads
+<async/*.ml{,i}>: use_cstruct
# Library lwt_cstruct
"lwt/lwt_cstruct.cmxs": use_lwt_cstruct
-<lwt/*.ml{,i}>: use_cstruct
<lwt/*.ml{,i}>: pkg_bigarray
<lwt/*.ml{,i}>: pkg_lwt.unix
<lwt/*.ml{,i}>: pkg_ocplib-endian
<lwt/*.ml{,i}>: pkg_ocplib-endian.bigstring
+<lwt/*.ml{,i}>: use_cstruct
# Library unix_cstruct
"unix/unix_cstruct.cmxs": use_unix_cstruct
-<unix/*.ml{,i}>: use_cstruct
-<unix/*.ml{,i}>: pkg_unix
<unix/*.ml{,i}>: pkg_bigarray
<unix/*.ml{,i}>: pkg_ocplib-endian
<unix/*.ml{,i}>: pkg_ocplib-endian.bigstring
+<unix/*.ml{,i}>: pkg_unix
+<unix/*.ml{,i}>: use_cstruct
# Library cstruct-syntax
"syntax/cstruct-syntax.cmxs": use_cstruct-syntax
+<syntax/*.ml{,i}>: pkg_bigarray
+<syntax/*.ml{,i}>: pkg_camlp4.extend
<syntax/*.ml{,i}>: pkg_camlp4.lib
<syntax/*.ml{,i}>: pkg_camlp4.quotations.r
-<syntax/*.ml{,i}>: pkg_camlp4.extend
-<syntax/*.ml{,i}>: pkg_bigarray
# Executable test_bounds
-"lib_test/bounds.byte": use_cstruct
-"lib_test/bounds.byte": pkg_unix
-"lib_test/bounds.byte": pkg_oUnit
"lib_test/bounds.byte": pkg_bigarray
+"lib_test/bounds.byte": pkg_oUnit
"lib_test/bounds.byte": pkg_ocplib-endian
"lib_test/bounds.byte": pkg_ocplib-endian.bigstring
-<lib_test/*.ml{,i}>: use_cstruct
-<lib_test/*.ml{,i}>: pkg_unix
-<lib_test/*.ml{,i}>: pkg_oUnit
+"lib_test/bounds.byte": pkg_unix
+"lib_test/bounds.byte": use_cstruct
<lib_test/*.ml{,i}>: pkg_bigarray
+<lib_test/*.ml{,i}>: pkg_oUnit
<lib_test/*.ml{,i}>: pkg_ocplib-endian
<lib_test/*.ml{,i}>: pkg_ocplib-endian.bigstring
+<lib_test/*.ml{,i}>: pkg_unix
+<lib_test/*.ml{,i}>: use_cstruct
# OASIS_STOP
<syntax/*.ml>: syntax_camlp4o, pkg_camlp4
<lib_test/*.ml{i}>: syntax_camlp4o, pkg_camlp4, pkg_cstruct.syntax
View
4 async/async_cstruct.mldylib
@@ -0,0 +1,4 @@
+# OASIS_START
+# DO NOT EDIT (digest: 3fe20d2f06c0b5b704604b021ed17e72)
+Async_cstruct
+# OASIS_STOP
View
18 lib/META
@@ -1,6 +1,6 @@
# OASIS_START
-# DO NOT EDIT (digest: b4981197fe71fb2a248209688d5e96a0)
-version = "1.1.0"
+# DO NOT EDIT (digest: 6a48e0fe41e5ab0028bf48ddcf4b3d5a)
+version = "1.2.0"
description = "Manipulate external buffers as C-like structs"
requires = "bigarray ocplib-endian ocplib-endian.bigstring"
archive(byte) = "cstruct.cma"
@@ -9,7 +9,7 @@ archive(native) = "cstruct.cmxa"
archive(native, plugin) = "cstruct.cmxs"
exists_if = "cstruct.cma"
package "unix" (
- version = "1.1.0"
+ version = "1.2.0"
description = "Manipulate external buffers as C-like structs"
requires = "cstruct unix"
archive(byte) = "unix_cstruct.cma"
@@ -20,20 +20,18 @@ package "unix" (
)
package "syntax" (
- version = "1.1.0"
+ version = "1.2.0"
description = "Syntax extension for Cstruct"
requires = "camlp4"
archive(syntax, preprocessor) = "cstruct-syntax.cma"
archive(syntax, toploop) = "cstruct-syntax.cma"
- archive(syntax, byte) = "cstruct-syntax.cma"
- archive(syntax, byte, plugin) = "cstruct-syntax.cma"
- archive(syntax, native) = "cstruct-syntax.cmxa"
- archive(syntax, native, plugin) = "cstruct-syntax.cmxs"
+ archive(syntax, preprocessor, native) = "cstruct-syntax.cmxa"
+ archive(syntax, preprocessor, native, plugin) = "cstruct-syntax.cmxs"
exists_if = "cstruct-syntax.cma"
)
package "lwt" (
- version = "1.1.0"
+ version = "1.2.0"
description = "Manipulate external buffers as C-like structs"
requires = "cstruct lwt.unix"
archive(byte) = "lwt_cstruct.cma"
@@ -44,7 +42,7 @@ package "lwt" (
)
package "async" (
- version = "1.1.0"
+ version = "1.2.0"
description = "Manipulate external buffers as C-like structs"
requires = "cstruct async threads"
archive(byte) = "async_cstruct.cma"
View
4 lib/cstruct.mldylib
@@ -0,0 +1,4 @@
+# OASIS_START
+# DO NOT EDIT (digest: 1e0fe6af05a6e3ed01c123c49f04dcbb)
+Cstruct
+# OASIS_STOP
View
4 lwt/lwt_cstruct.mldylib
@@ -0,0 +1,4 @@
+# OASIS_START
+# DO NOT EDIT (digest: d1391b5d2c30f723aff19f224fcc3c16)
+Lwt_cstruct
+# OASIS_STOP
View
146 myocamlbuild.ml
@@ -1,5 +1,5 @@
(* OASIS_START *)
-(* DO NOT EDIT (digest: 9342974ba108d0f0d160ad79462eb4d0) *)
+(* DO NOT EDIT (digest: 95c103dfde8da37f198ae192b5a6f2e8) *)
module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.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 =
@@ -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" *)
@@ -258,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
@@ -285,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 () =
@@ -306,9 +322,25 @@ 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 ->
+ | 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 *)
@@ -331,13 +363,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;
@@ -394,10 +430,10 @@ 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 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
@@ -412,7 +448,7 @@ module MyOCamlbuildBase = struct
* directory.
*)
includes: (dir * dir list) list;
- }
+ }
let env_filename =
@@ -455,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";
@@ -531,10 +567,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 +591,7 @@ module MyOCamlbuildBase = struct
end
-# 554 "myocamlbuild.ml"
+# 594 "myocamlbuild.ml"
open Ocamlbuild_plugin;;
let package_default =
{
@@ -584,6 +624,6 @@ let package_default =
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
-# 588 "myocamlbuild.ml"
+# 628 "myocamlbuild.ml"
(* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;;
View
499 setup.ml
@@ -1,9 +1,9 @@
(* setup.ml generated for the first time by OASIS v0.3.0 *)
(* OASIS_START *)
-(* DO NOT EDIT (digest: 567fc1ceb342119b65302973a5cf3b9c) *)
+(* DO NOT EDIT (digest: 7ee5dd9f35bdef589b538f42c75070e6) *)
(*
- Regenerated by OASIS v0.4.1
+ Regenerated by OASIS v0.4.4
Visit http://oasis.forge.ocamlcore.org for more information and
documentation about functions used in this file.
*)
@@ -52,6 +52,7 @@ module OASISContext = struct
type t =
{
+ (* TODO: replace this by a proplist. *)
quiet: bool;
info: bool;
debug: bool;
@@ -88,19 +89,31 @@ module OASISContext = struct
{!default with quiet = true}
- let args () =
+ let fspecs () =
+ (* TODO: don't act on default. *)
+ let ignore_plugins = ref false in
["-quiet",
Arg.Unit (fun () -> default := {!default with quiet = true}),
- (s_ " Run quietly");
+ s_ " Run quietly";
"-info",
Arg.Unit (fun () -> default := {!default with info = true}),
- (s_ " Display information message");
+ s_ " Display information message";
"-debug",
Arg.Unit (fun () -> default := {!default with debug = true}),
- (s_ " Output debug message")]
+ s_ " Output debug message";
+
+ "-ignore-plugins",
+ Arg.Set ignore_plugins,
+ s_ " Ignore plugin's field.";
+
+ "-C",
+ (* TODO: remove this chdir. *)
+ Arg.String (fun str -> Sys.chdir str),
+ s_ "dir Change directory before running."],
+ fun () -> {!default with ignore_plugins = !ignore_plugins}
end
module OASISString = struct
@@ -245,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 map_string_of_assoc assoc =
- List.fold_left
- (fun acc (k, v) -> MapString.add k v acc)
- MapString.empty
- assoc
+ let to_list t = fold (fun k v acc -> (k, v) :: acc) t []
+ end
+ end
- module SetString = Set.Make(String)
+ module MapString = MapExt.Make(String)
- let set_string_add_list st lst =
- List.fold_left
- (fun acc e -> SetString.add e acc)
- st
- lst
+ 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_of_list =
- set_string_add_list
- SetString.empty
+ module SetString = SetExt.Make(String)
let compare_csl s1 s2 =
@@ -286,6 +332,13 @@ module OASISUtils = struct
Hashtbl.hash (String.lowercase s)
end)
+ module SetStringCsl =
+ SetExt.Make
+ (struct
+ type t = string
+ let compare = compare_csl
+ end)
+
let varname_of_string ?(hyphen='_') s =
if String.length s = 0 then
@@ -686,7 +739,7 @@ module OASISVersion = struct
type s = string
- type t = string
+ type t = string
type comparator =
@@ -697,7 +750,7 @@ module OASISVersion = struct
| VLesserEqual of t
| VOr of comparator * comparator
| VAnd of comparator * comparator
-
+
(* Range of allowed characters *)
@@ -892,17 +945,17 @@ module OASISLicense = struct
- type license = string
+ type license = string
- type license_exception = string
+ type license_exception = string
type license_version =
| Version of OASISVersion.t
| VersionOrLater of OASISVersion.t
| NoVersion
-
+
type license_dep_5_unit =
@@ -911,20 +964,19 @@ module OASISLicense = struct
excption: license_exception option;
version: license_version;
}
-
+
type license_dep_5 =
| DEP5Unit of license_dep_5_unit
| DEP5Or of license_dep_5 list
| DEP5And of license_dep_5 list
-
type t =
| DEP5License of license_dep_5
| OtherLicense of string (* URL *)
-
+
end
@@ -939,10 +991,10 @@ module OASISExpr = struct
open OASISGettext
- type test = string
+ type test = string
- type flag = string
+ type flag = string
type t =
@@ -952,10 +1004,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 =
@@ -1028,47 +1080,62 @@ 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" *)
- type name = string
- type package_name = string
- type url = string
- type unix_dirname = string
- type unix_filename = string
- type host_dirname = string
- type host_filename = string
- type prog = string
- type arg = string
- type args = string list
- type command_line = (prog * arg list)
+ type name = string
+ type package_name = string
+ type url = string
+ type unix_dirname = string
+ type unix_filename = string
+ type host_dirname = string
+ type host_filename = string
+ type prog = string
+ type arg = string
+ type args = string list
+ type command_line = (prog * arg list)
- type findlib_name = string
- type findlib_full = string
+ type findlib_name = string
+ type findlib_full = string
type compiled_object =
| Byte
| Native
| Best
-
+
type dependency =
| FindlibPackage of findlib_full * OASISVersion.comparator option
| InternalLibrary of name
-
+
type tool =
| ExternalTool of name
| InternalExecutable of name
-
+
type vcs =
@@ -1081,7 +1148,7 @@ module OASISTypes = struct
| Arch
| Monotone
| OtherVCS of url
-
+
type plugin_kind =
@@ -1109,7 +1176,7 @@ module OASISTypes = struct
]
- type 'a plugin = 'a * name * OASISVersion.t option
+ type 'a plugin = 'a * name * OASISVersion.t option
type all_plugin = plugin_kind plugin
@@ -1121,15 +1188,15 @@ module OASISTypes = struct
(* # 115 "src/oasis/OASISTypes.ml" *)
- type 'a conditional = 'a OASISExpr.choices
+ type 'a conditional = 'a OASISExpr.choices
type custom =
{
pre_command: (command_line option) conditional;
post_command: (command_line option) conditional;
}
-
+
type common_section =
@@ -1138,7 +1205,7 @@ module OASISTypes = struct
cs_data: PropList.Data.t;
cs_plugin_data: plugin_data;
}
-
+
type build_section =
@@ -1158,7 +1225,7 @@ module OASISTypes = struct
bs_byteopt: args conditional;
bs_nativeopt: args conditional;
}
-
+
type library =
@@ -1169,28 +1236,28 @@ module OASISTypes = struct
lib_findlib_parent: findlib_name option;
lib_findlib_name: findlib_name option;
lib_findlib_containers: findlib_name list;
- }
+ }
type object_ =
{
obj_modules: string list;
obj_findlib_fullname: findlib_name list option;
- }
+ }
type executable =
{
exec_custom: bool;
exec_main_is: unix_filename;
- }
+ }
type flag =
{
flag_description: string option;
flag_default: bool conditional;
- }
+ }
type source_repository =
@@ -1202,7 +1269,7 @@ module OASISTypes = struct
src_repo_branch: string option;
src_repo_tag: string option;
src_repo_subdir: unix_filename option;
- }
+ }
type test =
@@ -1213,7 +1280,7 @@ module OASISTypes = struct
test_working_directory: unix_filename option;
test_run: bool conditional;
test_tools: tool list;
- }
+ }
type doc_format =
@@ -1224,7 +1291,7 @@ module OASISTypes = struct
| Info of unix_filename
| DVI
| OtherDoc
-
+
type doc =
@@ -1240,7 +1307,7 @@ module OASISTypes = struct
doc_format: doc_format;
doc_data_files: (unix_filename * unix_filename option) list;
doc_build_tools: tool list;
- }
+ }
type section =
@@ -1251,7 +1318,7 @@ module OASISTypes = struct
| SrcRepo of common_section * source_repository
| Test of common_section * test
| Doc of common_section * doc
-
+
type section_kind =
@@ -1260,42 +1327,43 @@ module OASISTypes = struct
type package =
{
- oasis_version: OASISVersion.t;
- ocaml_version: OASISVersion.comparator option;
- findlib_version: OASISVersion.comparator option;
- alpha_features: string list;
- beta_features: string list;
- name: package_name;
- version: OASISVersion.t;
- license: OASISLicense.t;
- license_file: unix_filename option;
- copyrights: string list;
- maintainers: string list;
- authors: string list;
- homepage: url option;
- synopsis: string;
- description: string option;
- categories: url list;
-
- conf_type: [`Configure] plugin;
- conf_custom: custom;
-
- build_type: [`Build] plugin;
- build_custom: custom;
-
- install_type: [`Install] plugin;
- install_custom: custom;
- uninstall_custom: custom;
-
- clean_custom: custom;
- distclean_custom: custom;
-
- files_ab: unix_filename list;
- sections: section list;
- plugins: [`Extra] plugin list;
- schema_data: PropList.Data.t;
- plugin_data: plugin_data;
- }
+ oasis_version: OASISVersion.t;
+ ocaml_version: OASISVersion.comparator option;
+ findlib_version: OASISVersion.comparator option;
+ alpha_features: string list;
+ beta_features: string list;
+ name: package_name;
+ version: OASISVersion.t;
+ license: OASISLicense.t;
+ license_file: unix_filename option;
+ copyrights: string list;
+ maintainers: string list;
+ authors: string list;
+ homepage: url option;
+ synopsis: string;
+ description: OASISText.t option;
+ categories: url list;
+
+ conf_type: [`Configure] plugin;
+ conf_custom: custom;
+
+ build_type: [`Build] plugin;
+ build_custom: custom;
+
+ install_type: [`Install] plugin;
+ install_custom: custom;
+ uninstall_custom: custom;
+
+ clean_custom: custom;
+ distclean_custom: custom;
+
+ 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;
+ }
end
@@ -1348,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 =
@@ -1388,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
@@ -1620,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
@@ -2708,14 +2817,17 @@ module OASISFileUtil = struct
let rmdir ~ctxt tgt =
- 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
+ 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
let glob ~ctxt fn =
@@ -2763,7 +2875,7 @@ module OASISFileUtil = struct
end
-# 2766 "setup.ml"
+# 2878 "setup.ml"
module BaseEnvLight = struct
(* # 22 "src/base/BaseEnvLight.ml" *)
@@ -2838,26 +2950,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 =
@@ -2867,15 +2980,15 @@ module BaseEnvLight = struct
end
-# 2870 "setup.ml"
+# 2983 "setup.ml"
module BaseContext = struct
(* # 22 "src/base/BaseContext.ml" *)
-
+ (* TODO: get rid of this module. *)
open OASISContext
- let args = args
+ let args () = fst (fspecs ())
let default = default
@@ -5006,11 +5119,14 @@ module BaseSetup = struct
s_ " Don't try to update setup.ml, even if _oasis has changed.")
+ let default_oasis_fn = "_oasis"
+
+
let update_setup_ml t =
let oasis_fn =
match t.oasis_fn with
| Some fn -> fn
- | None -> "_oasis"
+ | None -> default_oasis_fn
in
let oasis_exec =
match t.oasis_exec with
@@ -5108,7 +5224,8 @@ module BaseSetup = struct
try
match t.oasis_digest with
| Some dgst ->
- if Sys.file_exists oasis_fn && dgst <> Digest.file "_oasis" then
+ if Sys.file_exists oasis_fn &&
+ dgst <> Digest.file default_oasis_fn then
begin
do_update ();
true
@@ -5274,7 +5391,7 @@ module BaseSetup = struct
end
-# 5277 "setup.ml"
+# 5394 "setup.ml"
module InternalConfigurePlugin = struct
(* # 22 "src/plugins/internal/InternalConfigurePlugin.ml" *)
@@ -6123,7 +6240,7 @@ module InternalInstallPlugin = struct
end
-# 6126 "setup.ml"
+# 6243 "setup.ml"
module OCamlbuildCommon = struct
(* # 22 "src/plugins/ocamlbuild/OCamlbuildCommon.ml" *)
@@ -6135,10 +6252,15 @@ module OCamlbuildCommon = struct
open OASISGettext
open BaseEnv
open BaseStandardVar
+ open OASISTypes
- let ocamlbuild_clean_ev =
- "ocamlbuild-clean"
+
+
+ type extra_args = string list
+
+
+ let ocamlbuild_clean_ev = "ocamlbuild-clean"
let ocamlbuildflags =
@@ -6261,27 +6383,7 @@ module OCamlbuildPlugin = struct
ref (fun lst -> lst)
- type ocamlbuild_plugin =
- {
- plugin_tags: string option;
- extra_args: string list;
- }
-
-
- let check_ocaml_version version pkg =
- match pkg.ocaml_version with
- | Some ocaml_version ->
- let min_ocaml_version = OASISVersion.version_of_string version in
- OASISVersion.comparator_ge min_ocaml_version ocaml_version
- | None ->
- false
-
-
- let ocamlbuild_supports_ocamlfind = check_ocaml_version "3.12.1"
- let ocamlbuild_supports_plugin_tags = check_ocaml_version "4.01"
-
-
- let build t pkg argv =
+ let build extra_args pkg argv =
(* Return the filename in build directory *)
let in_build_dir fn =
Filename.concat
@@ -6425,33 +6527,13 @@ module OCamlbuildPlugin = struct
(BaseBuilt.register bt bnm lst)
in
- let cond_targets =
- (* Run the hook *)
- !cond_targets_hook cond_targets
- in
-
- let extra_args =
- match t.plugin_tags with
- | Some tags -> "-plugin-tags" :: ("'" ^ tags ^ "'") :: t.extra_args
- | None -> t.extra_args
- in
- let extra_args =
- if ocamlbuild_supports_ocamlfind pkg then
- "-use-ocamlfind" :: extra_args
- else
- extra_args
- in
+ (* Run the hook *)
+ let cond_targets = !cond_targets_hook cond_targets in
- (* Run a list of target... *)
- run_ocamlbuild
- (List.flatten
- (List.map snd cond_targets)
- @ extra_args)
- argv;
- (* ... and register events *)
- List.iter
- check_and_register
- (List.flatten (List.map fst cond_targets))
+ (* Run a list of target... *)
+ run_ocamlbuild (List.flatten (List.map snd cond_targets) @ extra_args) argv;
+ (* ... and register events *)
+ List.iter check_and_register (List.flatten (List.map fst cond_targets))
let clean pkg extra_args =
@@ -6488,12 +6570,18 @@ module OCamlbuildDocPlugin = struct
+ type run_t =
+ {
+ extra_args: string list;
+ run_path: unix_filename;
+ }
+
- let doc_build path pkg (cs, doc) argv =
+ let doc_build run pkg (cs, doc) argv =
let index_html =
OASISUnixPath.make
[
- path;
+ run.run_path;
cs.cs_name^".docdir";
"index.html";
]
@@ -6502,11 +6590,11 @@ module OCamlbuildDocPlugin = struct
OASISHostPath.make
[
build_dir argv;
- OASISHostPath.of_unix path;
+ OASISHostPath.of_unix run.run_path;
cs.cs_name^".docdir";
]
in
- run_ocamlbuild [index_html] argv;
+ run_ocamlbuild (index_html :: run.extra_args) argv;
List.iter
(fun glb ->
BaseBuilt.register
@@ -6517,15 +6605,15 @@ module OCamlbuildDocPlugin = struct
["*.html"; "*.css"]
- let doc_clean t pkg (cs, doc) argv =
+ let doc_clean run pkg (cs, doc) argv =
run_clean argv;
BaseBuilt.unregister BaseBuilt.BDoc cs.cs_name
end
-# 6528 "setup.ml"
+# 6616 "setup.ml"
module CustomPlugin = struct
(* # 22 "src/plugins/custom/CustomPlugin.ml" *)
@@ -6548,7 +6636,7 @@ module CustomPlugin = struct
cmd_main: command_line conditional;
cmd_clean: (command_line option) conditional;
cmd_distclean: (command_line option) conditional;
- }
+ }
let run = BaseCustom.run
@@ -6673,15 +6761,13 @@ module CustomPlugin = struct
end
-# 6676 "setup.ml"
+# 6764 "setup.ml"
open OASISTypes;;
let setup_t =
{
BaseSetup.configure = InternalConfigurePlugin.configure;
- build =
- OCamlbuildPlugin.build
- {OCamlbuildPlugin.plugin_tags = None; extra_args = []};
+ build = OCamlbuildPlugin.build [];
test =
[
("test_bounds",
@@ -6693,7 +6779,12 @@ let setup_t =
cmd_distclean = [(OASISExpr.EBool true, None)]
})
];
- doc = [("api", OCamlbuildDocPlugin.doc_build "doc")];
+ doc =
+ [
+ ("api",
+ OCamlbuildDocPlugin.doc_build
+ {OCamlbuildDocPlugin.extra_args = []; run_path = "doc"})
+ ];
install = InternalInstallPlugin.install;
uninstall = InternalInstallPlugin.uninstall;
clean = [OCamlbuildPlugin.clean];
@@ -6708,7 +6799,12 @@ let setup_t =
cmd_distclean = [(OASISExpr.EBool true, None)]
})
];
- clean_doc = [("api", OCamlbuildDocPlugin.doc_clean "doc")];
+ clean_doc =
+ [
+ ("api",
+ OCamlbuildDocPlugin.doc_clean
+ {OCamlbuildDocPlugin.extra_args = []; run_path = "doc"})
+ ];
distclean = [];
distclean_test =
[
@@ -6730,7 +6826,7 @@ let setup_t =
alpha_features = [];
beta_features = [];
name = "cstruct";
- version = "1.1.0";
+ version = "1.2.0";
license =
OASISLicense.DEP5License
(OASISLicense.DEP5Unit
@@ -7088,19 +7184,20 @@ let setup_t =
})
];
plugins = [(`Extra, "META", Some "0.3")];
+ disable_oasis_section = [];
schema_data = PropList.Data.create ();
plugin_data = []
};
oasis_fn = Some "_oasis";
- oasis_version = "0.4.1";
- oasis_digest = Some "\147Dr1þ û#/\001¥Â°\130";
+ oasis_version = "0.4.4";
+ oasis_digest = Some "ûðÓêgâS\031\132Íw\129\000¦d\153";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false
};;
let setup () = BaseSetup.setup setup_t;;
-# 7105 "setup.ml"
+# 7202 "setup.ml"
(* OASIS_STOP *)
let () = setup ();;
View
4 syntax/cstruct-syntax.mldylib
@@ -0,0 +1,4 @@
+# OASIS_START
+# DO NOT EDIT (digest: e07f00e21d3846391be380fbebb40162)
+Pa_cstruct
+# OASIS_STOP
View
4 unix/unix_cstruct.mldylib
@@ -0,0 +1,4 @@
+# OASIS_START
+# DO NOT EDIT (digest: 95a77fdaf3824610874360801bd4a05c)
+Unix_cstruct
+# OASIS_STOP

0 comments on commit 9bc2cdb

Please sign in to comment.