Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated to the latest OASIS (0.3.0~rc3) and disabled tests by default

  • Loading branch information...
commit e31d0e035f8cf0f1123a99311b8279108eb64ab4 1 parent f016385
Sergei Lebedev authored March 29, 2012
11  _oasis
... ...
@@ -1,16 +1,12 @@
1  
-OASISFormat: 0.2
2  
-Name:        ocaml-binary
  1
+OASISFormat: 0.3
  2
+Name:        binary
3 3
 Version:     0.1
4 4
 Synopsis:    Binary serialization of OCaml numeric types to and from strings.
5 5
 Authors:     Jane Street Capital, Sergei Lebedev
6 6
 License:     LGPL-2.1 with OCaml linking exception
7  
-Plugins:     DevFiles (0.2), META (0.2)
  7
+Plugins:     DevFiles (0.3), META (0.3)
8 8
 BuildTools: ocamlbuild
9 9
 
10  
-Flag tests
11  
-  Description: Build tests
12  
-  Default: true
13  
-
14 10
 Library "binary"
15 11
   Path:       src
16 12
   Modules:    Binary
@@ -26,4 +22,3 @@ Executable test
26 22
   BuildDepends:   kaputt, num
27 23
   NativeOpt:      -w @a
28 24
   ByteOpt:        -w @a
29  
-
4  _tags
... ...
@@ -1,5 +1,5 @@
1 1
 # OASIS_START
2  
-# DO NOT EDIT (digest: 6a97f219ea37e0d4b216a597cddf8240)
  2
+# DO NOT EDIT (digest: 08f37a2714d37d197e0f645700fcc852)
3 3
 # Ignore VCS directories, you can use the same kind of rule outside 
4 4
 # OASIS_START/STOP if you want to exclude directories that contains 
5 5
 # useless stuff for the build process
@@ -23,7 +23,7 @@
23 23
 <*.ml{,i}>: pkg_num
24 24
 <*.ml{,i}>: pkg_kaputt
25 25
 # Library binary
26  
-"src": include
  26
+"src/binary.cmxs": use_binary
27 27
 <src/binary.{cma,cmxa}>: oasis_library_binary_byte
