_oasis generated files

This commit is contained in:
Simon Cruanes 2014-05-23 00:01:07 +02:00
parent 1fd7b9fbe0
commit 8ad03fcc1d
21 changed files with 8568 additions and 96 deletions

144
_tags
View file

@ -1,5 +1,5 @@
# OASIS_START # OASIS_START
# DO NOT EDIT (digest: 1907902d29ff8cd23331587c97b0f346) # DO NOT EDIT (digest: df66284577d93287963c0c06e567cf78)
# 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
@ -14,61 +14,55 @@
"_darcs": -traverse "_darcs": -traverse
"_darcs": not_hygienic "_darcs": not_hygienic
# Library containers # Library containers
"containers.cmxs": use_containers "core/containers.cmxs": use_containers
"cache.cmx": for-pack(Containers) # Library containers_string
"deque.cmx": for-pack(Containers) "string/containers_string.cmxs": use_containers_string
"gen.cmx": for-pack(Containers) "string/KMP.cmx": for-pack(Containers_string)
"fHashtbl.cmx": for-pack(Containers) "string/CCString.cmx": for-pack(Containers_string)
"fQueue.cmx": for-pack(Containers) "string/levenshtein.cmx": for-pack(Containers_string)
"flatHashtbl.cmx": for-pack(Containers) # Library containers_misc
"hashset.cmx": for-pack(Containers) "misc/containers_misc.cmxs": use_containers_misc
"heap.cmx": for-pack(Containers) "misc/cache.cmx": for-pack(Containers_misc)
"lazyGraph.cmx": for-pack(Containers) "misc/fHashtbl.cmx": for-pack(Containers_misc)
"persistentGraph.cmx": for-pack(Containers) "misc/flatHashtbl.cmx": for-pack(Containers_misc)
"persistentHashtbl.cmx": for-pack(Containers) "misc/hashset.cmx": for-pack(Containers_misc)
"pHashtbl.cmx": for-pack(Containers) "misc/heap.cmx": for-pack(Containers_misc)
"sequence.cmx": for-pack(Containers) "misc/lazyGraph.cmx": for-pack(Containers_misc)
"skipList.cmx": for-pack(Containers) "misc/persistentGraph.cmx": for-pack(Containers_misc)
"splayTree.cmx": for-pack(Containers) "misc/pHashtbl.cmx": for-pack(Containers_misc)
"splayMap.cmx": for-pack(Containers) "misc/skipList.cmx": for-pack(Containers_misc)
"univ.cmx": for-pack(Containers) "misc/splayTree.cmx": for-pack(Containers_misc)
"vector.cmx": for-pack(Containers) "misc/splayMap.cmx": for-pack(Containers_misc)
"bij.cmx": for-pack(Containers) "misc/univ.cmx": for-pack(Containers_misc)
"piCalculus.cmx": for-pack(Containers) "misc/bij.cmx": for-pack(Containers_misc)
"bencode.cmx": for-pack(Containers) "misc/piCalculus.cmx": for-pack(Containers_misc)
"sexp.cmx": for-pack(Containers) "misc/bencode.cmx": for-pack(Containers_misc)
"RAL.cmx": for-pack(Containers) "misc/sexp.cmx": for-pack(Containers_misc)
"multiSet.cmx": for-pack(Containers) "misc/RAL.cmx": for-pack(Containers_misc)
"unionFind.cmx": for-pack(Containers) "misc/unionFind.cmx": for-pack(Containers_misc)
"smallSet.cmx": for-pack(Containers) "misc/smallSet.cmx": for-pack(Containers_misc)
"leftistheap.cmx": for-pack(Containers) "misc/absSet.cmx": for-pack(Containers_misc)
"absSet.cmx": for-pack(Containers) "misc/CSM.cmx": for-pack(Containers_misc)
"CSM.cmx": for-pack(Containers) "misc/actionMan.cmx": for-pack(Containers_misc)
"multiMap.cmx": for-pack(Containers) "misc/qCheck.cmx": for-pack(Containers_misc)
"actionMan.cmx": for-pack(Containers) "misc/bencodeOnDisk.cmx": for-pack(Containers_misc)
"BV.cmx": for-pack(Containers) "misc/tTree.cmx": for-pack(Containers_misc)
"qCheck.cmx": for-pack(Containers) "misc/hGraph.cmx": for-pack(Containers_misc)
"bencodeOnDisk.cmx": for-pack(Containers) "misc/automaton.cmx": for-pack(Containers_misc)
"show.cmx": for-pack(Containers) "misc/conv.cmx": for-pack(Containers_misc)
"tTree.cmx": for-pack(Containers) "misc/bidir.cmx": for-pack(Containers_misc)
"hGraph.cmx": for-pack(Containers) "misc/iteratee.cmx": for-pack(Containers_misc)
"automaton.cmx": for-pack(Containers) "misc/ty.cmx": for-pack(Containers_misc)
"conv.cmx": for-pack(Containers) "misc/tell.cmx": for-pack(Containers_misc)
"levenshtein.cmx": for-pack(Containers) "misc/bencodeStream.cmx": for-pack(Containers_misc)
"bidir.cmx": for-pack(Containers) "misc/ratTerm.cmx": for-pack(Containers_misc)
"iteratee.cmx": for-pack(Containers) "misc/cause.cmx": for-pack(Containers_misc)
"ty.cmx": for-pack(Containers) "misc/AVL.cmx": for-pack(Containers_misc)
"tell.cmx": for-pack(Containers) <misc/*.ml{,i}>: package(unix)
"bencodeStream.cmx": for-pack(Containers) <misc/*.ml{,i}>: use_containers
"ratTerm.cmx": for-pack(Containers)
"cause.cmx": for-pack(Containers)
"KMP.cmx": for-pack(Containers)
"circList.cmx": for-pack(Containers)
<*.ml{,i}>: package(unix)
# Library containers_thread # Library containers_thread
"threads/containers_thread.cmxs": use_containers_thread "threads/containers_thread.cmxs": use_containers_thread
<threads/*.ml{,i}>: package(threads) <threads/*.ml{,i}>: package(threads)
<threads/*.ml{,i}>: package(unix)
<threads/*.ml{,i}>: use_containers <threads/*.ml{,i}>: use_containers
# Library containers_lwt # Library containers_lwt
"lwt/containers_lwt.cmxs": use_containers_lwt "lwt/containers_lwt.cmxs": use_containers_lwt
@ -78,48 +72,66 @@
<lwt/*.ml{,i}>: package(lwt.unix) <lwt/*.ml{,i}>: package(lwt.unix)
<lwt/*.ml{,i}>: package(unix) <lwt/*.ml{,i}>: package(unix)
<lwt/*.ml{,i}>: use_containers <lwt/*.ml{,i}>: use_containers
<lwt/*.ml{,i}>: use_containers_misc
# Library containers_cgi # Library containers_cgi
"cgi/containers_cgi.cmxs": use_containers_cgi "cgi/containers_cgi.cmxs": use_containers_cgi
<cgi/*.ml{,i}>: package(CamlGI) <cgi/*.ml{,i}>: package(CamlGI)
<cgi/*.ml{,i}>: package(unix)
<cgi/*.ml{,i}>: use_containers <cgi/*.ml{,i}>: use_containers
# Executable benchs # Executable benchs
"tests/benchs.native": package(bench) "tests/benchs.native": package(bench)
"tests/benchs.native": package(unix) "tests/benchs.native": package(unix)
"tests/benchs.native": use_containers "tests/benchs.native": use_containers
"tests/benchs.native": use_containers_misc
"tests/benchs.native": use_containers_string
<tests/*.ml{,i}>: package(bench) <tests/*.ml{,i}>: package(bench)
<tests/*.ml{,i}>: package(unix)
<tests/*.ml{,i}>: use_containers_misc
<tests/*.ml{,i}>: use_containers_string
# Executable bench_conv # Executable bench_conv
"tests/bench_conv.native": package(benchmark) "tests/bench_conv.native": package(benchmark)
"tests/bench_conv.native": package(unix)
"tests/bench_conv.native": use_containers "tests/bench_conv.native": use_containers
<tests/*.ml{,i}>: package(benchmark) <tests/*.ml{,i}>: package(benchmark)
# Executable test_levenshtein # Executable test_levenshtein
"tests/test_levenshtein.native": package(qcheck) "tests/test_levenshtein.native": package(qcheck)
"tests/test_levenshtein.native": package(unix)
"tests/test_levenshtein.native": use_containers "tests/test_levenshtein.native": use_containers
<tests/*.ml{,i}>: package(qcheck) <tests/*.ml{,i}>: package(qcheck)
# Executable test_lwt
<tests/lwt/test_Behavior.{native,byte}>: package(lwt)
<tests/lwt/test_Behavior.{native,byte}>: package(lwt.unix)
<tests/lwt/test_Behavior.{native,byte}>: package(oUnit)
<tests/lwt/test_Behavior.{native,byte}>: package(unix)
<tests/lwt/test_Behavior.{native,byte}>: use_containers
<tests/lwt/test_Behavior.{native,byte}>: use_containers_lwt
<tests/lwt/test_Behavior.{native,byte}>: use_containers_misc
# Executable test_threads
<tests/lwt/test_Future.{native,byte}>: package(lwt)
<tests/lwt/test_Future.{native,byte}>: package(lwt.unix)
<tests/lwt/test_Future.{native,byte}>: package(oUnit)
<tests/lwt/test_Future.{native,byte}>: package(threads)
<tests/lwt/test_Future.{native,byte}>: package(unix)
<tests/lwt/test_Future.{native,byte}>: use_containers
<tests/lwt/test_Future.{native,byte}>: use_containers_lwt
<tests/lwt/test_Future.{native,byte}>: use_containers_misc
<tests/lwt/*.ml{,i}>: package(lwt)
<tests/lwt/*.ml{,i}>: package(lwt.unix)
<tests/lwt/*.ml{,i}>: package(oUnit)
<tests/lwt/*.ml{,i}>: package(threads)
<tests/lwt/*.ml{,i}>: package(unix)
<tests/lwt/*.ml{,i}>: use_containers
<tests/lwt/*.ml{,i}>: use_containers_lwt
<tests/lwt/*.ml{,i}>: use_containers_misc
# Executable run_tests # Executable run_tests
"tests/run_tests.native": package(lwt)
"tests/run_tests.native": package(lwt.unix)
"tests/run_tests.native": package(oUnit) "tests/run_tests.native": package(oUnit)
"tests/run_tests.native": package(threads)
"tests/run_tests.native": package(unix)
"tests/run_tests.native": use_containers "tests/run_tests.native": use_containers
<tests/*.ml{,i}>: package(lwt)
<tests/*.ml{,i}>: package(lwt.unix)
<tests/*.ml{,i}>: package(oUnit) <tests/*.ml{,i}>: package(oUnit)
<tests/*.ml{,i}>: package(threads)
<tests/*.ml{,i}>: package(unix)
<tests/*.ml{,i}>: use_containers <tests/*.ml{,i}>: use_containers
# Executable web_pwd # Executable web_pwd
"examples/cgi/web_pwd.byte": package(CamlGI) "examples/cgi/web_pwd.byte": package(CamlGI)
"examples/cgi/web_pwd.byte": package(threads) "examples/cgi/web_pwd.byte": package(threads)
"examples/cgi/web_pwd.byte": package(unix)
"examples/cgi/web_pwd.byte": use_containers "examples/cgi/web_pwd.byte": use_containers
"examples/cgi/web_pwd.byte": use_containers_cgi "examples/cgi/web_pwd.byte": use_containers_cgi
<examples/cgi/*.ml{,i}>: package(CamlGI) <examples/cgi/*.ml{,i}>: package(CamlGI)
<examples/cgi/*.ml{,i}>: package(threads) <examples/cgi/*.ml{,i}>: package(threads)
<examples/cgi/*.ml{,i}>: package(unix)
<examples/cgi/*.ml{,i}>: use_containers <examples/cgi/*.ml{,i}>: use_containers
<examples/cgi/*.ml{,i}>: use_containers_cgi <examples/cgi/*.ml{,i}>: use_containers_cgi
# OASIS_STOP # OASIS_STOP

View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: f5192440033c9e32b425a31804bbddaa)
ToWeb
# OASIS_STOP

4
cgi/containers_cgi.mllib Normal file
View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: f5192440033c9e32b425a31804bbddaa)
ToWeb
# OASIS_STOP

26
containers.odocl Normal file
View file

@ -0,0 +1,26 @@
# OASIS_START
# DO NOT EDIT (digest: a3c9e3f1dda45411bdcd3558229477d6)
core/CCVector
core/CCDeque
core/CCGen
core/CCSequence
core/CCFQueue
core/CCMultiMap
core/CCMultiSet
core/CCBV
core/CCPrint
core/CCPersistentHashtbl
core/CCLeftistheap
core/CCList
core/CCOpt
core/CCPair
core/CCFun
core/CCHash
core/CCKList
core/CCInt
core/CCBool
core/CCArray
string/KMP
string/CCString
string/Levenshtein
# OASIS_STOP

39
containers_misc.odocl Normal file
View file

@ -0,0 +1,39 @@
# OASIS_START
# DO NOT EDIT (digest: 74dad42b966e38504c0f3f573d675dbd)
misc/Cache
misc/FHashtbl
misc/FlatHashtbl
misc/Hashset
misc/Heap
misc/LazyGraph
misc/PersistentGraph
misc/PHashtbl
misc/SkipList
misc/SplayTree
misc/SplayMap
misc/Univ
misc/Bij
misc/PiCalculus
misc/Bencode
misc/Sexp
misc/RAL
misc/UnionFind
misc/SmallSet
misc/AbsSet
misc/CSM
misc/ActionMan
misc/QCheck
misc/BencodeOnDisk
misc/TTree
misc/HGraph
misc/Automaton
misc/Conv
misc/Bidir
misc/Iteratee
misc/Ty
misc/Tell
misc/BencodeStream
misc/RatTerm
misc/Cause
misc/AVL
# OASIS_STOP

64
core/META Normal file
View file

@ -0,0 +1,64 @@
# OASIS_START
# DO NOT EDIT (digest: 3290e6d132fccdad842c4889a82ab588)
version = "0.1"
description = "A bunch of modules, including polymorphic containers."
archive(byte) = "containers.cma"
archive(byte, plugin) = "containers.cma"
archive(native) = "containers.cmxa"
archive(native, plugin) = "containers.cmxs"
exists_if = "containers.cma"
package "thread" (
version = "0.1"
description = "A bunch of modules, including polymorphic containers."
requires = "containers threads lwt"
archive(byte) = "containers_thread.cma"
archive(byte, plugin) = "containers_thread.cma"
archive(native) = "containers_thread.cmxa"
archive(native, plugin) = "containers_thread.cmxs"
exists_if = "containers_thread.cma"
)
package "string" (
version = "0.1"
description = "A bunch of modules, including polymorphic containers."
archive(byte) = "containers_string.cma"
archive(byte, plugin) = "containers_string.cma"
archive(native) = "containers_string.cmxa"
archive(native, plugin) = "containers_string.cmxs"
exists_if = "containers_string.cma"
)
package "misc" (
version = "0.1"
description = "A bunch of modules, including polymorphic containers."
requires = "unix containers"
archive(byte) = "containers_misc.cma"
archive(byte, plugin) = "containers_misc.cma"
archive(native) = "containers_misc.cmxa"
archive(native, plugin) = "containers_misc.cmxs"
exists_if = "containers_misc.cma"
)
package "lwt" (
version = "0.1"
description = "A bunch of modules, including polymorphic containers."
requires = "containers lwt lwt.unix containers.misc"
archive(byte) = "containers_lwt.cma"
archive(byte, plugin) = "containers_lwt.cma"
archive(native) = "containers_lwt.cmxa"
archive(native, plugin) = "containers_lwt.cmxs"
exists_if = "containers_lwt.cma"
)
package "cgi" (
version = "0.1"
description = "A bunch of modules, including polymorphic containers."
requires = "containers CamlGI"
archive(byte) = "containers_cgi.cma"
archive(byte, plugin) = "containers_cgi.cma"
archive(native) = "containers_cgi.cmxa"
archive(native, plugin) = "containers_cgi.cmxs"
exists_if = "containers_cgi.cma"
)
# OASIS_STOP

23
core/containers.mldylib Normal file
View file

@ -0,0 +1,23 @@
# OASIS_START
# DO NOT EDIT (digest: f49e5e2f09b6b12af7e6ae013126d35f)
CCVector
CCDeque
CCGen
CCSequence
CCFQueue
CCMultiMap
CCMultiSet
CCBV
CCPrint
CCPersistentHashtbl
CCLeftistheap
CCList
CCOpt
CCPair
CCFun
CCHash
CCKList
CCInt
CCBool
CCArray
# OASIS_STOP

23
core/containers.mllib Normal file
View file

@ -0,0 +1,23 @@
# OASIS_START
# DO NOT EDIT (digest: f49e5e2f09b6b12af7e6ae013126d35f)
CCVector
CCDeque
CCGen
CCSequence
CCFQueue
CCMultiMap
CCMultiSet
CCBV
CCPrint
CCPersistentHashtbl
CCLeftistheap
CCList
CCOpt
CCPair
CCFun
CCHash
CCKList
CCInt
CCBool
CCArray
# OASIS_STOP

View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: bc144ef7b5b54947fab9662a822f9179)
Containers_lwt
# OASIS_STOP

4
lwt/containers_lwt.mllib Normal file
View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: bc144ef7b5b54947fab9662a822f9179)
Containers_lwt
# OASIS_STOP

View file

@ -0,0 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: 0baec9dfd3857e8cff12e40cdf9ce7db)
Behavior
Lwt_automaton
# OASIS_STOP

View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: 2df0608accd158542ebcb00720cfe599)
Containers_misc
# OASIS_STOP

View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: 2df0608accd158542ebcb00720cfe599)
Containers_misc
# OASIS_STOP

View file

@ -0,0 +1,39 @@
# OASIS_START
# DO NOT EDIT (digest: 172cd60f4b40396909554f6b5d21df63)
Cache
FHashtbl
FlatHashtbl
Hashset
Heap
LazyGraph
PersistentGraph
PHashtbl
SkipList
SplayTree
SplayMap
Univ
Bij
PiCalculus
Bencode
Sexp
RAL
UnionFind
SmallSet
AbsSet
CSM
ActionMan
QCheck
BencodeOnDisk
TTree
HGraph
Automaton
Conv
Bidir
Iteratee
Ty
Tell
BencodeStream
RatTerm
Cause
AVL
# OASIS_STOP

626
myocamlbuild.ml Normal file
View file

@ -0,0 +1,626 @@
(* OASIS_START *)
(* DO NOT EDIT (digest: 446468e76fe674ec3de56b3e7fbf2e8b) *)
module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.ml" *)
let ns_ str =
str
let s_ str =
str
let f_ (str: ('a, 'b, 'c, 'd) format4) =
str
let fn_ fmt1 fmt2 n =
if n = 1 then
fmt1^^""
else
fmt2^^""
let init =
[]
end
module OASISExpr = struct
(* # 22 "src/oasis/OASISExpr.ml" *)
open OASISGettext
type test = string
type flag = string
type t =
| EBool of bool
| ENot of t
| EAnd of t * t
| EOr of t * t
| EFlag of flag
| ETest of test * string
type 'a choices = (t * 'a) list
let eval var_get t =
let rec eval' =
function
| EBool b ->
b
| ENot e ->
not (eval' e)
| EAnd (e1, e2) ->
(eval' e1) && (eval' e2)
| EOr (e1, e2) ->
(eval' e1) || (eval' e2)
| EFlag nm ->
let v =
var_get nm
in
assert(v = "true" || v = "false");
(v = "true")
| ETest (nm, vl) ->
let v =
var_get nm
in
(v = vl)
in
eval' t
let choose ?printer ?name var_get lst =
let rec choose_aux =
function
| (cond, vl) :: tl ->
if eval var_get cond then
vl
else
choose_aux tl
| [] ->
let str_lst =
if lst = [] then
s_ "<empty>"
else
String.concat
(s_ ", ")
(List.map
(fun (cond, vl) ->
match printer with
| Some p -> p vl
| None -> s_ "<no printer>")
lst)
in
match name with
| Some nm ->
failwith
(Printf.sprintf
(f_ "No result for the choice list '%s': %s")
nm str_lst)
| None ->
failwith
(Printf.sprintf
(f_ "No result for a choice list: %s")
str_lst)
in
choose_aux (List.rev lst)
end
# 132 "myocamlbuild.ml"
module BaseEnvLight = struct
(* # 22 "src/base/BaseEnvLight.ml" *)
module MapString = Map.Make(String)
type t = string MapString.t
let default_filename =
Filename.concat
(Sys.getcwd ())
"setup.data"
let load ?(allow_empty=false) ?(filename=default_filename) () =
if Sys.file_exists filename then
begin
let chn =
open_in_bin filename
in
let st =
Stream.of_channel chn
in
let line =
ref 1
in
let st_line =
Stream.from
(fun _ ->
try
match Stream.next st with
| '\n' -> incr line; Some '\n'
| c -> Some c
with Stream.Failure -> None)
in
let lexer =
Genlex.make_lexer ["="] st_line
in
let rec read_file mp =
match Stream.npeek 3 lexer with
| [Genlex.Ident nm; Genlex.Kwd "="; Genlex.String value] ->
Stream.junk lexer;
Stream.junk lexer;
Stream.junk lexer;
read_file (MapString.add nm value mp)
| [] ->
mp
| _ ->
failwith
(Printf.sprintf
"Malformed data file '%s' line %d"
filename !line)
in
let mp =
read_file MapString.empty
in
close_in chn;
mp
end
else if allow_empty then
begin
MapString.empty
end
else
begin
failwith
(Printf.sprintf
"Unable to load environment, the file '%s' doesn't exist."
filename)
end
let rec var_expand str env =
let buff =
Buffer.create ((String.length str) * 2)
in
Buffer.add_substitute
buff
(fun var ->
try
var_expand (MapString.find var env) env
with Not_found ->
failwith
(Printf.sprintf
"No variable %s defined when trying to expand %S."
var
str))
str;
Buffer.contents buff
let var_get name env =
var_expand (MapString.find name env) env
let var_choose lst env =
OASISExpr.choose
(fun nm -> var_get nm env)
lst
end
# 237 "myocamlbuild.ml"
module MyOCamlbuildFindlib = struct
(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
(** OCamlbuild extension, copied from
* http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild
* by N. Pouillard and others
*
* Updated on 2009/02/28
*
* Modified by Sylvain Le Gall
*)
open Ocamlbuild_plugin
(* these functions are not really officially exported *)
let run_and_read =
Ocamlbuild_pack.My_unix.run_and_read
let blank_sep_strings =
Ocamlbuild_pack.Lexers.blank_sep_strings
let exec_from_conf exec =
let exec =
let env_filename = Pathname.basename BaseEnvLight.default_filename in
let env = BaseEnvLight.load ~filename:env_filename ~allow_empty:true () in
try
BaseEnvLight.var_get exec env
with Not_found ->
Printf.eprintf "W: Cannot get variable %s\n" exec;
exec
in
let fix_win32 str =
if Sys.os_type = "Win32" then begin
let buff = Buffer.create (String.length str) in
(* Adapt for windowsi, ocamlbuild + win32 has a hard time to handle '\\'.
*)
String.iter
(fun c -> Buffer.add_char buff (if c = '\\' then '/' else c))
str;
Buffer.contents buff
end else begin
str
end
in
fix_win32 exec
let split s ch =
let buf = Buffer.create 13 in
let x = ref [] in
let flush () =
x := (Buffer.contents buf) :: !x;
Buffer.clear buf
in
String.iter
(fun c ->
if c = ch then
flush ()
else
Buffer.add_char buf c)
s;
flush ();
List.rev !x
let split_nl s = split s '\n'
let before_space s =
try
String.before s (String.index s ' ')
with Not_found -> s
(* ocamlfind command *)
let ocamlfind x = S[Sh (exec_from_conf "ocamlfind"); x]
(* This lists all supported packages. *)
let find_packages () =
List.map before_space (split_nl & run_and_read "ocamlfind list")
(* Mock to list available syntaxes. *)
let find_syntaxes () = ["camlp4o"; "camlp4r"]
let well_known_syntax = [
"camlp4.quotations.o";
"camlp4.quotations.r";
"camlp4.exceptiontracer";
"camlp4.extend";
"camlp4.foldgenerator";
"camlp4.listcomprehension";
"camlp4.locationstripper";
"camlp4.macro";
"camlp4.mapgenerator";
"camlp4.metagenerator";
"camlp4.profiler";
"camlp4.tracer"
]
let dispatch =
function
| After_options ->
(* By using Before_options one let command line options have an higher
* priority on the contrary using After_options will guarantee to have
* the higher priority override default commands by ocamlfind ones *)
Options.ocamlc := ocamlfind & A"ocamlc";
Options.ocamlopt := ocamlfind & A"ocamlopt";
Options.ocamldep := ocamlfind & A"ocamldep";
Options.ocamldoc := ocamlfind & A"ocamldoc";
Options.ocamlmktop := ocamlfind & A"ocamlmktop";
Options.ocamlmklib := ocamlfind & A"ocamlmklib"
| After_rules ->
(* When one link an OCaml library/binary/package, one should use
* -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 ());
(* Like -package but for extensions syntax. Morover -syntax is useless
* when linking. *)
List.iter begin fun syntax ->
flag ["ocaml"; "compile"; "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"; "infer_interface"; "syntax_"^syntax] &
S[A"-syntax"; A syntax];
end (find_syntaxes ());
(* The default "thread" tag is not compatible with ocamlfind.
* Indeed, the default rules add the "threads.cma" or "threads.cmxa"
* options when using this tag. When using the "-linkpkg" option with
* ocamlfind, this module will then be added twice on the command line.
*
* To solve this, one approach is to add the "-thread" option when using
* the "threads" package using the previous plugin.
*)
flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]);
flag ["ocaml"; "pkg_threads"; "doc"] (S[A "-I"; A "+threads"]);
flag ["ocaml"; "pkg_threads"; "link"] (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
module MyOCamlbuildBase = struct
(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
(** Base functions for writing myocamlbuild.ml
@author Sylvain Le Gall
*)
open Ocamlbuild_plugin
module OC = Ocamlbuild_pack.Ocaml_compiler
type dir = string
type file = string
type name = string
type tag = string
(* # 62 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
type t =
{
lib_ocaml: (name * dir list * string list) list;
lib_c: (name * dir * file list) list;
flags: (tag list * (spec OASISExpr.choices)) list;
(* Replace the 'dir: include' from _tags by a precise interdepends in
* directory.
*)
includes: (dir * dir list) list;
}
let env_filename =
Pathname.basename
BaseEnvLight.default_filename
let dispatch_combine lst =
fun e ->
List.iter
(fun dispatch -> dispatch e)
lst
let tag_libstubs nm =
"use_lib"^nm^"_stubs"
let nm_libstubs nm =
nm^"_stubs"
let dispatch t e =
let env =
BaseEnvLight.load
~filename:env_filename
~allow_empty:true
()
in
match e with
| Before_options ->
let no_trailing_dot s =
if String.length s >= 1 && s.[0] = '.' then
String.sub s 1 ((String.length s) - 1)
else
s
in
List.iter
(fun (opt, var) ->
try
opt := no_trailing_dot (BaseEnvLight.var_get var env)
with Not_found ->
Printf.eprintf "W: Cannot get variable %s\n" var)
[
Options.ext_obj, "ext_obj";
Options.ext_lib, "ext_lib";
Options.ext_dll, "ext_dll";
]
| After_rules ->
(* Declare OCaml libraries *)
List.iter
(function
| nm, [], intf_modules ->
ocaml_lib nm;
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);
List.iter
(fun dir ->
List.iter
(fun str ->
flag ["ocaml"; "use_"^nm; str] (S[A"-I"; P dir]))
["compile"; "infer_interface"; "doc"])
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;
(* Declare directories dependencies, replace "include" in _tags. *)
List.iter
(fun (dir, include_dirs) ->
Pathname.define_context dir include_dirs)
t.includes;
(* Declare C libraries *)
List.iter
(fun (lib, dir, headers) ->
(* Handle C part of library *)
flag ["link"; "library"; "ocaml"; "byte"; tag_libstubs lib]
(S[A"-dllib"; A("-l"^(nm_libstubs lib)); A"-cclib";
A("-l"^(nm_libstubs lib))]);
flag ["link"; "library"; "ocaml"; "native"; tag_libstubs lib]
(S[A"-cclib"; A("-l"^(nm_libstubs lib))]);
flag ["link"; "program"; "ocaml"; "byte"; tag_libstubs lib]
(S[A"-dllib"; A("dll"^(nm_libstubs lib))]);
(* When ocaml link something that use the C library, then one
need that file to be up to date.
*)
dep ["link"; "ocaml"; "program"; 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)];
(* TODO: be more specific about what depends on headers *)
(* Depends on .h files *)
dep ["compile"; "c"]
headers;
(* Setup search path for lib *)
flag ["link"; "ocaml"; "use_"^lib]
(S[A"-I"; P(dir)]);
)
t.lib_c;
(* Add flags *)
List.iter
(fun (tags, cond_specs) ->
let spec = BaseEnvLight.var_choose cond_specs env in
let rec eval_specs =
function
| S lst -> S (List.map eval_specs lst)
| A str -> A (BaseEnvLight.var_expand str env)
| spec -> spec
in
flag tags & (eval_specs spec))
t.flags
| _ ->
()
let dispatch_default t =
dispatch_combine
[
dispatch t;
MyOCamlbuildFindlib.dispatch;
]
end
# 594 "myocamlbuild.ml"
open Ocamlbuild_plugin;;
let package_default =
{
MyOCamlbuildBase.lib_ocaml =
[
("containers", ["core"], []);
("containers_string", ["string"], []);
("containers_misc", ["misc"], []);
("containers_thread", ["threads"], []);
("containers_lwt", ["lwt"], []);
("containers_cgi", ["cgi"], [])
];
lib_c = [];
flags = [];
includes =
[
("threads", ["core"]);
("tests/lwt", ["core"; "lwt"]);
("tests", ["core"; "misc"; "string"]);
("misc", ["core"]);
("lwt", ["core"; "misc"]);
("examples/cgi", ["cgi"; "core"]);
("cgi", ["core"])
]
}
;;
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
# 625 "myocamlbuild.ml"
(* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;;

7627
setup.ml

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: c89cc456e050edff914368d7fbea4eca)
Containers_string
# OASIS_STOP

View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: c89cc456e050edff914368d7fbea4eca)
Containers_string
# OASIS_STOP

View file

@ -0,0 +1,6 @@
# OASIS_START
# DO NOT EDIT (digest: 743a23d1f0069e7d4c52271dfc2497d1)
KMP
CCString
Levenshtein
# OASIS_STOP

View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: adff855173c9b92b5478129af7d39e03)
Future
# OASIS_STOP

View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: adff855173c9b92b5478129af7d39e03)
Future
# OASIS_STOP