Skip to content

Commit

Permalink
v0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
seliopou committed Dec 8, 2014
1 parent 15fc274 commit d3d926a
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 192 deletions.
2 changes: 1 addition & 1 deletion _oasis
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
OASISFormat: 0.3
OCamlVersion: >= 4.01.0
Name: openflow
Version: 0.6.2
Version: 0.7.0
Synopsis: Serialization library for OpenFlow
Authors: https://github.com/frenetic-lang/ocaml-openflow/contributors
License: LGPL
Expand Down
147 changes: 74 additions & 73 deletions _tags
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# OASIS_START
# DO NOT EDIT (digest: e841dae195b3a4dde01d54b7e83088dd)
# DO NOT EDIT (digest: c549d3b3eb1ea3a63e2936cb07d78beb)
# 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
true: annot, bin_annot
<**/.svn>: -traverse
<**/.svn>: not_hygienic
".bzr": -traverse
Expand All @@ -15,40 +16,40 @@
"_darcs": not_hygienic
# Library openflow
"lib/openflow.cmxs": use_openflow
<lib/*.ml{,i}>: package(core)
<lib/*.ml{,i}>: package(cstruct)
<lib/*.ml{,i}>: package(cstruct.syntax)
<lib/*.ml{,i}>: package(packet)
<lib/*.ml{,i}>: package(sexplib)
<lib/*.ml{,i}>: package(sexplib.syntax)
<lib/*.ml{,i}>: package(str)
<lib/*.ml{,i}>: package(threads)
<lib/*.ml{,i,y}>: package(core)
<lib/*.ml{,i,y}>: package(cstruct)
<lib/*.ml{,i,y}>: package(cstruct.syntax)
<lib/*.ml{,i,y}>: package(packet)
<lib/*.ml{,i,y}>: package(sexplib)
<lib/*.ml{,i,y}>: package(sexplib.syntax)
<lib/*.ml{,i,y}>: package(str)
<lib/*.ml{,i,y}>: package(threads)
# Library async
"async/async.cmxs": use_async
<async/*.ml{,i}>: package(async)
<async/*.ml{,i}>: package(core)
<async/*.ml{,i}>: package(cstruct)
<async/*.ml{,i}>: package(cstruct.async)
<async/*.ml{,i}>: package(cstruct.syntax)
<async/*.ml{,i}>: package(packet)
<async/*.ml{,i}>: package(sexplib)
<async/*.ml{,i}>: package(sexplib.syntax)
<async/*.ml{,i}>: package(str)
<async/*.ml{,i}>: package(threads)
<async/*.ml{,i}>: use_openflow
<async/*.ml{,i,y}>: package(async)
<async/*.ml{,i,y}>: package(core)
<async/*.ml{,i,y}>: package(cstruct)
<async/*.ml{,i,y}>: package(cstruct.async)
<async/*.ml{,i,y}>: package(cstruct.syntax)
<async/*.ml{,i,y}>: package(packet)
<async/*.ml{,i,y}>: package(sexplib)
<async/*.ml{,i,y}>: package(sexplib.syntax)
<async/*.ml{,i,y}>: package(str)
<async/*.ml{,i,y}>: package(threads)
<async/*.ml{,i,y}>: use_openflow
# Library quickcheck
"quickcheck/quickcheck.cmxs": use_quickcheck
<quickcheck/*.ml{,i}>: package(core)
<quickcheck/*.ml{,i}>: package(cstruct)
<quickcheck/*.ml{,i}>: package(cstruct.syntax)
<quickcheck/*.ml{,i}>: package(packet)
<quickcheck/*.ml{,i}>: package(packet.quickcheck)
<quickcheck/*.ml{,i}>: package(quickcheck)
<quickcheck/*.ml{,i}>: package(sexplib)
<quickcheck/*.ml{,i}>: package(sexplib.syntax)
<quickcheck/*.ml{,i}>: package(str)
<quickcheck/*.ml{,i}>: package(threads)
<quickcheck/*.ml{,i}>: use_openflow
<quickcheck/*.ml{,i,y}>: package(core)
<quickcheck/*.ml{,i,y}>: package(cstruct)
<quickcheck/*.ml{,i,y}>: package(cstruct.syntax)
<quickcheck/*.ml{,i,y}>: package(packet)
<quickcheck/*.ml{,i,y}>: package(packet.quickcheck)
<quickcheck/*.ml{,i,y}>: package(quickcheck)
<quickcheck/*.ml{,i,y}>: package(sexplib)
<quickcheck/*.ml{,i,y}>: package(sexplib.syntax)
<quickcheck/*.ml{,i,y}>: package(str)
<quickcheck/*.ml{,i,y}>: package(threads)
<quickcheck/*.ml{,i,y}>: use_openflow
# Executable testtool
"test/Test.byte": package(core)
"test/Test.byte": package(cstruct)
Expand All @@ -65,21 +66,21 @@
"test/Test.byte": package(threads)
"test/Test.byte": use_openflow
"test/Test.byte": use_quickcheck
<test/*.ml{,i}>: package(core)
<test/*.ml{,i}>: package(cstruct)
<test/*.ml{,i}>: package(cstruct.syntax)
<test/*.ml{,i}>: package(oUnit)
<test/*.ml{,i}>: package(pa_ounit)
<test/*.ml{,i}>: package(pa_ounit.syntax)
<test/*.ml{,i}>: package(packet)
<test/*.ml{,i}>: package(packet.quickcheck)
<test/*.ml{,i}>: package(quickcheck)
<test/*.ml{,i}>: package(sexplib)
<test/*.ml{,i}>: package(sexplib.syntax)
<test/*.ml{,i}>: package(str)
<test/*.ml{,i}>: package(threads)
<test/*.ml{,i}>: use_openflow
<test/*.ml{,i}>: use_quickcheck
<test/*.ml{,i,y}>: package(core)
<test/*.ml{,i,y}>: package(cstruct)
<test/*.ml{,i,y}>: package(cstruct.syntax)
<test/*.ml{,i,y}>: package(oUnit)
<test/*.ml{,i,y}>: package(pa_ounit)
<test/*.ml{,i,y}>: package(pa_ounit.syntax)
<test/*.ml{,i,y}>: package(packet)
<test/*.ml{,i,y}>: package(packet.quickcheck)
<test/*.ml{,i,y}>: package(quickcheck)
<test/*.ml{,i,y}>: package(sexplib)
<test/*.ml{,i,y}>: package(sexplib.syntax)
<test/*.ml{,i,y}>: package(str)
<test/*.ml{,i,y}>: package(threads)
<test/*.ml{,i,y}>: use_openflow
<test/*.ml{,i,y}>: use_quickcheck
# Executable ping_test
"ping-test/PingTest.byte": package(async)
"ping-test/PingTest.byte": package(core)
Expand All @@ -96,21 +97,21 @@
"ping-test/PingTest.byte": package(threads)
"ping-test/PingTest.byte": use_async
"ping-test/PingTest.byte": use_openflow
<ping-test/*.ml{,i}>: package(async)
<ping-test/*.ml{,i}>: package(core)
<ping-test/*.ml{,i}>: package(cstruct)
<ping-test/*.ml{,i}>: package(cstruct.async)
<ping-test/*.ml{,i}>: package(cstruct.syntax)
<ping-test/*.ml{,i}>: package(oUnit)
<ping-test/*.ml{,i}>: package(pa_ounit)
<ping-test/*.ml{,i}>: package(pa_ounit.syntax)
<ping-test/*.ml{,i}>: package(packet)
<ping-test/*.ml{,i}>: package(sexplib)
<ping-test/*.ml{,i}>: package(sexplib.syntax)
<ping-test/*.ml{,i}>: package(str)
<ping-test/*.ml{,i}>: package(threads)
<ping-test/*.ml{,i}>: use_async
<ping-test/*.ml{,i}>: use_openflow
<ping-test/*.ml{,i,y}>: package(async)
<ping-test/*.ml{,i,y}>: package(core)
<ping-test/*.ml{,i,y}>: package(cstruct)
<ping-test/*.ml{,i,y}>: package(cstruct.async)
<ping-test/*.ml{,i,y}>: package(cstruct.syntax)
<ping-test/*.ml{,i,y}>: package(oUnit)
<ping-test/*.ml{,i,y}>: package(pa_ounit)
<ping-test/*.ml{,i,y}>: package(pa_ounit.syntax)
<ping-test/*.ml{,i,y}>: package(packet)
<ping-test/*.ml{,i,y}>: package(sexplib)
<ping-test/*.ml{,i,y}>: package(sexplib.syntax)
<ping-test/*.ml{,i,y}>: package(str)
<ping-test/*.ml{,i,y}>: package(threads)
<ping-test/*.ml{,i,y}>: use_async
<ping-test/*.ml{,i,y}>: use_openflow
# Executable learning_switch
"examples/Learning_Switch.byte": package(async)
"examples/Learning_Switch.byte": package(core)
Expand All @@ -137,18 +138,18 @@
"examples/Learning_Switch0x04.byte": package(threads)
"examples/Learning_Switch0x04.byte": use_async
"examples/Learning_Switch0x04.byte": use_openflow
<examples/*.ml{,i}>: package(async)
<examples/*.ml{,i}>: package(core)
<examples/*.ml{,i}>: package(cstruct)
<examples/*.ml{,i}>: package(cstruct.async)
<examples/*.ml{,i}>: package(cstruct.syntax)
<examples/*.ml{,i}>: package(packet)
<examples/*.ml{,i}>: package(sexplib)
<examples/*.ml{,i}>: package(sexplib.syntax)
<examples/*.ml{,i}>: package(str)
<examples/*.ml{,i}>: package(threads)
<examples/*.ml{,i}>: use_async
<examples/*.ml{,i}>: use_openflow
<examples/*.ml{,i,y}>: package(async)
<examples/*.ml{,i,y}>: package(core)
<examples/*.ml{,i,y}>: package(cstruct)
<examples/*.ml{,i,y}>: package(cstruct.async)
<examples/*.ml{,i,y}>: package(cstruct.syntax)
<examples/*.ml{,i,y}>: package(packet)
<examples/*.ml{,i,y}>: package(sexplib)
<examples/*.ml{,i,y}>: package(sexplib.syntax)
<examples/*.ml{,i,y}>: package(str)
<examples/*.ml{,i,y}>: package(threads)
<examples/*.ml{,i,y}>: use_async
<examples/*.ml{,i,y}>: use_openflow
# OASIS_STOP
<lib/*.ml{,i}>: syntax_camlp4o
<async/*.ml{,i}>: syntax_camlp4o
Expand Down
8 changes: 4 additions & 4 deletions lib/META
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OASIS_START
# DO NOT EDIT (digest: 03c6aa4eb5311c099a1fb8ca2157a81f)
version = "0.6.2"
# DO NOT EDIT (digest: bca9ff9aca32d529880868a36b2f43fb)
version = "0.7.0"
description = "Serialization library for OpenFlow"
requires =
"str cstruct cstruct.syntax packet core sexplib.syntax sexplib threads"
Expand All @@ -10,7 +10,7 @@ archive(native) = "openflow.cmxa"
archive(native, plugin) = "openflow.cmxs"
exists_if = "openflow.cma"
package "quickcheck" (
version = "0.6.2"
version = "0.7.0"
description = "Serialization library for OpenFlow"
requires = "quickcheck openflow packet.quickcheck"
archive(byte) = "quickcheck.cma"
Expand All @@ -21,7 +21,7 @@ package "quickcheck" (
)

package "async" (
version = "0.6.2"
version = "0.7.0"
description = "Serialization library for OpenFlow"
requires = "async openflow cstruct.async threads sexplib.syntax sexplib"
archive(byte) = "async.cma"
Expand Down
88 changes: 51 additions & 37 deletions myocamlbuild.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* OASIS_START *)
(* DO NOT EDIT (digest: d504cc72904744d1a686718531d2e7f0) *)
(* DO NOT EDIT (digest: 91f001561aa83cb69a61fc50aa6c6602) *)
module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.ml" *)

Expand Down Expand Up @@ -249,6 +249,9 @@ module MyOCamlbuildFindlib = struct
*)
open Ocamlbuild_plugin

type conf =
{ no_automatic_syntax: bool;
}

(* these functions are not really officially exported *)
let run_and_read =
Expand Down Expand Up @@ -315,7 +318,7 @@ module MyOCamlbuildFindlib = struct

(* This lists all supported packages. *)
let find_packages () =
List.map before_space (split_nl & run_and_read "ocamlfind list")
List.map before_space (split_nl & run_and_read (exec_from_conf "ocamlfind" ^ " list"))


(* Mock to list available syntaxes. *)
Expand All @@ -338,7 +341,7 @@ module MyOCamlbuildFindlib = struct
]


let dispatch =
let dispatch conf =
function
| After_options ->
(* By using Before_options one let command line options have an higher
Expand All @@ -357,31 +360,39 @@ module MyOCamlbuildFindlib = struct
* -linkpkg *)
flag ["ocaml"; "link"; "program"] & 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
(* 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" ||
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;
flag ["ocaml"; "doc"; "pkg_"^pkg] & S args;
flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args;
flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
end
(find_packages ());
if not (conf.no_automatic_syntax) then begin
(* 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
(* TODO: consider how to really choose camlp4o or camlp4r. *)
let syn_args = [A"-syntax"; A "camlp4o"] in
let (args, pargs) =
(* 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, syn_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;

(* TODO: Check if this is allowed for OCaml < 3.12.1 *)
flag ["ocaml"; "compile"; "package("^pkg^")"] & S pargs;
flag ["ocaml"; "ocamldep"; "package("^pkg^")"] & S pargs;
flag ["ocaml"; "doc"; "package("^pkg^")"] & S pargs;
flag ["ocaml"; "infer_interface"; "package("^pkg^")"] & S pargs;
end
(find_packages ());
end;

(* Like -package but for extensions syntax. Morover -syntax is useless
* when linking. *)
Expand Down Expand Up @@ -546,12 +557,13 @@ module MyOCamlbuildBase = struct

(* When ocaml link something that use the C library, then one
need that file to be up to date.
This holds both for programs and for libraries.
*)
dep ["link"; "ocaml"; "program"; tag_libstubs lib]
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
dep ["link"; "ocaml"; tag_libstubs lib]
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];

dep ["compile"; "ocaml"; "program"; tag_libstubs lib]
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
dep ["compile"; "ocaml"; tag_libstubs lib]
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];

(* TODO: be more specific about what depends on headers *)
(* Depends on .h files *)
Expand Down Expand Up @@ -580,18 +592,18 @@ module MyOCamlbuildBase = struct
()


let dispatch_default t =
let dispatch_default conf t =
dispatch_combine
[
dispatch t;
MyOCamlbuildFindlib.dispatch;
MyOCamlbuildFindlib.dispatch conf;
]


end


# 594 "myocamlbuild.ml"
# 606 "myocamlbuild.ml"
open Ocamlbuild_plugin;;
let package_default =
{
Expand All @@ -614,8 +626,10 @@ let package_default =
}
;;

let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}

let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;

# 620 "myocamlbuild.ml"
# 634 "myocamlbuild.ml"
(* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;;
Loading

0 comments on commit d3d926a

Please sign in to comment.