Skip to content

Commit

Permalink
add the optional Mirage version and regenerate OASIS
Browse files Browse the repository at this point in the history
  • Loading branch information
avsm committed Aug 31, 2012
1 parent e5a0568 commit 33ad596
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 17 deletions.
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -5,6 +5,7 @@ NAME=cohttp

LWT ?= $(shell if ocamlfind query lwt.unix >/dev/null 2>&1; then echo --enable-lwt; fi)
ASYNC ?= $(shell if ocamlfind query async_core >/dev/null 2>&1; then echo --enable-async; fi)
MIRAGE ?= $(shell if ocamlfind query mirage-net >/dev/null 2>&1; then echo --enable-mirage; fi)
TESTS ?= --enable-tests
# disabled by default as they hang at the moment for Async
# NETTESTS ?= --enable-nettests
Expand All @@ -14,7 +15,7 @@ setup.bin: setup.ml
rm -f setup.cmx setup.cmi setup.o setup.cmo

setup.data: setup.bin
./setup.bin -configure $(LWT) $(ASYNC) $(TESTS) $(NETTESTS)
./setup.bin -configure $(LWT) $(ASYNC) $(MIRAGE) $(TESTS) $(NETTESTS)

build: setup.data setup.bin
./setup.bin -build
Expand Down
13 changes: 13 additions & 0 deletions _oasis
Expand Up @@ -22,6 +22,10 @@ Flag async
Description: build the Core/Async library
Default: false

Flag mirage
Description: build the Mirage library
Default: false

Flag nettests
Description: run the internet-using tests
Default: false
Expand All @@ -35,6 +39,15 @@ Library cohttp_lwt
BuildDepends: lwt.unix, lwt, uri, cohttp, lwt.ssl, lwt.syntax
Modules: Cohttp_lwt_raw, Cohttp_lwt, Cohttp_lwt_net

Library cohttp_mirage
Build$: flag(mirage)
Install$: flag(mirage)
Path: mirage
Findlibname: mirage
FindlibParent: cohttp
BuildDepends: uri, re, cohttp, lwt.syntax, mirage, mirage-net
Modules: Cohttp_mirage_raw

