Permalink
Browse files

sync autobuild

  • Loading branch information...
1 parent 6fa5731 commit b43a852d017ee6f2e6a49a311aa9492573c0534f @avsm committed Feb 17, 2013
Showing with 203 additions and 423 deletions.
  1. +2 −2 CHANGES
  2. +2 −2 _oasis
  3. +9 −1 _tags
  4. +16 −5 lib/META
  5. +28 −57 myocamlbuild.ml
  6. +146 −356 setup.ml
View
@@ -1,6 +1,6 @@
-0.6.3 (trunk):
+0.7.0 (trunk):
-* no changes yet
+* Add Async interface to interoperate with Jane Street Core code.
0.6.2 (08-Feb-2013):
View
4 _oasis
@@ -1,6 +1,6 @@
OASISFormat: 0.3
Name: cstruct
-Version: 0.6.3
+Version: 0.7.0
Synopsis: Manipulate external buffers as C-like structs
Authors: Anil Madhavapeddy, Richard Mortier, Thomas Gazagnaire, Pierre Chambart
License: ISC
@@ -26,7 +26,7 @@ Library cstruct
CSources: cstruct_stubs.c
CCOpt: -O3
-Library lwt_async
+Library async_cstruct
Build$: flag(async)
Path: async/
BuildDepends: cstruct,async,threads
View
10 _tags
@@ -1,7 +1,7 @@
true: inline(10)
true: debug
# OASIS_START
-# DO NOT EDIT (digest: f47d7d63a4b380e9c2b494d7c65dcb6c)
+# DO NOT EDIT (digest: 0cbaead08ad7addfb80687ce8e3f2fcf)
# 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
@@ -26,6 +26,14 @@ true: debug
"lib/cstruct_stubs.c": pkg_bigarray
"lib/cstruct_stubs.c": pkg_ocplib-endian
"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_ocplib-endian
+<async/*.ml{,i}>: pkg_ocplib-endian.bigstring
# Library lwt_cstruct
"lwt/lwt_cstruct.cmxs": use_lwt_cstruct
<lwt/*.ml{,i}>: use_cstruct
View
@@ -1,6 +1,6 @@
# OASIS_START
-# DO NOT EDIT (digest: 71016be2156b75139fd37df08b6446cb)
-version = "0.6.3"
+# DO NOT EDIT (digest: e2c88be3dab1eba10415184a61d57bd7)
+version = "0.7.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 = "0.6.3"
+ version = "0.7.0"
description = "Manipulate external buffers as C-like structs"
requires = "cstruct unix"
archive(byte) = "unix_cstruct.cma"
@@ -20,7 +20,7 @@ package "unix" (
)
package "syntax" (
- version = "0.6.3"
+ version = "0.7.0"
description = "Syntax extension for Cstruct"
requires = "camlp4"
archive(syntax, preprocessor) = "cstruct-syntax.cma"
@@ -29,7 +29,7 @@ package "syntax" (
)
package "lwt" (
- version = "0.6.3"
+ version = "0.7.0"
description = "Manipulate external buffers as C-like structs"
requires = "cstruct lwt.unix"
archive(byte) = "lwt_cstruct.cma"
@@ -38,5 +38,16 @@ package "lwt" (
archive(native, plugin) = "lwt_cstruct.cmxs"
exists_if = "lwt_cstruct.cma"
)
+
+package "async" (
+ version = "0.7.0"
+ description = "Manipulate external buffers as C-like structs"
+ requires = "cstruct async threads"
+ archive(byte) = "async_cstruct.cma"
+ archive(byte, plugin) = "async_cstruct.cma"
+ archive(native) = "async_cstruct.cmxa"
+ archive(native, plugin) = "async_cstruct.cmxs"
+ exists_if = "async_cstruct.cma"
+)
# OASIS_STOP
View
@@ -1,7 +1,7 @@
(* OASIS_START *)
-(* DO NOT EDIT (digest: 3d107c56dad4aaefef25cf809eb2e395) *)
+(* DO NOT EDIT (digest: c970cdc387b0a1dc787833e678d5a0dc) *)
module OASISGettext = struct
-(* # 21 "/Users/avsm/.opam/4.00.1+short-types/build/oasis-mirage.0.3.0a/src/oasis/OASISGettext.ml" *)
+(* # 21 "/Users/avsm/.opam/system/build/oasis.0.3.0/src/oasis/OASISGettext.ml" *)
let ns_ str =
str
@@ -24,7 +24,7 @@ module OASISGettext = struct
end
module OASISExpr = struct
-(* # 21 "/Users/avsm/.opam/4.00.1+short-types/build/oasis-mirage.0.3.0a/src/oasis/OASISExpr.ml" *)
+(* # 21 "/Users/avsm/.opam/system/build/oasis.0.3.0/src/oasis/OASISExpr.ml" *)
@@ -116,7 +116,7 @@ end
# 117 "myocamlbuild.ml"
module BaseEnvLight = struct
-(* # 21 "/Users/avsm/.opam/4.00.1+short-types/build/oasis-mirage.0.3.0a/src/base/BaseEnvLight.ml" *)
+(* # 21 "/Users/avsm/.opam/system/build/oasis.0.3.0/src/base/BaseEnvLight.ml" *)
module MapString = Map.Make(String)
@@ -214,7 +214,7 @@ end
# 215 "myocamlbuild.ml"
module MyOCamlbuildFindlib = struct
-(* # 21 "/Users/avsm/.opam/4.00.1+short-types/build/oasis-mirage.0.3.0a/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
+(* # 21 "/Users/avsm/.opam/system/build/oasis.0.3.0/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
(** OCamlbuild extension, copied from
* http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild
@@ -234,21 +234,19 @@ module MyOCamlbuildFindlib = struct
Ocamlbuild_pack.Lexers.blank_sep_strings
let split s ch =
- let buf = Buffer.create 13 in
- let x = ref [] in
- let flush () =
- x := (Buffer.contents buf) :: !x;
- Buffer.clear buf
+ let x =
+ ref []
in
- String.iter
- (fun c ->
- if c = ch then
- flush ()
- else
- Buffer.add_char buf c)
- s;
- flush ();
- List.rev !x
+ let rec go s =
+ let pos =
+ String.index s ch
+ in
+ x := (String.before s pos)::!x;
+ go (String.after s (pos + 1))
+ in
+ try
+ go s
+ with Not_found -> !x
let split_nl s = split s '\n'
@@ -283,27 +281,17 @@ module MyOCamlbuildFindlib = struct
(* When one link an OCaml library/binary/package, one should use -linkpkg *)
flag ["ocaml"; "link"; "program"] & A"-linkpkg";
- flag ["ocaml"; "link"; "output_obj"] & 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
- 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
- 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;
+ flag ["ocaml"; "compile"; "pkg_"^pkg] & S[A"-package"; A pkg];
+ flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S[A"-package"; A pkg];
+ flag ["ocaml"; "doc"; "pkg_"^pkg] & S[A"-package"; A pkg];
+ flag ["ocaml"; "link"; "pkg_"^pkg] & S[A"-package"; A pkg];
+ flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S[A"-package"; A pkg];
end
(find_packages ());
@@ -335,7 +323,7 @@ module MyOCamlbuildFindlib = struct
end
module MyOCamlbuildBase = struct
-(* # 21 "/Users/avsm/.opam/4.00.1+short-types/build/oasis-mirage.0.3.0a/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
+(* # 21 "/Users/avsm/.opam/system/build/oasis.0.3.0/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
(** Base functions for writing myocamlbuild.ml
@author Sylvain Le Gall
@@ -351,7 +339,7 @@ module MyOCamlbuildBase = struct
type name = string
type tag = string
-(* # 56 "/Users/avsm/.opam/4.00.1+short-types/build/oasis-mirage.0.3.0a/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
+(* # 56 "/Users/avsm/.opam/system/build/oasis.0.3.0/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
type t =
{
@@ -464,24 +452,6 @@ module MyOCamlbuildBase = struct
)
t.lib_c;
- (* Add output_obj rules mapped to .nobj.o *)
- let native_output_obj x =
- OC.link_gen "cmx" "cmxa" !Options.ext_lib [!Options.ext_obj; "cmi"]
- OC.ocamlopt_link_prog
- (fun tags -> tags++"ocaml"++"link"++"native"++"output_obj") x
- in
- rule "ocaml: cmx* and o* -> .nobj.o" ~prod:"%.nobj.o" ~deps:["%.cmx"; "%.o"]
- (native_output_obj "%.cmx" "%.nobj.o");
-
- (* Add output_obj rules mapped to .bobj.o *)
- let bytecode_output_obj x =
- OC.link_gen "cmo" "cma" !Options.ext_lib [!Options.ext_obj; "cmi"]
- OC.ocamlc_link_prog
- (fun tags -> tags++"ocaml"++"link"++"byte"++"output_obj") x
- in
- rule "ocaml: cmo* -> .nobj.o" ~prod:"%.bobj.o" ~deps:["%.cmo"]
- (bytecode_output_obj "%.cmo" "%.bobj.o");
-
(* Add flags *)
List.iter
(fun (tags, cond_specs) ->
@@ -503,13 +473,14 @@ module MyOCamlbuildBase = struct
end
-# 506 "myocamlbuild.ml"
+# 476 "myocamlbuild.ml"
open Ocamlbuild_plugin;;
let package_default =
{
MyOCamlbuildBase.lib_ocaml =
[
("cstruct", ["lib"]);
+ ("async_cstruct", ["async"]);
("lwt_cstruct", ["lwt"]);
("unix_cstruct", ["unix"]);
("cstruct-syntax", ["syntax"])
@@ -520,12 +491,12 @@ let package_default =
(["oasis_library_cstruct_ccopt"; "compile"],
[(OASISExpr.EBool true, S [A "-ccopt"; A "-O3"])])
];
- includes = [("unix", ["lib"]); ("lwt", ["lib"])];
+ includes = [("unix", ["lib"]); ("lwt", ["lib"]); ("async", ["lib"])];
}
;;
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
-# 530 "myocamlbuild.ml"
+# 501 "myocamlbuild.ml"
(* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;;
Oops, something went wrong.

0 comments on commit b43a852

Please sign in to comment.