This is an automated email from the git hooks/post-receive script.

glondu pushed a commit to branch master
in repository bin-prot.

commit 0304745c433abbb51be3d0a8bf9c31baae6619c0
Author: Stephane Glondu <st...@glondu.net>
Date:   Thu Jul 28 14:33:58 2016 +0200

    Imported Upstream version 113.33.03
---
 META.ab                  |  19 +++++++--
 Makefile                 |   4 +-
 _oasis                   |  53 +++++++++++++++---------
 _tags                    |   2 +-
 install.ml               |  10 +++++
 js-utils/gen_install.ml  | 102 -----------------------------------------------
 js-utils/install_tags.ml |   9 -----
 myocamlbuild.ml          |  25 +++---------
 opam                     |  14 ++++---
 postconf.sh              |   9 +++++
 src/blit_stubs.c         |   4 ++
 src/blit_stubs_xen.c     |   1 +
 src/float_stubs_xen.c    |   1 +
 13 files changed, 93 insertions(+), 160 deletions(-)

diff --git a/META.ab b/META.ab
index a43e599..ea8b332 100644
--- a/META.ab
+++ b/META.ab
@@ -1,7 +1,20 @@
 version = "$(pkg_version)"
 description = "A binary protocol generator"
 requires = "bigarray"
-archive(byte          ) = "bin_prot.cma"
-archive(native        ) = "bin_prot.cmxa"
-archive(native, plugin) = "bin_prot.cmxs"
+archive(byte  ) = "bin_prot.cma"
+archive(native) = "bin_prot.cmxa"
+plugin(byte  ) = "bin_prot.cma"
+plugin(native) = "bin_prot.cmxs"
 exists_if = "bin_prot.cma"
+
+xen_linkopts = "-lbin_prot_xen_stubs"
+package "xen" (
+  version = "$(pkg_version)"
+  description = "A binary protocol generator"
+  requires = "bigarray"
+  archive(byte  ) = "bin_prot_xen.cma"
+  archive(native) = "bin_prot_xen.cmxa"
+  plugin(byte  ) = "bin_prot_xen.cma"
+  plugin(native) = "bin_prot_xen.cmxs"
+  exists_if = "bin_prot_xen.cma"
+)
diff --git a/Makefile b/Makefile
index 68b7a6e..e9a60ed 100644
--- a/Makefile
+++ b/Makefile
@@ -26,8 +26,8 @@ all: $(SETUP)
        ./$(SETUP) -all $(ALLFLAGS)
        $(MAKE) $(NAME).install
 
-$(NAME).install: js-utils/gen_install.ml setup.log setup.data
-       ocaml -I js-utils js-utils/gen_install.ml
+$(NAME).install: install.ml setup.log setup.data
+       ocaml -I "$(OCAML_TOPLEVEL_PATH)" install.ml
 
 install: $(NAME).install
        opam-installer -i --prefix $(PREFIX) $(NAME).install
