2
(* DO NOT EDIT (digest: 6a36af2626fc8bc901ff0b729583bf22) *)
2
(* DO NOT EDIT (digest: f445332011b20e926cbe52b8fd37e91b) *)
3
3
module OASISGettext = struct
4
# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISGettext.ml"
4
(* # 21 "/home/ysulsky/local/opam-full/4.00.1/build/oasis.0.3.0/src/oasis/OASISGettext.ml" *)
12
12
let f_ (str : ('a, 'b, 'c, 'd) format4) =
15
15
let fn_ fmt1 fmt2 n =
26
26
module OASISExpr = struct
27
# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISExpr.ml"
27
(* # 21 "/home/ysulsky/local/opam-full/4.00.1/build/oasis.0.3.0/src/oasis/OASISExpr.ml" *)
112
112
choose_aux (List.rev lst)
117
# 117 "myocamlbuild.ml"
117
118
module BaseEnvLight = struct
118
# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseEnvLight.ml"
119
(* # 21 "/home/ysulsky/local/opam-full/4.00.1/build/oasis.0.3.0/src/base/BaseEnvLight.ml" *)
120
121
module MapString = Map.Make(String)
122
123
type t = string MapString.t
124
125
let default_filename =
129
130
let load ?(allow_empty=false) ?(filename=default_filename) () =
130
131
if Sys.file_exists filename then
215
# 215 "myocamlbuild.ml"
214
216
module MyOCamlbuildFindlib = struct
215
# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml"
217
(* # 21 "/home/ysulsky/local/opam-full/4.00.1/build/oasis.0.3.0/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
217
219
(** OCamlbuild extension, copied from
218
220
* http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild
219
221
* by N. Pouillard and others
247
249
with Not_found -> !x
249
251
let split_nl s = split s '\n'
251
253
let before_space s =
253
255
String.before s (String.index s ' ')
254
256
with Not_found -> s
256
258
(* this lists all supported packages *)
257
259
let find_packages () =
258
260
List.map before_space (split_nl & run_and_read "ocamlfind list")
260
262
(* this is supposed to list available syntaxes, but I don't know how to do it. *)
261
263
let find_syntaxes () = ["camlp4o"; "camlp4r"]
263
265
(* ocamlfind command *)
264
266
let ocamlfind x = S[A"ocamlfind"; x]
268
270
| Before_options ->
301
303
flag ["ocaml"; "doc"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
302
304
flag ["ocaml"; "infer_interface"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
303
305
end (find_syntaxes ());
305
307
(* The default "thread" tag is not compatible with ocamlfind.
306
308
* Indeed, the default rules add the "threads.cma" or "threads.cmxa"
307
309
* options when using this tag. When using the "-linkpkg" option with
314
316
flag ["ocaml"; "pkg_threads"; "doc"] (S[A "-I"; A "+threads"]);
315
317
flag ["ocaml"; "pkg_threads"; "link"] (S[A "-thread"]);
316
318
flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"])
323
325
module MyOCamlbuildBase = struct
324
# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
326
(* # 21 "/home/ysulsky/local/opam-full/4.00.1/build/oasis.0.3.0/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
326
328
(** Base functions for writing myocamlbuild.ml
327
329
@author Sylvain Le Gall
332
334
open Ocamlbuild_plugin
335
module OC = Ocamlbuild_pack.Ocaml_compiler
334
337
type dir = string
335
338
type file = string
336
339
type name = string
337
340
type tag = string
339
# 55 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
342
(* # 56 "/home/ysulsky/local/opam-full/4.00.1/build/oasis.0.3.0/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
343
346
lib_ocaml: (name * dir list) list;
344
347
lib_c: (name * dir * file list) list;
345
348
flags: (tag list * (spec OASISExpr.choices)) list;
349
(* Replace the 'dir: include' from _tags by a precise interdepends in
352
includes: (dir * dir list) list;
348
355
let env_filename =
349
356
Pathname.basename
350
357
BaseEnvLight.default_filename
352
359
let dispatch_combine lst =
355
362
(fun dispatch -> dispatch e)
365
let tag_libstubs nm =
366
"use_lib"^nm^"_stubs"
358
371
let dispatch t e =
360
373
BaseEnvLight.load
381
394
Options.ext_lib, "ext_lib";
382
395
Options.ext_dll, "ext_dll";
386
399
(* Declare OCaml libraries *)
392
ocaml_lib ~dir:dir lib;
405
ocaml_lib ~dir:dir (dir^"/"^nm);
396
["ocaml"; "use_"^lib; "compile"]
410
flag ["ocaml"; "use_"^nm; str] (S[A"-I"; P dir]))
411
["compile"; "infer_interface"; "doc"])
415
(* Declare directories dependencies, replace "include" in _tags. *)
417
(fun (dir, include_dirs) ->
418
Pathname.define_context dir include_dirs)
401
421
(* Declare C libraries *)
403
423
(fun (lib, dir, headers) ->
404
424
(* Handle C part of library *)
405
flag ["link"; "library"; "ocaml"; "byte"; "use_lib"^lib]
406
(S[A"-dllib"; A("-l"^lib); A"-cclib"; A("-l"^lib)]);
408
flag ["link"; "library"; "ocaml"; "native"; "use_lib"^lib]
409
(S[A"-cclib"; A("-l"^lib)]);
425
flag ["link"; "library"; "ocaml"; "byte"; tag_libstubs lib]
426
(S[A"-dllib"; A("-l"^(nm_libstubs lib)); A"-cclib";
427
A("-l"^(nm_libstubs lib))]);
429
flag ["link"; "library"; "ocaml"; "native"; tag_libstubs lib]
430
(S[A"-cclib"; A("-l"^(nm_libstubs lib))]);
411
flag ["link"; "program"; "ocaml"; "byte"; "use_lib"^lib]
412
(S[A"-dllib"; A("dll"^lib)]);
432
flag ["link"; "program"; "ocaml"; "byte"; tag_libstubs lib]
433
(S[A"-dllib"; A("dll"^(nm_libstubs lib))]);
414
435
(* When ocaml link something that use the C library, then one
415
436
need that file to be up to date.
417
dep ["link"; "ocaml"; "program"; "use_lib"^lib]
418
[dir/"lib"^lib^"."^(!Options.ext_lib)];
420
dep ["compile"; "ocaml"; "program"; "use_lib"^lib]
421
[dir/"lib"^lib^"."^(!Options.ext_lib)];
438
dep ["link"; "ocaml"; "program"; tag_libstubs lib]
439
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
441
dep ["compile"; "ocaml"; "program"; tag_libstubs lib]
442
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
423
444
(* TODO: be more specific about what depends on headers *)
424
445
(* Depends on .h files *)
425
446
dep ["compile"; "c"]
428
449
(* Setup search path for lib *)
429
450
flag ["link"; "ocaml"; "use_"^lib]
430
451
(S[A"-I"; P(dir)]);
436
457
(fun (tags, cond_specs) ->
445
466
let dispatch_default t =
449
470
MyOCamlbuildFindlib.dispatch;
476
# 476 "myocamlbuild.ml"
455
477
open Ocamlbuild_plugin;;
456
478
let package_default =
458
480
MyOCamlbuildBase.lib_ocaml =
460
("lib/sexplib", ["lib"]);
461
("syntax/pa_sexp_conv", ["syntax"]);
462
("top/sexplib_top", ["top"])
482
("sexplib", ["lib"]);
483
("pa_sexp_conv", ["syntax"]);
484
("sexplib_top", ["top"])
488
includes = [("lib_test", ["lib"; "syntax"])];
469
492
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
471
# 472 "myocamlbuild.ml"
494
# 495 "myocamlbuild.ml"
474
Ocamlbuild_plugin.dispatch
477
| After_rules as e ->
479
flag ["ocamldep"; "ocaml"; "use_pa_sexp_conv"]
480
(S[A"-ppopt"; P"syntax/pa_sexp_conv.cma"]);
482
flag ["compile"; "ocaml"; "use_pa_sexp_conv"]
483
(S[A"-ppopt"; P"syntax/pa_sexp_conv.cma"]);
497
let dispatch = function
499
pflag ["ocaml"; "compile"] "I" (fun x -> S [A "-I"; A x]);
500
flag ["ocamldep"; "ocaml"; "use_pa_sexp_conv"]
501
(S [A "-ppopt"; P "syntax/pa_sexp_conv.cma"]);
502
flag ["compile"; "ocaml"; "use_pa_sexp_conv"]
503
(S [A "-ppopt"; P "syntax/pa_sexp_conv.cma"])
507
let () = Ocamlbuild_plugin.dispatch (fun hook -> dispatch hook; dispatch_default hook)