28 28
 <src/*.ml{,i}>: oasis_library_binary_byte
29 29
 <src/binary.{cma,cmxa}>: oasis_library_binary_native
142  myocamlbuild.ml
... ...
@@ -1,7 +1,7 @@
1 1
 (* OASIS_START *)
2  
-(* DO NOT EDIT (digest: 3858adfae4d4bbb356ad6954359703de) *)
  2
+(* DO NOT EDIT (digest: 8ce03072f99121b62750789df8f3d628) *)
3 3
 module OASISGettext = struct
4  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISGettext.ml"
  4
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISGettext.ml"
5 5
   
6 6
   let ns_ str =
7 7
     str
@@ -24,7 +24,7 @@ module OASISGettext = struct
24 24
 end
25 25
 
26 26
 module OASISExpr = struct
27  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISExpr.ml"
  27
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISExpr.ml"
28 28
   
29 29
   
30 30
   
@@ -115,7 +115,7 @@ end
115 115
 
116 116
 
117 117
 module BaseEnvLight = struct
118  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/base/BaseEnvLight.ml"
  118
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/base/BaseEnvLight.ml"
119 119
   
120 120
   module MapString = Map.Make(String)
121 121
   
@@ -212,7 +212,7 @@ end
212 212
 
213 213
 
214 214
 module MyOCamlbuildFindlib = struct
215  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml"
  215
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml"
216 216
   
217 217
   (** OCamlbuild extension, copied from 
218 218
     * http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild
@@ -321,7 +321,7 @@ module MyOCamlbuildFindlib = struct
321 321
 end
322 322
 
323 323
 module MyOCamlbuildBase = struct
324  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
  324
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
325 325
   
326 326
   (** Base functions for writing myocamlbuild.ml
327 327
       @author Sylvain Le Gall
@@ -330,19 +330,24 @@ module MyOCamlbuildBase = struct
330 330
   
331 331
   
332 332
   open Ocamlbuild_plugin
  333
+  module OC = Ocamlbuild_pack.Ocaml_compiler
333 334
   
334 335
   type dir = string 
335 336
   type file = string 
336 337
   type name = string 
337 338
   type tag = string 
338 339
   
339  
-# 55 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
  340
+# 56 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
340 341
   
341 342
   type t =
342 343
       {
343 344
         lib_ocaml: (name * dir list) list;
344 345
         lib_c:     (name * dir * file list) list; 
345 346
         flags:     (tag list * (spec OASISExpr.choices)) list;
  347
+        (* Replace the 'dir: include' from _tags by a precise interdepends in
  348
+         * directory.
  349
+         *)
  350
+        includes:  (dir * dir list) list; 
346 351
       } 
347 352
   
348 353
   let env_filename =
@@ -355,6 +360,12 @@ module MyOCamlbuildBase = struct
355 360
         (fun dispatch -> dispatch e)
356 361
         lst 
357 362
   
  363
+  let tag_libstubs nm =
  364
+    "use_lib"^nm^"_stubs"
  365
+  
  366
+  let nm_libstubs nm =
  367
+    nm^"_stubs"
  368
+  
358 369
   let dispatch t e = 
359 370
     let env = 
360 371
       BaseEnvLight.load 
@@ -382,40 +393,123 @@ module MyOCamlbuildBase = struct
382 393
                   Options.ext_dll, "ext_dll";
383 394
                 ]
384 395
   
  396
+        | Before_rules ->
  397
+          (* TODO: move this into its own file and conditionnaly include it, if
  398
+           * needed.
  399
+           *)
  400
+          (* OCaml cmxs rules: cmxs available in ocamlopt but not ocamlbuild.
  401
+             Copied from ocaml_specific.ml in ocamlbuild sources. *)
  402
+          let has_native_dynlink =
  403
+            try
  404
+              bool_of_string (BaseEnvLight.var_get "native_dynlink" env)
  405
+            with Not_found ->
  406
+              false
  407
+          in
  408
+          if has_native_dynlink && String.sub Sys.ocaml_version 0 4 = "3.11" then
  409
+            begin
  410
+              let ext_lib = !Options.ext_lib in
  411
+              let ext_obj = !Options.ext_obj in
  412
+              let ext_dll = !Options.ext_dll in
  413
+              let x_o = "%"-.-ext_obj in
  414
+              let x_a = "%"-.-ext_lib in
  415
+              let x_dll = "%"-.-ext_dll in
  416
+              let x_p_o = "%.p"-.-ext_obj in
  417
+              let x_p_a = "%.p"-.-ext_lib in
  418
+              let x_p_dll = "%.p"-.-ext_dll in
  419
+  
  420
+              rule "ocaml: mldylib & p.cmx* & p.o* -> p.cmxs & p.so"
  421
+                   ~tags:["ocaml"; "native"; "profile"; "shared"; "library"]
  422
+                   ~prods:["%.p.cmxs"; x_p_dll]
  423
+                   ~dep:"%.mldylib"
  424
+                   (OC.native_profile_shared_library_link_mldylib
  425
+                      "%.mldylib" "%.p.cmxs");
  426
+  
  427
+              rule "ocaml: mldylib & cmx* & o* -> cmxs & so"
  428
+                   ~tags:["ocaml"; "native"; "shared"; "library"]
  429
+                   ~prods:["%.cmxs"; x_dll]
  430
+                   ~dep:"%.mldylib"
  431
+                   (OC.native_shared_library_link_mldylib
  432
+                      "%.mldylib" "%.cmxs");
  433
+  
  434
+              rule "ocaml: p.cmx & p.o -> p.cmxs & p.so"
  435
+                   ~tags:["ocaml"; "native"; "profile"; "shared"; "library"]
  436
+                   ~prods:["%.p.cmxs"; x_p_dll]
  437
+                   ~deps:["%.p.cmx"; x_p_o]
  438
+                   (OC.native_shared_library_link ~tags:["profile"]
  439
+                                                  "%.p.cmx" "%.p.cmxs");
  440
+  
  441
+              rule "ocaml: p.cmxa & p.a -> p.cmxs & p.so"
  442
+                   ~tags:["ocaml"; "native"; "profile"; "shared"; "library"]
  443
+                   ~prods:["%.p.cmxs"; x_p_dll]
  444
+                   ~deps:["%.p.cmxa"; x_p_a]
  445
+                   (OC.native_shared_library_link ~tags:["profile"; "linkall"]
  446
+                                                  "%.p.cmxa" "%.p.cmxs");
  447
+  
  448
+              rule "ocaml: cmx & o -> cmxs"
  449
+                   ~tags:["ocaml"; "native"; "shared"; "library"]
  450
+                   ~prods:["%.cmxs"]
  451
+                   ~deps:["%.cmx"; x_o]
  452
+                   (OC.native_shared_library_link "%.cmx" "%.cmxs");
  453
+  
  454
+              rule "ocaml: cmx & o -> cmxs & so"
  455
+                   ~tags:["ocaml"; "native"; "shared"; "library"]
  456
+                   ~prods:["%.cmxs"; x_dll]
  457
+                   ~deps:["%.cmx"; x_o]
  458
+                   (OC.native_shared_library_link "%.cmx" "%.cmxs");
  459
+  
  460
+              rule "ocaml: cmxa & a -> cmxs & so"
  461
+                   ~tags:["ocaml"; "native"; "shared"; "library"]
  462
+                   ~prods:["%.cmxs"; x_dll]
  463
+                   ~deps:["%.cmxa"; x_a]
  464
+                   (OC.native_shared_library_link ~tags:["linkall"]
  465
+                                                  "%.cmxa" "%.cmxs");
  466
+            end
  467
+  
385 468
         | After_rules -> 
386 469
             (* Declare OCaml libraries *)
387 470
             List.iter 
388 471
               (function
389  
-                 | lib, [] ->
390  
-                     ocaml_lib lib;
391  
-                 | lib, dir :: tl ->
392  
-                     ocaml_lib ~dir:dir lib;
  472
+                 | nm, [] ->
  473
+                     ocaml_lib nm
  474
+                 | nm, dir :: tl ->
  475
+                     ocaml_lib ~dir:dir (dir^"/"^nm);
393 476
                      List.iter 
394 477
                        (fun dir -> 
395  
-                          flag 
396  
-                            ["ocaml"; "use_"^lib; "compile"] 
397  
-                            (S[A"-I"; P dir]))
  478
+                          List.iter
  479
+                            (fun str ->
  480
+                               flag ["ocaml"; "use_"^nm; str] (S[A"-I"; P dir]))
  481
+                            ["compile"; "infer_interface"; "doc"])
398 482
                        tl)
399 483
               t.lib_ocaml;
400 484
   
  485
+            (* Declare directories dependencies, replace "include" in _tags. *)
  486
+            List.iter 
  487
+              (fun (dir, include_dirs) ->
  488
+                 Pathname.define_context dir include_dirs)
  489
+              t.includes;
  490
+  
401 491
             (* Declare C libraries *)
402 492
             List.iter
403 493
               (fun (lib, dir, headers) ->
404 494
                    (* 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)]);
  495
+                   flag ["link"; "library"; "ocaml"; "byte"; tag_libstubs lib]
  496
+                     (S[A"-dllib"; A("-l"^(nm_libstubs lib)); A"-cclib";
  497
+                        A("-l"^(nm_libstubs lib))]);
407 498
   
408  
-                   flag ["link"; "library"; "ocaml"; "native"; "use_lib"^lib]
409  
-                     (S[A"-cclib"; A("-l"^lib)]);
  499
+                   flag ["link"; "library"; "ocaml"; "native"; tag_libstubs lib]
  500
+                     (S[A"-cclib"; A("-l"^(nm_libstubs lib))]);
410 501
                         
411  
-                   flag ["link"; "program"; "ocaml"; "byte"; "use_lib"^lib]
412  
-                     (S[A"-dllib"; A("dll"^lib)]);
  502
+                   flag ["link"; "program"; "ocaml"; "byte"; tag_libstubs lib]
  503
+                     (S[A"-dllib"; A("dll"^(nm_libstubs lib))]);
413 504
   
414 505
                    (* When ocaml link something that use the C library, then one
415 506
                       need that file to be up to date.
416 507
                     *)
417  
-                   dep  ["link"; "ocaml"; "use_lib"^lib] 
418  
-                     [dir/"lib"^lib^"."^(!Options.ext_lib)];
  508
+                   dep  ["link"; "ocaml"; "program"; tag_libstubs lib]
  509
+                     [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
  510
+  
  511
+                   dep  ["compile"; "ocaml"; "program"; tag_libstubs lib]
  512
+                     [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
419 513
   
420 514
                    (* TODO: be more specific about what depends on headers *)
421 515
                    (* Depends on .h files *)
@@ -452,7 +546,7 @@ end
452 546
 open Ocamlbuild_plugin;;
453 547
 let package_default =
454 548
   {
455  
-     MyOCamlbuildBase.lib_ocaml = [("src/binary", ["src"])];
  549
+     MyOCamlbuildBase.lib_ocaml = [("binary", ["src"])];
456 550
      lib_c = [];
457 551
      flags =
458 552
        [
@@ -481,10 +575,12 @@ let package_default =
481 575
           (["oasis_library_binary_native"; "ocaml"; "compile"; "native"],
482 576
             [(OASISExpr.EBool true, S [A "-w"; A "@a"])])
483 577
        ];
  578
+     includes = [];
484 579
      }
485 580
   ;;
486 581
 
487 582
 let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
488 583
 
  584
+# 585 "myocamlbuild.ml"
489 585
 (* OASIS_STOP *)
490 586
 Ocamlbuild_plugin.dispatch dispatch_default;;
1,243  setup.ml
... ...
@@ -1,14 +1,14 @@
1  
-(* setup.ml generated for the first time by OASIS v0.2.0 *)
  1
+(* setup.ml generated for the first time by OASIS v0.3.0~rc3 *)
2 2
 
3 3
 (* OASIS_START *)
4  
-(* DO NOT EDIT (digest: d2b8d8a24c538b2cc4ae688fc9677822) *)
  4
+(* DO NOT EDIT (digest: 4be63c8ae3bf5807feb4131b7d8b53cb) *)
5 5
 (*
6  
-   Regenerated by OASIS v0.2.1~alpha1
  6
+   Regenerated by OASIS v0.3.0~rc3
7 7
    Visit http://oasis.forge.ocamlcore.org for more information and
8 8
    documentation about functions used in this file.
9 9
 *)
10 10
 module OASISGettext = struct
11  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISGettext.ml"
  11
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISGettext.ml"
12 12
   
13 13
   let ns_ str =
14 14
     str
@@ -31,7 +31,7 @@ module OASISGettext = struct
31 31
 end
32 32
 
33 33
 module OASISContext = struct
34  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISContext.ml"
  34
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISContext.ml"
35 35
   
36 36
   open OASISGettext
37 37
   
@@ -88,7 +88,9 @@ module OASISContext = struct
88 88
 end
89 89
 
90 90
 module OASISUtils = struct
91  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISUtils.ml"
  91
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISUtils.ml"
  92
+  
  93
+  open OASISGettext
92 94
   
93 95
   module MapString = Map.Make(String)
94 96
   
@@ -224,10 +226,23 @@ module OASISUtils = struct
224 226
   
225 227
   let failwithf fmt = Printf.ksprintf failwith fmt
226 228
   
  229
+  let file_exists fn = 
  230
+    let dirname = Filename.dirname fn in
  231
+    let basename = Filename.basename fn in
  232
+      if Sys.file_exists dirname then
  233
+        if basename = Filename.current_dir_name then
  234
+          true
  235
+        else
  236
+          List.mem
  237
+            basename
  238
+            (Array.to_list (Sys.readdir dirname))
  239
+      else
  240
+        false
  241
+  
227 242
 end
228 243
 
229 244
 module PropList = struct
230  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/PropList.ml"
  245
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/PropList.ml"
231 246
   
232 247
   open OASISGettext
233 248
   
@@ -237,18 +252,23 @@ module PropList = struct
237 252
   exception No_printer of name
238 253
   exception Unknown_field of name * name
239 254
   
240  
-  let string_of_exception =
241  
-    function
242  
-      | Not_set (nm, Some rsn) ->
243  
-          Printf.sprintf (f_ "Field '%s' is not set: %s") nm rsn
244  
-      | Not_set (nm, None) ->
245  
-          Printf.sprintf (f_ "Field '%s' is not set") nm
246  
-      | No_printer nm ->
247  
-          Printf.sprintf (f_ "No default printer for value %s") nm
248  
-      | Unknown_field (nm, schm) ->
249  
-          Printf.sprintf (f_ "Field %s is not defined in schema %s") nm schm
250  
-      | e ->
251  
-          raise e
  255
+  let () =
  256
+    Printexc.register_printer
  257
+      (function
  258
+         | Not_set (nm, Some rsn) ->
  259
+             Some 
  260
+               (Printf.sprintf (f_ "Field '%s' is not set: %s") nm rsn)
  261
+         | Not_set (nm, None) ->
  262
+             Some 
  263
+               (Printf.sprintf (f_ "Field '%s' is not set") nm)
  264
+         | No_printer nm ->
  265
+             Some
  266
+               (Printf.sprintf (f_ "No default printer for value %s") nm)
  267
+         | Unknown_field (nm, schm) ->
  268
+             Some 
  269
+               (Printf.sprintf (f_ "Field %s is not defined in schema %s") nm schm)
  270
+         | _ ->
  271
+             None)
252 272
   
253 273
   module Data =
254 274
   struct
@@ -262,7 +282,7 @@ module PropList = struct
262 282
     let clear t =
263 283
       Hashtbl.clear t
264 284
   
265  
-# 66 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/PropList.ml"
  285
+# 71 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/PropList.ml"
266 286
   end
267 287
   
268 288
   module Schema =
@@ -503,7 +523,7 @@ module PropList = struct
503 523
 end
504 524
 
505 525
 module OASISMessage = struct
506  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISMessage.ml"
  526
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISMessage.ml"
507 527
   
508 528
   
509 529
   open OASISGettext
@@ -535,24 +555,10 @@ module OASISMessage = struct
535 555
   let error ~ctxt fmt =
536 556
     generic_message ~ctxt `Error fmt
537 557
   
538  
-  
539  
-  let string_of_exception e =
540  
-    try
541  
-      PropList.string_of_exception e
542  
-    with
543  
-      | Failure s ->
544  
-          s
545  
-      | e ->
546  
-          Printexc.to_string e
547  
-  
548  
-  (* TODO
549  
-  let register_exn_printer f =
550  
-   *)
551  
-  
552 558
 end
553 559
 
554 560
 module OASISVersion = struct
555  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISVersion.ml"
  561
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISVersion.ml"
556 562
   
557 563
   open OASISGettext
558 564
   
@@ -740,7 +746,7 @@ module OASISVersion = struct
740 746
 end
741 747
 
742 748
 module OASISLicense = struct
743  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISLicense.ml"
  749
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISLicense.ml"
744 750
   
745 751
   (** License for _oasis fields
746 752
       @author Sylvain Le Gall
@@ -773,7 +779,7 @@ module OASISLicense = struct
773 779
 end
774 780
 
775 781
 module OASISExpr = struct
776  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISExpr.ml"
  782
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISExpr.ml"
777 783
   
778 784
   
779 785
   
@@ -863,7 +869,7 @@ module OASISExpr = struct
863 869
 end
864 870
 
865 871
 module OASISTypes = struct
866  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISTypes.ml"
  872
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISTypes.ml"
867 873
   
868 874
   
869 875
   
@@ -940,7 +946,7 @@ module OASISTypes = struct
940 946
   
941 947
   type plugin_data = (all_plugin * plugin_data_purpose * (unit -> unit)) list
942 948
   
943  
-# 102 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISTypes.ml"
  949
+# 102 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISTypes.ml"
944 950
   
945 951
   type 'a conditional = 'a OASISExpr.choices 
946 952
   
@@ -981,6 +987,7 @@ module OASISTypes = struct
981 987
   type library =
982 988
       {
983 989
         lib_modules:            string list;
  990
+        lib_pack:               bool;
984 991
         lib_internal_modules:   string list;
985 992
         lib_findlib_parent:     findlib_name option;
986 993
         lib_findlib_name:       findlib_name option;
@@ -1097,7 +1104,7 @@ module OASISTypes = struct
1097 1104
 end
1098 1105
 
1099 1106
 module OASISUnixPath = struct
1100  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISUnixPath.ml"
  1107
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISUnixPath.ml"
1101 1108
   
1102 1109
   type unix_filename = string
1103 1110
   type unix_dirname = string
@@ -1176,7 +1183,8 @@ module OASISUnixPath = struct
1176 1183
 end
1177 1184
 
1178 1185
 module OASISSection = struct
1179  
-# 1 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISSection.ml"
  1186
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISSection.ml"
  1187
+  
1180 1188
   open OASISTypes
1181 1189
   
1182 1190
   let section_kind_common = 
@@ -1230,12 +1238,12 @@ module OASISSection = struct
1230 1238
 end
1231 1239
 
1232 1240
 module OASISBuildSection = struct
1233  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISBuildSection.ml"
  1241
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISBuildSection.ml"
1234 1242
   
1235 1243
 end
1236 1244
 
1237 1245
 module OASISExecutable = struct
1238  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISExecutable.ml"
  1246
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISExecutable.ml"
1239 1247
   
1240 1248
   open OASISTypes
1241 1249
   
@@ -1259,14 +1267,14 @@ module OASISExecutable = struct
1259 1267
       if not is_native_exec && 
1260 1268
          not exec.exec_custom && 
1261 1269
          bs.bs_c_sources <> [] then
1262  
-        Some (dir^"/dll"^cs.cs_name^(ext_dll ()))
  1270
+        Some (dir^"/dll"^cs.cs_name^"_stubs"^(ext_dll ()))
1263 1271
       else
1264 1272
         None
1265 1273
   
1266 1274
 end
1267 1275
 
1268 1276
 module OASISLibrary = struct
1269  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISLibrary.ml"
  1277
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISLibrary.ml"
1270 1278
   
1271 1279
   open OASISTypes
1272 1280
   open OASISUtils
@@ -1274,40 +1282,116 @@ module OASISLibrary = struct
1274 1282
   
1275 1283
   type library_name = name
1276 1284
   
1277  
-  let generated_unix_files ~ctxt (cs, bs, lib)
1278  
-        source_file_exists is_native ext_lib ext_dll =
  1285
+  (* Look for a module file, considering capitalization or not. *)
  1286
+  let find_module source_file_exists (cs, bs, lib) modul =
  1287
+    let possible_base_fn =
  1288
+      List.map
  1289
+        (OASISUnixPath.concat bs.bs_path)
  1290
+        [modul;
  1291
+         OASISUnixPath.uncapitalize_file modul;
  1292
+         OASISUnixPath.capitalize_file modul]
  1293
+    in
  1294
+      (* TODO: we should be able to be able to determine the source for every
  1295
+       * files. Hence we should introduce a Module(source: fn) for the fields
  1296
+       * Modules and InternalModules
  1297
+       *)
  1298
+      List.fold_left
  1299
+        (fun acc base_fn ->
  1300
+           match acc with
  1301
+             | `No_sources _ ->
  1302
+                 begin
  1303
+                   let file_found =
  1304
+                     List.fold_left
  1305
+                       (fun acc ext ->
  1306
+                          if source_file_exists (base_fn^ext) then
  1307
+                            (base_fn^ext) :: acc
  1308
+                          else
  1309
+                            acc)
  1310
+                       []
  1311
+                       [".ml"; ".mli"; ".mll"; ".mly"]
  1312
+                   in
  1313
+                     match file_found with
  1314
+                       | [] ->
  1315
+                           acc
  1316
+                       | lst ->
  1317
+                           `Sources (base_fn, lst)
  1318
+                 end
  1319
+             | `Sources _ ->
  1320
+                 acc)
  1321
+        (`No_sources possible_base_fn)
  1322
+        possible_base_fn
  1323
+  
  1324
+  let source_unix_files ~ctxt (cs, bs, lib) source_file_exists =
  1325
+    List.fold_left
  1326
+      (fun acc modul ->
  1327
+         match find_module source_file_exists (cs, bs, lib) modul with
  1328
+           | `Sources (base_fn, lst) ->
  1329
+               (base_fn, lst) :: acc
  1330
+           | `No_sources _ ->
  1331
+               OASISMessage.warning
  1332
+                 ~ctxt
  1333
+                 (f_ "Cannot find source file matching \
  1334
+                      module '%s' in library %s")
  1335
+                 modul cs.cs_name;
  1336
+               acc)
  1337
+      []
  1338
+      (lib.lib_modules @ lib.lib_internal_modules)
  1339
+  
  1340
+  let generated_unix_files
  1341
+        ~ctxt
  1342
+        ~is_native
  1343
+        ~has_native_dynlink
  1344
+        ~ext_lib
  1345
+        ~ext_dll
  1346
+        ~source_file_exists
  1347
+        (cs, bs, lib) =
  1348
+  
  1349
+    let find_modules lst ext = 
  1350
+      let find_module modul =
  1351
+        match find_module source_file_exists (cs, bs, lib) modul with
  1352
+          | `Sources (base_fn, _) ->
  1353
+              [base_fn]
  1354
+          | `No_sources lst ->
  1355
+              OASISMessage.warning
  1356
+                ~ctxt
  1357
+                (f_ "Cannot find source file matching \
  1358
+                     module '%s' in library %s")
  1359
+                modul cs.cs_name;
  1360
+              lst
  1361
+      in
  1362
+      List.map 
  1363
+        (fun nm -> 
  1364
+           List.map 
  1365
+             (fun base_fn -> base_fn ^"."^ext)
  1366
+             (find_module nm))
  1367
+        lst
  1368
+    in
  1369
+  
1279 1370
     (* The headers that should be compiled along *)
1280 1371
     let headers =
1281  
-      List.fold_left
1282  
-        (fun hdrs modul ->
1283  
-           try
1284  
-             let base_fn =
1285  
-               List.find
1286  
-                 (fun fn ->
1287  
-                    source_file_exists (fn^".ml") ||
1288  
-                    source_file_exists (fn^".mli") ||
1289  
-                    source_file_exists (fn^".mll") ||
1290  
-                    source_file_exists (fn^".mly"))
1291  
-                 (List.map
1292  
-                    (OASISUnixPath.concat bs.bs_path)
1293  
-                    [modul;
1294  
-                     OASISUnixPath.uncapitalize_file modul;
1295  
-                     OASISUnixPath.capitalize_file modul])
1296  
-             in
1297  
-               [base_fn^".cmi"] :: hdrs
1298  
-           with Not_found ->
1299  
-             OASISMessage.warning
1300  
-               ~ctxt
1301  
-               (f_ "Cannot find source file matching \
1302  
-                    module '%s' in library %s")
1303  
-               modul cs.cs_name;
1304  
-               (List.map (OASISUnixPath.concat bs.bs_path)
1305  
-                  [modul^".cmi";
1306  
-                   OASISUnixPath.uncapitalize_file modul ^ ".cmi";
1307  
-                   OASISUnixPath.capitalize_file modul ^ ".cmi"])
1308  
-               :: hdrs)
  1372
+      if lib.lib_pack then
1309 1373
         []
1310  
-        lib.lib_modules
  1374
+      else
  1375
+        find_modules
  1376
+          lib.lib_modules
  1377
+          "cmi"
  1378
+    in
  1379
+  
  1380
+    (* The .cmx that be compiled along *)
  1381
+    let cmxs =
  1382
+      let should_be_built =
  1383
+        (not lib.lib_pack) && (* Do not install .cmx packed submodules *)
  1384
+        match bs.bs_compiled_object with
  1385
+          | Native -> true
  1386
+          | Best -> is_native
  1387
+          | Byte -> false
  1388
+      in
  1389
+        if should_be_built then
  1390
+          find_modules
  1391
+            (lib.lib_modules @ lib.lib_internal_modules)
  1392
+            "cmx"
  1393
+        else
  1394
+          []
1311 1395
     in
1312 1396
   
1313 1397
     let acc_nopath =
@@ -1316,16 +1400,27 @@ module OASISLibrary = struct
1316 1400
   
1317 1401
     (* Compute what libraries should be built *)
1318 1402
     let acc_nopath =
  1403
+      (* Add the packed header file if required *)
  1404
+      let add_pack_header acc =
  1405
+        if lib.lib_pack then
  1406
+          [cs.cs_name^".cmi"] :: acc
  1407
+        else
  1408
+          acc
  1409
+      in
1319 1410
       let byte acc =
1320  
-        [cs.cs_name^".cma"] :: acc
  1411
+        add_pack_header ([cs.cs_name^".cma"] :: acc)
1321 1412
       in
1322 1413
       let native acc =
1323  
-        [cs.cs_name^".cmxa"] :: [cs.cs_name^(ext_lib ())] :: acc
  1414
+        let acc = [cs.cs_name^".cmxa"] :: [cs.cs_name^ext_lib] :: acc in
  1415
+        add_pack_header
  1416
+          (if has_native_dynlink then
  1417
+             [cs.cs_name^".cmxs"] :: acc
  1418
+           else acc)
1324 1419
       in
1325 1420
         match bs.bs_compiled_object with
1326 1421
           | Native ->
1327 1422
               byte (native acc_nopath)
1328  
-          | Best when is_native () ->
  1423
+          | Best when is_native ->
1329 1424
               byte (native acc_nopath)
1330 1425
           | Byte | Best ->
1331 1426
               byte acc_nopath
@@ -1335,9 +1430,9 @@ module OASISLibrary = struct
1335 1430
     let acc_nopath =
1336 1431
       if bs.bs_c_sources <> [] then
1337 1432
         begin
1338  
-          ["lib"^cs.cs_name^(ext_lib ())]
  1433
+          ["lib"^cs.cs_name^"_stubs"^ext_lib]
1339 1434
           ::
1340  
-          ["dll"^cs.cs_name^(ext_dll ())]
  1435
+          ["dll"^cs.cs_name^"_stubs"^ext_dll]
1341 1436
           ::
1342 1437
           acc_nopath
1343 1438
         end
@@ -1351,7 +1446,7 @@ module OASISLibrary = struct
1351 1446
            (List.rev_map
1352 1447
               (OASISUnixPath.concat bs.bs_path))
1353 1448
            acc_nopath)
1354  
-        headers
  1449
+        (headers @ cmxs)
1355 1450
   
1356 1451
   
1357 1452
   type group_t =
@@ -1557,33 +1652,33 @@ module OASISLibrary = struct
1557 1652
 end
1558 1653
 
1559 1654
 module OASISFlag = struct
1560  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISFlag.ml"
  1655
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISFlag.ml"
1561 1656
   
1562 1657
 end
1563 1658
 
1564 1659
 module OASISPackage = struct
1565  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISPackage.ml"
  1660
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISPackage.ml"
1566 1661
   
1567 1662
 end
1568 1663
 
1569 1664
 module OASISSourceRepository = struct
1570  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISSourceRepository.ml"
  1665
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISSourceRepository.ml"
1571 1666
   
1572 1667
 end
1573 1668
 
1574 1669
 module OASISTest = struct
1575  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISTest.ml"
  1670
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISTest.ml"
1576 1671
   
1577 1672
 end
1578 1673
 
1579 1674
 module OASISDocument = struct
1580  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/oasis/OASISDocument.ml"
  1675
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/oasis/OASISDocument.ml"
1581 1676
   
1582 1677
 end
1583 1678
 
1584 1679
 
1585 1680
 module BaseEnvLight = struct
1586  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/base/BaseEnvLight.ml"
  1681
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/base/BaseEnvLight.ml"
1587 1682
   
1588 1683
   module MapString = Map.Make(String)
1589 1684
   
@@ -1680,7 +1775,7 @@ end
1680 1775
 
1681 1776
 
1682 1777
 module BaseContext = struct
1683  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/base/BaseContext.ml"
  1778
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/base/BaseContext.ml"
1684 1779
   
1685 1780
   open OASISContext
1686 1781
   
@@ -1691,7 +1786,7 @@ module BaseContext = struct
1691 1786
 end
1692 1787
 
1693 1788
 module BaseMessage = struct
1694  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/base/BaseMessage.ml"
  1789
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/base/BaseMessage.ml"
1695 1790
   
1696 1791
   (** Message to user, overrid for Base
1697 1792
       @author Sylvain Le Gall
@@ -1707,12 +1802,10 @@ module BaseMessage = struct
1707 1802
   
1708 1803
   let error fmt = error ~ctxt:!default fmt
1709 1804
   
1710  
-  let string_of_exception = string_of_exception
1711  
-  
1712 1805
 end
1713 1806
 
1714 1807
 module BaseFilePath = struct
1715  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/base/BaseFilePath.ml"
  1808
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/base/BaseFilePath.ml"
1716 1809
   
1717 1810
   
1718 1811
   open Filename
@@ -1744,7 +1837,7 @@ module BaseFilePath = struct
1744 1837
 end
1745 1838
 
1746 1839
 module BaseEnv = struct
1747  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/base/BaseEnv.ml"
  1840
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/base/BaseEnv.ml"
1748 1841
   
1749 1842
   open OASISGettext
1750 1843
   open OASISUtils
@@ -1884,9 +1977,9 @@ module BaseEnv = struct
1884 1977
   
1885 1978
     let default =
1886 1979
       [
1887  
-        OFileLoad, lazy (MapString.find name !env_from_file);
  1980
+        OFileLoad, (fun () -> MapString.find name !env_from_file);
1888 1981
         ODefault,  dflt;
1889  
-        OGetEnv,   lazy (Sys.getenv name);
  1982
+        OGetEnv,   (fun () -> Sys.getenv name);
1890 1983
       ]
1891 1984
     in
1892 1985
   
@@ -1905,11 +1998,11 @@ module BaseEnv = struct
1905 1998
     let var_get_low lst =
1906 1999
       let errors, res =
1907 2000
         List.fold_left
1908  
-          (fun (errors, res) (_, v) ->
  2001
+          (fun (errors, res) (o, v) ->
1909 2002
              if res = None then
1910 2003
                begin
1911 2004
                  try
1912  
-                   errors, Some (Lazy.force v)
  2005
+                   errors, Some (v ())
1913 2006
                  with
1914 2007
                    | Not_found ->
1915 2008
                         errors, res
@@ -1923,12 +2016,7 @@ module BaseEnv = struct
1923 2016
           ([], None)
1924 2017
           (List.sort
1925 2018
              (fun (o1, _) (o2, _) ->
1926  
-                if o1 < o2 then
1927  
-                 1
1928  
-                else if o1 = o2 then
1929  
-                  0
1930  
-                else
1931  
-                 -1)
  2019
+                Pervasives.compare o2 o1)
1932 2020
              lst)
1933 2021
       in
1934 2022
         match res, errors with
@@ -1950,7 +2038,7 @@ module BaseEnv = struct
1950 2038
       FieldRO.create
1951 2039
         ~schema
1952 2040
         ~name
1953  
-        ~parse:(fun ?(context=ODefault) s -> [context, lazy s])
  2041
+        ~parse:(fun ?(context=ODefault) s -> [context, fun () -> s])
1954 2042
         ~print:var_get_low
1955 2043
         ~default
1956 2044
         ~update:(fun ?context x old_x -> x @ old_x)
@@ -1972,7 +2060,8 @@ module BaseEnv = struct
1972 2060
         dflt =
1973 2061
     if Schema.mem schema name then
1974 2062
       begin
1975  
-        Schema.set schema env ~context:ODefault name (Lazy.force dflt);
  2063
+        (* TODO: look suspsicious, we want to memorize dflt not dflt () *)
  2064
+        Schema.set schema env ~context:ODefault name (dflt ());
1976 2065
         fun () -> var_get name
1977 2066
       end
1978 2067
     else
@@ -1998,7 +2087,7 @@ module BaseEnv = struct
1998 2087
       ~cli:CLIAuto
1999 2088
       ~arg_help:"Print even non-printable variable. (debug)"
2000 2089
       "print_hidden"
2001  
-      (lazy "false")
  2090
+      (fun () -> "false")
2002 2091
   
2003 2092
   let var_all () =
2004 2093
     List.rev
@@ -2018,7 +2107,6 @@ module BaseEnv = struct
2018 2107
     env_from_file := BaseEnvLight.load ?allow_empty ?filename ()
2019 2108
   
2020 2109
   let unload () =
2021  
-    (* TODO: reset lazy values *)
2022 2110
     env_from_file := MapString.empty;
2023 2111
     Data.clear env
2024 2112
   
@@ -2026,8 +2114,13 @@ module BaseEnv = struct
2026 2114
     let chn =
2027 2115
       open_out_bin filename
2028 2116
     in
2029  
-      Schema.iter
2030  
-        (fun nm def _ ->
  2117
+    let output nm value = 
  2118
+      Printf.fprintf chn "%s=%S\n" nm value
  2119
+    in
  2120
+    let mp_todo = 
  2121
+      (* Dump data from schema *)
  2122
+      Schema.fold
  2123
+        (fun mp_todo nm def _ ->
2031 2124
            if def.dump then
2032 2125
              begin
2033 2126
                try
@@ -2037,11 +2130,18 @@ module BaseEnv = struct
2037 2130
                      env
2038 2131
                      nm
2039 2132
                  in
2040  
-                   Printf.fprintf chn "%s = %S\n" nm value
  2133
+                   output nm value
2041 2134
                with Not_set _ ->
2042 2135
                  ()
2043  
-             end)
2044  
-        schema;
  2136
+             end;
  2137
+           MapString.remove nm mp_todo)
  2138
+        !env_from_file
  2139
+        schema
  2140
+    in
  2141
+      (* Dump data defined outside of schema *)
  2142
+      MapString.iter output mp_todo;
  2143
+  
  2144
+      (* End of the dump *)
2045 2145
       close_out chn
2046 2146
   
2047 2147
   let print () =
@@ -2173,23 +2273,21 @@ module BaseEnv = struct
2173 2273
                        Printf.sprintf (f_ "%s %s%s") arg_hlp hlp default_value
2174 2274
                      ]
2175 2275
                  | CLIEnable ->
2176  
-                     [
2177  
-                       arg_concat "--enable-" arg_name,
2178  
-                       Arg.Unit (fun () -> var_set "true"),
2179  
-                       Printf.sprintf (f_ " %s%s") hlp
2180  
-                         (if default_value = " [true]" then
2181  
-                            (s_ " [default]")
2182  
-                          else
2183  
-                            "");
2184  
-  
2185  
-                       arg_concat "--disable-" arg_name,
2186  
-                       Arg.Unit (fun () -> var_set "false"),
2187  
-                       Printf.sprintf (f_ " %s%s") hlp
2188  
-                         (if default_value = " [false]" then
2189  
-                            (s_ " [default]")
2190  
-                          else
2191  
-                            "");
2192  
-                     ]
  2276
+                     let dflt =
  2277
+                       if default_value = " [true]" then
  2278
+                         s_ " [default: enabled]"
  2279
+                       else
  2280
+                         s_ " [default: disabled]"
  2281
+                     in
  2282
+                       [
  2283
+                         arg_concat "--enable-" arg_name,
  2284
+                         Arg.Unit (fun () -> var_set "true"),
  2285
+                         Printf.sprintf (f_ " %s%s") hlp dflt;
  2286
+  
  2287
+                         arg_concat "--disable-" arg_name,
  2288
+                         Arg.Unit (fun () -> var_set "false"),
  2289
+                         Printf.sprintf (f_ " %s%s") hlp dflt
  2290
+                       ]
2193 2291
                  | CLIUser lst ->
2194 2292
                      lst
2195 2293
              in
@@ -2199,7 +2297,7 @@ module BaseEnv = struct
2199 2297
 end
2200 2298
 
2201 2299
 module BaseExec = struct
2202  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/base/BaseExec.ml"
  2300
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/base/BaseExec.ml"
2203 2301
   
2204 2302
   open OASISGettext
2205 2303
   open OASISUtils
@@ -2259,7 +2357,7 @@ module BaseExec = struct
2259 2357
 end
2260 2358
 
2261 2359
 module BaseFileUtil = struct
2262  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/base/BaseFileUtil.ml"
  2360
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/base/BaseFileUtil.ml"
2263 2361
   
2264 2362
   open OASISGettext
2265 2363
   
@@ -2301,7 +2399,7 @@ module BaseFileUtil = struct
2301 2399
         ((combined_paths paths) * exts)
2302 2400
     in
2303 2401
       List.find
2304  
-        Sys.file_exists
  2402
+        OASISUtils.file_exists
2305 2403
         alternatives
2306 2404
   
2307 2405
   let which prg =
@@ -2364,7 +2462,7 @@ module BaseFileUtil = struct
2364 2462
     let tgt =
2365 2463
       fix_dir tgt
2366 2464
     in
2367  
-      if Sys.file_exists tgt then
  2465
+      if OASISUtils.file_exists tgt then
2368 2466
         begin
2369 2467
           if not (Sys.is_directory tgt) then
2370 2468
             OASISUtils.failwithf
@@ -2375,7 +2473,7 @@ module BaseFileUtil = struct
2375 2473
       else
2376 2474
         begin
2377 2475
           mkdir_parent f (Filename.dirname tgt);
2378  
-          if not (Sys.file_exists tgt) then
  2476
+          if not (OASISUtils.file_exists tgt) then
2379 2477
             begin
2380 2478
               f tgt;
2381 2479
               mkdir tgt
@@ -2429,7 +2527,7 @@ module BaseFileUtil = struct
2429 2527
        end
2430 2528
      else
2431 2529
        begin
2432  
-         if Sys.file_exists fn then
  2530
+         if OASISUtils.file_exists fn then
2433 2531
            [fn]
2434 2532
          else
2435 2533
            []
@@ -2437,7 +2535,7 @@ module BaseFileUtil = struct
2437 2535
 end
2438 2536
 
2439 2537
 module BaseArgExt = struct
2440  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/base/BaseArgExt.ml"
  2538
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/base/BaseArgExt.ml"
2441 2539
   
2442 2540
   open OASISUtils
2443 2541
   open OASISGettext
@@ -2465,7 +2563,7 @@ module BaseArgExt = struct
2465 2563
 end
2466 2564
 
2467 2565
 module BaseCheck = struct
2468  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/base/BaseCheck.ml"
  2566
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/base/BaseCheck.ml"
2469 2567
   
2470 2568
   open BaseEnv
2471 2569
   open BaseMessage
@@ -2475,24 +2573,24 @@ module BaseCheck = struct
2475 2573
   let prog_best prg prg_lst =
2476 2574
     var_redefine
2477 2575
       prg
2478  
-      (lazy
2479  
-         (let alternate =
2480  
-            List.fold_left
2481  
-              (fun res e ->
2482  
-                 match res with
2483  
-                   | Some _ ->
2484  
-                       res
2485  
-                   | None ->
2486  
-                       try
2487  
-                         Some (BaseFileUtil.which e)
2488  
-                       with Not_found ->
2489  
-                         None)
2490  
-              None
2491  
-              prg_lst
2492  
-          in
2493  
-            match alternate with
2494  
-              | Some prg -> prg
2495  
-              | None -> raise Not_found))
  2576
+      (fun () ->
  2577
+         let alternate =
  2578
+           List.fold_left
  2579
+             (fun res e ->
  2580
+                match res with
  2581
+                  | Some _ ->
  2582
+                      res
  2583
+                  | None ->
  2584
+                      try
  2585
+                        Some (BaseFileUtil.which e)
  2586
+                      with Not_found ->
  2587
+                        None)
  2588
+             None
  2589
+             prg_lst
  2590
+         in
  2591
+           match alternate with
  2592
+             | Some prg -> prg
  2593
+             | None -> raise Not_found)
2496 2594
   
2497 2595
   let prog prg =
2498 2596
     prog_best prg [prg]
@@ -2515,33 +2613,33 @@ module BaseCheck = struct
2515 2613
       var_redefine
2516 2614
         ~hide:true
2517 2615
         var
2518  
-        (lazy
2519  
-           (let version_str =
2520  
-              match fversion () with
2521  
-                | "[Distributed with OCaml]" ->
2522  
-                    begin
2523  
-                      try
2524  
-                        (var_get "ocaml_version")
2525  
-                      with Not_found ->
2526  
-                        warning
2527  
-                          (f_ "Variable ocaml_version not defined, fallback \
2528  
-                               to default");
2529  
-                        Sys.ocaml_version
2530  
-                    end
2531  
-                | res ->
2532  
-                    res
2533  
-            in
2534  
-            let version =
2535  
-              OASISVersion.version_of_string version_str
2536  
-            in
2537  
-              if OASISVersion.comparator_apply version cmp then
2538  
-                version_str
2539  
-              else
2540  
-                failwithf
2541  
-                  (f_ "Cannot satisfy version constraint on %s: %s (version: %s)")
2542  
-                  var_prefix
2543  
-                  (OASISVersion.string_of_comparator cmp)
2544  
-                  version_str))
  2616
+        (fun () ->
  2617
+           let version_str =
  2618
+             match fversion () with
  2619
+               | "[Distributed with OCaml]" ->
  2620
+                   begin
  2621
+                     try
  2622
+                       (var_get "ocaml_version")
  2623
+                     with Not_found ->
  2624
+                       warning
  2625
+                         (f_ "Variable ocaml_version not defined, fallback \
  2626
+                              to default");
  2627
+                       Sys.ocaml_version
  2628
+                   end
  2629
+               | res ->
  2630
+                   res
  2631
+           in
  2632
+           let version =
  2633
+             OASISVersion.version_of_string version_str
  2634
+           in
  2635
+             if OASISVersion.comparator_apply version cmp then
  2636
+               version_str
  2637
+             else
  2638
+               failwithf
  2639
+                 (f_ "Cannot satisfy version constraint on %s: %s (version: %s)")
  2640
+                 var_prefix
  2641
+                 (OASISVersion.string_of_comparator cmp)
  2642
+                 version_str)
2545 2643
         ()
2546 2644
   
2547 2645
   let package_version pkg =
@@ -2572,7 +2670,7 @@ module BaseCheck = struct
2572 2670
     let vl =
2573 2671
       var_redefine
2574 2672
         var
2575  
-        (lazy (findlib_dir pkg))
  2673
+        (fun () -> findlib_dir pkg)
2576 2674
         ()
2577 2675
     in
2578 2676
       (
@@ -2591,7 +2689,7 @@ module BaseCheck = struct
2591 2689
 end
2592 2690
 
2593 2691
 module BaseOCamlcConfig = struct
2594  
-# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis-darcs/src/oasis-build/src/base/BaseOCamlcConfig.ml"
  2692
+# 21 "/home/bobry/Code/playground/pkgbuilds/ocaml-oasis/src/oasis-0.3.0~rc3/src/base/BaseOCamlcConfig.ml"
2595 2693
   
2596 2694
   
2597 2695
   open BaseEnv
@@ -2648,18 +2746,23 @@ module BaseOCamlcConfig = struct
2648 2746
             mp
2649 2747
     in
2650 2748
   
  2749
+    let cache = 
  2750
+      lazy
  2751
+        (var_protect
  2752
+           (Marshal.to_string
  2753
+              (split_field
  2754
+                 SMap.empty
  2755
+                 (BaseExec.run_read_output
  2756
+                    (ocamlc ()) ["-config"]))
  2757
+              []))
  2758
+    in
2651 2759
       var_redefine
2652 2760
         "ocamlc_config_map"
2653 2761
         ~hide:true
2654 2762
         ~dump:false
2655  
-        (lazy
2656  
-           (var_protect
2657  
-              (Marshal.to_string
2658  
-                 (split_field
2659  
-                    SMap.empty
2660  
-                    (BaseExec.run_read_output
2661  
-                       (ocamlc ()) ["-config"]))
2662  
-                 [])))
  2763
+        (fun () ->
  2764
+           (* TODO: update if ocamlc change !!! *)
  2765
+           Lazy.force cache)
2663 2766
   
2664 2767
   let var_define nm =
2665 2768
     (* Extract data from ocamlc -config *)
@@ -2683,25 +2786,25 @@ module BaseOCamlcConfig = struct
2683 2786
     in
2684 2787
       var_redefine
2685 2788
         nm
2686  
-        (lazy
2687  
-          (try
2688  
-              let map =
2689  
-                avlbl_config_get ()