diff --git a/_oasis b/_oasis
index 94b7bfa..030b7c9 100644
--- a/_oasis
+++ b/_oasis
@@ -1,29 +1,36 @@
-OASISFormat:      0.4
-OCamlVersion:     >= 4.02.3
-FindlibVersion:   >= 1.3.2
-Name:             bin_prot
-Version:          113.33.00
-Synopsis:         A binary protocol generator
-Authors:          Jane Street Group, LLC <opensou...@janestreet.com>
-Copyrights:       (C) 2008-2016 Jane Street Group LLC 
<opensou...@janestreet.com>
-Maintainers:      Jane Street Group, LLC <opensou...@janestreet.com>
-License:          Apache-2.0
-LicenseFile:      LICENSE.txt
-Homepage:         https://github.com/janestreet/bin_prot
-Plugins:          StdFiles (0.3), DevFiles (0.3), META (0.3)
-XStdFilesAUTHORS: false
-XStdFilesREADME:  false
-BuildTools:       ocamlbuild
-FilesAB:          META.ab
+OASISFormat:           0.4
+OCamlVersion:          >= 4.02.3
+FindlibVersion:        >= 1.3.2
+Name:                  bin_prot
+Version:               113.33.03
+Synopsis:              A binary protocol generator
+Authors:               Jane Street Group, LLC <opensou...@janestreet.com>
+Copyrights:            (C) 2008-2016 Jane Street Group LLC 
<opensou...@janestreet.com>
+Maintainers:           Jane Street Group, LLC <opensou...@janestreet.com>
+License:               Apache-2.0
+LicenseFile:           LICENSE.txt
+Homepage:              https://github.com/janestreet/bin_prot
+Plugins:               StdFiles (0.3), DevFiles (0.3)
+XStdFilesAUTHORS:      false
+XStdFilesREADME:       false
+BuildTools:            ocamlbuild
+BetaFeatures:          section_object
+AlphaFeatures:         ocamlbuild_more_args
+XOCamlbuildPluginTags: package(js-build-tools.ocamlbuild_goodies)
+FilesAB:               META.ab
 Description:
   Part of Jane Street’s Core library
   The Core suite of libraries is an industrial strength alternative to
   OCaml's standard library that was developed by Jane Street, the
   largest industrial user of OCaml.
 
-PostConfCommand: cd src && ./detect-arch.sh $ocamlc config.h
+PostConfCommand: (cd src && ./detect-arch.sh $ocamlc config.h) && ./postconf.sh
 PreDistCleanCommand: $rm src/config.h
 
+Flag xen
+  Description:        Build Xen support
+  Default:            false
+
 Library bin_prot
   Path:         src
   Pack:         true
@@ -41,3 +48,13 @@ Library bin_prot
   CSources:     blit_stubs.c,
                 config.h,
                 float_stubs.c
+
+Library bin_prot_xen
+  Build$:             flag(xen)
+  CompiledObject:     best
+  Path:               src
+  FindlibParent:      bin_prot
+  Findlibname:        xen
+  BuildDepends:       bigarray
+  CSources:           blit_stubs_xen.c, config.h, float_stubs_xen.c
+  CCOpt:              -O2 $XEN_CFLAGS
diff --git a/_tags b/_tags
index b3d4866..839d41b 100644
--- a/_tags
+++ b/_tags
@@ -1,7 +1,7 @@
 <**/*.ml{,i}>: warn(-40), no_alias_deps
 <**/*>: thread
 # This prevents the implicit addition of -ppx options by ocamlfind
