Skip to content

Commit d3d926a

Browse files
committed
v0.7.0
1 parent 15fc274 commit d3d926a

File tree

5 files changed

+242
-192
lines changed

5 files changed

+242
-192
lines changed

_oasis

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
OASISFormat: 0.3
22
OCamlVersion: >= 4.01.0
33
Name: openflow
4-
Version: 0.6.2
4+
Version: 0.7.0
55
Synopsis: Serialization library for OpenFlow
66
Authors: https://github.com/frenetic-lang/ocaml-openflow/contributors
77
License: LGPL

_tags

Lines changed: 74 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: e841dae195b3a4dde01d54b7e83088dd)
2+
# DO NOT EDIT (digest: c549d3b3eb1ea3a63e2936cb07d78beb)
33
# Ignore VCS directories, you can use the same kind of rule outside
44
# OASIS_START/STOP if you want to exclude directories that contains
55
# useless stuff for the build process
6+
true: annot, bin_annot
67
<**/.svn>: -traverse
78
<**/.svn>: not_hygienic
89
".bzr": -traverse
@@ -15,40 +16,40 @@
1516
"_darcs": not_hygienic
1617
# Library openflow
1718
"lib/openflow.cmxs": use_openflow
18-
<lib/*.ml{,i}>: package(core)
19-
<lib/*.ml{,i}>: package(cstruct)
20-
<lib/*.ml{,i}>: package(cstruct.syntax)
21-
<lib/*.ml{,i}>: package(packet)
22-
<lib/*.ml{,i}>: package(sexplib)
23-
<lib/*.ml{,i}>: package(sexplib.syntax)
24-
<lib/*.ml{,i}>: package(str)
25-
<lib/*.ml{,i}>: package(threads)
19+
<lib/*.ml{,i,y}>: package(core)
20+
<lib/*.ml{,i,y}>: package(cstruct)
21+
<lib/*.ml{,i,y}>: package(cstruct.syntax)
22+
<lib/*.ml{,i,y}>: package(packet)
23+
<lib/*.ml{,i,y}>: package(sexplib)
24+
<lib/*.ml{,i,y}>: package(sexplib.syntax)
25+
<lib/*.ml{,i,y}>: package(str)
26+
<lib/*.ml{,i,y}>: package(threads)
2627
# Library async
2728
"async/async.cmxs": use_async
28-
<async/*.ml{,i}>: package(async)
29-
<async/*.ml{,i}>: package(core)
30-
<async/*.ml{,i}>: package(cstruct)
31-
<async/*.ml{,i}>: package(cstruct.async)
32-
<async/*.ml{,i}>: package(cstruct.syntax)
33-
<async/*.ml{,i}>: package(packet)
34-
<async/*.ml{,i}>: package(sexplib)
35-
<async/*.ml{,i}>: package(sexplib.syntax)
36-
<async/*.ml{,i}>: package(str)
37-
<async/*.ml{,i}>: package(threads)
38-
<async/*.ml{,i}>: use_openflow
29+
<async/*.ml{,i,y}>: package(async)
30+
<async/*.ml{,i,y}>: package(core)
31+
<async/*.ml{,i,y}>: package(cstruct)
32+
<async/*.ml{,i,y}>: package(cstruct.async)
33+
<async/*.ml{,i,y}>: package(cstruct.syntax)
34+
<async/*.ml{,i,y}>: package(packet)
35+
<async/*.ml{,i,y}>: package(sexplib)
36+
<async/*.ml{,i,y}>: package(sexplib.syntax)
37+
<async/*.ml{,i,y}>: package(str)
38+
<async/*.ml{,i,y}>: package(threads)
39+
<async/*.ml{,i,y}>: use_openflow
3940
# Library quickcheck
4041
"quickcheck/quickcheck.cmxs": use_quickcheck
41-
<quickcheck/*.ml{,i}>: package(core)
42-
<quickcheck/*.ml{,i}>: package(cstruct)
43-
<quickcheck/*.ml{,i}>: package(cstruct.syntax)
44-
<quickcheck/*.ml{,i}>: package(packet)
45-
<quickcheck/*.ml{,i}>: package(packet.quickcheck)
46-
<quickcheck/*.ml{,i}>: package(quickcheck)
47-
<quickcheck/*.ml{,i}>: package(sexplib)
48-
<quickcheck/*.ml{,i}>: package(sexplib.syntax)
49-
<quickcheck/*.ml{,i}>: package(str)
50-
<quickcheck/*.ml{,i}>: package(threads)
51-
<quickcheck/*.ml{,i}>: use_openflow
42+
<quickcheck/*.ml{,i,y}>: package(core)
43+
<quickcheck/*.ml{,i,y}>: package(cstruct)
44+
<quickcheck/*.ml{,i,y}>: package(cstruct.syntax)
45+
<quickcheck/*.ml{,i,y}>: package(packet)
46+
<quickcheck/*.ml{,i,y}>: package(packet.quickcheck)
47+
<quickcheck/*.ml{,i,y}>: package(quickcheck)
48+
<quickcheck/*.ml{,i,y}>: package(sexplib)
49+
<quickcheck/*.ml{,i,y}>: package(sexplib.syntax)
50+
<quickcheck/*.ml{,i,y}>: package(str)
51+
<quickcheck/*.ml{,i,y}>: package(threads)
52+
<quickcheck/*.ml{,i,y}>: use_openflow
5253
# Executable testtool
5354
"test/Test.byte": package(core)
5455
"test/Test.byte": package(cstruct)
@@ -65,21 +66,21 @@
6566
"test/Test.byte": package(threads)
6667
"test/Test.byte": use_openflow
6768
"test/Test.byte": use_quickcheck
68-
<test/*.ml{,i}>: package(core)
69-
<test/*.ml{,i}>: package(cstruct)
70-
<test/*.ml{,i}>: package(cstruct.syntax)
71-
<test/*.ml{,i}>: package(oUnit)
72-
<test/*.ml{,i}>: package(pa_ounit)
73-
<test/*.ml{,i}>: package(pa_ounit.syntax)
74-
<test/*.ml{,i}>: package(packet)
75-
<test/*.ml{,i}>: package(packet.quickcheck)
76-
<test/*.ml{,i}>: package(quickcheck)
77-
<test/*.ml{,i}>: package(sexplib)
78-
<test/*.ml{,i}>: package(sexplib.syntax)
79-
<test/*.ml{,i}>: package(str)
80-
<test/*.ml{,i}>: package(threads)
81-
<test/*.ml{,i}>: use_openflow
82-
<test/*.ml{,i}>: use_quickcheck
69+
<test/*.ml{,i,y}>: package(core)
70+
<test/*.ml{,i,y}>: package(cstruct)
71+
<test/*.ml{,i,y}>: package(cstruct.syntax)
72+
<test/*.ml{,i,y}>: package(oUnit)
73+
<test/*.ml{,i,y}>: package(pa_ounit)
74+
<test/*.ml{,i,y}>: package(pa_ounit.syntax)
75+
<test/*.ml{,i,y}>: package(packet)
76+
<test/*.ml{,i,y}>: package(packet.quickcheck)
77+
<test/*.ml{,i,y}>: package(quickcheck)
78+
<test/*.ml{,i,y}>: package(sexplib)
79+
<test/*.ml{,i,y}>: package(sexplib.syntax)
80+
<test/*.ml{,i,y}>: package(str)
81+
<test/*.ml{,i,y}>: package(threads)
82+
<test/*.ml{,i,y}>: use_openflow
83+
<test/*.ml{,i,y}>: use_quickcheck
8384
# Executable ping_test
8485
"ping-test/PingTest.byte": package(async)
8586
"ping-test/PingTest.byte": package(core)
@@ -96,21 +97,21 @@
9697
"ping-test/PingTest.byte": package(threads)
9798
"ping-test/PingTest.byte": use_async
9899
"ping-test/PingTest.byte": use_openflow
99-
<ping-test/*.ml{,i}>: package(async)
100-
<ping-test/*.ml{,i}>: package(core)
101-
<ping-test/*.ml{,i}>: package(cstruct)
102-
<ping-test/*.ml{,i}>: package(cstruct.async)
103-
<ping-test/*.ml{,i}>: package(cstruct.syntax)
104-
<ping-test/*.ml{,i}>: package(oUnit)
105-
<ping-test/*.ml{,i}>: package(pa_ounit)
106-
<ping-test/*.ml{,i}>: package(pa_ounit.syntax)
107-
<ping-test/*.ml{,i}>: package(packet)
108-
<ping-test/*.ml{,i}>: package(sexplib)
109-
<ping-test/*.ml{,i}>: package(sexplib.syntax)
110-
<ping-test/*.ml{,i}>: package(str)
111-
<ping-test/*.ml{,i}>: package(threads)
112-
<ping-test/*.ml{,i}>: use_async
113-
<ping-test/*.ml{,i}>: use_openflow
100+
<ping-test/*.ml{,i,y}>: package(async)
101+
<ping-test/*.ml{,i,y}>: package(core)
102+
<ping-test/*.ml{,i,y}>: package(cstruct)
103+
<ping-test/*.ml{,i,y}>: package(cstruct.async)
104+
<ping-test/*.ml{,i,y}>: package(cstruct.syntax)
105+
<ping-test/*.ml{,i,y}>: package(oUnit)
106+
<ping-test/*.ml{,i,y}>: package(pa_ounit)
107+
<ping-test/*.ml{,i,y}>: package(pa_ounit.syntax)
108+
<ping-test/*.ml{,i,y}>: package(packet)
109+
<ping-test/*.ml{,i,y}>: package(sexplib)
110+
<ping-test/*.ml{,i,y}>: package(sexplib.syntax)
111+
<ping-test/*.ml{,i,y}>: package(str)
112+
<ping-test/*.ml{,i,y}>: package(threads)
113+
<ping-test/*.ml{,i,y}>: use_async
114+
<ping-test/*.ml{,i,y}>: use_openflow
114115
# Executable learning_switch
115116
"examples/Learning_Switch.byte": package(async)
116117
"examples/Learning_Switch.byte": package(core)
@@ -137,18 +138,18 @@
137138
"examples/Learning_Switch0x04.byte": package(threads)
138139
"examples/Learning_Switch0x04.byte": use_async
139140
"examples/Learning_Switch0x04.byte": use_openflow
140-
<examples/*.ml{,i}>: package(async)
141-
<examples/*.ml{,i}>: package(core)
142-
<examples/*.ml{,i}>: package(cstruct)
143-
<examples/*.ml{,i}>: package(cstruct.async)
144-
<examples/*.ml{,i}>: package(cstruct.syntax)
145-
<examples/*.ml{,i}>: package(packet)
146-
<examples/*.ml{,i}>: package(sexplib)
147-
<examples/*.ml{,i}>: package(sexplib.syntax)
148-
<examples/*.ml{,i}>: package(str)
149-
<examples/*.ml{,i}>: package(threads)
150-
<examples/*.ml{,i}>: use_async
151-
<examples/*.ml{,i}>: use_openflow
141+
<examples/*.ml{,i,y}>: package(async)
142+
<examples/*.ml{,i,y}>: package(core)
143+
<examples/*.ml{,i,y}>: package(cstruct)
144+
<examples/*.ml{,i,y}>: package(cstruct.async)
145+
<examples/*.ml{,i,y}>: package(cstruct.syntax)
146+
<examples/*.ml{,i,y}>: package(packet)
147+
<examples/*.ml{,i,y}>: package(sexplib)
148+
<examples/*.ml{,i,y}>: package(sexplib.syntax)
149+
<examples/*.ml{,i,y}>: package(str)
150+
<examples/*.ml{,i,y}>: package(threads)
151+
<examples/*.ml{,i,y}>: use_async
152+
<examples/*.ml{,i,y}>: use_openflow
152153
# OASIS_STOP
153154
<lib/*.ml{,i}>: syntax_camlp4o
154155
<async/*.ml{,i}>: syntax_camlp4o

lib/META

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: 03c6aa4eb5311c099a1fb8ca2157a81f)
3-
version = "0.6.2"
2+
# DO NOT EDIT (digest: bca9ff9aca32d529880868a36b2f43fb)
3+
version = "0.7.0"
44
description = "Serialization library for OpenFlow"
55
requires =
66
"str cstruct cstruct.syntax packet core sexplib.syntax sexplib threads"
@@ -10,7 +10,7 @@ archive(native) = "openflow.cmxa"
1010
archive(native, plugin) = "openflow.cmxs"
1111
exists_if = "openflow.cma"
1212
package "quickcheck" (
13-
version = "0.6.2"
13+
version = "0.7.0"
1414
description = "Serialization library for OpenFlow"
1515
requires = "quickcheck openflow packet.quickcheck"
1616
archive(byte) = "quickcheck.cma"
@@ -21,7 +21,7 @@ package "quickcheck" (
2121
)
2222

2323
package "async" (
24-
version = "0.6.2"
24+
version = "0.7.0"
2525
description = "Serialization library for OpenFlow"
2626
requires = "async openflow cstruct.async threads sexplib.syntax sexplib"
2727
archive(byte) = "async.cma"

myocamlbuild.ml

Lines changed: 51 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(* OASIS_START *)
2-
(* DO NOT EDIT (digest: d504cc72904744d1a686718531d2e7f0) *)
2+
(* DO NOT EDIT (digest: 91f001561aa83cb69a61fc50aa6c6602) *)
33
module OASISGettext = struct
44
(* # 22 "src/oasis/OASISGettext.ml" *)
55

@@ -249,6 +249,9 @@ module MyOCamlbuildFindlib = struct
249249
*)
250250
open Ocamlbuild_plugin
251251

252+
type conf =
253+
{ no_automatic_syntax: bool;
254+
}
252255

253256
(* these functions are not really officially exported *)
254257
let run_and_read =
@@ -315,7 +318,7 @@ module MyOCamlbuildFindlib = struct
315318

316319
(* This lists all supported packages. *)
317320
let find_packages () =
318-
List.map before_space (split_nl & run_and_read "ocamlfind list")
321+
List.map before_space (split_nl & run_and_read (exec_from_conf "ocamlfind" ^ " list"))
319322

320323

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

340343

341-
let dispatch =
344+
let dispatch conf =
342345
function
343346
| After_options ->
344347
(* By using Before_options one let command line options have an higher
@@ -357,31 +360,39 @@ module MyOCamlbuildFindlib = struct
357360
* -linkpkg *)
358361
flag ["ocaml"; "link"; "program"] & A"-linkpkg";
359362

360-
(* For each ocamlfind package one inject the -package option when
361-
* compiling, computing dependencies, generating documentation and
362-
* linking. *)
363-
List.iter
364-
begin fun pkg ->
365-
let base_args = [A"-package"; A pkg] in
366-
(* TODO: consider how to really choose camlp4o or camlp4r. *)
367-
let syn_args = [A"-syntax"; A "camlp4o"] in
368-
let args =
369-
(* Heuristic to identify syntax extensions: whether they end in
370-
".syntax"; some might not.
371-
*)
372-
if Filename.check_suffix pkg "syntax" ||
373-
List.mem pkg well_known_syntax then
374-
syn_args @ base_args
375-
else
376-
base_args
377-
in
378-
flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
379-
flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
380-
flag ["ocaml"; "doc"; "pkg_"^pkg] & S args;
381-
flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args;
382-
flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
383-
end
384-
(find_packages ());
363+
if not (conf.no_automatic_syntax) then begin
364+
(* For each ocamlfind package one inject the -package option when
365+
* compiling, computing dependencies, generating documentation and
366+
* linking. *)
367+
List.iter
368+
begin fun pkg ->
369+
let base_args = [A"-package"; A pkg] in
370+
(* TODO: consider how to really choose camlp4o or camlp4r. *)
371+
let syn_args = [A"-syntax"; A "camlp4o"] in
372+
let (args, pargs) =
373+
(* Heuristic to identify syntax extensions: whether they end in
374+
".syntax"; some might not.
375+
*)
376+
if Filename.check_suffix pkg "syntax" ||
377+
List.mem pkg well_known_syntax then
378+
(syn_args @ base_args, syn_args)
379+
else
380+
(base_args, [])
381+
in
382+
flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
383+
flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
384+
flag ["ocaml"; "doc"; "pkg_"^pkg] & S args;
385+
flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args;
386+
flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
387+
388+
(* TODO: Check if this is allowed for OCaml < 3.12.1 *)
389+
flag ["ocaml"; "compile"; "package("^pkg^")"] & S pargs;
390+
flag ["ocaml"; "ocamldep"; "package("^pkg^")"] & S pargs;
391+
flag ["ocaml"; "doc"; "package("^pkg^")"] & S pargs;
392+
flag ["ocaml"; "infer_interface"; "package("^pkg^")"] & S pargs;
393+
end
394+
(find_packages ());
395+
end;
385396

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

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

553-
dep ["compile"; "ocaml"; "program"; tag_libstubs lib]
554-
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
565+
dep ["compile"; "ocaml"; tag_libstubs lib]
566+
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
555567

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

582594

583-
let dispatch_default t =
595+
let dispatch_default conf t =
584596
dispatch_combine
585597
[
586598
dispatch t;
587-
MyOCamlbuildFindlib.dispatch;
599+
MyOCamlbuildFindlib.dispatch conf;
588600
]
589601

590602

591603
end
592604

593605

594-
# 594 "myocamlbuild.ml"
606+
# 606 "myocamlbuild.ml"
595607
open Ocamlbuild_plugin;;
596608
let package_default =
597609
{
@@ -614,8 +626,10 @@ let package_default =
614626
}
615627
;;
616628

617-
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
629+
let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}
630+
631+
let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;
618632

619-
# 620 "myocamlbuild.ml"
633+
# 634 "myocamlbuild.ml"
620634
(* OASIS_STOP *)
621635
Ocamlbuild_plugin.dispatch dispatch_default;;

0 commit comments

Comments
 (0)