mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 11:45:31 -05:00
moved cgi in a subdir (would not build with oasis 0.4 otherwise)
This commit is contained in:
parent
239f6af59f
commit
74735a7ad9
13 changed files with 1551 additions and 467 deletions
2
Makefile
2
Makefile
|
|
@ -1,5 +1,5 @@
|
||||||
# OASIS_START
|
# OASIS_START
|
||||||
# DO NOT EDIT (digest: bc1e05bfc8b39b664f29dae8dbd3ebbb)
|
# DO NOT EDIT (digest: 7b2408909643717852b95f994b273fee)
|
||||||
|
|
||||||
SETUP = ocaml setup.ml
|
SETUP = ocaml setup.ml
|
||||||
|
|
||||||
|
|
|
||||||
7
_oasis
7
_oasis
|
|
@ -64,7 +64,7 @@ Library "containers_lwt"
|
||||||
XMETARequires: containers,lwt
|
XMETARequires: containers,lwt
|
||||||
|
|
||||||
Library "containers_cgi"
|
Library "containers_cgi"
|
||||||
Path: .
|
Path: cgi
|
||||||
Modules: ToWeb
|
Modules: ToWeb
|
||||||
FindlibName: cgi
|
FindlibName: cgi
|
||||||
FindlibParent: containers
|
FindlibParent: containers
|
||||||
|
|
@ -78,6 +78,7 @@ Document containers
|
||||||
Type: ocamlbuild (0.3)
|
Type: ocamlbuild (0.3)
|
||||||
BuildTools+: ocamldoc
|
BuildTools+: ocamldoc
|
||||||
Install: true
|
Install: true
|
||||||
|
Build$: flag(lwt)
|
||||||
XOCamlbuildPath: .
|
XOCamlbuildPath: .
|
||||||
XOCamlbuildLibraries: containers,containers.lwt
|
XOCamlbuildLibraries: containers,containers.lwt
|
||||||
|
|
||||||
|
|
@ -103,11 +104,11 @@ Executable run_tests
|
||||||
BuildDepends: containers, oUnit, lwt, threads, lwt.unix
|
BuildDepends: containers, oUnit, lwt, threads, lwt.unix
|
||||||
|
|
||||||
Executable web_pwd
|
Executable web_pwd
|
||||||
Path: examples
|
Path: examples/cgi/
|
||||||
Install: false
|
Install: false
|
||||||
MainIs: web_pwd.ml
|
MainIs: web_pwd.ml
|
||||||
Build$: flag(cgi)
|
Build$: flag(cgi)
|
||||||
BuildDepends: containers.cgi, threads, CamlGI
|
BuildDepends: containers, containers.cgi, threads, CamlGI
|
||||||
|
|
||||||
SourceRepository head
|
SourceRepository head
|
||||||
Type: git
|
Type: git
|
||||||
|
|
|
||||||
63
_tags
63
_tags
|
|
@ -1,5 +1,5 @@
|
||||||
# OASIS_START
|
# OASIS_START
|
||||||
# DO NOT EDIT (digest: dcf1c0cacacb67335a863b18858eaeb7)
|
# DO NOT EDIT (digest: 1f5b1920aa5191df724ab0786999e476)
|
||||||
# Ignore VCS directories, you can use the same kind of rule outside
|
# Ignore VCS directories, you can use the same kind of rule outside
|
||||||
# OASIS_START/STOP if you want to exclude directories that contains
|
# OASIS_START/STOP if you want to exclude directories that contains
|
||||||
# useless stuff for the build process
|
# useless stuff for the build process
|
||||||
|
|
@ -52,44 +52,47 @@
|
||||||
"show.cmx": for-pack(Containers)
|
"show.cmx": for-pack(Containers)
|
||||||
"tTree.cmx": for-pack(Containers)
|
"tTree.cmx": for-pack(Containers)
|
||||||
"hGraph.cmx": for-pack(Containers)
|
"hGraph.cmx": for-pack(Containers)
|
||||||
|
"automaton.cmx": for-pack(Containers)
|
||||||
# Library containers_thread
|
# Library containers_thread
|
||||||
"containers_thread.cmxs": use_containers_thread
|
"containers_thread.cmxs": use_containers_thread
|
||||||
<*.ml{,i}>: pkg_threads
|
<*.ml{,i}>: package(threads)
|
||||||
# Library containers_lwt
|
# Library containers_lwt
|
||||||
"containers_lwt.cmxs": use_containers_lwt
|
"containers_lwt.cmxs": use_containers_lwt
|
||||||
<*.ml{,i}>: pkg_lwt
|
|
||||||
# Library containers_cgi
|
|
||||||
"containers_cgi.cmxs": use_containers_cgi
|
|
||||||
<*.ml{,i}>: use_containers
|
<*.ml{,i}>: use_containers
|
||||||
<*.ml{,i}>: pkg_CamlGI
|
<*.ml{,i}>: package(lwt)
|
||||||
<*.ml{,i}>: pkg_unix
|
<*.ml{,i}>: package(unix)
|
||||||
|
# Library containers_cgi
|
||||||
|
"cgi/containers_cgi.cmxs": use_containers_cgi
|
||||||
|
<cgi/*.ml{,i}>: use_containers
|
||||||
|
<cgi/*.ml{,i}>: package(CamlGI)
|
||||||
|
<cgi/*.ml{,i}>: package(unix)
|
||||||
# Executable benchs
|
# Executable benchs
|
||||||
"tests/benchs.native": use_containers
|
"tests/benchs.native": use_containers
|
||||||
"tests/benchs.native": pkg_bench
|
"tests/benchs.native": package(bench)
|
||||||
"tests/benchs.native": pkg_unix
|
"tests/benchs.native": package(unix)
|
||||||
<tests/*.ml{,i}>: pkg_bench
|
<tests/*.ml{,i}>: package(bench)
|
||||||
# Executable run_tests
|
# Executable run_tests
|
||||||
"tests/run_tests.native": use_containers
|
"tests/run_tests.native": use_containers
|
||||||
"tests/run_tests.native": pkg_threads
|
"tests/run_tests.native": package(threads)
|
||||||
"tests/run_tests.native": pkg_oUnit
|
"tests/run_tests.native": package(oUnit)
|
||||||
"tests/run_tests.native": pkg_lwt
|
"tests/run_tests.native": package(lwt)
|
||||||
"tests/run_tests.native": pkg_lwt.unix
|
"tests/run_tests.native": package(lwt.unix)
|
||||||
"tests/run_tests.native": pkg_unix
|
"tests/run_tests.native": package(unix)
|
||||||
<tests/*.ml{,i}>: use_containers
|
<tests/*.ml{,i}>: use_containers
|
||||||
<tests/*.ml{,i}>: pkg_threads
|
<tests/*.ml{,i}>: package(threads)
|
||||||
<tests/*.ml{,i}>: pkg_oUnit
|
<tests/*.ml{,i}>: package(oUnit)
|
||||||
<tests/*.ml{,i}>: pkg_lwt
|
<tests/*.ml{,i}>: package(lwt)
|
||||||
<tests/*.ml{,i}>: pkg_lwt.unix
|
<tests/*.ml{,i}>: package(lwt.unix)
|
||||||
<tests/*.ml{,i}>: pkg_unix
|
<tests/*.ml{,i}>: package(unix)
|
||||||
# Executable web_pwd
|
# Executable web_pwd
|
||||||
"examples/web_pwd.byte": use_containers_cgi
|
"examples/cgi/web_pwd.byte": use_containers_cgi
|
||||||
"examples/web_pwd.byte": use_containers
|
"examples/cgi/web_pwd.byte": use_containers
|
||||||
"examples/web_pwd.byte": pkg_threads
|
"examples/cgi/web_pwd.byte": package(threads)
|
||||||
"examples/web_pwd.byte": pkg_CamlGI
|
"examples/cgi/web_pwd.byte": package(CamlGI)
|
||||||
"examples/web_pwd.byte": pkg_unix
|
"examples/cgi/web_pwd.byte": package(unix)
|
||||||
<examples/*.ml{,i}>: use_containers_cgi
|
<examples/cgi/*.ml{,i}>: use_containers_cgi
|
||||||
<examples/*.ml{,i}>: use_containers
|
<examples/cgi/*.ml{,i}>: use_containers
|
||||||
<examples/*.ml{,i}>: pkg_threads
|
<examples/cgi/*.ml{,i}>: package(threads)
|
||||||
<examples/*.ml{,i}>: pkg_CamlGI
|
<examples/cgi/*.ml{,i}>: package(CamlGI)
|
||||||
<examples/*.ml{,i}>: pkg_unix
|
<examples/cgi/*.ml{,i}>: package(unix)
|
||||||
# OASIS_STOP
|
# OASIS_STOP
|
||||||
|
|
|
||||||
4
cgi/containers_cgi.mllib
Normal file
4
cgi/containers_cgi.mllib
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
# OASIS_START
|
||||||
|
# DO NOT EDIT (digest: f5192440033c9e32b425a31804bbddaa)
|
||||||
|
ToWeb
|
||||||
|
# OASIS_STOP
|
||||||
2
configure
vendored
2
configure
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# OASIS_START
|
# OASIS_START
|
||||||
# DO NOT EDIT (digest: 425187ed8bfdbdd207fd76392dd243a7)
|
# DO NOT EDIT (digest: dc86c2ad450f91ca10c931b6045d0499)
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
FST=true
|
FST=true
|
||||||
|
|
|
||||||
4
containers.mllib
Normal file
4
containers.mllib
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
# OASIS_START
|
||||||
|
# DO NOT EDIT (digest: 5382aaf8b3d2fdeb6717f9805b0dd511)
|
||||||
|
Containers
|
||||||
|
# OASIS_STOP
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# OASIS_START
|
# OASIS_START
|
||||||
# DO NOT EDIT (digest: c05f285f4d4b4832b21ddd28863f4edf)
|
# DO NOT EDIT (digest: 9b329c33930d547bbc92d89a6a2cec77)
|
||||||
Cache
|
Cache
|
||||||
Deque
|
Deque
|
||||||
Gen
|
Gen
|
||||||
|
|
@ -37,4 +37,5 @@ BencodeOnDisk
|
||||||
Show
|
Show
|
||||||
TTree
|
TTree
|
||||||
HGraph
|
HGraph
|
||||||
|
Automaton
|
||||||
# OASIS_STOP
|
# OASIS_STOP
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# OASIS_START
|
# OASIS_START
|
||||||
# DO NOT EDIT (digest: b68696a2df00165022fe21a389026f4f)
|
# DO NOT EDIT (digest: 1374a4df6a056c922bd254bb51737f89)
|
||||||
Cache
|
Cache
|
||||||
Deque
|
Deque
|
||||||
Gen
|
Gen
|
||||||
|
|
@ -37,5 +37,6 @@ BencodeOnDisk
|
||||||
Show
|
Show
|
||||||
TTree
|
TTree
|
||||||
HGraph
|
HGraph
|
||||||
|
Automaton
|
||||||
Behavior
|
Behavior
|
||||||
# OASIS_STOP
|
# OASIS_STOP
|
||||||
|
|
|
||||||
180
myocamlbuild.ml
180
myocamlbuild.ml
|
|
@ -1,39 +1,50 @@
|
||||||
(* OASIS_START *)
|
(* OASIS_START *)
|
||||||
(* DO NOT EDIT (digest: 240e1f430a880e29ecae75f577790609) *)
|
(* DO NOT EDIT (digest: 0ae112fe35eff6babb0408ce917edebb) *)
|
||||||
module OASISGettext = struct
|
module OASISGettext = struct
|
||||||
(* # 21 "src/oasis/OASISGettext.ml" *)
|
(* # 22 "src/oasis/OASISGettext.ml" *)
|
||||||
|
|
||||||
|
|
||||||
let ns_ str =
|
let ns_ str =
|
||||||
str
|
str
|
||||||
|
|
||||||
|
|
||||||
let s_ str =
|
let s_ str =
|
||||||
str
|
str
|
||||||
|
|
||||||
let f_ (str : ('a, 'b, 'c, 'd) format4) =
|
|
||||||
|
let f_ (str: ('a, 'b, 'c, 'd) format4) =
|
||||||
str
|
str
|
||||||
|
|
||||||
|
|
||||||
let fn_ fmt1 fmt2 n =
|
let fn_ fmt1 fmt2 n =
|
||||||
if n = 1 then
|
if n = 1 then
|
||||||
fmt1^^""
|
fmt1^^""
|
||||||
else
|
else
|
||||||
fmt2^^""
|
fmt2^^""
|
||||||
|
|
||||||
|
|
||||||
let init =
|
let init =
|
||||||
[]
|
[]
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module OASISExpr = struct
|
module OASISExpr = struct
|
||||||
(* # 21 "src/oasis/OASISExpr.ml" *)
|
(* # 22 "src/oasis/OASISExpr.ml" *)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
open OASISGettext
|
open OASISGettext
|
||||||
|
|
||||||
|
|
||||||
type test = string
|
type test = string
|
||||||
|
|
||||||
|
|
||||||
type flag = string
|
type flag = string
|
||||||
|
|
||||||
|
|
||||||
type t =
|
type t =
|
||||||
| EBool of bool
|
| EBool of bool
|
||||||
| ENot of t
|
| ENot of t
|
||||||
|
|
@ -43,8 +54,10 @@ module OASISExpr = struct
|
||||||
| ETest of test * string
|
| ETest of test * string
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type 'a choices = (t * 'a) list
|
type 'a choices = (t * 'a) list
|
||||||
|
|
||||||
|
|
||||||
let eval var_get t =
|
let eval var_get t =
|
||||||
let rec eval' =
|
let rec eval' =
|
||||||
function
|
function
|
||||||
|
|
@ -75,6 +88,7 @@ module OASISExpr = struct
|
||||||
in
|
in
|
||||||
eval' t
|
eval' t
|
||||||
|
|
||||||
|
|
||||||
let choose ?printer ?name var_get lst =
|
let choose ?printer ?name var_get lst =
|
||||||
let rec choose_aux =
|
let rec choose_aux =
|
||||||
function
|
function
|
||||||
|
|
@ -111,22 +125,27 @@ module OASISExpr = struct
|
||||||
in
|
in
|
||||||
choose_aux (List.rev lst)
|
choose_aux (List.rev lst)
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# 117 "myocamlbuild.ml"
|
# 132 "myocamlbuild.ml"
|
||||||
module BaseEnvLight = struct
|
module BaseEnvLight = struct
|
||||||
(* # 21 "src/base/BaseEnvLight.ml" *)
|
(* # 22 "src/base/BaseEnvLight.ml" *)
|
||||||
|
|
||||||
|
|
||||||
module MapString = Map.Make(String)
|
module MapString = Map.Make(String)
|
||||||
|
|
||||||
|
|
||||||
type t = string MapString.t
|
type t = string MapString.t
|
||||||
|
|
||||||
|
|
||||||
let default_filename =
|
let default_filename =
|
||||||
Filename.concat
|
Filename.concat
|
||||||
(Sys.getcwd ())
|
(Sys.getcwd ())
|
||||||
"setup.data"
|
"setup.data"
|
||||||
|
|
||||||
|
|
||||||
let load ?(allow_empty=false) ?(filename=default_filename) () =
|
let load ?(allow_empty=false) ?(filename=default_filename) () =
|
||||||
if Sys.file_exists filename then
|
if Sys.file_exists filename then
|
||||||
begin
|
begin
|
||||||
|
|
@ -184,6 +203,7 @@ module BaseEnvLight = struct
|
||||||
filename)
|
filename)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
let var_get name env =
|
let var_get name env =
|
||||||
let rec var_expand str =
|
let rec var_expand str =
|
||||||
let buff =
|
let buff =
|
||||||
|
|
@ -205,6 +225,7 @@ module BaseEnvLight = struct
|
||||||
in
|
in
|
||||||
var_expand (MapString.find name env)
|
var_expand (MapString.find name env)
|
||||||
|
|
||||||
|
|
||||||
let var_choose lst env =
|
let var_choose lst env =
|
||||||
OASISExpr.choose
|
OASISExpr.choose
|
||||||
(fun nm -> var_get nm env)
|
(fun nm -> var_get nm env)
|
||||||
|
|
@ -212,9 +233,10 @@ module BaseEnvLight = struct
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# 215 "myocamlbuild.ml"
|
# 236 "myocamlbuild.ml"
|
||||||
module MyOCamlbuildFindlib = struct
|
module MyOCamlbuildFindlib = struct
|
||||||
(* # 21 "src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
|
(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
|
||||||
|
|
||||||
|
|
||||||
(** OCamlbuild extension, copied from
|
(** OCamlbuild extension, copied from
|
||||||
* http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild
|
* http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild
|
||||||
|
|
@ -226,60 +248,81 @@ module MyOCamlbuildFindlib = struct
|
||||||
*)
|
*)
|
||||||
open Ocamlbuild_plugin
|
open Ocamlbuild_plugin
|
||||||
|
|
||||||
|
|
||||||
(* these functions are not really officially exported *)
|
(* these functions are not really officially exported *)
|
||||||
let run_and_read =
|
let run_and_read =
|
||||||
Ocamlbuild_pack.My_unix.run_and_read
|
Ocamlbuild_pack.My_unix.run_and_read
|
||||||
|
|
||||||
|
|
||||||
let blank_sep_strings =
|
let blank_sep_strings =
|
||||||
Ocamlbuild_pack.Lexers.blank_sep_strings
|
Ocamlbuild_pack.Lexers.blank_sep_strings
|
||||||
|
|
||||||
|
|
||||||
let split s ch =
|
let split s ch =
|
||||||
let x =
|
let buf = Buffer.create 13 in
|
||||||
ref []
|
let x = ref [] in
|
||||||
|
let flush () =
|
||||||
|
x := (Buffer.contents buf) :: !x;
|
||||||
|
Buffer.clear buf
|
||||||
in
|
in
|
||||||
let rec go s =
|
String.iter
|
||||||
let pos =
|
(fun c ->
|
||||||
String.index s ch
|
if c = ch then
|
||||||
in
|
flush ()
|
||||||
x := (String.before s pos)::!x;
|
else
|
||||||
go (String.after s (pos + 1))
|
Buffer.add_char buf c)
|
||||||
in
|
s;
|
||||||
try
|
flush ();
|
||||||
go s
|
List.rev !x
|
||||||
with Not_found -> !x
|
|
||||||
|
|
||||||
let split_nl s = split s '\n'
|
let split_nl s = split s '\n'
|
||||||
|
|
||||||
|
|
||||||
let before_space s =
|
let before_space s =
|
||||||
try
|
try
|
||||||
String.before s (String.index s ' ')
|
String.before s (String.index s ' ')
|
||||||
with Not_found -> s
|
with Not_found -> s
|
||||||
|
|
||||||
(* this lists all supported packages *)
|
(* ocamlfind command *)
|
||||||
|
let ocamlfind x =
|
||||||
|
let ocamlfind_prog =
|
||||||
|
let env_filename = Pathname.basename BaseEnvLight.default_filename in
|
||||||
|
let env = BaseEnvLight.load ~filename:env_filename ~allow_empty:true () in
|
||||||
|
try
|
||||||
|
BaseEnvLight.var_get "ocamlfind" env
|
||||||
|
with Not_found ->
|
||||||
|
Printf.eprintf "W: Cannot get variable ocamlfind";
|
||||||
|
"ocamlfind"
|
||||||
|
in
|
||||||
|
S[Sh ocamlfind_prog; x]
|
||||||
|
|
||||||
|
(* This lists all supported packages. *)
|
||||||
let find_packages () =
|
let find_packages () =
|
||||||
List.map before_space (split_nl & run_and_read "ocamlfind list")
|
List.map before_space (split_nl & run_and_read "ocamlfind list")
|
||||||
|
|
||||||
(* this is supposed to list available syntaxes, but I don't know how to do it. *)
|
|
||||||
|
(* Mock to list available syntaxes. *)
|
||||||
let find_syntaxes () = ["camlp4o"; "camlp4r"]
|
let find_syntaxes () = ["camlp4o"; "camlp4r"]
|
||||||
|
|
||||||
(* ocamlfind command *)
|
|
||||||
let ocamlfind x = S[A"ocamlfind"; x]
|
|
||||||
|
|
||||||
let dispatch =
|
let dispatch =
|
||||||
function
|
function
|
||||||
| Before_options ->
|
| Before_options ->
|
||||||
(* by using Before_options one let command line options have an higher priority *)
|
(* By using Before_options one let command line options have an higher
|
||||||
(* on the contrary using After_options will guarantee to have the higher priority *)
|
* priority on the contrary using After_options will guarantee to have
|
||||||
(* override default commands by ocamlfind ones *)
|
* the higher priority override default commands by ocamlfind ones *)
|
||||||
Options.ocamlc := ocamlfind & A"ocamlc";
|
Options.ocamlc := ocamlfind & A"ocamlc";
|
||||||
Options.ocamlopt := ocamlfind & A"ocamlopt";
|
Options.ocamlopt := ocamlfind & A"ocamlopt";
|
||||||
Options.ocamldep := ocamlfind & A"ocamldep";
|
Options.ocamldep := ocamlfind & A"ocamldep";
|
||||||
Options.ocamldoc := ocamlfind & A"ocamldoc";
|
Options.ocamldoc := ocamlfind & A"ocamldoc";
|
||||||
Options.ocamlmktop := ocamlfind & A"ocamlmktop"
|
Options.ocamlmktop := ocamlfind & A"ocamlmktop";
|
||||||
|
Options.ocamlmklib := ocamlfind & A"ocamlmklib"
|
||||||
|
|
||||||
| After_rules ->
|
| After_rules ->
|
||||||
|
|
||||||
(* When one link an OCaml library/binary/package, one should use -linkpkg *)
|
(* When one link an OCaml library/binary/package, one should use
|
||||||
|
* -linkpkg *)
|
||||||
flag ["ocaml"; "link"; "program"] & A"-linkpkg";
|
flag ["ocaml"; "link"; "program"] & A"-linkpkg";
|
||||||
|
|
||||||
(* For each ocamlfind package one inject the -package option when
|
(* For each ocamlfind package one inject the -package option when
|
||||||
|
|
@ -287,11 +330,20 @@ module MyOCamlbuildFindlib = struct
|
||||||
* linking. *)
|
* linking. *)
|
||||||
List.iter
|
List.iter
|
||||||
begin fun pkg ->
|
begin fun pkg ->
|
||||||
flag ["ocaml"; "compile"; "pkg_"^pkg] & S[A"-package"; A pkg];
|
let base_args = [A"-package"; A pkg] in
|
||||||
flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S[A"-package"; A pkg];
|
let syn_args = [A"-syntax"; A "camlp4o"] in
|
||||||
flag ["ocaml"; "doc"; "pkg_"^pkg] & S[A"-package"; A pkg];
|
let args =
|
||||||
flag ["ocaml"; "link"; "pkg_"^pkg] & S[A"-package"; A pkg];
|
(* Heuristic to identify syntax extensions: whether they end in
|
||||||
flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S[A"-package"; A pkg];
|
* ".syntax"; some might not *)
|
||||||
|
if Filename.check_suffix pkg "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
|
end
|
||||||
(find_packages ());
|
(find_packages ());
|
||||||
|
|
||||||
|
|
@ -301,7 +353,8 @@ module MyOCamlbuildFindlib = struct
|
||||||
flag ["ocaml"; "compile"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
|
flag ["ocaml"; "compile"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
|
||||||
flag ["ocaml"; "ocamldep"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
|
flag ["ocaml"; "ocamldep"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
|
||||||
flag ["ocaml"; "doc"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
|
flag ["ocaml"; "doc"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
|
||||||
flag ["ocaml"; "infer_interface"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
|
flag ["ocaml"; "infer_interface"; "syntax_"^syntax] &
|
||||||
|
S[A"-syntax"; A syntax];
|
||||||
end (find_syntaxes ());
|
end (find_syntaxes ());
|
||||||
|
|
||||||
(* The default "thread" tag is not compatible with ocamlfind.
|
(* The default "thread" tag is not compatible with ocamlfind.
|
||||||
|
|
@ -315,15 +368,19 @@ module MyOCamlbuildFindlib = struct
|
||||||
flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]);
|
flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]);
|
||||||
flag ["ocaml"; "pkg_threads"; "doc"] (S[A "-I"; A "+threads"]);
|
flag ["ocaml"; "pkg_threads"; "doc"] (S[A "-I"; A "+threads"]);
|
||||||
flag ["ocaml"; "pkg_threads"; "link"] (S[A "-thread"]);
|
flag ["ocaml"; "pkg_threads"; "link"] (S[A "-thread"]);
|
||||||
flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"])
|
flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"]);
|
||||||
|
flag ["ocaml"; "package(threads)"; "compile"] (S[A "-thread"]);
|
||||||
|
flag ["ocaml"; "package(threads)"; "doc"] (S[A "-I"; A "+threads"]);
|
||||||
|
flag ["ocaml"; "package(threads)"; "link"] (S[A "-thread"]);
|
||||||
|
flag ["ocaml"; "package(threads)"; "infer_interface"] (S[A "-thread"]);
|
||||||
|
|
||||||
| _ ->
|
| _ ->
|
||||||
()
|
()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module MyOCamlbuildBase = struct
|
module MyOCamlbuildBase = struct
|
||||||
(* # 21 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
|
(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
|
||||||
|
|
||||||
|
|
||||||
(** Base functions for writing myocamlbuild.ml
|
(** Base functions for writing myocamlbuild.ml
|
||||||
@author Sylvain Le Gall
|
@author Sylvain Le Gall
|
||||||
|
|
@ -331,19 +388,24 @@ module MyOCamlbuildBase = struct
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
open Ocamlbuild_plugin
|
open Ocamlbuild_plugin
|
||||||
module OC = Ocamlbuild_pack.Ocaml_compiler
|
module OC = Ocamlbuild_pack.Ocaml_compiler
|
||||||
|
|
||||||
|
|
||||||
type dir = string
|
type dir = string
|
||||||
type file = string
|
type file = string
|
||||||
type name = string
|
type name = string
|
||||||
type tag = string
|
type tag = string
|
||||||
|
|
||||||
(* # 56 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
|
|
||||||
|
(* # 62 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
|
||||||
|
|
||||||
|
|
||||||
type t =
|
type t =
|
||||||
{
|
{
|
||||||
lib_ocaml: (name * dir list) list;
|
lib_ocaml: (name * dir list * string list) list;
|
||||||
lib_c: (name * dir * file list) list;
|
lib_c: (name * dir * file list) list;
|
||||||
flags: (tag list * (spec OASISExpr.choices)) list;
|
flags: (tag list * (spec OASISExpr.choices)) list;
|
||||||
(* Replace the 'dir: include' from _tags by a precise interdepends in
|
(* Replace the 'dir: include' from _tags by a precise interdepends in
|
||||||
|
|
@ -352,22 +414,27 @@ module MyOCamlbuildBase = struct
|
||||||
includes: (dir * dir list) list;
|
includes: (dir * dir list) list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let env_filename =
|
let env_filename =
|
||||||
Pathname.basename
|
Pathname.basename
|
||||||
BaseEnvLight.default_filename
|
BaseEnvLight.default_filename
|
||||||
|
|
||||||
|
|
||||||
let dispatch_combine lst =
|
let dispatch_combine lst =
|
||||||
fun e ->
|
fun e ->
|
||||||
List.iter
|
List.iter
|
||||||
(fun dispatch -> dispatch e)
|
(fun dispatch -> dispatch e)
|
||||||
lst
|
lst
|
||||||
|
|
||||||
|
|
||||||
let tag_libstubs nm =
|
let tag_libstubs nm =
|
||||||
"use_lib"^nm^"_stubs"
|
"use_lib"^nm^"_stubs"
|
||||||
|
|
||||||
|
|
||||||
let nm_libstubs nm =
|
let nm_libstubs nm =
|
||||||
nm^"_stubs"
|
nm^"_stubs"
|
||||||
|
|
||||||
|
|
||||||
let dispatch t e =
|
let dispatch t e =
|
||||||
let env =
|
let env =
|
||||||
BaseEnvLight.load
|
BaseEnvLight.load
|
||||||
|
|
@ -399,9 +466,13 @@ module MyOCamlbuildBase = struct
|
||||||
(* Declare OCaml libraries *)
|
(* Declare OCaml libraries *)
|
||||||
List.iter
|
List.iter
|
||||||
(function
|
(function
|
||||||
| nm, [] ->
|
| nm, [], intf_modules ->
|
||||||
ocaml_lib nm
|
ocaml_lib nm;
|
||||||
| nm, dir :: tl ->
|
let cmis =
|
||||||
|
List.map (fun m -> (String.uncapitalize m) ^ ".cmi")
|
||||||
|
intf_modules in
|
||||||
|
dep ["ocaml"; "link"; "library"; "file:"^nm^".cma"] cmis
|
||||||
|
| nm, dir :: tl, intf_modules ->
|
||||||
ocaml_lib ~dir:dir (dir^"/"^nm);
|
ocaml_lib ~dir:dir (dir^"/"^nm);
|
||||||
List.iter
|
List.iter
|
||||||
(fun dir ->
|
(fun dir ->
|
||||||
|
|
@ -409,7 +480,12 @@ module MyOCamlbuildBase = struct
|
||||||
(fun str ->
|
(fun str ->
|
||||||
flag ["ocaml"; "use_"^nm; str] (S[A"-I"; P dir]))
|
flag ["ocaml"; "use_"^nm; str] (S[A"-I"; P dir]))
|
||||||
["compile"; "infer_interface"; "doc"])
|
["compile"; "infer_interface"; "doc"])
|
||||||
tl)
|
tl;
|
||||||
|
let cmis =
|
||||||
|
List.map (fun m -> dir^"/"^(String.uncapitalize m)^".cmi")
|
||||||
|
intf_modules in
|
||||||
|
dep ["ocaml"; "link"; "library"; "file:"^dir^"/"^nm^".cma"]
|
||||||
|
cmis)
|
||||||
t.lib_ocaml;
|
t.lib_ocaml;
|
||||||
|
|
||||||
(* Declare directories dependencies, replace "include" in _tags. *)
|
(* Declare directories dependencies, replace "include" in _tags. *)
|
||||||
|
|
@ -463,6 +539,7 @@ module MyOCamlbuildBase = struct
|
||||||
| _ ->
|
| _ ->
|
||||||
()
|
()
|
||||||
|
|
||||||
|
|
||||||
let dispatch_default t =
|
let dispatch_default t =
|
||||||
dispatch_combine
|
dispatch_combine
|
||||||
[
|
[
|
||||||
|
|
@ -470,28 +547,29 @@ module MyOCamlbuildBase = struct
|
||||||
MyOCamlbuildFindlib.dispatch;
|
MyOCamlbuildFindlib.dispatch;
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# 476 "myocamlbuild.ml"
|
# 554 "myocamlbuild.ml"
|
||||||
open Ocamlbuild_plugin;;
|
open Ocamlbuild_plugin;;
|
||||||
let package_default =
|
let package_default =
|
||||||
{
|
{
|
||||||
MyOCamlbuildBase.lib_ocaml =
|
MyOCamlbuildBase.lib_ocaml =
|
||||||
[
|
[
|
||||||
("containers", []);
|
("containers", [], []);
|
||||||
("containers_thread", []);
|
("containers_thread", [], []);
|
||||||
("containers_lwt", []);
|
("containers_lwt", [], []);
|
||||||
("containers_cgi", [])
|
("containers_cgi", ["cgi"], [])
|
||||||
];
|
];
|
||||||
lib_c = [];
|
lib_c = [];
|
||||||
flags = [];
|
flags = [];
|
||||||
includes = [];
|
includes = [("examples/cgi", ["cgi"])]
|
||||||
}
|
}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
|
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
|
||||||
|
|
||||||
# 496 "myocamlbuild.ml"
|
# 574 "myocamlbuild.ml"
|
||||||
(* OASIS_STOP *)
|
(* OASIS_STOP *)
|
||||||
Ocamlbuild_plugin.dispatch dispatch_default;;
|
Ocamlbuild_plugin.dispatch dispatch_default;;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue