4 module C
= Myocamlbuild_config
9 let bracket res destroy k
= let x = (try k res
with e
-> destroy res
; raise e
) in destroy res
; x in
10 let get_line r d
= bracket r d input_line
in
12 bracket (open_out
"version.ml") close_out
(fun out
->
15 get_line (Unix.open_process_in
"git describe --always") (Unix.close_process_in
)
17 _
-> (try get_line (open_in
"version.id") close_in
with _
-> "<unknown>")
19 Printf.fprintf out
"let id=\"%s\"\n" (String.escaped
revision)
24 dispatch
begin function
27 C.extern ~cma
:"extLib" "extlib";
33 C.extern
"netcgi2" ~cma
:"netcgi";
36 C.extern
"json-wheel" ~cma
:"jsonwheel";
38 C.extern
"ocsigen.xhtml" ~cma
:"xhtml";
40 flag
["ocaml"; "doc"; "use_extLib"] (S
[A
"-I"; A
(C.lib
"extlib")]);
47 flag_bn ["link"; "ocaml"; "use_netstring"; "thread"] (S
[A
"netstring_mt.cmo"]);
48 flag_bn ["link"; "ocaml"; "use_equeue"; "thread"] (S
[A
"unixqueue_mt.cmo"]);