Library cohttp_async
Build$: flag(async)
Install$: flag(async)
Expand Down
28 changes: 18 additions & 10 deletions _tags
@@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: e5550f759ebf1185a3c2599dd0c7a147)
# DO NOT EDIT (digest: a1b53f46a128191a8606d25b3cb0974c)
# 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
Expand Down Expand Up @@ -32,12 +32,21 @@
"lwt/cohttp_lwt.cmxs": use_cohttp_lwt
<lwt/*.ml{,i}>: use_cohttp
<lwt/*.ml{,i}>: pkg_uri
<lwt/*.ml{,i}>: pkg_re
<lwt/*.ml{,i}>: pkg_lwt.syntax
<lwt/*.ml{,i}>: pkg_lwt.unix
<lwt/*.ml{,i}>: pkg_lwt
<lwt/*.ml{,i}>: pkg_lwt.ssl
<lwt/*.ml{,i}>: pkg_lwt.syntax
<lwt/*.ml{,i}>: pkg_re
<lwt/*.ml{,i}>: pkg_uri.services
# Library cohttp_mirage
"mirage/cohttp_mirage.cmxs": use_cohttp_mirage
<mirage/*.ml{,i}>: use_cohttp
<mirage/*.ml{,i}>: pkg_uri
<mirage/*.ml{,i}>: pkg_re
<mirage/*.ml{,i}>: pkg_lwt.syntax
<mirage/*.ml{,i}>: pkg_mirage
<mirage/*.ml{,i}>: pkg_mirage-net
<mirage/*.ml{,i}>: pkg_uri.services
# Library cohttp_async
"async/cohttp_async.cmxs": use_cohttp_async
<async/*.ml{,i}>: use_cohttp
Expand All @@ -53,11 +62,11 @@
<lib_test/test_parser.{native,byte}>: use_cohttp
<lib_test/test_parser.{native,byte}>: pkg_oUnit
<lib_test/test_parser.{native,byte}>: pkg_uri
<lib_test/test_parser.{native,byte}>: pkg_re
<lib_test/test_parser.{native,byte}>: pkg_lwt.syntax
<lib_test/test_parser.{native,byte}>: pkg_lwt.unix
<lib_test/test_parser.{native,byte}>: pkg_lwt
<lib_test/test_parser.{native,byte}>: pkg_lwt.ssl
<lib_test/test_parser.{native,byte}>: pkg_lwt.syntax
<lib_test/test_parser.{native,byte}>: pkg_re
<lib_test/test_parser.{native,byte}>: pkg_uri.services
<lib_test/test_parser.{native,byte}>: custom
# Executable test_accept
Expand All @@ -72,17 +81,17 @@
<lib_test/test_net_lwt.{native,byte}>: use_cohttp
<lib_test/test_net_lwt.{native,byte}>: pkg_oUnit
<lib_test/test_net_lwt.{native,byte}>: pkg_uri
<lib_test/test_net_lwt.{native,byte}>: pkg_re
<lib_test/test_net_lwt.{native,byte}>: pkg_lwt.syntax
<lib_test/test_net_lwt.{native,byte}>: pkg_lwt.unix
<lib_test/test_net_lwt.{native,byte}>: pkg_lwt
<lib_test/test_net_lwt.{native,byte}>: pkg_lwt.ssl
<lib_test/test_net_lwt.{native,byte}>: pkg_lwt.syntax
<lib_test/test_net_lwt.{native,byte}>: pkg_re
<lib_test/test_net_lwt.{native,byte}>: pkg_uri.services
<lib_test/*.ml{,i}>: use_cohttp_lwt
<lib_test/*.ml{,i}>: pkg_lwt.syntax
<lib_test/*.ml{,i}>: pkg_lwt.unix
<lib_test/*.ml{,i}>: pkg_lwt
<lib_test/*.ml{,i}>: pkg_lwt.ssl
<lib_test/*.ml{,i}>: pkg_lwt.syntax
<lib_test/test_net_lwt.{native,byte}>: custom
# Executable test_net_async
<lib_test/test_net_async.{native,byte}>: use_cohttp_async
Expand Down Expand Up @@ -122,6 +131,5 @@
<lib/*>: syntax_camlp4o, pkg_lwt.syntax
<lib_test/*>: syntax_camlp4o, pkg_lwt.syntax
<lwt/*>: syntax_camlp4o, pkg_lwt.syntax
<lwt_client/*>: syntax_camlp4o, pkg_lwt.syntax
<lwt_server/*>: syntax_camlp4o, pkg_lwt.syntax
<mirage/*>: syntax_camlp4o, pkg_lwt.syntax
true: annot
13 changes: 12 additions & 1 deletion lib/META
@@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: 2c88caae23164b562c22c2b199977048)
# DO NOT EDIT (digest: 859856a1753b2347ba33a04341e04d0e)
version = "0.9-dev"
description = "HTTP protocol library for Lwt"
requires = "re uri uri.services"
Expand All @@ -8,6 +8,17 @@ archive(byte, plugin) = "cohttp.cma"
archive(native) = "cohttp.cmxa"
archive(native, plugin) = "cohttp.cmxs"
exists_if = "cohttp.cma"
package "mirage" (
version = "0.9-dev"
description = "HTTP protocol library for Lwt"
requires = "uri re cohttp lwt.syntax mirage mirage-net"
archive(byte) = "cohttp_mirage.cma"
archive(byte, plugin) = "cohttp_mirage.cma"
archive(native) = "cohttp_mirage.cmxa"
archive(native, plugin) = "cohttp_mirage.cmxs"
exists_if = "cohttp_mirage.cma"
)

package "lwt" (
version = "0.9-dev"
description = "HTTP protocol library for Lwt"
Expand Down
6 changes: 4 additions & 2 deletions myocamlbuild.ml
@@ -1,5 +1,5 @@
(* OASIS_START *)
(* DO NOT EDIT (digest: 6901382c6ef6b8591d71d3e76820a74c) *)
(* DO NOT EDIT (digest: 67f6e5eaf5a726679938d30ee32e1d0c) *)
module OASISGettext = struct
# 21 "/home/avsm/src/git/avsm/oasis.git/src/oasis/OASISGettext.ml"

Expand Down Expand Up @@ -562,12 +562,14 @@ let package_default =
[
("cohttp", ["lib"]);
("cohttp_lwt", ["lwt"]);
("cohttp_mirage", ["mirage"]);
("cohttp_async", ["async"])
];
lib_c = [];
flags = [];
includes =
[
("mirage", ["lib"]);
("lwt", ["lib"]);
("lib_test", ["async"; "lib"; "lwt"]);
("async", ["lib"])
Expand All @@ -577,7 +579,7 @@ let package_default =

let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;

# 581 "myocamlbuild.ml"
# 583 "myocamlbuild.ml"
(* OASIS_STOP *)
open Ocamlbuild_plugin

Expand Down
62 changes: 59 additions & 3 deletions setup.ml
@@ -1,7 +1,7 @@
(* setup.ml generated for the first time by OASIS v0.3.0 *)

(* OASIS_START *)
(* DO NOT EDIT (digest: 02f4df0ba613da559ace2cb8e8ab07e0) *)
(* DO NOT EDIT (digest: c861e54b14fc5f54350f07bbcd8a2e38) *)
(*
Regenerated by OASIS v0.3.1
Visit http://oasis.forge.ocamlcore.org for more information and
Expand Down Expand Up @@ -6198,6 +6198,16 @@ let setup_t =
flag_description = Some "build the Core/Async library";
flag_default = [(OASISExpr.EBool true, false)];
});
Flag
({
cs_name = "mirage";
cs_data = PropList.Data.create ();
cs_plugin_data = [];
},
{
flag_description = Some "build the Mirage library";
flag_default = [(OASISExpr.EBool true, false)];
});
Flag
({
cs_name = "nettests";
Expand Down Expand Up @@ -6255,6 +6265,52 @@ let setup_t =
lib_findlib_name = Some "lwt";
lib_findlib_containers = [];
});
Library
({
cs_name = "cohttp_mirage";
cs_data = PropList.Data.create ();
cs_plugin_data = [];
},
{
bs_build =
[
(OASISExpr.EBool true, false);
(OASISExpr.EFlag "mirage", true)
];
bs_install =
[
(OASISExpr.EBool true, false);
(OASISExpr.EFlag "mirage", true)
];
bs_path = "mirage";
bs_compiled_object = Best;
bs_build_depends =
[
FindlibPackage ("uri", None);
FindlibPackage ("re", None);
InternalLibrary "cohttp";
FindlibPackage ("lwt.syntax", None);
FindlibPackage ("mirage", None);
FindlibPackage ("mirage-net", None)
];
bs_build_tools = [ExternalTool "ocamlbuild"];
bs_c_sources = [];
bs_data_files = [];
bs_ccopt = [(OASISExpr.EBool true, [])];
bs_cclib = [(OASISExpr.EBool true, [])];
bs_dlllib = [(OASISExpr.EBool true, [])];
bs_dllpath = [(OASISExpr.EBool true, [])];
bs_byteopt = [(OASISExpr.EBool true, [])];
bs_nativeopt = [(OASISExpr.EBool true, [])];
},
{
lib_modules = ["Cohttp_mirage_raw"];
lib_pack = false;
lib_internal_modules = [];
lib_findlib_parent = Some "cohttp";
lib_findlib_name = Some "mirage";
lib_findlib_containers = [];
});
Library
({
cs_name = "cohttp_async";
Expand Down Expand Up @@ -6651,14 +6707,14 @@ let setup_t =
};
oasis_fn = Some "_oasis";
oasis_version = "0.3.1";
oasis_digest = Some "Fe\229\156\198\168\189\194\217B\204\231O\231\164L";
oasis_digest = Some "\133#G\138\173\218,\151\209N\159{x\220\254\\";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false;
};;

let setup () = BaseSetup.setup setup_t;;

# 6663 "setup.ml"
# 6719 "setup.ml"
(* OASIS_STOP *)
let () = setup ();;

0 comments on commit 33ad596

Please sign in to comment.