-<**/*.ml{,i}>: predicate(ppx_driver)
+<**/*>: predicate(custom_ppx)
 <src/*.ml>: for-pack(Bin_prot)
 <src/*.ml{,i}>: pp_deps_for_src
 <src/{size,write,read,type_class}.ml{i,}>:cpp
diff --git a/install.ml b/install.ml
new file mode 100644
index 0000000..31a7c58
--- /dev/null
+++ b/install.ml
@@ -0,0 +1,10 @@
+#use "topfind";;
+#require "js-build-tools.oasis2opam_install";;
+
+open Oasis2opam_install;;
+
+generate ~package:"bin_prot"
+  [ oasis_lib "bin_prot"
+  ; file "META" ~section:"lib"
+  ; oasis_lib "bin_prot_xen"
+  ]
diff --git a/js-utils/gen_install.ml b/js-utils/gen_install.ml
deleted file mode 100644
index 39db642..0000000
--- a/js-utils/gen_install.ml
+++ /dev/null
@@ -1,102 +0,0 @@
-(* Generate <package>.install from setup.log *)
-
-#use "install_tags.ml"
-
-module String_map = Map.Make(String)
-let string_map_of_list =
-  List.fold_left
-    (fun acc (k, v) ->
-       assert (not (String_map.mem k acc));
-       String_map.add k v acc)
-    String_map.empty
-
-let lines_of_file fn =
-  let ic = open_in fn in
-  let rec loop acc =
-    match input_line ic with
-    | exception End_of_file ->
-      close_in ic;
-      List.rev acc
-    | line ->
-      loop (line :: acc)
-  in
-  loop []
-
-let read_setup_log () =
-  lines_of_file "setup.log"
-  |> List.map (fun line -> Scanf.sscanf line "%S %S" (fun tag arg -> (tag, 
arg)))
-
-let read_setup_data () =
-  lines_of_file "setup.data"
-  |> List.map (fun line -> Scanf.sscanf line "%[^=]=%S" (fun k v -> (k, v)))
-
-let remove_cwd =
-  let prefix = Sys.getcwd () ^ "/" in
-  let len_prefix = String.length prefix in
-  fun fn ->
-    let len = String.length fn in
-    if len >= len_prefix && String.sub fn 0 len_prefix = prefix then
-      String.sub fn len_prefix (len - len_prefix)
-    else
-      fn
-
-let gen_section oc name files =
-  let pr fmt = Printf.fprintf oc (fmt ^^ "\n") in
-  pr "%s: [" name;
-  List.iter
-    (fun (src, dst) ->
-       let src = remove_cwd src in
-       let dst =
-         match dst with
-         | None -> Filename.basename src
-         | Some fn -> fn
-       in
-       if src = dst then
-         pr "  %S" src
-       else
-         pr "  %S {%S}" src dst)
-    files;
-  pr "]"
-
-let rec filter_log tags log acc =
-  match log with
-  | [] -> acc
-  | (tag, fname) :: rest ->
-    match String_map.find tag tags with
-    | exception Not_found -> filter_log tags rest acc
-    | dst -> filter_log tags rest ((fname, dst) :: acc)
-
-let () =
-  let log = read_setup_log () in
-  let setup_data = read_setup_data () in
-  let ext_dll =
-    match List.assoc "ext_dll" setup_data with
-    | ext -> ext
-    | exception Not_found -> ".so"
-  in
-  let merge name files map =
-    match String_map.find name map with
-    | files' -> String_map.add name (files @ files') map
-    | exception Not_found -> String_map.add name files map
-  in
-  let sections =
-    List.fold_left
-      (fun acc (name, tags, extra_files) ->
-         let tags = string_map_of_list tags in
-         let files = filter_log tags log [] @ extra_files in
-         if name = "lib" then
-           let stubs, others =
-             List.partition
-               (fun (fn, _) -> Filename.check_suffix fn ext_dll)
-               files
-           in
-           merge "lib" others (merge "stublibs" stubs acc)
-         else
-           merge name files acc)
-      String_map.empty sections
-    |> String_map.bindings
-    |> List.filter (fun (_, l) -> l <> [])
-  in
-  let oc = open_out (package_name ^ ".install") in
-  List.iter (fun (name, files) -> gen_section oc name files) sections;
-  close_out oc
diff --git a/js-utils/install_tags.ml b/js-utils/install_tags.ml
deleted file mode 100644
index f3a726c..0000000
--- a/js-utils/install_tags.ml
+++ /dev/null
@@ -1,9 +0,0 @@
-let package_name = "bin_prot"
-
-let sections =
-  [ ("lib",
-    [ ("built_lib_bin_prot", None)
-    ],
-    [ ("META", None)
-    ])
-  ]
diff --git a/myocamlbuild.ml b/myocamlbuild.ml
index 6c9e27d..eb85acf 100644
--- a/myocamlbuild.ml
+++ b/myocamlbuild.ml
@@ -1,26 +1,9 @@
 (* OASIS_START *)
 (* OASIS_STOP *)
 
-(* Temporary hacks *)
-let js_hacks = function
-  | After_rules ->
-    rule "Generate a cmxs from a cmxa"
-      ~dep:"%.cmxa"
-      ~prod:"%.cmxs"
-      ~insert:`top
-      (fun env _ ->
-         Cmd (S [ !Options.ocamlopt
-                ; A "-shared"
-                ; A "-linkall"
-                ; A "-I"; A (Pathname.dirname (env "%"))
-                ; A (env "%.cmxa")
-                ; A "-o"
-                ; A (env "%.cmxs")
-            ]));
+module JS = Jane_street_ocamlbuild_goodies
 
-    (* Pass -predicates to ocamldep *)
-    pflag ["ocaml"; "ocamldep"] "predicate" (fun s -> S [A "-predicates"; A s])
-  | _ -> ()
+let dev_mode = true
 
 let setup_preprocessor_deps = function
   | After_rules ->
@@ -40,7 +23,9 @@ let dispatch = function
 
 let () =
   Ocamlbuild_plugin.dispatch (fun hook ->
-    js_hacks hook;
+    JS.alt_cmxs_of_cmxa_rule hook;
+    JS.pass_predicates_to_ocamldep hook;
+    if dev_mode && not Sys.win32 then JS.track_external_deps hook;
     setup_preprocessor_deps hook;
     dispatch hook;
     dispatch_default hook)
diff --git a/opam b/opam
index bd28572..230232a 100644
--- a/opam
+++ b/opam
@@ -6,12 +6,16 @@ bug-reports: "https://github.com/janestreet/bin_prot/issues";
 dev-repo: "https://github.com/janestreet/bin_prot.git";
 license: "Apache-2.0"
 build: [
-  ["./configure" "--prefix" prefix]
+  ["./configure" "--prefix" prefix "--%{mirage-xen:enable}%-xen"]
   [make]
 ]
 depends: [
-  "ocamlbuild" {build}
-  "oasis"      {build & >= "0.4"}
-  "ocamlfind"  {build & >= "1.3.2"}
+  "ocamlbuild"     {build}
+  "oasis"          {build & >= "0.4"}
+  "ocamlfind"      {build & >= "1.3.2"}
+  "js-build-tools" {build}
+]
+available: [ ocaml-version = "4.02.3" ]
+depopts: [
+  "mirage-xen-ocaml"
 ]
-available: [ ocaml-version >= "4.02.3" ]
diff --git a/postconf.sh b/postconf.sh
new file mode 100755
index 0000000..209d69c
--- /dev/null
+++ b/postconf.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+export PKG_CONFIG_PATH="$(opam config var prefix)/lib/pkgconfig"
+
+# Bridge through $XEN_CFLAGS from the environment into Oasis' world.
+#
+XEN_CFLAGS="disabled"
+grep -q '^xen="true"' setup.data && XEN_CFLAGS="$(pkg-config --static 
mirage-xen --cflags)"
+echo "XEN_CFLAGS=\"${XEN_CFLAGS}\"" >> setup.data
diff --git a/src/blit_stubs.c b/src/blit_stubs.c
index 20813d0..267ef18 100644
--- a/src/blit_stubs.c
+++ b/src/blit_stubs.c
@@ -23,6 +23,10 @@
 # endif
 #endif
 
+#ifdef __MINIOS__
+#define unlikely(x)     __builtin_expect((x),0)
+#endif
+
 #define get_buf(v_buf, v_pos) (char *) Caml_ba_data_val(v_buf) + 
Long_val(v_pos)
 
 CAMLprim value bin_prot_blit_string_buf_stub(
diff --git a/src/blit_stubs_xen.c b/src/blit_stubs_xen.c
new file mode 120000
index 0000000..d00a31d
--- /dev/null
+++ b/src/blit_stubs_xen.c
@@ -0,0 +1 @@
+src/blit_stubs.c
\ No newline at end of file
diff --git a/src/float_stubs_xen.c b/src/float_stubs_xen.c
new file mode 120000
index 0000000..9a0f02d
--- /dev/null
+++ b/src/float_stubs_xen.c
@@ -0,0 +1 @@
+src/float_stubs.c
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-ocaml-maint/packages/bin-prot.git

_______________________________________________
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits

Reply via email to