0 | 0 |
(* setup.ml generated for the first time by OASIS v0.3.0 *)
|
1 | 1 |
|
2 | 2 |
(* OASIS_START *)
|
3 | |
(* DO NOT EDIT (digest: 2458cae84f1526b9c4473257507b4b85) *)
|
|
3 |
(* DO NOT EDIT (digest: 21bca576d00ecf73bc0f2b8434ab927e) *)
|
4 | 4 |
(*
|
5 | |
Regenerated by OASIS v0.3.0
|
|
5 |
Regenerated by OASIS v0.4.0
|
6 | 6 |
Visit http://oasis.forge.ocamlcore.org for more information and
|
7 | 7 |
documentation about functions used in this file.
|
8 | 8 |
*)
|
9 | 9 |
module OASISGettext = struct
|
10 | |
(* # 21 "src/oasis/OASISGettext.ml" *)
|
|
10 |
(* # 22 "src/oasis/OASISGettext.ml" *)
|
|
11 |
|
11 | 12 |
|
12 | 13 |
let ns_ str =
|
13 | 14 |
str
|
14 | 15 |
|
|
16 |
|
15 | 17 |
let s_ str =
|
16 | 18 |
str
|
17 | 19 |
|
18 | |
let f_ (str : ('a, 'b, 'c, 'd) format4) =
|
|
20 |
|
|
21 |
let f_ (str: ('a, 'b, 'c, 'd) format4) =
|
19 | 22 |
str
|
|
23 |
|
20 | 24 |
|
21 | 25 |
let fn_ fmt1 fmt2 n =
|
22 | 26 |
if n = 1 then
|
|
24 | 28 |
else
|
25 | 29 |
fmt2^^""
|
26 | 30 |
|
|
31 |
|
27 | 32 |
let init =
|
28 | 33 |
[]
|
29 | 34 |
|
|
35 |
|
30 | 36 |
end
|
31 | 37 |
|
32 | 38 |
module OASISContext = struct
|
33 | |
(* # 21 "src/oasis/OASISContext.ml" *)
|
|
39 |
(* # 22 "src/oasis/OASISContext.ml" *)
|
|
40 |
|
34 | 41 |
|
35 | 42 |
open OASISGettext
|
|
43 |
|
36 | 44 |
|
37 | 45 |
type level =
|
38 | 46 |
[ `Debug
|
39 | 47 |
| `Info
|
40 | 48 |
| `Warning
|
41 | 49 |
| `Error]
|
|
50 |
|
42 | 51 |
|
43 | 52 |
type t =
|
44 | 53 |
{
|
|
50 | 59 |
printf: level -> string -> unit;
|
51 | 60 |
}
|
52 | 61 |
|
|
62 |
|
53 | 63 |
let printf lvl str =
|
54 | 64 |
let beg =
|
55 | 65 |
match lvl with
|
|
59 | 69 |
| `Debug -> s_ "D: "
|
60 | 70 |
in
|
61 | 71 |
prerr_endline (beg^str)
|
|
72 |
|
62 | 73 |
|
63 | 74 |
let default =
|
64 | 75 |
ref
|
|
71 | 82 |
printf = printf;
|
72 | 83 |
}
|
73 | 84 |
|
|
85 |
|
74 | 86 |
let quiet =
|
75 | 87 |
{!default with quiet = true}
|
76 | 88 |
|
|
91 | 103 |
end
|
92 | 104 |
|
93 | 105 |
module OASISString = struct
|
94 | |
(* # 1 "src/oasis/OASISString.ml" *)
|
95 | |
|
|
106 |
(* # 22 "src/oasis/OASISString.ml" *)
|
96 | 107 |
|
97 | 108 |
|
98 | 109 |
(** Various string utilities.
|
99 | |
|
|
110 |
|
100 | 111 |
Mostly inspired by extlib and batteries ExtString and BatString libraries.
|
101 | 112 |
|
102 | 113 |
@author Sylvain Le Gall
|
103 | 114 |
*)
|
|
115 |
|
104 | 116 |
|
105 | 117 |
let nsplitf str f =
|
106 | 118 |
if str = "" then
|
|
122 | 134 |
push ();
|
123 | 135 |
List.rev !lst
|
124 | 136 |
|
|
137 |
|
125 | 138 |
(** [nsplit c s] Split the string [s] at char [c]. It doesn't include the
|
126 | 139 |
separator.
|
127 | 140 |
*)
|
128 | 141 |
let nsplit str c =
|
129 | 142 |
nsplitf str ((=) c)
|
130 | 143 |
|
|
144 |
|
131 | 145 |
let find ~what ?(offset=0) str =
|
132 | 146 |
let what_idx = ref 0 in
|
133 | |
let str_idx = ref offset in
|
134 | |
while !str_idx < String.length str &&
|
|
147 |
let str_idx = ref offset in
|
|
148 |
while !str_idx < String.length str &&
|
135 | 149 |
!what_idx < String.length what do
|
136 | 150 |
if str.[!str_idx] = what.[!what_idx] then
|
137 | 151 |
incr what_idx
|
|
141 | 155 |
done;
|
142 | 156 |
if !what_idx <> String.length what then
|
143 | 157 |
raise Not_found
|
144 | |
else
|
|
158 |
else
|
145 | 159 |
!str_idx - !what_idx
|
146 | 160 |
|
147 | |
let sub_start str len =
|
|
161 |
|
|
162 |
let sub_start str len =
|
148 | 163 |
let str_len = String.length str in
|
149 | 164 |
if len >= str_len then
|
150 | 165 |
""
|
151 | 166 |
else
|
152 | 167 |
String.sub str len (str_len - len)
|
|
168 |
|
153 | 169 |
|
154 | 170 |
let sub_end ?(offset=0) str len =
|
155 | 171 |
let str_len = String.length str in
|
|
158 | 174 |
else
|
159 | 175 |
String.sub str 0 (str_len - len)
|
160 | 176 |
|
|
177 |
|
161 | 178 |
let starts_with ~what ?(offset=0) str =
|
162 | 179 |
let what_idx = ref 0 in
|
163 | 180 |
let str_idx = ref offset in
|
164 | 181 |
let ok = ref true in
|
165 | 182 |
while !ok &&
|
166 | |
!str_idx < String.length str &&
|
|
183 |
!str_idx < String.length str &&
|
167 | 184 |
!what_idx < String.length what do
|
168 | 185 |
if str.[!str_idx] = what.[!what_idx] then
|
169 | 186 |
incr what_idx
|
|
173 | 190 |
done;
|
174 | 191 |
if !what_idx = String.length what then
|
175 | 192 |
true
|
176 | |
else
|
|
193 |
else
|
177 | 194 |
false
|
|
195 |
|
178 | 196 |
|
179 | 197 |
let strip_starts_with ~what str =
|
180 | 198 |
if starts_with ~what str then
|
|
182 | 200 |
else
|
183 | 201 |
raise Not_found
|
184 | 202 |
|
|
203 |
|
185 | 204 |
let ends_with ~what ?(offset=0) str =
|
186 | 205 |
let what_idx = ref ((String.length what) - 1) in
|
187 | 206 |
let str_idx = ref ((String.length str) - 1) in
|
188 | 207 |
let ok = ref true in
|
189 | 208 |
while !ok &&
|
190 | |
offset <= !str_idx &&
|
|
209 |
offset <= !str_idx &&
|
191 | 210 |
0 <= !what_idx do
|
192 | 211 |
if str.[!str_idx] = what.[!what_idx] then
|
193 | 212 |
decr what_idx
|
|
197 | 216 |
done;
|
198 | 217 |
if !what_idx = -1 then
|
199 | 218 |
true
|
200 | |
else
|
|
219 |
else
|
201 | 220 |
false
|
|
221 |
|
202 | 222 |
|
203 | 223 |
let strip_ends_with ~what str =
|
204 | 224 |
if ends_with ~what str then
|
205 | 225 |
sub_end str (String.length what)
|
206 | 226 |
else
|
207 | 227 |
raise Not_found
|
|
228 |
|
208 | 229 |
|
209 | 230 |
let replace_chars f s =
|
210 | 231 |
let buf = String.make (String.length s) 'X' in
|
|
213 | 234 |
done;
|
214 | 235 |
buf
|
215 | 236 |
|
|
237 |
|
216 | 238 |
end
|
217 | 239 |
|
218 | 240 |
module OASISUtils = struct
|
219 | |
(* # 21 "src/oasis/OASISUtils.ml" *)
|
|
241 |
(* # 22 "src/oasis/OASISUtils.ml" *)
|
|
242 |
|
220 | 243 |
|
221 | 244 |
open OASISGettext
|
222 | 245 |
|
|
246 |
|
223 | 247 |
module MapString = Map.Make(String)
|
|
248 |
|
224 | 249 |
|
225 | 250 |
let map_string_of_assoc assoc =
|
226 | 251 |
List.fold_left
|
|
228 | 253 |
MapString.empty
|
229 | 254 |
assoc
|
230 | 255 |
|
|
256 |
|
231 | 257 |
module SetString = Set.Make(String)
|
|
258 |
|
232 | 259 |
|
233 | 260 |
let set_string_add_list st lst =
|
234 | 261 |
List.fold_left
|
|
236 | 263 |
st
|
237 | 264 |
lst
|
238 | 265 |
|
|
266 |
|
239 | 267 |
let set_string_of_list =
|
240 | 268 |
set_string_add_list
|
241 | 269 |
SetString.empty
|
|
243 | 271 |
|
244 | 272 |
let compare_csl s1 s2 =
|
245 | 273 |
String.compare (String.lowercase s1) (String.lowercase s2)
|
|
274 |
|
246 | 275 |
|
247 | 276 |
module HashStringCsl =
|
248 | 277 |
Hashtbl.Make
|
|
255 | 284 |
let hash s =
|
256 | 285 |
Hashtbl.hash (String.lowercase s)
|
257 | 286 |
end)
|
|
287 |
|
258 | 288 |
|
259 | 289 |
let varname_of_string ?(hyphen='_') s =
|
260 | 290 |
if String.length s = 0 then
|
|
286 | 316 |
String.lowercase buf
|
287 | 317 |
end
|
288 | 318 |
|
|
319 |
|
289 | 320 |
let varname_concat ?(hyphen='_') p s =
|
290 | 321 |
let what = String.make 1 hyphen in
|
291 | 322 |
let p =
|
|
306 | 337 |
let is_varname str =
|
307 | 338 |
str = varname_of_string str
|
308 | 339 |
|
|
340 |
|
309 | 341 |
let failwithf fmt = Printf.ksprintf failwith fmt
|
310 | 342 |
|
|
343 |
|
311 | 344 |
end
|
312 | 345 |
|
313 | 346 |
module PropList = struct
|
314 | |
(* # 21 "src/oasis/PropList.ml" *)
|
|
347 |
(* # 22 "src/oasis/PropList.ml" *)
|
|
348 |
|
315 | 349 |
|
316 | 350 |
open OASISGettext
|
317 | 351 |
|
|
352 |
|
318 | 353 |
type name = string
|
|
354 |
|
319 | 355 |
|
320 | 356 |
exception Not_set of name * string option
|
321 | 357 |
exception No_printer of name
|
322 | 358 |
exception Unknown_field of name * name
|
|
359 |
|
323 | 360 |
|
324 | 361 |
let () =
|
325 | 362 |
Printexc.register_printer
|
326 | 363 |
(function
|
327 | 364 |
| Not_set (nm, Some rsn) ->
|
328 | |
Some
|
|
365 |
Some
|
329 | 366 |
(Printf.sprintf (f_ "Field '%s' is not set: %s") nm rsn)
|
330 | 367 |
| Not_set (nm, None) ->
|
331 | |
Some
|
|
368 |
Some
|
332 | 369 |
(Printf.sprintf (f_ "Field '%s' is not set") nm)
|
333 | 370 |
| No_printer nm ->
|
334 | 371 |
Some
|
335 | 372 |
(Printf.sprintf (f_ "No default printer for value %s") nm)
|
336 | 373 |
| Unknown_field (nm, schm) ->
|
337 | |
Some
|
338 | |
(Printf.sprintf (f_ "Field %s is not defined in schema %s") nm schm)
|
|
374 |
Some
|
|
375 |
(Printf.sprintf
|
|
376 |
(f_ "Field %s is not defined in schema %s") nm schm)
|
339 | 377 |
| _ ->
|
340 | 378 |
None)
|
341 | 379 |
|
|
380 |
|
342 | 381 |
module Data =
|
343 | 382 |
struct
|
344 | |
|
345 | 383 |
type t =
|
346 | 384 |
(name, unit -> unit) Hashtbl.t
|
347 | 385 |
|
|
351 | 389 |
let clear t =
|
352 | 390 |
Hashtbl.clear t
|
353 | 391 |
|
354 | |
(* # 71 "src/oasis/PropList.ml" *)
|
|
392 |
|
|
393 |
(* # 78 "src/oasis/PropList.ml" *)
|
355 | 394 |
end
|
|
395 |
|
356 | 396 |
|
357 | 397 |
module Schema =
|
358 | 398 |
struct
|
359 | |
|
360 | 399 |
type ('ctxt, 'extra) value =
|
361 | 400 |
{
|
362 | 401 |
get: Data.t -> string;
|
|
444 | 483 |
t.name
|
445 | 484 |
end
|
446 | 485 |
|
|
486 |
|
447 | 487 |
module Field =
|
448 | 488 |
struct
|
449 | |
|
450 | 489 |
type ('ctxt, 'value, 'extra) t =
|
451 | 490 |
{
|
452 | 491 |
set: Data.t -> ?context:'ctxt -> 'value -> unit;
|
|
576 | 615 |
|
577 | 616 |
let fgets data t =
|
578 | 617 |
t.gets data
|
579 | |
|
580 | 618 |
end
|
|
619 |
|
581 | 620 |
|
582 | 621 |
module FieldRO =
|
583 | 622 |
struct
|
584 | |
|
585 | 623 |
let create ?schema ?name ?parse ?print ?default ?update ?help extra =
|
586 | 624 |
let fld =
|
587 | 625 |
Field.create ?schema ?name ?parse ?print ?default ?update ?help extra
|
588 | 626 |
in
|
589 | 627 |
fun data -> Field.fget data fld
|
590 | |
|
591 | 628 |
end
|
592 | 629 |
end
|
593 | 630 |
|
594 | 631 |
module OASISMessage = struct
|
595 | |
(* # 21 "src/oasis/OASISMessage.ml" *)
|
|
632 |
(* # 22 "src/oasis/OASISMessage.ml" *)
|
596 | 633 |
|
597 | 634 |
|
598 | 635 |
open OASISGettext
|
599 | 636 |
open OASISContext
|
|
637 |
|
600 | 638 |
|
601 | 639 |
let generic_message ~ctxt lvl fmt =
|
602 | 640 |
let cond =
|
|
616 | 654 |
end)
|
617 | 655 |
fmt
|
618 | 656 |
|
|
657 |
|
619 | 658 |
let debug ~ctxt fmt =
|
620 | 659 |
generic_message ~ctxt `Debug fmt
|
621 | 660 |
|
|
661 |
|
622 | 662 |
let info ~ctxt fmt =
|
623 | 663 |
generic_message ~ctxt `Info fmt
|
624 | 664 |
|
|
665 |
|
625 | 666 |
let warning ~ctxt fmt =
|
626 | 667 |
generic_message ~ctxt `Warning fmt
|
627 | 668 |
|
|
669 |
|
628 | 670 |
let error ~ctxt fmt =
|
629 | 671 |
generic_message ~ctxt `Error fmt
|
630 | 672 |
|
631 | 673 |
end
|
632 | 674 |
|
633 | 675 |
module OASISVersion = struct
|
634 | |
(* # 21 "src/oasis/OASISVersion.ml" *)
|
|
676 |
(* # 22 "src/oasis/OASISVersion.ml" *)
|
|
677 |
|
635 | 678 |
|
636 | 679 |
open OASISGettext
|
637 | 680 |
|
638 | 681 |
|
639 | 682 |
|
|
683 |
|
|
684 |
|
640 | 685 |
type s = string
|
641 | 686 |
|
|
687 |
|
642 | 688 |
type t = string
|
|
689 |
|
643 | 690 |
|
644 | 691 |
type comparator =
|
645 | 692 |
| VGreater of t
|
|
651 | 698 |
| VAnd of comparator * comparator
|
652 | 699 |
|
653 | 700 |
|
|
701 |
|
654 | 702 |
(* Range of allowed characters *)
|
655 | 703 |
let is_digit c =
|
656 | 704 |
'0' <= c && c <= '9'
|
657 | 705 |
|
|
706 |
|
658 | 707 |
let is_alpha c =
|
659 | 708 |
('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')
|
|
709 |
|
660 | 710 |
|
661 | 711 |
let is_special =
|
662 | 712 |
function
|
663 | 713 |
| '.' | '+' | '-' | '~' -> true
|
664 | 714 |
| _ -> false
|
|
715 |
|
665 | 716 |
|
666 | 717 |
let rec version_compare v1 v2 =
|
667 | 718 |
if v1 <> "" || v2 <> "" then
|
|
706 | 757 |
while !p < String.length v && is_digit v.[!p] do
|
707 | 758 |
incr p
|
708 | 759 |
done;
|
709 | |
let substr =
|
|
760 |
let substr =
|
710 | 761 |
String.sub v !p ((String.length v) - !p)
|
711 | |
in
|
712 | |
let res =
|
713 | |
match String.sub v start_p (!p - start_p) with
|
|
762 |
in
|
|
763 |
let res =
|
|
764 |
match String.sub v start_p (!p - start_p) with
|
714 | 765 |
| "" -> 0
|
715 | 766 |
| s -> int_of_string s
|
716 | 767 |
in
|
|
746 | 797 |
|
747 | 798 |
let version_of_string str = str
|
748 | 799 |
|
|
800 |
|
749 | 801 |
let string_of_version t = t
|
|
802 |
|
|
803 |
|
|
804 |
let version_compare_string s1 s2 =
|
|
805 |
version_compare (version_of_string s1) (version_of_string s2)
|
|
806 |
|
750 | 807 |
|
751 | 808 |
let chop t =
|
752 | 809 |
try
|
|
756 | 813 |
String.sub t 0 pos
|
757 | 814 |
with Not_found ->
|
758 | 815 |
t
|
|
816 |
|
759 | 817 |
|
760 | 818 |
let rec comparator_apply v op =
|
761 | 819 |
match op with
|
|
774 | 832 |
| VAnd (op1, op2) ->
|
775 | 833 |
(comparator_apply v op1) && (comparator_apply v op2)
|
776 | 834 |
|
|
835 |
|
777 | 836 |
let rec string_of_comparator =
|
778 | 837 |
function
|
779 | 838 |
| VGreater v -> "> "^(string_of_version v)
|
|
786 | 845 |
| VAnd (c1, c2) ->
|
787 | 846 |
(string_of_comparator c1)^" && "^(string_of_comparator c2)
|
788 | 847 |
|
|
848 |
|
789 | 849 |
let rec varname_of_comparator =
|
790 | 850 |
let concat p v =
|
791 | 851 |
OASISUtils.varname_concat
|
|
804 | 864 |
| VAnd (c1, c2) ->
|
805 | 865 |
(varname_of_comparator c1)^"_and_"^(varname_of_comparator c2)
|
806 | 866 |
|
807 | |
let version_0_3_or_after t =
|
808 | |
comparator_apply t (VGreaterEqual (string_of_version "0.3"))
|
|
867 |
|
|
868 |
let rec comparator_ge v' =
|
|
869 |
let cmp v = version_compare v v' >= 0 in
|
|
870 |
function
|
|
871 |
| VEqual v
|
|
872 |
| VGreaterEqual v
|
|
873 |
| VGreater v -> cmp v
|
|
874 |
| VLesserEqual _
|
|
875 |
| VLesser _ -> false
|
|
876 |
| VOr (c1, c2) -> comparator_ge v' c1 || comparator_ge v' c2
|
|
877 |
| VAnd (c1, c2) -> comparator_ge v' c1 && comparator_ge v' c2
|
|
878 |
|
809 | 879 |
|
810 | 880 |
end
|
811 | 881 |
|
812 | 882 |
module OASISLicense = struct
|
813 | |
(* # 21 "src/oasis/OASISLicense.ml" *)
|
|
883 |
(* # 22 "src/oasis/OASISLicense.ml" *)
|
|
884 |
|
814 | 885 |
|
815 | 886 |
(** License for _oasis fields
|
816 | 887 |
@author Sylvain Le Gall
|
|
818 | 889 |
|
819 | 890 |
|
820 | 891 |
|
|
892 |
|
|
893 |
|
821 | 894 |
type license = string
|
822 | 895 |
|
|
896 |
|
823 | 897 |
type license_exception = string
|
|
898 |
|
824 | 899 |
|
825 | 900 |
type license_version =
|
826 | 901 |
| Version of OASISVersion.t
|
827 | 902 |
| VersionOrLater of OASISVersion.t
|
828 | 903 |
| NoVersion
|
829 | 904 |
|
|
905 |
|
830 | 906 |
|
831 | 907 |
type license_dep_5_unit =
|
832 | 908 |
{
|
|
836 | 912 |
}
|
837 | 913 |
|
838 | 914 |
|
|
915 |
|
839 | 916 |
type license_dep_5 =
|
840 | 917 |
| DEP5Unit of license_dep_5_unit
|
841 | 918 |
| DEP5Or of license_dep_5 list
|
842 | 919 |
| DEP5And of license_dep_5 list
|
843 | 920 |
|
844 | 921 |
|
|
922 |
|
845 | 923 |
type t =
|
846 | 924 |
| DEP5License of license_dep_5
|
847 | 925 |
| OtherLicense of string (* URL *)
|
848 | 926 |
|
849 | 927 |
|
|
928 |
|
850 | 929 |
end
|
851 | 930 |
|
852 | 931 |
module OASISExpr = struct
|
853 | |
(* # 21 "src/oasis/OASISExpr.ml" *)
|
|
932 |
(* # 22 "src/oasis/OASISExpr.ml" *)
|
|
933 |
|
|
934 |
|
854 | 935 |
|
855 | 936 |
|
856 | 937 |
|
857 | 938 |
open OASISGettext
|
858 | 939 |
|
|
940 |
|
859 | 941 |
type test = string
|
860 | 942 |
|
|
943 |
|
861 | 944 |
type flag = string
|
|
945 |
|
862 | 946 |
|
863 | 947 |
type t =
|
864 | 948 |
| EBool of bool
|
|
869 | 953 |
| ETest of test * string
|
870 | 954 |
|
871 | 955 |
|
|
956 |
|
872 | 957 |
type 'a choices = (t * 'a) list
|
|
958 |
|
873 | 959 |
|
874 | 960 |
let eval var_get t =
|
875 | 961 |
let rec eval' =
|
|
900 | 986 |
(v = vl)
|
901 | 987 |
in
|
902 | 988 |
eval' t
|
|
989 |
|
903 | 990 |
|
904 | 991 |
let choose ?printer ?name var_get lst =
|
905 | 992 |
let rec choose_aux =
|
|
937 | 1024 |
in
|
938 | 1025 |
choose_aux (List.rev lst)
|
939 | 1026 |
|
|
1027 |
|
940 | 1028 |
end
|
941 | 1029 |
|
942 | 1030 |
module OASISTypes = struct
|
943 | |
(* # 21 "src/oasis/OASISTypes.ml" *)
|
|
1031 |
(* # 22 "src/oasis/OASISTypes.ml" *)
|
|
1032 |
|
944 | 1033 |
|
945 | 1034 |
|
946 | 1035 |
|
|
957 | 1046 |
type args = string list
|
958 | 1047 |
type command_line = (prog * arg list)
|
959 | 1048 |
|
|
1049 |
|
960 | 1050 |
type findlib_name = string
|
961 | 1051 |
type findlib_full = string
|
|
1052 |
|
962 | 1053 |
|
963 | 1054 |
type compiled_object =
|
964 | 1055 |
| Byte
|
|
966 | 1057 |
| Best
|
967 | 1058 |
|
968 | 1059 |
|
|
1060 |
|
969 | 1061 |
type dependency =
|
970 | 1062 |
| FindlibPackage of findlib_full * OASISVersion.comparator option
|
971 | 1063 |
| InternalLibrary of name
|
972 | 1064 |
|
973 | 1065 |
|
|
1066 |
|
974 | 1067 |
type tool =
|
975 | 1068 |
| ExternalTool of name
|
976 | 1069 |
| InternalExecutable of name
|
977 | 1070 |
|
|
1071 |
|
978 | 1072 |
|
979 | 1073 |
type vcs =
|
980 | 1074 |
| Darcs
|
|
988 | 1082 |
| OtherVCS of url
|
989 | 1083 |
|
990 | 1084 |
|
|
1085 |
|
991 | 1086 |
type plugin_kind =
|
992 | 1087 |
[ `Configure
|
993 | 1088 |
| `Build
|
|
996 | 1091 |
| `Install
|
997 | 1092 |
| `Extra
|
998 | 1093 |
]
|
|
1094 |
|
999 | 1095 |
|
1000 | 1096 |
type plugin_data_purpose =
|
1001 | 1097 |
[ `Configure
|
|
1011 | 1107 |
| `Other of string
|
1012 | 1108 |
]
|
1013 | 1109 |
|
|
1110 |
|
1014 | 1111 |
type 'a plugin = 'a * name * OASISVersion.t option
|
1015 | 1112 |
|
|
1113 |
|
1016 | 1114 |
type all_plugin = plugin_kind plugin
|
1017 | 1115 |
|
|
1116 |
|
1018 | 1117 |
type plugin_data = (all_plugin * plugin_data_purpose * (unit -> unit)) list
|
1019 | 1118 |
|
1020 | |
(* # 102 "src/oasis/OASISTypes.ml" *)
|
|
1119 |
|
|
1120 |
(* # 115 "src/oasis/OASISTypes.ml" *)
|
|
1121 |
|
1021 | 1122 |
|
1022 | 1123 |
type 'a conditional = 'a OASISExpr.choices
|
|
1124 |
|
1023 | 1125 |
|
1024 | 1126 |
type custom =
|
1025 | 1127 |
{
|
|
1027 | 1129 |
post_command: (command_line option) conditional;
|
1028 | 1130 |
}
|
1029 | 1131 |
|
|
1132 |
|
1030 | 1133 |
|
1031 | 1134 |
type common_section =
|
1032 | 1135 |
{
|
|
1035 | 1138 |
cs_plugin_data: plugin_data;
|
1036 | 1139 |
}
|
1037 | 1140 |
|
|
1141 |
|
1038 | 1142 |
|
1039 | 1143 |
type build_section =
|
1040 | 1144 |
{
|
|
1055 | 1159 |
}
|
1056 | 1160 |
|
1057 | 1161 |
|
|
1162 |
|
1058 | 1163 |
type library =
|
1059 | 1164 |
{
|
1060 | 1165 |
lib_modules: string list;
|
|
1065 | 1170 |
lib_findlib_containers: findlib_name list;
|
1066 | 1171 |
}
|
1067 | 1172 |
|
|
1173 |
|
|
1174 |
type object_ =
|
|
1175 |
{
|
|
1176 |
obj_modules: string list;
|
|
1177 |
obj_findlib_fullname: findlib_name list option;
|
|
1178 |
}
|
|
1179 |
|
|
1180 |
|
1068 | 1181 |
type executable =
|
1069 | 1182 |
{
|
1070 | 1183 |
exec_custom: bool;
|
1071 | 1184 |
exec_main_is: unix_filename;
|
1072 | 1185 |
}
|
1073 | 1186 |
|
|
1187 |
|
1074 | 1188 |
type flag =
|
1075 | 1189 |
{
|
1076 | 1190 |
flag_description: string option;
|
1077 | 1191 |
flag_default: bool conditional;
|
1078 | 1192 |
}
|
|
1193 |
|
1079 | 1194 |
|
1080 | 1195 |
type source_repository =
|
1081 | 1196 |
{
|
|
1088 | 1203 |
src_repo_subdir: unix_filename option;
|
1089 | 1204 |
}
|
1090 | 1205 |
|
|
1206 |
|
1091 | 1207 |
type test =
|
1092 | 1208 |
{
|
1093 | 1209 |
test_type: [`Test] plugin;
|
|
1098 | 1214 |
test_tools: tool list;
|
1099 | 1215 |
}
|
1100 | 1216 |
|
|
1217 |
|
1101 | 1218 |
type doc_format =
|
1102 | 1219 |
| HTML of unix_filename
|
1103 | 1220 |
| DocText
|
|
1107 | 1224 |
| DVI
|
1108 | 1225 |
| OtherDoc
|
1109 | 1226 |
|
|
1227 |
|
1110 | 1228 |
|
1111 | 1229 |
type doc =
|
1112 | 1230 |
{
|
|
1123 | 1241 |
doc_build_tools: tool list;
|
1124 | 1242 |
}
|
1125 | 1243 |
|
|
1244 |
|
1126 | 1245 |
type section =
|
1127 | 1246 |
| Library of common_section * build_section * library
|
|
1247 |
| Object of common_section * build_section * object_
|
1128 | 1248 |
| Executable of common_section * build_section * executable
|
1129 | 1249 |
| Flag of common_section * flag
|
1130 | 1250 |
| SrcRepo of common_section * source_repository
|
|
1132 | 1252 |
| Doc of common_section * doc
|
1133 | 1253 |
|
1134 | 1254 |
|
|
1255 |
|
1135 | 1256 |
type section_kind =
|
1136 | |
[ `Library | `Executable | `Flag | `SrcRepo | `Test | `Doc ]
|
1137 | |
|
1138 | |
type package =
|
|
1257 |
[ `Library | `Object | `Executable | `Flag | `SrcRepo | `Test | `Doc ]
|
|
1258 |
|
|
1259 |
|
|
1260 |
type package =
|
1139 | 1261 |
{
|
1140 | 1262 |
oasis_version: OASISVersion.t;
|
1141 | 1263 |
ocaml_version: OASISVersion.comparator option;
|
1142 | 1264 |
findlib_version: OASISVersion.comparator option;
|
|
1265 |
alpha_features: string list;
|
|
1266 |
beta_features: string list;
|
1143 | 1267 |
name: package_name;
|
1144 | 1268 |
version: OASISVersion.t;
|
1145 | 1269 |
license: OASISLicense.t;
|
|
1172 | 1296 |
plugin_data: plugin_data;
|
1173 | 1297 |
}
|
1174 | 1298 |
|
|
1299 |
|
1175 | 1300 |
end
|
1176 | 1301 |
|
|
1302 |
module OASISFeatures = struct
|
|
1303 |
(* # 22 "src/oasis/OASISFeatures.ml" *)
|
|
1304 |
|
|
1305 |
open OASISTypes
|
|
1306 |
open OASISUtils
|
|
1307 |
open OASISGettext
|
|
1308 |
open OASISVersion
|
|
1309 |
|
|
1310 |
module MapPlugin =
|
|
1311 |
Map.Make
|
|
1312 |
(struct
|
|
1313 |
type t = plugin_kind * name
|
|
1314 |
let compare = Pervasives.compare
|
|
1315 |
end)
|
|
1316 |
|
|
1317 |
module Data =
|
|
1318 |
struct
|
|
1319 |
type t =
|
|
1320 |
{
|
|
1321 |
oasis_version: OASISVersion.t;
|
|
1322 |
plugin_versions: OASISVersion.t option MapPlugin.t;
|
|
1323 |
alpha_features: string list;
|
|
1324 |
beta_features: string list;
|
|
1325 |
}
|
|
1326 |
|
|
1327 |
let create oasis_version alpha_features beta_features =
|
|
1328 |
{
|
|
1329 |
oasis_version = oasis_version;
|
|
1330 |
plugin_versions = MapPlugin.empty;
|
|
1331 |
alpha_features = alpha_features;
|
|
1332 |
beta_features = beta_features
|
|
1333 |
}
|
|
1334 |
|
|
1335 |
let of_package pkg =
|
|
1336 |
create
|
|
1337 |
pkg.OASISTypes.oasis_version
|
|
1338 |
pkg.OASISTypes.alpha_features
|
|
1339 |
pkg.OASISTypes.beta_features
|
|
1340 |
|
|
1341 |
let add_plugin (plugin_kind, plugin_name, plugin_version) t =
|
|
1342 |
{t with
|
|
1343 |
plugin_versions = MapPlugin.add
|
|
1344 |
(plugin_kind, plugin_name)
|
|
1345 |
plugin_version
|
|
1346 |
t.plugin_versions}
|
|
1347 |
|
|
1348 |
let plugin_version plugin_kind plugin_name t =
|
|
1349 |
MapPlugin.find (plugin_kind, plugin_name) t.plugin_versions
|
|
1350 |
end
|
|
1351 |
|
|
1352 |
type origin =
|
|
1353 |
| Field of string * string
|
|
1354 |
| Section of string
|
|
1355 |
| NoOrigin
|
|
1356 |
|
|
1357 |
type stage = Alpha | Beta
|
|
1358 |
|
|
1359 |
|
|
1360 |
let string_of_stage =
|
|
1361 |
function
|
|
1362 |
| Alpha -> "alpha"
|
|
1363 |
| Beta -> "beta"
|
|
1364 |
|
|
1365 |
|
|
1366 |
let field_of_stage =
|
|
1367 |
function
|
|
1368 |
| Alpha -> "AlphaFeatures"
|
|
1369 |
| Beta -> "BetaFeatures"
|
|
1370 |
|
|
1371 |
type publication = InDev of stage | SinceVersion of OASISVersion.t
|
|
1372 |
|
|
1373 |
type t =
|
|
1374 |
{
|
|
1375 |
name: string;
|
|
1376 |
plugin: all_plugin option;
|
|
1377 |
publication: publication;
|
|
1378 |
description: unit -> string;
|
|
1379 |
}
|
|
1380 |
|
|
1381 |
(* TODO: mutex protect this. *)
|
|
1382 |
let all_features = Hashtbl.create 13
|
|
1383 |
|
|
1384 |
|
|
1385 |
let since_version ver_str = SinceVersion (version_of_string ver_str)
|
|
1386 |
let alpha = InDev Alpha
|
|
1387 |
let beta = InDev Beta
|
|
1388 |
|
|
1389 |
|
|
1390 |
let data_check t data origin =
|
|
1391 |
let no_message = "no message" in
|
|
1392 |
|
|
1393 |
let check_feature features stage =
|
|
1394 |
let has_feature = List.mem t.name features in
|
|
1395 |
if not has_feature then
|
|
1396 |
match origin with
|
|
1397 |
| Field (fld, where) ->
|
|
1398 |
Some
|
|
1399 |
(Printf.sprintf
|
|
1400 |
(f_ "Field %s in %s is only available when feature %s \
|
|
1401 |
is in field %s.")
|
|
1402 |
fld where t.name (field_of_stage stage))
|
|
1403 |
| Section sct ->
|
|
1404 |
Some
|
|
1405 |
(Printf.sprintf
|
|
1406 |
(f_ "Section %s is only available when features %s \
|
|
1407 |
is in field %s.")
|
|
1408 |
sct t.name (field_of_stage stage))
|
|
1409 |
| NoOrigin ->
|
|
1410 |
Some no_message
|
|
1411 |
else
|
|
1412 |
None
|
|
1413 |
in
|
|
1414 |
|
|
1415 |
let version_is_good ~min_version version fmt =
|
|
1416 |
let version_is_good =
|
|
1417 |
OASISVersion.comparator_apply
|
|
1418 |
version (OASISVersion.VGreaterEqual min_version)
|
|
1419 |
in
|
|
1420 |
Printf.ksprintf
|
|
1421 |
(fun str ->
|
|
1422 |
if version_is_good then
|
|
1423 |
None
|
|
1424 |
else
|
|
1425 |
Some str)
|
|
1426 |
fmt
|
|
1427 |
in
|
|
1428 |
|
|
1429 |
match origin, t.plugin, t.publication with
|
|
1430 |
| _, _, InDev Alpha -> check_feature data.Data.alpha_features Alpha
|
|
1431 |
| _, _, InDev Beta -> check_feature data.Data.beta_features Beta
|
|
1432 |
| Field(fld, where), None, SinceVersion min_version ->
|
|
1433 |
version_is_good ~min_version data.Data.oasis_version
|
|
1434 |
(f_ "Field %s in %s is only valid since OASIS v%s, update \
|
|
1435 |
OASISFormat field from '%s' to '%s' after checking \
|
|
1436 |
OASIS changelog.")
|
|
1437 |
fld where (string_of_version min_version)
|
|
1438 |
(string_of_version data.Data.oasis_version)
|
|
1439 |
(string_of_version min_version)
|
|
1440 |
|
|
1441 |
| Field(fld, where), Some(plugin_knd, plugin_name, _),
|
|
1442 |
SinceVersion min_version ->
|
|
1443 |
begin
|
|
1444 |
try
|
|
1445 |
let plugin_version_current =
|
|
1446 |
try
|
|
1447 |
match Data.plugin_version plugin_knd plugin_name data with
|
|
1448 |
| Some ver -> ver
|
|
1449 |
| None ->
|
|
1450 |
failwithf
|
|
1451 |
(f_ "Field %s in %s is only valid for the OASIS \
|
|
1452 |
plugin %s since v%s, but no plugin version is \
|
|
1453 |
defined in the _oasis file, change '%s' to \
|
|
1454 |
'%s (%s)' in your _oasis file.")
|
|
1455 |
fld where plugin_name (string_of_version min_version)
|
|
1456 |
plugin_name
|
|
1457 |
plugin_name (string_of_version min_version)
|
|
1458 |
with Not_found ->
|
|
1459 |
failwithf
|
|
1460 |
(f_ "Field %s in %s is only valid when the OASIS plugin %s \
|
|
1461 |
is defined.")
|
|
1462 |
fld where plugin_name
|
|
1463 |
in
|
|
1464 |
version_is_good ~min_version plugin_version_current
|
|
1465 |
(f_ "Field %s in %s is only valid for the OASIS plugin %s \
|
|
1466 |
since v%s, update your plugin from '%s (%s)' to \
|
|
1467 |
'%s (%s)' after checking the plugin's changelog.")
|
|
1468 |
fld where plugin_name (string_of_version min_version)
|
|
1469 |
plugin_name (string_of_version plugin_version_current)
|
|
1470 |
plugin_name (string_of_version min_version)
|
|
1471 |
with Failure msg ->
|
|
1472 |
Some msg
|
|
1473 |
end
|
|
1474 |
|
|
1475 |
| Section sct, None, SinceVersion min_version ->
|
|
1476 |
version_is_good ~min_version data.Data.oasis_version
|
|
1477 |
(f_ "Section %s is only valid for since OASIS v%s, update \
|
|
1478 |
OASISFormat field from '%s' to '%s' after checking OASIS \
|
|
1479 |
changelog.")
|
|
1480 |
sct (string_of_version min_version)
|
|
1481 |
(string_of_version data.Data.oasis_version)
|
|
1482 |
(string_of_version min_version)
|
|
1483 |
|
|
1484 |
| Section sct, Some(plugin_knd, plugin_name, _),
|
|
1485 |
SinceVersion min_version ->
|
|
1486 |
begin
|
|
1487 |
try
|
|
1488 |
let plugin_version_current =
|
|
1489 |
try
|
|
1490 |
match Data.plugin_version plugin_knd plugin_name data with
|
|
1491 |
| Some ver -> ver
|
|
1492 |
| None ->
|
|
1493 |
failwithf
|
|
1494 |
(f_ "Section %s is only valid for the OASIS \
|
|
1495 |
plugin %s since v%s, but no plugin version is \
|
|
1496 |
defined in the _oasis file, change '%s' to \
|
|
1497 |
'%s (%s)' in your _oasis file.")
|
|
1498 |
sct plugin_name (string_of_version min_version)
|
|
1499 |
plugin_name
|
|
1500 |
plugin_name (string_of_version min_version)
|
|
1501 |
with Not_found ->
|
|
1502 |
failwithf
|
|
1503 |
(f_ "Section %s is only valid when the OASIS plugin %s \
|
|
1504 |
is defined.")
|
|
1505 |
sct plugin_name
|
|
1506 |
in
|
|
1507 |
version_is_good ~min_version plugin_version_current
|
|
1508 |
(f_ "Section %s is only valid for the OASIS plugin %s \
|
|
1509 |
since v%s, update your plugin from '%s (%s)' to \
|
|
1510 |
'%s (%s)' after checking the plugin's changelog.")
|
|
1511 |
sct plugin_name (string_of_version min_version)
|
|
1512 |
plugin_name (string_of_version plugin_version_current)
|
|
1513 |
plugin_name (string_of_version min_version)
|
|
1514 |
with Failure msg ->
|
|
1515 |
Some msg
|
|
1516 |
end
|
|
1517 |
|
|
1518 |
| NoOrigin, None, SinceVersion min_version ->
|
|
1519 |
version_is_good ~min_version data.Data.oasis_version "%s" no_message
|
|
1520 |
|
|
1521 |
| NoOrigin, Some(plugin_knd, plugin_name, _), SinceVersion min_version ->
|
|
1522 |
begin
|
|
1523 |
try
|
|
1524 |
let plugin_version_current =
|
|
1525 |
match Data.plugin_version plugin_knd plugin_name data with
|
|
1526 |
| Some ver -> ver
|
|
1527 |
| None -> raise Not_found
|
|
1528 |
in
|
|
1529 |
version_is_good ~min_version plugin_version_current
|
|
1530 |
"%s" no_message
|
|
1531 |
with Not_found ->
|
|
1532 |
Some no_message
|
|
1533 |
end
|
|
1534 |
|
|
1535 |
|
|
1536 |
let data_assert t data origin =
|
|
1537 |
match data_check t data origin with
|
|
1538 |
| None -> ()
|
|
1539 |
| Some str -> failwith str
|
|
1540 |
|
|
1541 |
|
|
1542 |
let data_test t data =
|
|
1543 |
match data_check t data NoOrigin with
|
|
1544 |
| None -> true
|
|
1545 |
| Some str -> false
|
|
1546 |
|
|
1547 |
|
|
1548 |
let package_test t pkg =
|
|
1549 |
data_test t (Data.of_package pkg)
|
|
1550 |
|
|
1551 |
|
|
1552 |
let create ?plugin name publication description =
|
|
1553 |
let () =
|
|
1554 |
if Hashtbl.mem all_features name then
|
|
1555 |
failwithf "Feature '%s' is already declared." name
|
|
1556 |
in
|
|
1557 |
let t =
|
|
1558 |
{
|
|
1559 |
name = name;
|
|
1560 |
plugin = plugin;
|
|
1561 |
publication = publication;
|
|
1562 |
description = description;
|
|
1563 |
}
|
|
1564 |
in
|
|
1565 |
Hashtbl.add all_features name t;
|
|
1566 |
t
|
|
1567 |
|
|
1568 |
|
|
1569 |
let get_stage name =
|
|
1570 |
try
|
|
1571 |
(Hashtbl.find all_features name).publication
|
|
1572 |
with Not_found ->
|
|
1573 |
failwithf (f_ "Feature %s doesn't exist.") name
|
|
1574 |
|
|
1575 |
|
|
1576 |
let list () =
|
|
1577 |
Hashtbl.fold (fun _ v acc -> v :: acc) all_features []
|
|
1578 |
|
|
1579 |
(*
|
|
1580 |
* Real flags.
|
|
1581 |
*)
|
|
1582 |
|
|
1583 |
|
|
1584 |
let features =
|
|
1585 |
create "features_fields"
|
|
1586 |
(since_version "0.4")
|
|
1587 |
(fun () ->
|
|
1588 |
s_ "Enable to experiment not yet official features.")
|
|
1589 |
|
|
1590 |
|
|
1591 |
let flag_docs =
|
|
1592 |
create "flag_docs"
|
|
1593 |
(since_version "0.3")
|
|
1594 |
(fun () ->
|
|
1595 |
s_ "Building docs require '-docs' flag at configure.")
|
|
1596 |
|
|
1597 |
|
|
1598 |
let flag_tests =
|
|
1599 |
create "flag_tests"
|
|
1600 |
(since_version "0.3")
|
|
1601 |
(fun () ->
|
|
1602 |
s_ "Running tests require '-tests' flag at configure.")
|
|
1603 |
|
|
1604 |
|
|
1605 |
let pack =
|
|
1606 |
create "pack"
|
|
1607 |
(since_version "0.3")
|
|
1608 |
(fun () ->
|
|
1609 |
s_ "Allow to create packed library.")
|
|
1610 |
|
|
1611 |
|
|
1612 |
let section_object =
|
|
1613 |
create "section_object" beta
|
|
1614 |
(fun () ->
|
|
1615 |
s_ "Implement an object section.")
|
|
1616 |
end
|
|
1617 |
|
1177 | 1618 |
module OASISUnixPath = struct
|
1178 | |
(* # 21 "src/oasis/OASISUnixPath.ml" *)
|
|
1619 |
(* # 22 "src/oasis/OASISUnixPath.ml" *)
|
|
1620 |
|
1179 | 1621 |
|
1180 | 1622 |
type unix_filename = string
|
1181 | 1623 |
type unix_dirname = string
|
1182 | 1624 |
|
|
1625 |
|
1183 | 1626 |
type host_filename = string
|
1184 | 1627 |
type host_dirname = string
|
1185 | 1628 |
|
|
1629 |
|
1186 | 1630 |
let current_dir_name = "."
|
1187 | 1631 |
|
|
1632 |
|
1188 | 1633 |
let parent_dir_name = ".."
|
|
1634 |
|
1189 | 1635 |
|
1190 | 1636 |
let is_current_dir fn =
|
1191 | 1637 |
fn = current_dir_name || fn = ""
|
|
1638 |
|
1192 | 1639 |
|
1193 | 1640 |
let concat f1 f2 =
|
1194 | 1641 |
if is_current_dir f1 then
|
|
1198 | 1645 |
try OASISString.strip_ends_with ~what:"/" f1 with Not_found -> f1
|
1199 | 1646 |
in
|
1200 | 1647 |
f1'^"/"^f2
|
|
1648 |
|
1201 | 1649 |
|
1202 | 1650 |
let make =
|
1203 | 1651 |
function
|
|
1209 | 1657 |
| [] ->
|
1210 | 1658 |
invalid_arg "OASISUnixPath.make"
|
1211 | 1659 |
|
|
1660 |
|
1212 | 1661 |
let dirname f =
|
1213 | 1662 |
try
|
1214 | 1663 |
String.sub f 0 (String.rindex f '/')
|
1215 | 1664 |
with Not_found ->
|
1216 | 1665 |
current_dir_name
|
|
1666 |
|
1217 | 1667 |
|
1218 | 1668 |
let basename f =
|
1219 | 1669 |
try
|
|
1223 | 1673 |
String.sub f pos_start ((String.length f) - pos_start)
|
1224 | 1674 |
with Not_found ->
|
1225 | 1675 |
f
|
|
1676 |
|
1226 | 1677 |
|
1227 | 1678 |
let chop_extension f =
|
1228 | 1679 |
try
|
|
1246 | 1697 |
with Not_found ->
|
1247 | 1698 |
f
|
1248 | 1699 |
|
|
1700 |
|
1249 | 1701 |
let capitalize_file f =
|
1250 | 1702 |
let dir = dirname f in
|
1251 | 1703 |
let base = basename f in
|
1252 | 1704 |
concat dir (String.capitalize base)
|
1253 | 1705 |
|
|
1706 |
|
1254 | 1707 |
let uncapitalize_file f =
|
1255 | 1708 |
let dir = dirname f in
|
1256 | 1709 |
let base = basename f in
|
1257 | 1710 |
concat dir (String.uncapitalize base)
|
1258 | 1711 |
|
|
1712 |
|
1259 | 1713 |
end
|
1260 | 1714 |
|
1261 | 1715 |
module OASISHostPath = struct
|
1262 | |
(* # 21 "src/oasis/OASISHostPath.ml" *)
|
|
1716 |
(* # 22 "src/oasis/OASISHostPath.ml" *)
|
1263 | 1717 |
|
1264 | 1718 |
|
1265 | 1719 |
open Filename
|
1266 | 1720 |
|
|
1721 |
|
1267 | 1722 |
module Unix = OASISUnixPath
|
|
1723 |
|
1268 | 1724 |
|
1269 | 1725 |
let make =
|
1270 | 1726 |
function
|
|
1272 | 1728 |
invalid_arg "OASISHostPath.make"
|
1273 | 1729 |
| hd :: tl ->
|
1274 | 1730 |
List.fold_left Filename.concat hd tl
|
|
1731 |
|
1275 | 1732 |
|
1276 | 1733 |
let of_unix ufn =
|
1277 | 1734 |
if Sys.os_type = "Unix" then
|
|
1292 | 1749 |
end
|
1293 | 1750 |
|
1294 | 1751 |
module OASISSection = struct
|
1295 | |
(* # 21 "src/oasis/OASISSection.ml" *)
|
|
1752 |
(* # 22 "src/oasis/OASISSection.ml" *)
|
|
1753 |
|
1296 | 1754 |
|
1297 | 1755 |
open OASISTypes
|
1298 | 1756 |
|
1299 | |
let section_kind_common =
|
|
1757 |
|
|
1758 |
let section_kind_common =
|
1300 | 1759 |
function
|
1301 | |
| Library (cs, _, _) ->
|
|
1760 |
| Library (cs, _, _) ->
|
1302 | 1761 |
`Library, cs
|
|
1762 |
| Object (cs, _, _) ->
|
|
1763 |
`Object, cs
|
1303 | 1764 |
| Executable (cs, _, _) ->
|
1304 | 1765 |
`Executable, cs
|
1305 | 1766 |
| Flag (cs, _) ->
|
|
1311 | 1772 |
| Doc (cs, _) ->
|
1312 | 1773 |
`Doc, cs
|
1313 | 1774 |
|
|
1775 |
|
1314 | 1776 |
let section_common sct =
|
1315 | 1777 |
snd (section_kind_common sct)
|
|
1778 |
|
1316 | 1779 |
|
1317 | 1780 |
let section_common_set cs =
|
1318 | 1781 |
function
|
1319 | 1782 |
| Library (_, bs, lib) -> Library (cs, bs, lib)
|
|
1783 |
| Object (_, bs, obj) -> Object (cs, bs, obj)
|
1320 | 1784 |
| Executable (_, bs, exec) -> Executable (cs, bs, exec)
|
1321 | 1785 |
| Flag (_, flg) -> Flag (cs, flg)
|
1322 | 1786 |
| SrcRepo (_, src_repo) -> SrcRepo (cs, src_repo)
|
1323 | 1787 |
| Test (_, tst) -> Test (cs, tst)
|
1324 | 1788 |
| Doc (_, doc) -> Doc (cs, doc)
|
1325 | 1789 |
|
|
1790 |
|
1326 | 1791 |
(** Key used to identify section
|
1327 | 1792 |
*)
|
1328 | |
let section_id sct =
|
1329 | |
let k, cs =
|
|
1793 |
let section_id sct =
|
|
1794 |
let k, cs =
|
1330 | 1795 |
section_kind_common sct
|
1331 | 1796 |
in
|
1332 | 1797 |
k, cs.cs_name
|
|
1798 |
|
1333 | 1799 |
|
1334 | 1800 |
let string_of_section sct =
|
1335 | 1801 |
let k, nm =
|
1336 | 1802 |
section_id sct
|
1337 | 1803 |
in
|
1338 | 1804 |
(match k with
|
1339 | |
| `Library -> "library"
|
|
1805 |
| `Library -> "library"
|
|
1806 |
| `Object -> "object"
|
1340 | 1807 |
| `Executable -> "executable"
|
1341 | 1808 |
| `Flag -> "flag"
|
1342 | 1809 |
| `SrcRepo -> "src repository"
|
|
1344 | 1811 |
| `Doc -> "doc")
|
1345 | 1812 |
^" "^nm
|
1346 | 1813 |
|
|
1814 |
|
1347 | 1815 |
let section_find id scts =
|
1348 | 1816 |
List.find
|
1349 | 1817 |
(fun sct -> id = section_id sct)
|
1350 | 1818 |
scts
|
1351 | 1819 |
|
|
1820 |
|
1352 | 1821 |
module CSection =
|
1353 | 1822 |
struct
|
1354 | 1823 |
type t = section
|
1355 | 1824 |
|
1356 | 1825 |
let id = section_id
|
1357 | 1826 |
|
1358 | |
let compare t1 t2 =
|
|
1827 |
let compare t1 t2 =
|
1359 | 1828 |
compare (id t1) (id t2)
|
1360 | |
|
|
1829 |
|
1361 | 1830 |
let equal t1 t2 =
|
1362 | 1831 |
(id t1) = (id t2)
|
1363 | 1832 |
|
|
1365 | 1834 |
Hashtbl.hash (id t)
|
1366 | 1835 |
end
|
1367 | 1836 |
|
|
1837 |
|
1368 | 1838 |
module MapSection = Map.Make(CSection)
|
1369 | 1839 |
module SetSection = Set.Make(CSection)
|
1370 | 1840 |
|
|
1841 |
|
1371 | 1842 |
end
|
1372 | 1843 |
|
1373 | 1844 |
module OASISBuildSection = struct
|
1374 | |
(* # 21 "src/oasis/OASISBuildSection.ml" *)
|
|
1845 |
(* # 22 "src/oasis/OASISBuildSection.ml" *)
|
|
1846 |
|
1375 | 1847 |
|
1376 | 1848 |
end
|
1377 | 1849 |
|
1378 | 1850 |
module OASISExecutable = struct
|
1379 | |
(* # 21 "src/oasis/OASISExecutable.ml" *)
|
|
1851 |
(* # 22 "src/oasis/OASISExecutable.ml" *)
|
|
1852 |
|
1380 | 1853 |
|
1381 | 1854 |
open OASISTypes
|
1382 | 1855 |
|
1383 | |
let unix_exec_is (cs, bs, exec) is_native ext_dll suffix_program =
|
1384 | |
let dir =
|
|
1856 |
|
|
1857 |
let unix_exec_is (cs, bs, exec) is_native ext_dll suffix_program =
|
|
1858 |
let dir =
|
1385 | 1859 |
OASISUnixPath.concat
|
1386 | 1860 |
bs.bs_path
|
1387 | 1861 |
(OASISUnixPath.dirname exec.exec_main_is)
|
1388 | 1862 |
in
|
1389 | |
let is_native_exec =
|
|
1863 |
let is_native_exec =
|
1390 | 1864 |
match bs.bs_compiled_object with
|
1391 | 1865 |
| Native -> true
|
1392 | 1866 |
| Best -> is_native ()
|
|
1397 | 1871 |
dir
|
1398 | 1872 |
(cs.cs_name^(suffix_program ())),
|
1399 | 1873 |
|
1400 | |
if not is_native_exec &&
|
1401 | |
not exec.exec_custom &&
|
|
1874 |
if not is_native_exec &&
|
|
1875 |
not exec.exec_custom &&
|
1402 | 1876 |
bs.bs_c_sources <> [] then
|
1403 | 1877 |
Some (dir^"/dll"^cs.cs_name^"_stubs"^(ext_dll ()))
|
1404 | 1878 |
else
|
1405 | 1879 |
None
|
1406 | 1880 |
|
|
1881 |
|
1407 | 1882 |
end
|
1408 | 1883 |
|
1409 | 1884 |
module OASISLibrary = struct
|
1410 | |
(* # 21 "src/oasis/OASISLibrary.ml" *)
|
|
1885 |
(* # 22 "src/oasis/OASISLibrary.ml" *)
|
|
1886 |
|
1411 | 1887 |
|
1412 | 1888 |
open OASISTypes
|
1413 | 1889 |
open OASISUtils
|
1414 | 1890 |
open OASISGettext
|
1415 | 1891 |
open OASISSection
|
1416 | 1892 |
|
1417 | |
type library_name = name
|
1418 | |
type findlib_part_name = name
|
1419 | |
type 'a map_of_findlib_part_name = 'a OASISUtils.MapString.t
|
1420 | |
|
1421 | |
exception InternalLibraryNotFound of library_name
|
1422 | |
exception FindlibPackageNotFound of findlib_name
|
1423 | |
|
1424 | |
type group_t =
|
1425 | |
| Container of findlib_name * group_t list
|
1426 | |
| Package of (findlib_name *
|
1427 | |
common_section *
|
1428 | |
build_section *
|
1429 | |
library *
|
1430 | |
group_t list)
|
1431 | 1893 |
|
1432 | 1894 |
(* Look for a module file, considering capitalization or not. *)
|
1433 | |
let find_module source_file_exists (cs, bs, lib) modul =
|
|
1895 |
let find_module source_file_exists bs modul =
|
1434 | 1896 |
let possible_base_fn =
|
1435 | 1897 |
List.map
|
1436 | 1898 |
(OASISUnixPath.concat bs.bs_path)
|
|
1468 | 1930 |
(`No_sources possible_base_fn)
|
1469 | 1931 |
possible_base_fn
|
1470 | 1932 |
|
|
1933 |
|
1471 | 1934 |
let source_unix_files ~ctxt (cs, bs, lib) source_file_exists =
|
1472 | 1935 |
List.fold_left
|
1473 | 1936 |
(fun acc modul ->
|
1474 | |
match find_module source_file_exists (cs, bs, lib) modul with
|
|
1937 |
match find_module source_file_exists bs modul with
|
1475 | 1938 |
| `Sources (base_fn, lst) ->
|
1476 | 1939 |
(base_fn, lst) :: acc
|
1477 | 1940 |
| `No_sources _ ->
|
|
1484 | 1947 |
[]
|
1485 | 1948 |
(lib.lib_modules @ lib.lib_internal_modules)
|
1486 | 1949 |
|
|
1950 |
|
1487 | 1951 |
let generated_unix_files
|
1488 | 1952 |
~ctxt
|
1489 | 1953 |
~is_native
|
|
1493 | 1957 |
~source_file_exists
|
1494 | 1958 |
(cs, bs, lib) =
|
1495 | 1959 |
|
1496 | |
let find_modules lst ext =
|
|
1960 |
let find_modules lst ext =
|
1497 | 1961 |
let find_module modul =
|
1498 | |
match find_module source_file_exists (cs, bs, lib) modul with
|
|
1962 |
match find_module source_file_exists bs modul with
|
|
1963 |
| `Sources (base_fn, [fn]) when ext <> "cmi"
|
|
1964 |
&& Filename.check_suffix fn ".mli" ->
|
|
1965 |
None (* No implementation files for pure interface. *)
|
1499 | 1966 |
| `Sources (base_fn, _) ->
|
1500 | |
[base_fn]
|
|
1967 |
Some [base_fn]
|
1501 | 1968 |
| `No_sources lst ->
|
1502 | 1969 |
OASISMessage.warning
|
1503 | 1970 |
~ctxt
|
1504 | 1971 |
(f_ "Cannot find source file matching \
|
1505 | 1972 |
module '%s' in library %s")
|
1506 | 1973 |
modul cs.cs_name;
|
1507 | |
lst
|
|
1974 |
Some lst
|
1508 | 1975 |
in
|
1509 | |
List.map
|
1510 | |
(fun nm ->
|
1511 | |
List.map
|
1512 | |
(fun base_fn -> base_fn ^"."^ext)
|
1513 | |
(find_module nm))
|
|
1976 |
List.fold_left
|
|
1977 |
(fun acc nm ->
|
|
1978 |
match find_module nm with
|
|
1979 |
| None -> acc
|
|
1980 |
| Some base_fns ->
|
|
1981 |
List.map (fun base_fn -> base_fn ^"."^ext) base_fns :: acc)
|
|
1982 |
[]
|
1514 | 1983 |
lst
|
1515 | 1984 |
in
|
1516 | 1985 |
|
|
1527 | 1996 |
(* The .cmx that be compiled along *)
|
1528 | 1997 |
let cmxs =
|
1529 | 1998 |
let should_be_built =
|
1530 | |
(not lib.lib_pack) && (* Do not install .cmx packed submodules *)
|
1531 | 1999 |
match bs.bs_compiled_object with
|
1532 | 2000 |
| Native -> true
|
1533 | 2001 |
| Best -> is_native
|
1534 | 2002 |
| Byte -> false
|
1535 | 2003 |
in
|
1536 | 2004 |
if should_be_built then
|
1537 | |
find_modules
|
1538 | |
(lib.lib_modules @ lib.lib_internal_modules)
|
1539 | |
"cmx"
|
|
2005 |
if lib.lib_pack then
|
|
2006 |
find_modules
|
|
2007 |
[cs.cs_name]
|
|
2008 |
"cmx"
|
|
2009 |
else
|
|
2010 |
find_modules
|
|
2011 |
(lib.lib_modules @ lib.lib_internal_modules)
|
|
2012 |
"cmx"
|
1540 | 2013 |
else
|
1541 | 2014 |
[]
|
1542 | 2015 |
in
|
|
1558 | 2031 |
add_pack_header ([cs.cs_name^".cma"] :: acc)
|
1559 | 2032 |
in
|
1560 | 2033 |
let native acc =
|
1561 | |
let acc =
|
|
2034 |
let acc =
|
1562 | 2035 |
add_pack_header
|
1563 | 2036 |
(if has_native_dynlink then
|
1564 | 2037 |
[cs.cs_name^".cmxs"] :: acc
|
|
1597 | 2070 |
acc_nopath)
|
1598 | 2071 |
(headers @ cmxs)
|
1599 | 2072 |
|
1600 | |
type data = common_section * build_section * library
|
|
2073 |
|
|
2074 |
end
|
|
2075 |
|
|
2076 |
module OASISObject = struct
|
|
2077 |
(* # 22 "src/oasis/OASISObject.ml" *)
|
|
2078 |
|
|
2079 |
|
|
2080 |
open OASISTypes
|
|
2081 |
open OASISGettext
|
|
2082 |
|
|
2083 |
|
|
2084 |
let source_unix_files ~ctxt (cs, bs, obj) source_file_exists =
|
|
2085 |
List.fold_left
|
|
2086 |
(fun acc modul ->
|
|
2087 |
match OASISLibrary.find_module source_file_exists bs modul with
|
|
2088 |
| `Sources (base_fn, lst) ->
|
|
2089 |
(base_fn, lst) :: acc
|
|
2090 |
| `No_sources _ ->
|
|
2091 |
OASISMessage.warning
|
|
2092 |
~ctxt
|
|
2093 |
(f_ "Cannot find source file matching \
|
|
2094 |
module '%s' in object %s")
|
|
2095 |
modul cs.cs_name;
|
|
2096 |
acc)
|
|
2097 |
[]
|
|
2098 |
obj.obj_modules
|
|
2099 |
|
|
2100 |
|
|
2101 |
let generated_unix_files
|
|
2102 |
~ctxt
|
|
2103 |
~is_native
|
|
2104 |
~source_file_exists
|
|
2105 |
(cs, bs, obj) =
|
|
2106 |
|
|
2107 |
let find_module ext modul =
|
|
2108 |
match OASISLibrary.find_module source_file_exists bs modul with
|
|
2109 |
| `Sources (base_fn, _) -> [base_fn ^ ext]
|
|
2110 |
| `No_sources lst ->
|
|
2111 |
OASISMessage.warning
|
|
2112 |
~ctxt
|
|
2113 |
(f_ "Cannot find source file matching \
|
|
2114 |
module '%s' in object %s")
|
|
2115 |
modul cs.cs_name ;
|
|
2116 |
lst
|
|
2117 |
in
|
|
2118 |
|
|
2119 |
let header, byte, native, c_object, f =
|
|
2120 |
match obj.obj_modules with
|
|
2121 |
| [ m ] -> (find_module ".cmi" m,
|
|
2122 |
find_module ".cmo" m,
|
|
2123 |
find_module ".cmx" m,
|
|
2124 |
find_module ".o" m,
|
|
2125 |
fun x -> x)
|
|
2126 |
| _ -> ([cs.cs_name ^ ".cmi"],
|
|
2127 |
[cs.cs_name ^ ".cmo"],
|
|
2128 |
[cs.cs_name ^ ".cmx"],
|
|
2129 |
[cs.cs_name ^ ".o"],
|
|
2130 |
OASISUnixPath.concat bs.bs_path)
|
|
2131 |
in
|
|
2132 |
List.map (List.map f) (
|
|
2133 |
match bs.bs_compiled_object with
|
|
2134 |
| Native ->
|
|
2135 |
native :: c_object :: byte :: header :: []
|
|
2136 |
| Best when is_native ->
|
|
2137 |
native :: c_object :: byte :: header :: []
|
|
2138 |
| Byte | Best ->
|
|
2139 |
byte :: header :: [])
|
|
2140 |
|
|
2141 |
|
|
2142 |
end
|
|
2143 |
|
|
2144 |
module OASISFindlib = struct
|
|
2145 |
(* # 22 "src/oasis/OASISFindlib.ml" *)
|
|
2146 |
|
|
2147 |
|
|
2148 |
open OASISTypes
|
|
2149 |
open OASISUtils
|
|
2150 |
open OASISGettext
|
|
2151 |
open OASISSection
|
|
2152 |
|
|
2153 |
|
|
2154 |
type library_name = name
|
|
2155 |
type findlib_part_name = name
|
|
2156 |
type 'a map_of_findlib_part_name = 'a OASISUtils.MapString.t
|
|
2157 |
|
|
2158 |
|
|
2159 |
exception InternalLibraryNotFound of library_name
|
|
2160 |
exception FindlibPackageNotFound of findlib_name
|
|
2161 |
|
|
2162 |
|
|
2163 |
type group_t =
|
|
2164 |
| Container of findlib_name * group_t list
|
|
2165 |
| Package of (findlib_name *
|
|
2166 |
common_section *
|
|
2167 |
build_section *
|
|
2168 |
[`Library of library | `Object of object_] *
|
|
2169 |
group_t list)
|
|
2170 |
|
|
2171 |
|
|
2172 |
type data = common_section *
|
|
2173 |
build_section *
|
|
2174 |
[`Library of library | `Object of object_]
|
1601 | 2175 |
type tree =
|
1602 | 2176 |
| Node of (data option) * (tree MapString.t)
|
1603 | 2177 |
| Leaf of data
|
|
2178 |
|
1604 | 2179 |
|
1605 | 2180 |
let findlib_mapping pkg =
|
1606 | 2181 |
(* Map from library name to either full findlib name or parts + parent. *)
|
|
1638 | 2213 |
lib_name
|
1639 | 2214 |
(`Solved fndlb_parts)
|
1640 | 2215 |
mp
|
|
2216 |
end
|
|
2217 |
|
|
2218 |
| Object (cs, _, obj) ->
|
|
2219 |
begin
|
|
2220 |
let obj_name = cs.cs_name in
|
|
2221 |
if MapString.mem obj_name mp then
|
|
2222 |
failwithf
|
|
2223 |
(f_ "The object name '%s' is used more than once.")
|
|
2224 |
obj_name;
|
|
2225 |
let findlib_full_name = match obj.obj_findlib_fullname with
|
|
2226 |
| Some ns -> String.concat "." ns
|
|
2227 |
| None -> obj_name
|
|
2228 |
in
|
|
2229 |
MapString.add
|
|
2230 |
obj_name
|
|
2231 |
(`Solved findlib_full_name)
|
|
2232 |
mp
|
1641 | 2233 |
end
|
1642 | 2234 |
|
1643 | 2235 |
| Executable _ | Test _ | Flag _ | SrcRepo _ | Doc _ ->
|
|
1707 | 2299 |
let lib_name = cs.cs_name in
|
1708 | 2300 |
findlib_name_of_library_name lib_name
|
1709 | 2301 |
in
|
1710 | |
let rec add_children nm_lst (children : tree MapString.t) =
|
|
2302 |
let rec add_children nm_lst (children: tree MapString.t) =
|
1711 | 2303 |
match nm_lst with
|
1712 | 2304 |
| (hd :: tl) ->
|
1713 | 2305 |
begin
|
|
1777 | 2369 |
(fun mp ->
|
1778 | 2370 |
function
|
1779 | 2371 |
| Library (cs, bs, lib) ->
|
1780 | |
add (cs, bs, lib) mp
|
|
2372 |
add (cs, bs, `Library lib) mp
|
|
2373 |
| Object (cs, bs, obj) ->
|
|
2374 |
add (cs, bs, `Object obj) mp
|
1781 | 2375 |
| _ ->
|
1782 | 2376 |
mp)
|
1783 | 2377 |
MapString.empty
|
|
1808 | 2402 |
findlib_name_of_library_name,
|
1809 | 2403 |
library_name_of_findlib_name
|
1810 | 2404 |
|
|
2405 |
|
1811 | 2406 |
let findlib_of_group =
|
1812 | 2407 |
function
|
1813 | 2408 |
| Container (fndlb_nm, _)
|
1814 | 2409 |
| Package (fndlb_nm, _, _, _, _) -> fndlb_nm
|
|
2410 |
|
1815 | 2411 |
|
1816 | 2412 |
let root_of_group grp =
|
1817 | 2413 |
let rec root_lib_aux =
|
|
1837 | 2433 |
(f_ "Unable to determine root library of findlib library '%s'")
|
1838 | 2434 |
(findlib_of_group grp)
|
1839 | 2435 |
|
|
2436 |
|
1840 | 2437 |
end
|
1841 | 2438 |
|
1842 | 2439 |
module OASISFlag = struct
|
1843 | |
(* # 21 "src/oasis/OASISFlag.ml" *)
|
|
2440 |
(* # 22 "src/oasis/OASISFlag.ml" *)
|
|
2441 |
|
1844 | 2442 |
|
1845 | 2443 |
end
|
1846 | 2444 |
|
1847 | 2445 |
module OASISPackage = struct
|
1848 | |
(* # 21 "src/oasis/OASISPackage.ml" *)
|
|
2446 |
(* # 22 "src/oasis/OASISPackage.ml" *)
|
|
2447 |
|
1849 | 2448 |
|
1850 | 2449 |
end
|
1851 | 2450 |
|
1852 | 2451 |
module OASISSourceRepository = struct
|
1853 | |
(* # 21 "src/oasis/OASISSourceRepository.ml" *)
|
|
2452 |
(* # 22 "src/oasis/OASISSourceRepository.ml" *)
|
|
2453 |
|
1854 | 2454 |
|
1855 | 2455 |
end
|
1856 | 2456 |
|
1857 | 2457 |
module OASISTest = struct
|
1858 | |
(* # 21 "src/oasis/OASISTest.ml" *)
|
|
2458 |
(* # 22 "src/oasis/OASISTest.ml" *)
|
|
2459 |
|
1859 | 2460 |
|
1860 | 2461 |
end
|
1861 | 2462 |
|
1862 | 2463 |
module OASISDocument = struct
|
1863 | |
(* # 21 "src/oasis/OASISDocument.ml" *)
|
|
2464 |
(* # 22 "src/oasis/OASISDocument.ml" *)
|
|
2465 |
|
1864 | 2466 |
|
1865 | 2467 |
end
|
1866 | 2468 |
|
1867 | 2469 |
module OASISExec = struct
|
1868 | |
(* # 21 "src/oasis/OASISExec.ml" *)
|
|
2470 |
(* # 22 "src/oasis/OASISExec.ml" *)
|
|
2471 |
|
1869 | 2472 |
|
1870 | 2473 |
open OASISGettext
|
1871 | 2474 |
open OASISUtils
|
1872 | 2475 |
open OASISMessage
|
|
2476 |
|
1873 | 2477 |
|
1874 | 2478 |
(* TODO: I don't like this quote, it is there because $(rm) foo expands to
|
1875 | 2479 |
* 'rm -f' foo...
|
|
1900 | 2504 |
cmdline i
|
1901 | 2505 |
| Some f, i ->
|
1902 | 2506 |
f i
|
|
2507 |
|
1903 | 2508 |
|
1904 | 2509 |
let run_read_output ~ctxt ?f_exit_code cmd args =
|
1905 | 2510 |
let fn =
|
|
1932 | 2537 |
(try Sys.remove fn with _ -> ());
|
1933 | 2538 |
raise e
|
1934 | 2539 |
|
|
2540 |
|
1935 | 2541 |
let run_read_one_line ~ctxt ?f_exit_code cmd args =
|
1936 | 2542 |
match run_read_output ~ctxt ?f_exit_code cmd args with
|
1937 | 2543 |
| [fst] ->
|
|
1943 | 2549 |
end
|
1944 | 2550 |
|
1945 | 2551 |
module OASISFileUtil = struct
|
1946 | |
(* # 21 "src/oasis/OASISFileUtil.ml" *)
|
|
2552 |
(* # 22 "src/oasis/OASISFileUtil.ml" *)
|
|
2553 |
|
1947 | 2554 |
|
1948 | 2555 |
open OASISGettext
|
|
2556 |
|
1949 | 2557 |
|
1950 | 2558 |
let file_exists_case fn =
|
1951 | 2559 |
let dirname = Filename.dirname fn in
|
|
1960 | 2568 |
else
|
1961 | 2569 |
false
|
1962 | 2570 |
|
|
2571 |
|
1963 | 2572 |
let find_file ?(case_sensitive=true) paths exts =
|
1964 | 2573 |
|
1965 | 2574 |
(* Cardinal product of two list *)
|
|
1968 | 2577 |
(List.map
|
1969 | 2578 |
(fun a ->
|
1970 | 2579 |
List.map
|
1971 | |
(fun b -> a,b)
|
|
2580 |
(fun b -> a, b)
|
1972 | 2581 |
lst2)
|
1973 | 2582 |
lst1)
|
1974 | 2583 |
in
|
|
1978 | 2587 |
| p1 :: p2 :: tl ->
|
1979 | 2588 |
let acc =
|
1980 | 2589 |
(List.map
|
1981 | |
(fun (a,b) -> Filename.concat a b)
|
|
2590 |
(fun (a, b) -> Filename.concat a b)
|
1982 | 2591 |
(p1 * p2))
|
1983 | 2592 |
in
|
1984 | 2593 |
combined_paths (acc :: tl)
|
|
1990 | 2599 |
|
1991 | 2600 |
let alternatives =
|
1992 | 2601 |
List.map
|
1993 | |
(fun (p,e) ->
|
|
2602 |
(fun (p, e) ->
|
1994 | 2603 |
if String.length e > 0 && e.[0] <> '.' then
|
1995 | 2604 |
p ^ "." ^ e
|
1996 | 2605 |
else
|
1997 | 2606 |
p ^ e)
|
1998 | 2607 |
((combined_paths paths) * exts)
|
1999 | 2608 |
in
|
2000 | |
List.find
|
|
2609 |
List.find (fun file ->
|
2001 | 2610 |
(if case_sensitive then
|
2002 | |
file_exists_case
|
|
2611 |
file_exists_case file
|
2003 | 2612 |
else
|
2004 | |
Sys.file_exists)
|
2005 | |
alternatives
|
|
2613 |
Sys.file_exists file)
|
|
2614 |
&& not (Sys.is_directory file)
|
|
2615 |
) alternatives
|
|
2616 |
|
2006 | 2617 |
|
2007 | 2618 |
let which ~ctxt prg =
|
2008 | 2619 |
let path_sep =
|
|
2022 | 2633 |
in
|
2023 | 2634 |
find_file ~case_sensitive:false [path_lst; [prg]] exec_ext
|
2024 | 2635 |
|
|
2636 |
|
2025 | 2637 |
(**/**)
|
2026 | 2638 |
let rec fix_dir dn =
|
2027 | 2639 |
(* Windows hack because Sys.file_exists "src\\" = false when
|
|
2035 | 2647 |
else
|
2036 | 2648 |
dn
|
2037 | 2649 |
|
|
2650 |
|
2038 | 2651 |
let q = Filename.quote
|
2039 | 2652 |
(**/**)
|
|
2653 |
|
2040 | 2654 |
|
2041 | 2655 |
let cp ~ctxt ?(recurse=false) src tgt =
|
2042 | 2656 |
if recurse then
|
|
2054 | 2668 |
| _ -> "cp")
|
2055 | 2669 |
[q src; q tgt]
|
2056 | 2670 |
|
|
2671 |
|
2057 | 2672 |
let mkdir ~ctxt tgt =
|
2058 | 2673 |
OASISExec.run ~ctxt
|
2059 | 2674 |
(match Sys.os_type with
|
2060 | 2675 |
| "Win32" -> "md"
|
2061 | 2676 |
| _ -> "mkdir")
|
2062 | 2677 |
[q tgt]
|
|
2678 |
|
2063 | 2679 |
|
2064 | 2680 |
let rec mkdir_parent ~ctxt f tgt =
|
2065 | 2681 |
let tgt =
|
|
2083 | 2699 |
end
|
2084 | 2700 |
end
|
2085 | 2701 |
|
|
2702 |
|
2086 | 2703 |
let rmdir ~ctxt tgt =
|
2087 | 2704 |
if Sys.readdir tgt = [||] then
|
2088 | 2705 |
begin
|
|
2092 | 2709 |
| _ ->
|
2093 | 2710 |
OASISExec.run ~ctxt "rm" ["-r"; q tgt]
|
2094 | 2711 |
end
|
|
2712 |
|
2095 | 2713 |
|
2096 | 2714 |
let glob ~ctxt fn =
|
2097 | 2715 |
let basename =
|
|
2138 | 2756 |
end
|
2139 | 2757 |
|
2140 | 2758 |
|
2141 | |
# 2142 "setup.ml"
|
|
2759 |
# 2760 "setup.ml"
|
2142 | 2760 |
module BaseEnvLight = struct
|
2143 | |
(* # 21 "src/base/BaseEnvLight.ml" *)
|
|
2761 |
(* # 22 "src/base/BaseEnvLight.ml" *)
|
|
2762 |
|
2144 | 2763 |
|
2145 | 2764 |
module MapString = Map.Make(String)
|
2146 | 2765 |
|
|
2766 |
|
2147 | 2767 |
type t = string MapString.t
|
|
2768 |
|
2148 | 2769 |
|
2149 | 2770 |
let default_filename =
|
2150 | 2771 |
Filename.concat
|
2151 | 2772 |
(Sys.getcwd ())
|
2152 | 2773 |
"setup.data"
|
|
2774 |
|
2153 | 2775 |
|
2154 | 2776 |
let load ?(allow_empty=false) ?(filename=default_filename) () =
|
2155 | 2777 |
if Sys.file_exists filename then
|
|
2208 | 2830 |
filename)
|
2209 | 2831 |
end
|
2210 | 2832 |
|
|
2833 |
|
2211 | 2834 |
let var_get name env =
|
2212 | 2835 |
let rec var_expand str =
|
2213 | 2836 |
let buff =
|
|
2229 | 2852 |
in
|
2230 | 2853 |
var_expand (MapString.find name env)
|
2231 | 2854 |
|
|
2855 |
|
2232 | 2856 |
let var_choose lst env =
|
2233 | 2857 |
OASISExpr.choose
|
2234 | 2858 |
(fun nm -> var_get nm env)
|
|
2236 | 2860 |
end
|
2237 | 2861 |
|
2238 | 2862 |
|
2239 | |
# 2240 "setup.ml"
|
|
2863 |
# 2864 "setup.ml"
|
2240 | 2864 |
module BaseContext = struct
|
2241 | |
(* # 21 "src/base/BaseContext.ml" *)
|
|
2865 |
(* # 22 "src/base/BaseContext.ml" *)
|
|
2866 |
|
2242 | 2867 |
|
2243 | 2868 |
open OASISContext
|
2244 | 2869 |
|
|
2870 |
|
2245 | 2871 |
let args = args
|
2246 | 2872 |
|
|
2873 |
|
2247 | 2874 |
let default = default
|
2248 | 2875 |
|
2249 | 2876 |
end
|
2250 | 2877 |
|
2251 | 2878 |
module BaseMessage = struct
|
2252 | |
(* # 21 "src/base/BaseMessage.ml" *)
|
|
2879 |
(* # 22 "src/base/BaseMessage.ml" *)
|
|
2880 |
|
2253 | 2881 |
|
2254 | 2882 |
(** Message to user, overrid for Base
|
2255 | 2883 |
@author Sylvain Le Gall
|
|
2257 | 2885 |
open OASISMessage
|
2258 | 2886 |
open BaseContext
|
2259 | 2887 |
|
|
2888 |
|
2260 | 2889 |
let debug fmt = debug ~ctxt:!default fmt
|
2261 | 2890 |
|
|
2891 |
|
2262 | 2892 |
let info fmt = info ~ctxt:!default fmt
|
2263 | 2893 |
|
|
2894 |
|
2264 | 2895 |
let warning fmt = warning ~ctxt:!default fmt
|
2265 | 2896 |
|
|
2897 |
|
2266 | 2898 |
let error fmt = error ~ctxt:!default fmt
|
2267 | 2899 |
|
2268 | 2900 |
end
|
2269 | 2901 |
|
2270 | 2902 |
module BaseEnv = struct
|
2271 | |
(* # 21 "src/base/BaseEnv.ml" *)
|
|
2903 |
(* # 22 "src/base/BaseEnv.ml" *)
|
2272 | 2904 |
|
2273 | 2905 |
open OASISGettext
|
2274 | 2906 |
open OASISUtils
|
2275 | 2907 |
open PropList
|
2276 | 2908 |
|
|
2909 |
|
2277 | 2910 |
module MapString = BaseEnvLight.MapString
|
|
2911 |
|
2278 | 2912 |
|
2279 | 2913 |
type origin_t =
|
2280 | 2914 |
| ODefault
|
2281 | 2915 |
| OGetEnv
|
2282 | 2916 |
| OFileLoad
|
2283 | 2917 |
| OCommandLine
|
|
2918 |
|
2284 | 2919 |
|
2285 | 2920 |
type cli_handle_t =
|
2286 | 2921 |
| CLINone
|
|
2288 | 2923 |
| CLIWith
|
2289 | 2924 |
| CLIEnable
|
2290 | 2925 |
| CLIUser of (Arg.key * Arg.spec * Arg.doc) list
|
|
2926 |
|
2291 | 2927 |
|
2292 | 2928 |
type definition_t =
|
2293 | 2929 |
{
|
|
2298 | 2934 |
group: string option;
|
2299 | 2935 |
}
|
2300 | 2936 |
|
|
2937 |
|
2301 | 2938 |
let schema =
|
2302 | 2939 |
Schema.create "environment"
|
|
2940 |
|
2303 | 2941 |
|
2304 | 2942 |
(* Environment data *)
|
2305 | 2943 |
let env =
|
2306 | 2944 |
Data.create ()
|
2307 | 2945 |
|
|
2946 |
|
2308 | 2947 |
(* Environment data from file *)
|
2309 | 2948 |
let env_from_file =
|
2310 | 2949 |
ref MapString.empty
|
2311 | 2950 |
|
|
2951 |
|
2312 | 2952 |
(* Lexer for var *)
|
2313 | 2953 |
let var_lxr =
|
2314 | 2954 |
Genlex.make_lexer []
|
|
2955 |
|
2315 | 2956 |
|
2316 | 2957 |
let rec var_expand str =
|
2317 | 2958 |
let buff =
|
|
2363 | 3004 |
str;
|
2364 | 3005 |
Buffer.contents buff
|
2365 | 3006 |
|
|
3007 |
|
2366 | 3008 |
and var_get name =
|
2367 | 3009 |
let vl =
|
2368 | 3010 |
try
|
|
2377 | 3019 |
in
|
2378 | 3020 |
var_expand vl
|
2379 | 3021 |
|
|
3022 |
|
2380 | 3023 |
let var_choose ?printer ?name lst =
|
2381 | 3024 |
OASISExpr.choose
|
2382 | 3025 |
?printer
|
|
2384 | 3027 |
var_get
|
2385 | 3028 |
lst
|
2386 | 3029 |
|
|
3030 |
|
2387 | 3031 |
let var_protect vl =
|
2388 | 3032 |
let buff =
|
2389 | 3033 |
Buffer.create (String.length vl)
|
|
2394 | 3038 |
| c -> Buffer.add_char buff c)
|
2395 | 3039 |
vl;
|
2396 | 3040 |
Buffer.contents buff
|
|
3041 |
|
2397 | 3042 |
|
2398 | 3043 |
let var_define
|
2399 | 3044 |
?(hide=false)
|
|
2480 | 3125 |
fun () ->
|
2481 | 3126 |
var_expand (var_get_low (var_get_lst env))
|
2482 | 3127 |
|
|
3128 |
|
2483 | 3129 |
let var_redefine
|
2484 | 3130 |
?hide
|
2485 | 3131 |
?dump
|
|
2508 | 3154 |
dflt
|
2509 | 3155 |
end
|
2510 | 3156 |
|
2511 | |
let var_ignore (e : unit -> string) =
|
2512 | |
()
|
|
3157 |
|
|
3158 |
let var_ignore (e: unit -> string) = ()
|
|
3159 |
|
2513 | 3160 |
|
2514 | 3161 |
let print_hidden =
|
2515 | 3162 |
var_define
|
|
2519 | 3166 |
~arg_help:"Print even non-printable variable. (debug)"
|
2520 | 3167 |
"print_hidden"
|
2521 | 3168 |
(fun () -> "false")
|
|
3169 |
|
2522 | 3170 |
|
2523 | 3171 |
let var_all () =
|
2524 | 3172 |
List.rev
|
|
2531 | 3179 |
[]
|
2532 | 3180 |
schema)
|
2533 | 3181 |
|
|
3182 |
|
2534 | 3183 |
let default_filename =
|
2535 | 3184 |
BaseEnvLight.default_filename
|
2536 | 3185 |
|
|
3186 |
|
2537 | 3187 |
let load ?allow_empty ?filename () =
|
2538 | 3188 |
env_from_file := BaseEnvLight.load ?allow_empty ?filename ()
|
|
3189 |
|
2539 | 3190 |
|
2540 | 3191 |
let unload () =
|
2541 | 3192 |
env_from_file := MapString.empty;
|
2542 | 3193 |
Data.clear env
|
2543 | 3194 |
|
|
3195 |
|
2544 | 3196 |
let dump ?(filename=default_filename) () =
|
2545 | 3197 |
let chn =
|
2546 | 3198 |
open_out_bin filename
|
2547 | 3199 |
in
|
2548 | |
let output nm value =
|
|
3200 |
let output nm value =
|
2549 | 3201 |
Printf.fprintf chn "%s=%S\n" nm value
|
2550 | 3202 |
in
|
2551 | |
let mp_todo =
|
|
3203 |
let mp_todo =
|
2552 | 3204 |
(* Dump data from schema *)
|
2553 | 3205 |
Schema.fold
|
2554 | 3206 |
(fun mp_todo nm def _ ->
|
|
2574 | 3226 |
|
2575 | 3227 |
(* End of the dump *)
|
2576 | 3228 |
close_out chn
|
|
3229 |
|
2577 | 3230 |
|
2578 | 3231 |
let print () =
|
2579 | 3232 |
let printable_vars =
|
|
2613 | 3266 |
|
2614 | 3267 |
Printf.printf "\nConfiguration: \n";
|
2615 | 3268 |
List.iter
|
2616 | |
(fun (name,value) ->
|
|
3269 |
(fun (name, value) ->
|
2617 | 3270 |
Printf.printf "%s: %s %s\n" name (dot_pad name) value)
|
2618 | 3271 |
(List.rev printable_vars);
|
2619 | 3272 |
Printf.printf "\n%!"
|
|
3273 |
|
2620 | 3274 |
|
2621 | 3275 |
let args () =
|
2622 | 3276 |
let arg_concat =
|
|
2728 | 3382 |
end
|
2729 | 3383 |
|
2730 | 3384 |
module BaseArgExt = struct
|
2731 | |
(* # 21 "src/base/BaseArgExt.ml" *)
|
|
3385 |
(* # 22 "src/base/BaseArgExt.ml" *)
|
|
3386 |
|
2732 | 3387 |
|
2733 | 3388 |
open OASISUtils
|
2734 | 3389 |
open OASISGettext
|
|
3390 |
|
2735 | 3391 |
|
2736 | 3392 |
let parse argv args =
|
2737 | 3393 |
(* Simulate command line for Arg *)
|
|
2756 | 3412 |
end
|
2757 | 3413 |
|
2758 | 3414 |
module BaseCheck = struct
|
2759 | |
(* # 21 "src/base/BaseCheck.ml" *)
|
|
3415 |
(* # 22 "src/base/BaseCheck.ml" *)
|
|
3416 |
|
2760 | 3417 |
|
2761 | 3418 |
open BaseEnv
|
2762 | 3419 |
open BaseMessage
|
2763 | 3420 |
open OASISUtils
|
2764 | 3421 |
open OASISGettext
|
|
3422 |
|
2765 | 3423 |
|
2766 | 3424 |
let prog_best prg prg_lst =
|
2767 | 3425 |
var_redefine
|
|
2785 | 3443 |
| Some prg -> prg
|
2786 | 3444 |
| None -> raise Not_found)
|
2787 | 3445 |
|
|
3446 |
|
2788 | 3447 |
let prog prg =
|
2789 | 3448 |
prog_best prg [prg]
|
2790 | 3449 |
|
|
3450 |
|
2791 | 3451 |
let prog_opt prg =
|
2792 | 3452 |
prog_best prg [prg^".opt"; prg]
|
2793 | 3453 |
|
|
3454 |
|
2794 | 3455 |
let ocamlfind =
|
2795 | 3456 |
prog "ocamlfind"
|
|
3457 |
|
2796 | 3458 |
|
2797 | 3459 |
let version
|
2798 | 3460 |
var_prefix
|
|
2835 | 3497 |
version_str)
|
2836 | 3498 |
()
|
2837 | 3499 |
|
|
3500 |
|
2838 | 3501 |
let package_version pkg =
|
2839 | 3502 |
OASISExec.run_read_one_line ~ctxt:!BaseContext.default
|
2840 | 3503 |
(ocamlfind ())
|
2841 | 3504 |
["query"; "-format"; "%v"; pkg]
|
|
3505 |
|
2842 | 3506 |
|
2843 | 3507 |
let package ?version_comparator pkg () =
|
2844 | 3508 |
let var =
|
|
2882 | 3546 |
end
|
2883 | 3547 |
|
2884 | 3548 |
module BaseOCamlcConfig = struct
|
2885 | |
(* # 21 "src/base/BaseOCamlcConfig.ml" *)
|
|
3549 |
(* # 22 "src/base/BaseOCamlcConfig.ml" *)
|
2886 | 3550 |
|
2887 | 3551 |
|
2888 | 3552 |
open BaseEnv
|
2889 | 3553 |
open OASISUtils
|
2890 | 3554 |
open OASISGettext
|
2891 | 3555 |
|
|
3556 |
|
2892 | 3557 |
module SMap = Map.Make(String)
|
|
3558 |
|
2893 | 3559 |
|
2894 | 3560 |
let ocamlc =
|
2895 | 3561 |
BaseCheck.prog_opt "ocamlc"
|
|
3562 |
|
2896 | 3563 |
|
2897 | 3564 |
let ocamlc_config_map =
|
2898 | 3565 |
(* Map name to value for ocamlc -config output
|
|
2939 | 3606 |
mp
|
2940 | 3607 |
in
|
2941 | 3608 |
|
2942 | |
let cache =
|
|
3609 |
let cache =
|
2943 | 3610 |
lazy
|
2944 | 3611 |
(var_protect
|
2945 | 3612 |
(Marshal.to_string
|
|
2958 | 3625 |
(* TODO: update if ocamlc change !!! *)
|
2959 | 3626 |
Lazy.force cache)
|
2960 | 3627 |
|
|
3628 |
|
2961 | 3629 |
let var_define nm =
|
2962 | 3630 |
(* Extract data from ocamlc -config *)
|
2963 | 3631 |
let avlbl_config_get () =
|
|
2966 | 3634 |
0
|
2967 | 3635 |
in
|
2968 | 3636 |
let chop_version_suffix s =
|
2969 | |
try
|
|
3637 |
try
|
2970 | 3638 |
String.sub s 0 (String.index s '+')
|
2971 | |
with _ ->
|
|
3639 |
with _ ->
|
2972 | 3640 |
s
|
2973 | 3641 |
in
|
2974 | 3642 |
|
2975 | 3643 |
let nm_config, value_config =
|
2976 | 3644 |
match nm with
|
2977 | |
| "ocaml_version" ->
|
|
3645 |
| "ocaml_version" ->
|
2978 | 3646 |
"version", chop_version_suffix
|
2979 | 3647 |
| _ -> nm, (fun x -> x)
|
2980 | 3648 |
in
|
|
2998 | 3666 |
end
|
2999 | 3667 |
|
3000 | 3668 |
module BaseStandardVar = struct
|
3001 | |
(* # 21 "src/base/BaseStandardVar.ml" *)
|
|
3669 |
(* # 22 "src/base/BaseStandardVar.ml" *)
|
3002 | 3670 |
|
3003 | 3671 |
|
3004 | 3672 |
open OASISGettext
|
|
3007 | 3675 |
open BaseCheck
|
3008 | 3676 |
open BaseEnv
|
3009 | 3677 |
|
|
3678 |
|
3010 | 3679 |
let ocamlfind = BaseCheck.ocamlfind
|
3011 | 3680 |
let ocamlc = BaseOCamlcConfig.ocamlc
|
3012 | 3681 |
let ocamlopt = prog_opt "ocamlopt"
|
|
3017 | 3686 |
let rpkg =
|
3018 | 3687 |
ref None
|
3019 | 3688 |
|
|
3689 |
|
3020 | 3690 |
let pkg_get () =
|
3021 | 3691 |
match !rpkg with
|
3022 | 3692 |
| Some pkg -> pkg
|
3023 | 3693 |
| None -> failwith (s_ "OASIS Package is not set")
|
3024 | 3694 |
|
|
3695 |
|
3025 | 3696 |
let var_cond = ref []
|
|
3697 |
|
3026 | 3698 |
|
3027 | 3699 |
let var_define_cond ~since_version f dflt =
|
3028 | 3700 |
let holder = ref (fun () -> dflt) in
|
|
3035 | 3707 |
holder := f ()) :: !var_cond;
|
3036 | 3708 |
fun () -> !holder ()
|
3037 | 3709 |
|
|
3710 |
|
3038 | 3711 |
(**/**)
|
|
3712 |
|
3039 | 3713 |
|
3040 | 3714 |
let pkg_name =
|
3041 | 3715 |
var_define
|
3042 | 3716 |
~short_desc:(fun () -> s_ "Package name")
|
3043 | 3717 |
"pkg_name"
|
3044 | 3718 |
(fun () -> (pkg_get ()).name)
|
|
3719 |
|
3045 | 3720 |
|
3046 | 3721 |
let pkg_version =
|
3047 | 3722 |
var_define
|
|
3050 | 3725 |
(fun () ->
|
3051 | 3726 |
(OASISVersion.string_of_version (pkg_get ()).version))
|
3052 | 3727 |
|
|
3728 |
|
3053 | 3729 |
let c = BaseOCamlcConfig.var_define
|
|
3730 |
|
3054 | 3731 |
|
3055 | 3732 |
let os_type = c "os_type"
|
3056 | 3733 |
let system = c "system"
|
|
3058 | 3735 |
let ccomp_type = c "ccomp_type"
|
3059 | 3736 |
let ocaml_version = c "ocaml_version"
|
3060 | 3737 |
|
|
3738 |
|
3061 | 3739 |
(* TODO: Check standard variable presence at runtime *)
|
|
3740 |
|
3062 | 3741 |
|
3063 | 3742 |
let standard_library_default = c "standard_library_default"
|
3064 | 3743 |
let standard_library = c "standard_library"
|
|
3073 | 3752 |
let default_executable_name = c "default_executable_name"
|
3074 | 3753 |
let systhread_supported = c "systhread_supported"
|
3075 | 3754 |
|
3076 | |
let flexlink =
|
|
3755 |
|
|
3756 |
let flexlink =
|
3077 | 3757 |
BaseCheck.prog "flexlink"
|
|
3758 |
|
3078 | 3759 |
|
3079 | 3760 |
let flexdll_version =
|
3080 | 3761 |
var_define
|
3081 | 3762 |
~short_desc:(fun () -> "FlexDLL version (Win32)")
|
3082 | 3763 |
"flexdll_version"
|
3083 | 3764 |
(fun () ->
|
3084 | |
let lst =
|
|
3765 |
let lst =
|
3085 | 3766 |
OASISExec.run_read_output ~ctxt:!BaseContext.default
|
3086 | 3767 |
(flexlink ()) ["-help"]
|
3087 | 3768 |
in
|
3088 | |
match lst with
|
|
3769 |
match lst with
|
3089 | 3770 |
| line :: _ ->
|
3090 | 3771 |
Scanf.sscanf line "FlexDLL version %s" (fun ver -> ver)
|
3091 | 3772 |
| [] ->
|
3092 | 3773 |
raise Not_found)
|
|
3774 |
|
3093 | 3775 |
|
3094 | 3776 |
(**/**)
|
3095 | 3777 |
let p name hlp dflt =
|
|
3099 | 3781 |
~arg_help:"dir"
|
3100 | 3782 |
name
|
3101 | 3783 |
dflt
|
|
3784 |
|
3102 | 3785 |
|
3103 | 3786 |
let (/) a b =
|
3104 | 3787 |
if os_type () = Sys.os_type then
|
|
3109 | 3792 |
OASISUtils.failwithf (f_ "Cannot handle os_type %s filename concat")
|
3110 | 3793 |
(os_type ())
|
3111 | 3794 |
(**/**)
|
|
3795 |
|
3112 | 3796 |
|
3113 | 3797 |
let prefix =
|
3114 | 3798 |
p "prefix"
|
|
3123 | 3807 |
| _ ->
|
3124 | 3808 |
"/usr/local")
|
3125 | 3809 |
|
|
3810 |
|
3126 | 3811 |
let exec_prefix =
|
3127 | 3812 |
p "exec_prefix"
|
3128 | 3813 |
(fun () -> s_ "Install architecture-dependent files in dir")
|
3129 | 3814 |
(fun () -> "$prefix")
|
3130 | 3815 |
|
|
3816 |
|
3131 | 3817 |
let bindir =
|
3132 | 3818 |
p "bindir"
|
3133 | 3819 |
(fun () -> s_ "User executables")
|
3134 | 3820 |
(fun () -> "$exec_prefix"/"bin")
|
3135 | 3821 |
|
|
3822 |
|
3136 | 3823 |
let sbindir =
|
3137 | 3824 |
p "sbindir"
|
3138 | 3825 |
(fun () -> s_ "System admin executables")
|
3139 | 3826 |
(fun () -> "$exec_prefix"/"sbin")
|
3140 | 3827 |
|
|
3828 |
|
3141 | 3829 |
let libexecdir =
|
3142 | 3830 |
p "libexecdir"
|
3143 | 3831 |
(fun () -> s_ "Program executables")
|
3144 | 3832 |
(fun () -> "$exec_prefix"/"libexec")
|
3145 | 3833 |
|
|
3834 |
|
3146 | 3835 |
let sysconfdir =
|
3147 | 3836 |
p "sysconfdir"
|
3148 | 3837 |
(fun () -> s_ "Read-only single-machine data")
|
3149 | 3838 |
(fun () -> "$prefix"/"etc")
|
3150 | 3839 |
|
|
3840 |
|
3151 | 3841 |
let sharedstatedir =
|
3152 | 3842 |
p "sharedstatedir"
|
3153 | 3843 |
(fun () -> s_ "Modifiable architecture-independent data")
|
3154 | 3844 |
(fun () -> "$prefix"/"com")
|
3155 | 3845 |
|
|
3846 |
|
3156 | 3847 |
let localstatedir =
|
3157 | 3848 |
p "localstatedir"
|
3158 | 3849 |
(fun () -> s_ "Modifiable single-machine data")
|
3159 | 3850 |
(fun () -> "$prefix"/"var")
|
3160 | 3851 |
|
|
3852 |
|
3161 | 3853 |
let libdir =
|
3162 | 3854 |
p "libdir"
|
3163 | 3855 |
(fun () -> s_ "Object code libraries")
|
3164 | 3856 |
(fun () -> "$exec_prefix"/"lib")
|
3165 | 3857 |
|
|
3858 |
|
3166 | 3859 |
let datarootdir =
|
3167 | 3860 |
p "datarootdir"
|
3168 | 3861 |
(fun () -> s_ "Read-only arch-independent data root")
|
3169 | 3862 |
(fun () -> "$prefix"/"share")
|
3170 | 3863 |
|
|
3864 |
|
3171 | 3865 |
let datadir =
|
3172 | 3866 |
p "datadir"
|
3173 | 3867 |
(fun () -> s_ "Read-only architecture-independent data")
|
3174 | 3868 |
(fun () -> "$datarootdir")
|
3175 | 3869 |
|
|
3870 |
|
3176 | 3871 |
let infodir =
|
3177 | 3872 |
p "infodir"
|
3178 | 3873 |
(fun () -> s_ "Info documentation")
|
3179 | 3874 |
(fun () -> "$datarootdir"/"info")
|
3180 | 3875 |
|
|
3876 |
|
3181 | 3877 |
let localedir =
|
3182 | 3878 |
p "localedir"
|
3183 | 3879 |
(fun () -> s_ "Locale-dependent data")
|
3184 | 3880 |
(fun () -> "$datarootdir"/"locale")
|
3185 | 3881 |
|
|
3882 |
|
3186 | 3883 |
let mandir =
|
3187 | 3884 |
p "mandir"
|
3188 | 3885 |
(fun () -> s_ "Man documentation")
|
3189 | 3886 |
(fun () -> "$datarootdir"/"man")
|
3190 | 3887 |
|
|
3888 |
|
3191 | 3889 |
let docdir =
|
3192 | 3890 |
p "docdir"
|
3193 | 3891 |
(fun () -> s_ "Documentation root")
|
3194 | 3892 |
(fun () -> "$datarootdir"/"doc"/"$pkg_name")
|
3195 | 3893 |
|
|
3894 |
|
3196 | 3895 |
let htmldir =
|
3197 | 3896 |
p "htmldir"
|
3198 | 3897 |
(fun () -> s_ "HTML documentation")
|
3199 | 3898 |
(fun () -> "$docdir")
|
3200 | 3899 |
|
|
3900 |
|
3201 | 3901 |
let dvidir =
|
3202 | 3902 |
p "dvidir"
|
3203 | 3903 |
(fun () -> s_ "DVI documentation")
|
3204 | 3904 |
(fun () -> "$docdir")
|
3205 | 3905 |
|
|
3906 |
|
3206 | 3907 |
let pdfdir =
|
3207 | 3908 |
p "pdfdir"
|
3208 | 3909 |
(fun () -> s_ "PDF documentation")
|
3209 | 3910 |
(fun () -> "$docdir")
|
3210 | 3911 |
|
|
3912 |
|
3211 | 3913 |
let psdir =
|
3212 | 3914 |
p "psdir"
|
3213 | 3915 |
(fun () -> s_ "PS documentation")
|
3214 | 3916 |
(fun () -> "$docdir")
|
|
3917 |
|
3215 | 3918 |
|
3216 | 3919 |
let destdir =
|
3217 | 3920 |
p "destdir"
|
|
3222 | 3925 |
("destdir",
|
3223 | 3926 |
Some (s_ "undefined by construct"))))
|
3224 | 3927 |
|
|
3928 |
|
3225 | 3929 |
let findlib_version =
|
3226 | 3930 |
var_define
|
3227 | 3931 |
"findlib_version"
|
3228 | 3932 |
(fun () ->
|
3229 | 3933 |
BaseCheck.package_version "findlib")
|
3230 | 3934 |
|
|
3935 |
|
3231 | 3936 |
let is_native =
|
3232 | 3937 |
var_define
|
3233 | 3938 |
"is_native"
|
3234 | 3939 |
(fun () ->
|
3235 | 3940 |
try
|
3236 | |
let _s : string =
|
|
3941 |
let _s: string =
|
3237 | 3942 |
ocamlopt ()
|
3238 | 3943 |
in
|
3239 | 3944 |
"true"
|
3240 | 3945 |
with PropList.Not_set _ ->
|
3241 | |
let _s : string =
|
|
3946 |
let _s: string =
|
3242 | 3947 |
ocamlc ()
|
3243 | 3948 |
in
|
3244 | 3949 |
"false")
|
|
3950 |
|
3245 | 3951 |
|
3246 | 3952 |
let ext_program =
|
3247 | 3953 |
var_define
|
3248 | 3954 |
"suffix_program"
|
3249 | 3955 |
(fun () ->
|
3250 | 3956 |
match os_type () with
|
3251 | |
| "Win32" -> ".exe"
|
|
3957 |
| "Win32" | "Cygwin" -> ".exe"
|
3252 | 3958 |
| _ -> "")
|
|
3959 |
|
3253 | 3960 |
|
3254 | 3961 |
let rm =
|
3255 | 3962 |
var_define
|
|
3260 | 3967 |
| "Win32" -> "del"
|
3261 | 3968 |
| _ -> "rm -f")
|
3262 | 3969 |
|
|
3970 |
|
3263 | 3971 |
let rmdir =
|
3264 | 3972 |
var_define
|
3265 | 3973 |
~short_desc:(fun () -> s_ "Remove a directory.")
|
|
3269 | 3977 |
| "Win32" -> "rd"
|
3270 | 3978 |
| _ -> "rm -rf")
|
3271 | 3979 |
|
|
3980 |
|
3272 | 3981 |
let debug =
|
3273 | 3982 |
var_define
|
3274 | 3983 |
~short_desc:(fun () -> s_ "Turn ocaml debug flag on")
|
|
3276 | 3985 |
"debug"
|
3277 | 3986 |
(fun () -> "true")
|
3278 | 3987 |
|
|
3988 |
|
3279 | 3989 |
let profile =
|
3280 | 3990 |
var_define
|
3281 | 3991 |
~short_desc:(fun () -> s_ "Turn ocaml profile flag on")
|
3282 | 3992 |
~cli:CLIEnable
|
3283 | 3993 |
"profile"
|
3284 | 3994 |
(fun () -> "false")
|
|
3995 |
|
3285 | 3996 |
|
3286 | 3997 |
let tests =
|
3287 | 3998 |
var_define_cond ~since_version:"0.3"
|
|
3294 | 4005 |
(fun () -> "false"))
|
3295 | 4006 |
"true"
|
3296 | 4007 |
|
|
4008 |
|
3297 | 4009 |
let docs =
|
3298 | 4010 |
var_define_cond ~since_version:"0.3"
|
3299 | 4011 |
(fun () ->
|
|
3304 | 4016 |
(fun () -> "true"))
|
3305 | 4017 |
"true"
|
3306 | 4018 |
|
|
4019 |
|
3307 | 4020 |
let native_dynlink =
|
3308 | 4021 |
var_define
|
3309 | 4022 |
~short_desc:(fun () -> s_ "Compiler support generation of .cmxs.")
|
|
3311 | 4024 |
"native_dynlink"
|
3312 | 4025 |
(fun () ->
|
3313 | 4026 |
let res =
|
3314 | |
let ocaml_lt_312 () =
|
|
4027 |
let ocaml_lt_312 () =
|
3315 | 4028 |
OASISVersion.comparator_apply
|
3316 | 4029 |
(OASISVersion.version_of_string (ocaml_version ()))
|
3317 | 4030 |
(OASISVersion.VLesser
|
|
3323 | 4036 |
(OASISVersion.VLesser
|
3324 | 4037 |
(OASISVersion.version_of_string "0.30"))
|
3325 | 4038 |
in
|
3326 | |
let has_native_dynlink =
|
|
4039 |
let has_native_dynlink =
|
3327 | 4040 |
let ocamlfind = ocamlfind () in
|
3328 | 4041 |
try
|
3329 | 4042 |
let fn =
|
|
3341 | 4054 |
false
|
3342 | 4055 |
else if ocaml_lt_312 () then
|
3343 | 4056 |
false
|
3344 | |
else if (os_type () = "Win32" || os_type () = "Cygwin")
|
|
4057 |
else if (os_type () = "Win32" || os_type () = "Cygwin")
|
3345 | 4058 |
&& flexdll_lt_030 () then
|
3346 | 4059 |
begin
|
3347 | |
BaseMessage.warning
|
|
4060 |
BaseMessage.warning
|
3348 | 4061 |
(f_ ".cmxs generation disabled because FlexDLL needs to be \
|
3349 | 4062 |
at least 0.30. Please upgrade FlexDLL from %s to 0.30.")
|
3350 | 4063 |
(flexdll_version ());
|
|
3355 | 4068 |
in
|
3356 | 4069 |
string_of_bool res)
|
3357 | 4070 |
|
|
4071 |
|
3358 | 4072 |
let init pkg =
|
3359 | 4073 |
rpkg := Some pkg;
|
3360 | 4074 |
List.iter (fun f -> f pkg.oasis_version) !var_cond
|
|
3362 | 4076 |
end
|
3363 | 4077 |
|
3364 | 4078 |
module BaseFileAB = struct
|
3365 | |
(* # 21 "src/base/BaseFileAB.ml" *)
|
|
4079 |
(* # 22 "src/base/BaseFileAB.ml" *)
|
|
4080 |
|
3366 | 4081 |
|
3367 | 4082 |
open BaseEnv
|
3368 | 4083 |
open OASISGettext
|
3369 | 4084 |
open BaseMessage
|
|
4085 |
|
3370 | 4086 |
|
3371 | 4087 |
let to_filename fn =
|
3372 | 4088 |
let fn =
|
|
3377 | 4093 |
(f_ "File '%s' doesn't have '.ab' extension")
|
3378 | 4094 |
fn;
|
3379 | 4095 |
Filename.chop_extension fn
|
|
4096 |
|
3380 | 4097 |
|
3381 | 4098 |
let replace fn_lst =
|
3382 | 4099 |
let buff =
|
|
3410 | 4127 |
end
|
3411 | 4128 |
|
3412 | 4129 |
module BaseLog = struct
|
3413 | |
(* # 21 "src/base/BaseLog.ml" *)
|
|
4130 |
(* # 22 "src/base/BaseLog.ml" *)
|
|
4131 |
|
3414 | 4132 |
|
3415 | 4133 |
open OASISUtils
|
|
4134 |
|
3416 | 4135 |
|
3417 | 4136 |
let default_filename =
|
3418 | 4137 |
Filename.concat
|
3419 | 4138 |
(Filename.dirname BaseEnv.default_filename)
|
3420 | 4139 |
"setup.log"
|
|
4140 |
|
3421 | 4141 |
|
3422 | 4142 |
module SetTupleString =
|
3423 | 4143 |
Set.Make
|
|
3428 | 4148 |
| 0 -> String.compare s12 s22
|
3429 | 4149 |
| n -> n
|
3430 | 4150 |
end)
|
|
4151 |
|
3431 | 4152 |
|
3432 | 4153 |
let load () =
|
3433 | 4154 |
if Sys.file_exists default_filename then
|
|
3478 | 4199 |
[]
|
3479 | 4200 |
end
|
3480 | 4201 |
|
|
4202 |
|
3481 | 4203 |
let register event data =
|
3482 | 4204 |
let chn_out =
|
3483 | 4205 |
open_out_gen [Open_append; Open_creat; Open_text] 0o644 default_filename
|
3484 | 4206 |
in
|
3485 | 4207 |
Printf.fprintf chn_out "%S %S\n" event data;
|
3486 | 4208 |
close_out chn_out
|
|
4209 |
|
3487 | 4210 |
|
3488 | 4211 |
let unregister event data =
|
3489 | 4212 |
if Sys.file_exists default_filename then
|
|
3510 | 4233 |
Sys.remove default_filename
|
3511 | 4234 |
end
|
3512 | 4235 |
|
|
4236 |
|
3513 | 4237 |
let filter events =
|
3514 | 4238 |
let st_events =
|
3515 | 4239 |
List.fold_left
|
|
3522 | 4246 |
(fun (e, _) -> SetString.mem e st_events)
|
3523 | 4247 |
(load ())
|
3524 | 4248 |
|
|
4249 |
|
3525 | 4250 |
let exists event data =
|
3526 | 4251 |
List.exists
|
3527 | 4252 |
(fun v -> (event, data) = v)
|
|
3529 | 4254 |
end
|
3530 | 4255 |
|
3531 | 4256 |
module BaseBuilt = struct
|
3532 | |
(* # 21 "src/base/BaseBuilt.ml" *)
|
|
4257 |
(* # 22 "src/base/BaseBuilt.ml" *)
|
|
4258 |
|
3533 | 4259 |
|
3534 | 4260 |
open OASISTypes
|
3535 | 4261 |
open OASISGettext
|
3536 | 4262 |
open BaseStandardVar
|
3537 | 4263 |
open BaseMessage
|
3538 | 4264 |
|
|
4265 |
|
3539 | 4266 |
type t =
|
3540 | 4267 |
| BExec (* Executable *)
|
3541 | 4268 |
| BExecLib (* Library coming with executable *)
|
3542 | 4269 |
| BLib (* Library *)
|
|
4270 |
| BObj (* Library *)
|
3543 | 4271 |
| BDoc (* Document *)
|
|
4272 |
|
3544 | 4273 |
|
3545 | 4274 |
let to_log_event_file t nm =
|
3546 | 4275 |
"built_"^
|
|
3548 | 4277 |
| BExec -> "exec"
|
3549 | 4278 |
| BExecLib -> "exec_lib"
|
3550 | 4279 |
| BLib -> "lib"
|
|
4280 |
| BObj -> "obj"
|
3551 | 4281 |
| BDoc -> "doc")^
|
3552 | 4282 |
"_"^nm
|
3553 | 4283 |
|
|
4284 |
|
3554 | 4285 |
let to_log_event_done t nm =
|
3555 | 4286 |
"is_"^(to_log_event_file t nm)
|
|
4287 |
|
3556 | 4288 |
|
3557 | 4289 |
let register t nm lst =
|
3558 | 4290 |
BaseLog.register
|
|
3584 | 4316 |
(String.concat (s_ ", ") alt))
|
3585 | 4317 |
lst
|
3586 | 4318 |
|
|
4319 |
|
3587 | 4320 |
let unregister t nm =
|
3588 | 4321 |
List.iter
|
3589 | 4322 |
(fun (e, d) ->
|
|
3591 | 4324 |
(BaseLog.filter
|
3592 | 4325 |
[to_log_event_file t nm;
|
3593 | 4326 |
to_log_event_done t nm])
|
|
4327 |
|
3594 | 4328 |
|
3595 | 4329 |
let fold t nm f acc =
|
3596 | 4330 |
List.fold_left
|
|
3611 | 4345 |
(f_ "executable %s")
|
3612 | 4346 |
| BLib ->
|
3613 | 4347 |
(f_ "library %s")
|
|
4348 |
| BObj ->
|
|
4349 |
(f_ "object %s")
|
3614 | 4350 |
| BDoc ->
|
3615 | 4351 |
(f_ "documentation %s"))
|
3616 | 4352 |
nm);
|
|
3619 | 4355 |
acc
|
3620 | 4356 |
(BaseLog.filter
|
3621 | 4357 |
[to_log_event_file t nm])
|
|
4358 |
|
3622 | 4359 |
|
3623 | 4360 |
let is_built t nm =
|
3624 | 4361 |
List.fold_left
|
|
3631 | 4368 |
(BaseLog.filter
|
3632 | 4369 |
[to_log_event_done t nm])
|
3633 | 4370 |
|
|
4371 |
|
3634 | 4372 |
let of_executable ffn (cs, bs, exec) =
|
3635 | 4373 |
let unix_exec_is, unix_dll_opt =
|
3636 | 4374 |
OASISExecutable.unix_exec_is
|
|
3653 | 4391 |
evs,
|
3654 | 4392 |
unix_exec_is,
|
3655 | 4393 |
unix_dll_opt
|
|
4394 |
|
3656 | 4395 |
|
3657 | 4396 |
let of_library ffn (cs, bs, lib) =
|
3658 | 4397 |
let unix_lst =
|
|
3673 | 4412 |
in
|
3674 | 4413 |
evs, unix_lst
|
3675 | 4414 |
|
|
4415 |
|
|
4416 |
let of_object ffn (cs, bs, obj) =
|
|
4417 |
let unix_lst =
|
|
4418 |
OASISObject.generated_unix_files
|
|
4419 |
~ctxt:!BaseContext.default
|
|
4420 |
~source_file_exists:(fun fn ->
|
|
4421 |
OASISFileUtil.file_exists_case (OASISHostPath.of_unix fn))
|
|
4422 |
~is_native:(bool_of_string (is_native ()))
|
|
4423 |
(cs, bs, obj)
|
|
4424 |
in
|
|
4425 |
let evs =
|
|
4426 |
[BObj,
|
|
4427 |
cs.cs_name,
|
|
4428 |
List.map (List.map ffn) unix_lst]
|
|
4429 |
in
|
|
4430 |
evs, unix_lst
|
|
4431 |
|
3676 | 4432 |
end
|
3677 | 4433 |
|
3678 | 4434 |
module BaseCustom = struct
|
3679 | |
(* # 21 "src/base/BaseCustom.ml" *)
|
|
4435 |
(* # 22 "src/base/BaseCustom.ml" *)
|
|
4436 |
|
3680 | 4437 |
|
3681 | 4438 |
open BaseEnv
|
3682 | 4439 |
open BaseMessage
|
3683 | 4440 |
open OASISTypes
|
3684 | 4441 |
open OASISGettext
|
|
4442 |
|
3685 | 4443 |
|
3686 | 4444 |
let run cmd args extra_args =
|
3687 | 4445 |
OASISExec.run ~ctxt:!BaseContext.default ~quote:false
|
|
3689 | 4447 |
(List.map
|
3690 | 4448 |
var_expand
|
3691 | 4449 |
(args @ (Array.to_list extra_args)))
|
|
4450 |
|
3692 | 4451 |
|
3693 | 4452 |
let hook ?(failsafe=false) cstm f e =
|
3694 | 4453 |
let optional_command lst =
|
|
3726 | 4485 |
end
|
3727 | 4486 |
|
3728 | 4487 |
module BaseDynVar = struct
|
3729 | |
(* # 21 "src/base/BaseDynVar.ml" *)
|
|
4488 |
(* # 22 "src/base/BaseDynVar.ml" *)
|
3730 | 4489 |
|
3731 | 4490 |
|
3732 | 4491 |
open OASISTypes
|
3733 | 4492 |
open OASISGettext
|
3734 | 4493 |
open BaseEnv
|
3735 | 4494 |
open BaseBuilt
|
|
4495 |
|
3736 | 4496 |
|
3737 | 4497 |
let init pkg =
|
3738 | 4498 |
(* TODO: disambiguate exec vs other variable by adding exec_VARNAME. *)
|
|
3767 | 4527 |
(f_ "Executable '%s' not yet built.")
|
3768 | 4528 |
cs.cs_name)))))
|
3769 | 4529 |
|
3770 | |
| Library _ | Flag _ | Test _ | SrcRepo _ | Doc _ ->
|
|
4530 |
| Library _ | Object _ | Flag _ | Test _ | SrcRepo _ | Doc _ ->
|
3771 | 4531 |
())
|
3772 | 4532 |
pkg.sections
|
3773 | 4533 |
end
|
3774 | 4534 |
|
3775 | 4535 |
module BaseTest = struct
|
3776 | |
(* # 21 "src/base/BaseTest.ml" *)
|
|
4536 |
(* # 22 "src/base/BaseTest.ml" *)
|
|
4537 |
|
3777 | 4538 |
|
3778 | 4539 |
open BaseEnv
|
3779 | 4540 |
open BaseMessage
|
3780 | 4541 |
open OASISTypes
|
3781 | 4542 |
open OASISExpr
|
3782 | 4543 |
open OASISGettext
|
|
4544 |
|
3783 | 4545 |
|
3784 | 4546 |
let test lst pkg extra_args =
|
3785 | 4547 |
|
|
3831 | 4593 |
(failure, n)
|
3832 | 4594 |
end
|
3833 | 4595 |
in
|
3834 | |
let (failed, n) =
|
|
4596 |
let failed, n =
|
3835 | 4597 |
List.fold_left
|
3836 | 4598 |
one_test
|
3837 | 4599 |
(0.0, 0)
|
|
3854 | 4616 |
info "%s" msg;
|
3855 | 4617 |
|
3856 | 4618 |
(* Possible explanation why the tests where not run. *)
|
3857 | |
if OASISVersion.version_0_3_or_after pkg.oasis_version &&
|
|
4619 |
if OASISFeatures.package_test OASISFeatures.flag_tests pkg &&
|
3858 | 4620 |
not (bool_of_string (BaseStandardVar.tests ())) &&
|
3859 | 4621 |
lst <> [] then
|
3860 | 4622 |
BaseMessage.warning
|
|
3863 | 4625 |
end
|
3864 | 4626 |
|
3865 | 4627 |
module BaseDoc = struct
|
3866 | |
(* # 21 "src/base/BaseDoc.ml" *)
|
|
4628 |
(* # 22 "src/base/BaseDoc.ml" *)
|
|
4629 |
|
3867 | 4630 |
|
3868 | 4631 |
open BaseEnv
|
3869 | 4632 |
open BaseMessage
|
3870 | 4633 |
open OASISTypes
|
3871 | 4634 |
open OASISGettext
|
|
4635 |
|
3872 | 4636 |
|
3873 | 4637 |
let doc lst pkg extra_args =
|
3874 | 4638 |
|
|
3889 | 4653 |
in
|
3890 | 4654 |
List.iter one_doc lst;
|
3891 | 4655 |
|
3892 | |
if OASISVersion.version_0_3_or_after pkg.oasis_version &&
|
|
4656 |
if OASISFeatures.package_test OASISFeatures.flag_docs pkg &&
|
3893 | 4657 |
not (bool_of_string (BaseStandardVar.docs ())) &&
|
3894 | 4658 |
lst <> [] then
|
3895 | 4659 |
BaseMessage.warning
|
|
3898 | 4662 |
end
|
3899 | 4663 |
|
3900 | 4664 |
module BaseSetup = struct
|
3901 | |
(* # 21 "src/base/BaseSetup.ml" *)
|
|
4665 |
(* # 22 "src/base/BaseSetup.ml" *)
|
3902 | 4666 |
|
3903 | 4667 |
open BaseEnv
|
3904 | 4668 |
open BaseMessage
|
|
3907 | 4671 |
open OASISGettext
|
3908 | 4672 |
open OASISUtils
|
3909 | 4673 |
|
|
4674 |
|
3910 | 4675 |
type std_args_fun =
|
3911 | 4676 |
package -> string array -> unit
|
3912 | 4677 |
|
|
4678 |
|
3913 | 4679 |
type ('a, 'b) section_args_fun =
|
3914 | 4680 |
name * (package -> (common_section * 'a) -> string array -> 'b)
|
|
4681 |
|
3915 | 4682 |
|
3916 | 4683 |
type t =
|
3917 | 4684 |
{
|
|
3936 | 4703 |
setup_update: bool;
|
3937 | 4704 |
}
|
3938 | 4705 |
|
|
4706 |
|
3939 | 4707 |
(* Associate a plugin function with data from package *)
|
3940 | 4708 |
let join_plugin_sections filter_map lst =
|
3941 | 4709 |
List.rev
|
|
3949 | 4717 |
[]
|
3950 | 4718 |
lst)
|
3951 | 4719 |
|
|
4720 |
|
3952 | 4721 |
(* Search for plugin data associated with a section name *)
|
3953 | 4722 |
let lookup_plugin_section plugin action nm lst =
|
3954 | 4723 |
try
|
|
3960 | 4729 |
nm
|
3961 | 4730 |
action
|
3962 | 4731 |
|
|
4732 |
|
3963 | 4733 |
let configure t args =
|
3964 | 4734 |
(* Run configure *)
|
3965 | 4735 |
BaseCustom.hook
|
3966 | 4736 |
t.package.conf_custom
|
3967 | |
(fun () ->
|
|
4737 |
(fun () ->
|
3968 | 4738 |
(* Reload if preconf has changed it *)
|
3969 | 4739 |
begin
|
3970 | 4740 |
try
|
|
3991 | 4761 |
(* Replace data in file *)
|
3992 | 4762 |
BaseFileAB.replace t.package.files_ab
|
3993 | 4763 |
|
|
4764 |
|
3994 | 4765 |
let build t args =
|
3995 | 4766 |
BaseCustom.hook
|
3996 | 4767 |
t.package.build_custom
|
3997 | 4768 |
(t.build t.package)
|
3998 | 4769 |
args
|
|
4770 |
|
3999 | 4771 |
|
4000 | 4772 |
let doc t args =
|
4001 | 4773 |
BaseDoc.doc
|
|
4016 | 4788 |
t.package
|
4017 | 4789 |
args
|
4018 | 4790 |
|
|
4791 |
|
4019 | 4792 |
let test t args =
|
4020 | 4793 |
BaseTest.test
|
4021 | 4794 |
(join_plugin_sections
|
|
4035 | 4808 |
t.package
|
4036 | 4809 |
args
|
4037 | 4810 |
|
|
4811 |
|
4038 | 4812 |
let all t args =
|
4039 | 4813 |
let rno_doc =
|
4040 | 4814 |
ref false
|
4041 | 4815 |
in
|
4042 | 4816 |
let rno_test =
|
4043 | 4817 |
ref false
|
|
4818 |
in
|
|
4819 |
let arg_rest =
|
|
4820 |
ref []
|
4044 | 4821 |
in
|
4045 | 4822 |
Arg.parse_argv
|
4046 | 4823 |
~current:(ref 0)
|
|
4055 | 4832 |
"-no-test",
|
4056 | 4833 |
Arg.Set rno_test,
|
4057 | 4834 |
s_ "Don't run test target";
|
|
4835 |
|
|
4836 |
"--",
|
|
4837 |
Arg.Rest (fun arg -> arg_rest := arg :: !arg_rest),
|
|
4838 |
s_ "All arguments for configure.";
|
4058 | 4839 |
]
|
4059 | 4840 |
(failwithf (f_ "Don't know what to do with '%s'"))
|
4060 | 4841 |
"";
|
4061 | 4842 |
|
4062 | 4843 |
info "Running configure step";
|
4063 | |
configure t [||];
|
|
4844 |
configure t (Array.of_list (List.rev !arg_rest));
|
4064 | 4845 |
|
4065 | 4846 |
info "Running build step";
|
4066 | 4847 |
build t [||];
|
|
4088 | 4869 |
info "Skipping test step"
|
4089 | 4870 |
end
|
4090 | 4871 |
|
|
4872 |
|
4091 | 4873 |
let install t args =
|
4092 | 4874 |
BaseCustom.hook
|
4093 | 4875 |
t.package.install_custom
|
4094 | 4876 |
(t.install t.package)
|
4095 | 4877 |
args
|
4096 | 4878 |
|
|
4879 |
|
4097 | 4880 |
let uninstall t args =
|
4098 | 4881 |
BaseCustom.hook
|
4099 | 4882 |
t.package.uninstall_custom
|
4100 | 4883 |
(t.uninstall t.package)
|
4101 | 4884 |
args
|
4102 | 4885 |
|
|
4886 |
|
4103 | 4887 |
let reinstall t args =
|
4104 | 4888 |
uninstall t args;
|
4105 | 4889 |
install t args
|
|
4890 |
|
4106 | 4891 |
|
4107 | 4892 |
let clean, distclean =
|
4108 | 4893 |
let failsafe f a =
|
|
4145 | 4930 |
(f t.package (cs, doc))
|
4146 | 4931 |
args
|
4147 | 4932 |
| Library _
|
|
4933 |
| Object _
|
4148 | 4934 |
| Executable _
|
4149 | 4935 |
| Flag _
|
4150 | 4936 |
| SrcRepo _ ->
|
|
4200 | 4986 |
|
4201 | 4987 |
clean, distclean
|
4202 | 4988 |
|
|
4989 |
|
4203 | 4990 |
let version t _ =
|
4204 | 4991 |
print_endline t.oasis_version
|
|
4992 |
|
4205 | 4993 |
|
4206 | 4994 |
let update_setup_ml, no_update_setup_ml_cli =
|
4207 | 4995 |
let b = ref true in
|
|
4209 | 4997 |
("-no-update-setup-ml",
|
4210 | 4998 |
Arg.Clear b,
|
4211 | 4999 |
s_ " Don't try to update setup.ml, even if _oasis has changed.")
|
|
5000 |
|
4212 | 5001 |
|
4213 | 5002 |
let update_setup_ml t =
|
4214 | 5003 |
let oasis_fn =
|
|
4332 | 5121 |
else
|
4333 | 5122 |
false
|
4334 | 5123 |
|
|
5124 |
|
4335 | 5125 |
let setup t =
|
4336 | 5126 |
let catch_exn =
|
4337 | 5127 |
ref true
|
|
4473 | 5263 |
error "%s" (Printexc.to_string e);
|
4474 | 5264 |
exit 1
|
4475 | 5265 |
|
|
5266 |
|
4476 | 5267 |
end
|
4477 | 5268 |
|
4478 | 5269 |
|
4479 | |
# 4480 "setup.ml"
|
|
5270 |
# 5271 "setup.ml"
|
4480 | 5271 |
module InternalConfigurePlugin = struct
|
4481 | |
(* # 21 "src/plugins/internal/InternalConfigurePlugin.ml" *)
|
|
5272 |
(* # 22 "src/plugins/internal/InternalConfigurePlugin.ml" *)
|
|
5273 |
|
4482 | 5274 |
|
4483 | 5275 |
(** Configure using internal scheme
|
4484 | 5276 |
@author Sylvain Le Gall
|
4485 | 5277 |
*)
|
|
5278 |
|
4486 | 5279 |
|
4487 | 5280 |
open BaseEnv
|
4488 | 5281 |
open OASISTypes
|
|
4490 | 5283 |
open OASISGettext
|
4491 | 5284 |
open BaseMessage
|
4492 | 5285 |
|
|
5286 |
|
4493 | 5287 |
(** Configure build using provided series of check to be done
|
4494 | 5288 |
* and then output corresponding file.
|
4495 | 5289 |
*)
|
4496 | 5290 |
let configure pkg argv =
|
4497 | |
let var_ignore_eval var =
|
4498 | |
let _s : string =
|
4499 | |
var ()
|
4500 | |
in
|
4501 | |
()
|
4502 | |
in
|
4503 | |
|
4504 | |
let errors =
|
4505 | |
ref SetString.empty
|
4506 | |
in
|
4507 | |
|
4508 | |
let buff =
|
4509 | |
Buffer.create 13
|
4510 | |
in
|
|
5291 |
let var_ignore_eval var = let _s: string = var () in () in
|
|
5292 |
let errors = ref SetString.empty in
|
|
5293 |
let buff = Buffer.create 13 in
|
4511 | 5294 |
|
4512 | 5295 |
let add_errors fmt =
|
4513 | 5296 |
Printf.kbprintf
|
|
4655 | 5438 |
| None ->
|
4656 | 5439 |
()
|
4657 | 5440 |
end;
|
|
5441 |
(* Make sure the findlib version is fine for the OCaml compiler. *)
|
|
5442 |
begin
|
|
5443 |
let ocaml_ge4 =
|
|
5444 |
OASISVersion.version_compare
|
|
5445 |
(OASISVersion.version_of_string (BaseStandardVar.ocaml_version()))
|
|
5446 |
(OASISVersion.version_of_string "4.0.0") >= 0 in
|
|
5447 |
if ocaml_ge4 then
|
|
5448 |
let findlib_lt132 =
|
|
5449 |
OASISVersion.version_compare
|
|
5450 |
(OASISVersion.version_of_string (BaseStandardVar.findlib_version()))
|
|
5451 |
(OASISVersion.version_of_string "1.3.2") < 0 in
|
|
5452 |
if findlib_lt132 then
|
|
5453 |
add_errors "OCaml >= 4.0.0 requires Findlib version >= 1.3.2"
|
|
5454 |
end;
|
4658 | 5455 |
|
4659 | 5456 |
(* FlexDLL *)
|
4660 | 5457 |
if BaseStandardVar.os_type () = "Win32" ||
|
|
4717 | 5514 |
(SetString.cardinal !errors)
|
4718 | 5515 |
end
|
4719 | 5516 |
|
|
5517 |
|
4720 | 5518 |
end
|
4721 | 5519 |
|
4722 | 5520 |
module InternalInstallPlugin = struct
|
4723 | |
(* # 21 "src/plugins/internal/InternalInstallPlugin.ml" *)
|
|
5521 |
(* # 22 "src/plugins/internal/InternalInstallPlugin.ml" *)
|
|
5522 |
|
4724 | 5523 |
|
4725 | 5524 |
(** Install using internal scheme
|
4726 | 5525 |
@author Sylvain Le Gall
|
4727 | 5526 |
*)
|
|
5527 |
|
4728 | 5528 |
|
4729 | 5529 |
open BaseEnv
|
4730 | 5530 |
open BaseStandardVar
|
4731 | 5531 |
open BaseMessage
|
4732 | 5532 |
open OASISTypes
|
4733 | |
open OASISLibrary
|
|
5533 |
open OASISFindlib
|
4734 | 5534 |
open OASISGettext
|
4735 | 5535 |
open OASISUtils
|
4736 | 5536 |
|
|
5537 |
|
4737 | 5538 |
let exec_hook =
|
4738 | 5539 |
ref (fun (cs, bs, exec) -> cs, bs, exec)
|
4739 | 5540 |
|
|
5541 |
|
4740 | 5542 |
let lib_hook =
|
4741 | 5543 |
ref (fun (cs, bs, lib) -> cs, bs, lib, [])
|
4742 | 5544 |
|
|
5545 |
|
|
5546 |
let obj_hook =
|
|
5547 |
ref (fun (cs, bs, obj) -> cs, bs, obj, [])
|
|
5548 |
|
|
5549 |
|
4743 | 5550 |
let doc_hook =
|
4744 | 5551 |
ref (fun (cs, doc) -> cs, doc)
|
4745 | 5552 |
|
|
5553 |
|
4746 | 5554 |
let install_file_ev =
|
4747 | 5555 |
"install-file"
|
4748 | 5556 |
|
|
5557 |
|
4749 | 5558 |
let install_dir_ev =
|
4750 | 5559 |
"install-dir"
|
4751 | 5560 |
|
|
5561 |
|
4752 | 5562 |
let install_findlib_ev =
|
4753 | 5563 |
"install-findlib"
|
4754 | 5564 |
|
|
5565 |
|
4755 | 5566 |
let win32_max_command_line_length = 8000
|
|
5567 |
|
4756 | 5568 |
|
4757 | 5569 |
let split_install_command ocamlfind findlib_name meta files =
|
4758 | 5570 |
if Sys.os_type = "Win32" then
|
|
4793 | 5605 |
| (firsts, others) ->
|
4794 | 5606 |
let cmd = args @ firsts in
|
4795 | 5607 |
(* Use -add for remaining commands: *)
|
4796 | |
let () =
|
|
5608 |
let () =
|
4797 | 5609 |
let findlib_ge_132 =
|
4798 | 5610 |
OASISVersion.comparator_apply
|
4799 | |
(OASISVersion.version_of_string
|
|
5611 |
(OASISVersion.version_of_string
|
4800 | 5612 |
(BaseStandardVar.findlib_version ()))
|
4801 | |
(OASISVersion.VGreaterEqual
|
|
5613 |
(OASISVersion.VGreaterEqual
|
4802 | 5614 |
(OASISVersion.version_of_string "1.3.2"))
|
4803 | 5615 |
in
|
4804 | 5616 |
if not findlib_ge_132 then
|
4805 | 5617 |
failwithf
|
4806 | |
(f_ "Installing the library %s require to use the flag \
|
4807 | |
'-add' of ocamlfind because the command line is too \
|
4808 | |
long. This flag is only available for findlib 1.3.2. \
|
4809 | |
Please upgrade findlib from %s to 1.3.2")
|
|
5618 |
(f_ "Installing the library %s require to use the \
|
|
5619 |
flag '-add' of ocamlfind because the command \
|
|
5620 |
line is too long. This flag is only available \
|
|
5621 |
for findlib 1.3.2. Please upgrade findlib from \
|
|
5622 |
%s to 1.3.2")
|
4810 | 5623 |
findlib_name (BaseStandardVar.findlib_version ())
|
4811 | 5624 |
in
|
4812 | 5625 |
let cmds = split other_args others in
|
|
4816 | 5629 |
split first_args files
|
4817 | 5630 |
else
|
4818 | 5631 |
["install" :: findlib_name :: meta :: files]
|
|
5632 |
|
4819 | 5633 |
|
4820 | 5634 |
let install pkg argv =
|
4821 | 5635 |
|
|
4960 | 5774 |
begin
|
4961 | 5775 |
(f_data, acc)
|
4962 | 5776 |
end
|
|
5777 |
and files_of_object (f_data, acc) data_obj =
|
|
5778 |
let cs, bs, obj, obj_extra =
|
|
5779 |
!obj_hook data_obj
|
|
5780 |
in
|
|
5781 |
if var_choose bs.bs_install &&
|
|
5782 |
BaseBuilt.is_built BaseBuilt.BObj cs.cs_name then
|
|
5783 |
begin
|
|
5784 |
let acc =
|
|
5785 |
(* Start with acc + obj_extra *)
|
|
5786 |
List.rev_append obj_extra acc
|
|
5787 |
in
|
|
5788 |
let acc =
|
|
5789 |
(* Add uncompiled header from the source tree *)
|
|
5790 |
let path =
|
|
5791 |
OASISHostPath.of_unix bs.bs_path
|
|
5792 |
in
|
|
5793 |
List.fold_left
|
|
5794 |
(fun acc modul ->
|
|
5795 |
try
|
|
5796 |
List.find
|
|
5797 |
OASISFileUtil.file_exists_case
|
|
5798 |
(List.map
|
|
5799 |
(Filename.concat path)
|
|
5800 |
[modul^".mli";
|
|
5801 |
modul^".ml";
|
|
5802 |
String.uncapitalize modul^".mli";
|
|
5803 |
String.capitalize modul^".mli";
|
|
5804 |
String.uncapitalize modul^".ml";
|
|
5805 |
String.capitalize modul^".ml"])
|
|
5806 |
:: acc
|
|
5807 |
with Not_found ->
|
|
5808 |
begin
|
|
5809 |
warning
|
|
5810 |
(f_ "Cannot find source header for module %s \
|
|
5811 |
in object %s")
|
|
5812 |
modul cs.cs_name;
|
|
5813 |
acc
|
|
5814 |
end)
|
|
5815 |
acc
|
|
5816 |
obj.obj_modules
|
|
5817 |
in
|
|
5818 |
|
|
5819 |
let acc =
|
|
5820 |
(* Get generated files *)
|
|
5821 |
BaseBuilt.fold
|
|
5822 |
BaseBuilt.BObj
|
|
5823 |
cs.cs_name
|
|
5824 |
(fun acc fn -> fn :: acc)
|
|
5825 |
acc
|
|
5826 |
in
|
|
5827 |
|
|
5828 |
let f_data () =
|
|
5829 |
(* Install data associated with the object *)
|
|
5830 |
install_data
|
|
5831 |
bs.bs_path
|
|
5832 |
bs.bs_data_files
|
|
5833 |
(Filename.concat
|
|
5834 |
(datarootdir ())
|
|
5835 |
pkg.name);
|
|
5836 |
f_data ()
|
|
5837 |
in
|
|
5838 |
|
|
5839 |
(f_data, acc)
|
|
5840 |
end
|
|
5841 |
else
|
|
5842 |
begin
|
|
5843 |
(f_data, acc)
|
|
5844 |
end
|
|
5845 |
|
4963 | 5846 |
in
|
4964 | 5847 |
|
4965 | 5848 |
(* Install one group of library *)
|
|
4970 | 5853 |
match grp with
|
4971 | 5854 |
| Container (_, children) ->
|
4972 | 5855 |
data_and_files, children
|
4973 | |
| Package (_, cs, bs, lib, children) ->
|
|
5856 |
| Package (_, cs, bs, `Library lib, children) ->
|
4974 | 5857 |
files_of_library data_and_files (cs, bs, lib), children
|
|
5858 |
| Package (_, cs, bs, `Object obj, children) ->
|
|
5859 |
files_of_object data_and_files (cs, bs, obj), children
|
4975 | 5860 |
in
|
4976 | 5861 |
List.fold_left
|
4977 | 5862 |
install_group_lib_aux
|
|
5005 | 5890 |
begin
|
5006 | 5891 |
let meta =
|
5007 | 5892 |
(* Search META file *)
|
5008 | |
let (_, bs, _) =
|
|
5893 |
let _, bs, _ =
|
5009 | 5894 |
root_lib
|
5010 | 5895 |
in
|
5011 | 5896 |
let res =
|
|
5018 | 5903 |
findlib_name;
|
5019 | 5904 |
res
|
5020 | 5905 |
in
|
5021 | |
let files =
|
|
5906 |
let files =
|
5022 | 5907 |
(* Make filename shorter to avoid hitting command max line length
|
5023 | 5908 |
* too early, esp. on Windows.
|
5024 | 5909 |
*)
|
|
5027 | 5912 |
let nlen = String.length n in
|
5028 | 5913 |
if plen <= nlen && String.sub n 0 plen = p then
|
5029 | 5914 |
begin
|
5030 | |
let fn_sep =
|
|
5915 |
let fn_sep =
|
5031 | 5916 |
if Sys.os_type = "Win32" then
|
5032 | 5917 |
'\\'
|
5033 | 5918 |
else
|
5034 | 5919 |
'/'
|
5035 | 5920 |
in
|
5036 | 5921 |
let cutpoint = plen +
|
5037 | |
(if plen < nlen && n.[plen] = fn_sep then
|
|
5922 |
(if plen < nlen && n.[plen] = fn_sep then
|
5038 | 5923 |
1
|
5039 | |
else
|
|
5924 |
else
|
5040 | 5925 |
0)
|
5041 | 5926 |
in
|
5042 | 5927 |
String.sub n cutpoint (nlen - cutpoint)
|
5043 | 5928 |
end
|
5044 | |
else
|
|
5929 |
else
|
5045 | 5930 |
n
|
5046 | 5931 |
in
|
5047 | |
List.map (remove_prefix (Sys.getcwd ())) files
|
|
5932 |
List.map (remove_prefix (Sys.getcwd ())) files
|
5048 | 5933 |
in
|
5049 | 5934 |
info
|
5050 | 5935 |
(f_ "Installing findlib library '%s'")
|
|
5078 | 5963 |
|
5079 | 5964 |
let install_execs pkg =
|
5080 | 5965 |
let install_exec data_exec =
|
5081 | |
let (cs, bs, exec) =
|
|
5966 |
let cs, bs, exec =
|
5082 | 5967 |
!exec_hook data_exec
|
5083 | 5968 |
in
|
5084 | 5969 |
if var_choose bs.bs_install &&
|
|
5125 | 6010 |
|
5126 | 6011 |
let install_docs pkg =
|
5127 | 6012 |
let install_doc data =
|
5128 | |
let (cs, doc) =
|
|
6013 |
let cs, doc =
|
5129 | 6014 |
!doc_hook data
|
5130 | 6015 |
in
|
5131 | 6016 |
if var_choose doc.doc_install &&
|
|
5160 | 6045 |
install_libs pkg;
|
5161 | 6046 |
install_execs pkg;
|
5162 | 6047 |
install_docs pkg
|
|
6048 |
|
5163 | 6049 |
|
5164 | 6050 |
(* Uninstall already installed data *)
|
5165 | 6051 |
let uninstall _ argv =
|
|
5224 | 6110 |
(BaseLog.filter
|
5225 | 6111 |
[install_file_ev;
|
5226 | 6112 |
install_dir_ev;
|
5227 | |
install_findlib_ev;]))
|
|
6113 |
install_findlib_ev]))
|
|
6114 |
|
5228 | 6115 |
|
5229 | 6116 |
end
|
5230 | 6117 |
|
5231 | 6118 |
|
5232 | |
# 5233 "setup.ml"
|
|
6119 |
# 6120 "setup.ml"
|
5233 | 6120 |
module OCamlbuildCommon = struct
|
5234 | |
(* # 21 "src/plugins/ocamlbuild/OCamlbuildCommon.ml" *)
|
|
6121 |
(* # 22 "src/plugins/ocamlbuild/OCamlbuildCommon.ml" *)
|
|
6122 |
|
5235 | 6123 |
|
5236 | 6124 |
(** Functions common to OCamlbuild build and doc plugin
|
5237 | 6125 |
*)
|
|
6126 |
|
5238 | 6127 |
|
5239 | 6128 |
open OASISGettext
|
5240 | 6129 |
open BaseEnv
|
5241 | 6130 |
open BaseStandardVar
|
5242 | 6131 |
|
|
6132 |
|
5243 | 6133 |
let ocamlbuild_clean_ev =
|
5244 | 6134 |
"ocamlbuild-clean"
|
|
6135 |
|
5245 | 6136 |
|
5246 | 6137 |
let ocamlbuildflags =
|
5247 | 6138 |
var_define
|
5248 | 6139 |
~short_desc:(fun () -> "OCamlbuild additional flags")
|
5249 | 6140 |
"ocamlbuildflags"
|
5250 | 6141 |
(fun () -> "")
|
|
6142 |
|
5251 | 6143 |
|
5252 | 6144 |
(** Fix special arguments depending on environment *)
|
5253 | 6145 |
let fix_args args extra_argv =
|
|
5287 | 6179 |
Array.to_list extra_argv;
|
5288 | 6180 |
]
|
5289 | 6181 |
|
|
6182 |
|
5290 | 6183 |
(** Run 'ocamlbuild -clean' if not already done *)
|
5291 | 6184 |
let run_clean extra_argv =
|
5292 | 6185 |
let extra_cli =
|
|
5306 | 6199 |
())
|
5307 | 6200 |
end
|
5308 | 6201 |
|
|
6202 |
|
5309 | 6203 |
(** Run ocamlbuild, unregister all clean events *)
|
5310 | 6204 |
let run_ocamlbuild args extra_argv =
|
5311 | 6205 |
(* TODO: enforce that target in args must be UNIX encoded i.e. toto/index.html
|
|
5317 | 6211 |
(fun (e, d) -> BaseLog.unregister e d)
|
5318 | 6212 |
(BaseLog.filter [ocamlbuild_clean_ev])
|
5319 | 6213 |
|
|
6214 |
|
5320 | 6215 |
(** Determine real build directory *)
|
5321 | 6216 |
let build_dir extra_argv =
|
5322 | 6217 |
let rec search_args dir =
|
|
5330 | 6225 |
in
|
5331 | 6226 |
search_args "_build" (fix_args [] extra_argv)
|
5332 | 6227 |
|
|
6228 |
|
5333 | 6229 |
end
|
5334 | 6230 |
|
5335 | 6231 |
module OCamlbuildPlugin = struct
|
5336 | |
(* # 21 "src/plugins/ocamlbuild/OCamlbuildPlugin.ml" *)
|
|
6232 |
(* # 22 "src/plugins/ocamlbuild/OCamlbuildPlugin.ml" *)
|
|
6233 |
|
5337 | 6234 |
|
5338 | 6235 |
(** Build using ocamlbuild
|
5339 | 6236 |
@author Sylvain Le Gall
|
5340 | 6237 |
*)
|
5341 | 6238 |
|
|
6239 |
|
5342 | 6240 |
open OASISTypes
|
5343 | 6241 |
open OASISGettext
|
5344 | 6242 |
open OASISUtils
|
|
6243 |
open OASISString
|
5345 | 6244 |
open BaseEnv
|
5346 | 6245 |
open OCamlbuildCommon
|
5347 | 6246 |
open BaseStandardVar
|
5348 | 6247 |
open BaseMessage
|
5349 | 6248 |
|
|
6249 |
|
|
6250 |
|
|
6251 |
|
|
6252 |
|
5350 | 6253 |
let cond_targets_hook =
|
5351 | 6254 |
ref (fun lst -> lst)
|
5352 | 6255 |
|
5353 | |
let build pkg argv =
|
5354 | |
|
|
6256 |
|
|
6257 |
type ocamlbuild_plugin =
|
|
6258 |
{
|
|
6259 |
plugin_tags: string option;
|
|
6260 |
extra_args: string list;
|
|
6261 |
}
|
|
6262 |
|
|
6263 |
|
|
6264 |
let check_ocaml_version version pkg =
|
|
6265 |
match pkg.ocaml_version with
|
|
6266 |
| Some ocaml_version ->
|
|
6267 |
let min_ocaml_version = OASISVersion.version_of_string version in
|
|
6268 |
OASISVersion.comparator_ge min_ocaml_version ocaml_version
|
|
6269 |
| None ->
|
|
6270 |
false
|
|
6271 |
|
|
6272 |
|
|
6273 |
let ocamlbuild_supports_ocamlfind = check_ocaml_version "3.12.1"
|
|
6274 |
let ocamlbuild_supports_plugin_tags = check_ocaml_version "4.01"
|
|
6275 |
|
|
6276 |
|
|
6277 |
let build t pkg argv =
|
5355 | 6278 |
(* Return the filename in build directory *)
|
5356 | 6279 |
let in_build_dir fn =
|
5357 | 6280 |
Filename.concat
|
|
5376 | 6299 |
(cs, bs, lib)
|
5377 | 6300 |
in
|
5378 | 6301 |
|
5379 | |
let ends_with nd fn =
|
5380 | |
let nd_len =
|
5381 | |
String.length nd
|
5382 | |
in
|
5383 | |
(String.length fn >= nd_len)
|
5384 | |
&&
|
5385 | |
(String.sub
|
5386 | |
fn
|
5387 | |
(String.length fn - nd_len)
|
5388 | |
nd_len) = nd
|
5389 | |
in
|
5390 | |
|
5391 | 6302 |
let tgts =
|
5392 | 6303 |
List.flatten
|
5393 | 6304 |
(List.filter
|
|
5395 | 6306 |
(List.map
|
5396 | 6307 |
(List.filter
|
5397 | 6308 |
(fun fn ->
|
5398 | |
ends_with ".cma" fn
|
5399 | |
|| ends_with ".cmxs" fn
|
5400 | |
|| ends_with ".cmxa" fn
|
5401 | |
|| ends_with (ext_lib ()) fn
|
5402 | |
|| ends_with (ext_dll ()) fn))
|
|
6309 |
ends_with ~what:".cma" fn
|
|
6310 |
|| ends_with ~what:".cmxs" fn
|
|
6311 |
|| ends_with ~what:".cmxa" fn
|
|
6312 |
|| ends_with ~what:(ext_lib ()) fn
|
|
6313 |
|| ends_with ~what:(ext_dll ()) fn))
|
5403 | 6314 |
unix_files))
|
5404 | 6315 |
in
|
5405 | 6316 |
|
|
5412 | 6323 |
cs.cs_name
|
5413 | 6324 |
end
|
5414 | 6325 |
|
|
6326 |
| Object (cs, bs, obj) when var_choose bs.bs_build ->
|
|
6327 |
begin
|
|
6328 |
let evs, unix_files =
|
|
6329 |
BaseBuilt.of_object
|
|
6330 |
in_build_dir_of_unix
|
|
6331 |
(cs, bs, obj)
|
|
6332 |
in
|
|
6333 |
|
|
6334 |
let tgts =
|
|
6335 |
List.flatten
|
|
6336 |
(List.filter
|
|
6337 |
(fun l -> l <> [])
|
|
6338 |
(List.map
|
|
6339 |
(List.filter
|
|
6340 |
(fun fn ->
|
|
6341 |
ends_with ".cmo" fn
|
|
6342 |
|| ends_with ".cmx" fn))
|
|
6343 |
unix_files))
|
|
6344 |
in
|
|
6345 |
|
|
6346 |
match tgts with
|
|
6347 |
| _ :: _ ->
|
|
6348 |
(evs, tgts) :: acc
|
|
6349 |
| [] ->
|
|
6350 |
failwithf
|
|
6351 |
(f_ "No possible ocamlbuild targets for object %s")
|
|
6352 |
cs.cs_name
|
|
6353 |
end
|
|
6354 |
|
5415 | 6355 |
| Executable (cs, bs, exec) when var_choose bs.bs_build ->
|
5416 | 6356 |
begin
|
5417 | 6357 |
let evs, unix_exec_is, unix_dll_opt =
|
|
5427 | 6367 |
(OASISUnixPath.chop_extension
|
5428 | 6368 |
exec.exec_main_is))^ext
|
5429 | 6369 |
in
|
5430 | |
let evs =
|
|
6370 |
let evs =
|
5431 | 6371 |
(* Fix evs, we want to use the unix_tgt, without copying *)
|
5432 | 6372 |
List.map
|
5433 | 6373 |
(function
|
5434 | 6374 |
| BaseBuilt.BExec, nm, lst when nm = cs.cs_name ->
|
5435 | |
BaseBuilt.BExec, nm, [[in_build_dir_of_unix unix_tgt]]
|
|
6375 |
BaseBuilt.BExec, nm,
|
|
6376 |
[[in_build_dir_of_unix unix_tgt]]
|
5436 | 6377 |
| ev ->
|
5437 | 6378 |
ev)
|
5438 | 6379 |
evs
|
|
5454 | 6395 |
acc
|
5455 | 6396 |
end
|
5456 | 6397 |
|
5457 | |
| Library _ | Executable _ | Test _
|
|
6398 |
| Library _ | Object _ | Executable _ | Test _
|
5458 | 6399 |
| SrcRepo _ | Flag _ | Doc _ ->
|
5459 | 6400 |
acc)
|
5460 | 6401 |
[]
|
|
5468 | 6409 |
(fun fns ->
|
5469 | 6410 |
if not (List.exists OASISFileUtil.file_exists_case fns) then
|
5470 | 6411 |
failwithf
|
5471 | |
(f_ "No one of expected built files %s exists")
|
5472 | |
(String.concat (s_ ", ") (List.map (Printf.sprintf "'%s'") fns)))
|
|
6412 |
(fn_
|
|
6413 |
"Expected built file %s doesn't exist."
|
|
6414 |
"None of expected built files %s exists."
|
|
6415 |
(List.length fns))
|
|
6416 |
(String.concat (s_ " or ") (List.map (Printf.sprintf "'%s'") fns)))
|
5473 | 6417 |
lst;
|
5474 | 6418 |
(BaseBuilt.register bt bnm lst)
|
5475 | 6419 |
in
|
|
5479 | 6423 |
!cond_targets_hook cond_targets
|
5480 | 6424 |
in
|
5481 | 6425 |
|
|
6426 |
let extra_args =
|
|
6427 |
match t.plugin_tags with
|
|
6428 |
| Some tags -> "-plugin-tags" :: ("'" ^ tags ^ "'") :: t.extra_args
|
|
6429 |
| None -> t.extra_args
|
|
6430 |
in
|
|
6431 |
let extra_args =
|
|
6432 |
if ocamlbuild_supports_ocamlfind pkg then
|
|
6433 |
"-use-ocamlfind" :: extra_args
|
|
6434 |
else
|
|
6435 |
extra_args
|
|
6436 |
in
|
|
6437 |
|
5482 | 6438 |
(* Run a list of target... *)
|
5483 | |
run_ocamlbuild
|
5484 | |
(List.flatten
|
5485 | |
(List.map snd cond_targets))
|
|
6439 |
run_ocamlbuild
|
|
6440 |
(List.flatten
|
|
6441 |
(List.map snd cond_targets)
|
|
6442 |
@ extra_args)
|
5486 | 6443 |
argv;
|
5487 | 6444 |
(* ... and register events *)
|
5488 | 6445 |
List.iter
|
|
5503 | 6460 |
())
|
5504 | 6461 |
pkg.sections
|
5505 | 6462 |
|
|
6463 |
|
5506 | 6464 |
end
|
5507 | 6465 |
|
5508 | 6466 |
module OCamlbuildDocPlugin = struct
|
5509 | |
(* # 21 "src/plugins/ocamlbuild/OCamlbuildDocPlugin.ml" *)
|
|
6467 |
(* # 22 "src/plugins/ocamlbuild/OCamlbuildDocPlugin.ml" *)
|
|
6468 |
|
5510 | 6469 |
|
5511 | 6470 |
(* Create documentation using ocamlbuild .odocl files
|
5512 | 6471 |
@author Sylvain Le Gall
|
5513 | 6472 |
*)
|
|
6473 |
|
5514 | 6474 |
|
5515 | 6475 |
open OASISTypes
|
5516 | 6476 |
open OASISGettext
|
5517 | 6477 |
open OASISMessage
|
5518 | 6478 |
open OCamlbuildCommon
|
5519 | 6479 |
open BaseStandardVar
|
|
6480 |
|
|
6481 |
|
5520 | 6482 |
|
5521 | 6483 |
|
5522 | 6484 |
|
|
5547 | 6509 |
(Filename.concat tgt_dir glb)])
|
5548 | 6510 |
["*.html"; "*.css"]
|
5549 | 6511 |
|
|
6512 |
|
5550 | 6513 |
let doc_clean t pkg (cs, doc) argv =
|
5551 | 6514 |
run_clean argv;
|
5552 | 6515 |
BaseBuilt.unregister BaseBuilt.BDoc cs.cs_name
|
5553 | 6516 |
|
|
6517 |
|
5554 | 6518 |
end
|
5555 | 6519 |
|
5556 | 6520 |
|
5557 | |
# 5558 "setup.ml"
|
|
6521 |
# 6522 "setup.ml"
|
5558 | 6522 |
open OASISTypes;;
|
5559 | 6523 |
|
5560 | 6524 |
let setup_t =
|
5561 | 6525 |
{
|
5562 | 6526 |
BaseSetup.configure = InternalConfigurePlugin.configure;
|
5563 | |
build = OCamlbuildPlugin.build;
|
|
6527 |
build =
|
|
6528 |
OCamlbuildPlugin.build
|
|
6529 |
{OCamlbuildPlugin.plugin_tags = None; extra_args = []};
|
5564 | 6530 |
test = [];
|
5565 | 6531 |
doc = [("API", OCamlbuildDocPlugin.doc_build ".")];
|
5566 | 6532 |
install = InternalInstallPlugin.install;
|
|
5573 | 6539 |
distclean_doc = [];
|
5574 | 6540 |
package =
|
5575 | 6541 |
{
|
5576 | |
oasis_version = "0.3";
|
|
6542 |
oasis_version = "0.4";
|
5577 | 6543 |
ocaml_version = Some (OASISVersion.VGreaterEqual "3.12");
|
5578 | 6544 |
findlib_version = Some (OASISVersion.VGreaterEqual "1.3.1");
|
|
6545 |
alpha_features = [];
|
|
6546 |
beta_features = [];
|
5579 | 6547 |
name = "postgresql-ocaml";
|
5580 | |
version = "2.0.4";
|
|
6548 |
version = "2.0.5";
|
5581 | 6549 |
license =
|
5582 | 6550 |
OASISLicense.DEP5License
|
5583 | 6551 |
(OASISLicense.DEP5Unit
|
5584 | 6552 |
{
|
5585 | 6553 |
OASISLicense.license = "LGPL";
|
5586 | 6554 |
excption = Some "OCaml linking";
|
5587 | |
version = OASISLicense.VersionOrLater "2.1";
|
5588 | |
});
|
|
6555 |
version = OASISLicense.VersionOrLater "2.1"
|
|
6556 |
});
|
5589 | 6557 |
license_file = Some "COPYING.txt";
|
5590 | 6558 |
copyrights =
|
5591 | 6559 |
[
|
|
5608 | 6576 |
Some
|
5609 | 6577 |
"postgresql-ocaml offers library functions for accessing PostgreSQL databases";
|
5610 | 6578 |
categories = [];
|
5611 | |
conf_type = (`Configure, "internal", Some "0.3");
|
|
6579 |
conf_type = (`Configure, "internal", Some "0.4");
|
5612 | 6580 |
conf_custom =
|
5613 | 6581 |
{
|
5614 | 6582 |
pre_command = [(OASISExpr.EBool true, None)];
|
5615 | |
post_command = [(OASISExpr.EBool true, None)];
|
5616 | |
};
|
5617 | |
build_type = (`Build, "ocamlbuild", Some "0.3");
|
|
6583 |
post_command = [(OASISExpr.EBool true, None)]
|
|
6584 |
};
|
|
6585 |
build_type = (`Build, "ocamlbuild", Some "0.4");
|
5618 | 6586 |
build_custom =
|
5619 | 6587 |
{
|
5620 | 6588 |
pre_command = [(OASISExpr.EBool true, None)];
|
5621 | |
post_command = [(OASISExpr.EBool true, None)];
|
5622 | |
};
|
5623 | |
install_type = (`Install, "internal", Some "0.3");
|
|
6589 |
post_command = [(OASISExpr.EBool true, None)]
|
|
6590 |
};
|
|
6591 |
install_type = (`Install, "internal", Some "0.4");
|
5624 | 6592 |
install_custom =
|
5625 | 6593 |
{
|
5626 | 6594 |
pre_command = [(OASISExpr.EBool true, None)];
|
5627 | |
post_command = [(OASISExpr.EBool true, None)];
|
5628 | |
};
|
|
6595 |
post_command = [(OASISExpr.EBool true, None)]
|
|
6596 |
};
|
5629 | 6597 |
uninstall_custom =
|
5630 | 6598 |
{
|
5631 | 6599 |
pre_command = [(OASISExpr.EBool true, None)];
|
5632 | |
post_command = [(OASISExpr.EBool true, None)];
|
5633 | |
};
|
|
6600 |
post_command = [(OASISExpr.EBool true, None)]
|
|
6601 |
};
|
5634 | 6602 |
clean_custom =
|
5635 | 6603 |
{
|
5636 | 6604 |
pre_command = [(OASISExpr.EBool true, None)];
|
5637 | |
post_command = [(OASISExpr.EBool true, None)];
|
5638 | |
};
|
|
6605 |
post_command = [(OASISExpr.EBool true, None)]
|
|
6606 |
};
|
5639 | 6607 |
distclean_custom =
|
5640 | 6608 |
{
|
5641 | 6609 |
pre_command = [(OASISExpr.EBool true, None)];
|
5642 | |
post_command = [(OASISExpr.EBool true, None)];
|
5643 | |
};
|
|
6610 |
post_command = [(OASISExpr.EBool true, None)]
|
|
6611 |
};
|
5644 | 6612 |
files_ab = [];
|
5645 | 6613 |
sections =
|
5646 | 6614 |
[
|
|
5648 | 6616 |
({
|
5649 | 6617 |
cs_name = "strict";
|
5650 | 6618 |
cs_data = PropList.Data.create ();
|
5651 | |
cs_plugin_data = [];
|
5652 | |
},
|
|
6619 |
cs_plugin_data = []
|
|
6620 |
},
|
5653 | 6621 |
{
|
5654 | 6622 |
flag_description = Some "Strict compile-time checks";
|
5655 | |
flag_default = [(OASISExpr.EBool true, true)];
|
5656 | |
});
|
|
6623 |
flag_default = [(OASISExpr.EBool true, true)]
|
|
6624 |
});
|
5657 | 6625 |
Library
|
5658 | 6626 |
({
|
5659 | 6627 |
cs_name = "postgresql";
|
5660 | 6628 |
cs_data = PropList.Data.create ();
|
5661 | |
cs_plugin_data = [];
|
5662 | |
},
|
|
6629 |
cs_plugin_data = []
|
|
6630 |
},
|
5663 | 6631 |
{
|
5664 | 6632 |
bs_build = [(OASISExpr.EBool true, true)];
|
5665 | 6633 |
bs_install = [(OASISExpr.EBool true, true)];
|
|
5697 | 6665 |
bs_dlllib = [(OASISExpr.EBool true, [])];
|
5698 | 6666 |
bs_dllpath = [(OASISExpr.EBool true, [])];
|
5699 | 6667 |
bs_byteopt = [(OASISExpr.EBool true, [])];
|
5700 | |
bs_nativeopt = [(OASISExpr.EBool true, [])];
|
5701 | |
},
|
|
6668 |
bs_nativeopt = [(OASISExpr.EBool true, [])]
|
|
6669 |
},
|
5702 | 6670 |
{
|
5703 | 6671 |
lib_modules = ["Postgresql"];
|
5704 | 6672 |
lib_pack = false;
|
5705 | 6673 |
lib_internal_modules = [];
|
5706 | 6674 |
lib_findlib_parent = None;
|
5707 | 6675 |
lib_findlib_name = Some "postgresql";
|
5708 | |
lib_findlib_containers = [];
|
5709 | |
});
|
|
6676 |
lib_findlib_containers = []
|
|
6677 |
});
|
5710 | 6678 |
Flag
|
5711 | 6679 |
({
|
5712 | 6680 |
cs_name = "examples";
|
5713 | 6681 |
cs_data = PropList.Data.create ();
|
5714 | |
cs_plugin_data = [];
|
5715 | |
},
|
|
6682 |
cs_plugin_data = []
|
|
6683 |
},
|
5716 | 6684 |
{
|
5717 | 6685 |
flag_description = Some "Build examples";
|
5718 | |
flag_default = [(OASISExpr.EBool true, true)];
|
5719 | |
});
|
|
6686 |
flag_default = [(OASISExpr.EBool true, true)]
|
|
6687 |
});
|
5720 | 6688 |
Executable
|
5721 | 6689 |
({
|
5722 | 6690 |
cs_name = "cursor";
|
5723 | 6691 |
cs_data = PropList.Data.create ();
|
5724 | |
cs_plugin_data = [];
|
5725 | |
},
|
|
6692 |
cs_plugin_data = []
|
|
6693 |
},
|
5726 | 6694 |
{
|
5727 | 6695 |
bs_build =
|
5728 | 6696 |
[
|
|
5742 | 6710 |
bs_dlllib = [(OASISExpr.EBool true, [])];
|
5743 | 6711 |
bs_dllpath = [(OASISExpr.EBool true, [])];
|
5744 | 6712 |
bs_byteopt = [(OASISExpr.EBool true, [])];
|
5745 | |
bs_nativeopt = [(OASISExpr.EBool true, [])];
|
5746 | |
},
|
5747 | |
{exec_custom = false; exec_main_is = "cursor.ml"; });
|
|
6713 |
bs_nativeopt = [(OASISExpr.EBool true, [])]
|
|
6714 |
},
|
|
6715 |
{exec_custom = false; exec_main_is = "cursor.ml"});
|
5748 | 6716 |
Executable
|
5749 | 6717 |
({
|
5750 | 6718 |
cs_name = "dump";
|
5751 | 6719 |
cs_data = PropList.Data.create ();
|
5752 | |
cs_plugin_data = [];
|
5753 | |
},
|
|
6720 |
cs_plugin_data = []
|
|
6721 |
},
|
5754 | 6722 |
{
|
5755 | 6723 |
bs_build =
|
5756 | 6724 |
[
|
|
5770 | 6738 |
bs_dlllib = [(OASISExpr.EBool true, [])];
|
5771 | 6739 |
bs_dllpath = [(OASISExpr.EBool true, [])];
|
5772 | 6740 |
bs_byteopt = [(OASISExpr.EBool true, [])];
|
5773 | |
bs_nativeopt = [(OASISExpr.EBool true, [])];
|
5774 | |
},
|
5775 | |
{exec_custom = false; exec_main_is = "dump.ml"; });
|
|
6741 |
bs_nativeopt = [(OASISExpr.EBool true, [])]
|
|
6742 |
},
|
|
6743 |
{exec_custom = false; exec_main_is = "dump.ml"});
|
5776 | 6744 |
Executable
|
5777 | 6745 |
({
|
5778 | 6746 |
cs_name = "populate";
|
5779 | 6747 |
cs_data = PropList.Data.create ();
|
5780 | |
cs_plugin_data = [];
|
5781 | |
},
|
|
6748 |
cs_plugin_data = []
|
|
6749 |
},
|
5782 | 6750 |
{
|
5783 | 6751 |
bs_build =
|
5784 | 6752 |
[
|
|
5798 | 6766 |
bs_dlllib = [(OASISExpr.EBool true, [])];
|
5799 | 6767 |
bs_dllpath = [(OASISExpr.EBool true, [])];
|
5800 | 6768 |
bs_byteopt = [(OASISExpr.EBool true, [])];
|
5801 | |
bs_nativeopt = [(OASISExpr.EBool true, [])];
|
5802 | |
},
|
5803 | |
{exec_custom = false; exec_main_is = "populate.ml"; });
|
|
6769 |
bs_nativeopt = [(OASISExpr.EBool true, [])]
|
|
6770 |
},
|
|
6771 |
{exec_custom = false; exec_main_is = "populate.ml"});
|
5804 | 6772 |
Executable
|
5805 | 6773 |
({
|
5806 | 6774 |
cs_name = "prompt";
|
5807 | 6775 |
cs_data = PropList.Data.create ();
|
5808 | |
cs_plugin_data = [];
|
5809 | |
},
|
|
6776 |
cs_plugin_data = []
|
|
6777 |
},
|
5810 | 6778 |
{
|
5811 | 6779 |
bs_build =
|
5812 | 6780 |
[
|
|
5826 | 6794 |
bs_dlllib = [(OASISExpr.EBool true, [])];
|
5827 | 6795 |
bs_dllpath = [(OASISExpr.EBool true, [])];
|
5828 | 6796 |
bs_byteopt = [(OASISExpr.EBool true, [])];
|
5829 | |
bs_nativeopt = [(OASISExpr.EBool true, [])];
|
5830 | |
},
|
5831 | |
{exec_custom = false; exec_main_is = "prompt.ml"; });
|
|
6797 |
bs_nativeopt = [(OASISExpr.EBool true, [])]
|
|
6798 |
},
|
|
6799 |
{exec_custom = false; exec_main_is = "prompt.ml"});
|
5832 | 6800 |
Flag
|
5833 | 6801 |
({
|
5834 | 6802 |
cs_name = "lablgtk2";
|
5835 | 6803 |
cs_data = PropList.Data.create ();
|
5836 | |
cs_plugin_data = [];
|
5837 | |
},
|
|
6804 |
cs_plugin_data = []
|
|
6805 |
},
|
5838 | 6806 |
{
|
5839 | 6807 |
flag_description =
|
5840 | 6808 |
Some "Build applications depending on lablgtk2";
|
5841 | |
flag_default = [(OASISExpr.EBool true, false)];
|
5842 | |
});
|
|
6809 |
flag_default = [(OASISExpr.EBool true, false)]
|
|
6810 |
});
|
5843 | 6811 |
Executable
|
5844 | 6812 |
({
|
5845 | 6813 |
cs_name = "prompt_gtk";
|
5846 | 6814 |
cs_data = PropList.Data.create ();
|
5847 | |
cs_plugin_data = [];
|
5848 | |
},
|
|
6815 |
cs_plugin_data = []
|
|
6816 |
},
|
5849 | 6817 |
{
|
5850 | 6818 |
bs_build =
|
5851 | 6819 |
[
|
|
5872 | 6840 |
bs_dlllib = [(OASISExpr.EBool true, [])];
|
5873 | 6841 |
bs_dllpath = [(OASISExpr.EBool true, [])];
|
5874 | 6842 |
bs_byteopt = [(OASISExpr.EBool true, [])];
|
5875 | |
bs_nativeopt = [(OASISExpr.EBool true, [])];
|
5876 | |
},
|
5877 | |
{exec_custom = false; exec_main_is = "prompt_gtk.ml"; });
|
|
6843 |
bs_nativeopt = [(OASISExpr.EBool true, [])]
|
|
6844 |
},
|
|
6845 |
{exec_custom = false; exec_main_is = "prompt_gtk.ml"});
|
5878 | 6846 |
Executable
|
5879 | 6847 |
({
|
5880 | 6848 |
cs_name = "test_lo";
|
5881 | 6849 |
cs_data = PropList.Data.create ();
|
5882 | |
cs_plugin_data = [];
|
5883 | |
},
|
|
6850 |
cs_plugin_data = []
|
|
6851 |
},
|
5884 | 6852 |
{
|
5885 | 6853 |
bs_build =
|
5886 | 6854 |
[
|
|
5900 | 6868 |
bs_dlllib = [(OASISExpr.EBool true, [])];
|
5901 | 6869 |
bs_dllpath = [(OASISExpr.EBool true, [])];
|
5902 | 6870 |
bs_byteopt = [(OASISExpr.EBool true, [])];
|
5903 | |
bs_nativeopt = [(OASISExpr.EBool true, [])];
|
5904 | |
},
|
5905 | |
{exec_custom = false; exec_main_is = "test_lo.ml"; });
|
|
6871 |
bs_nativeopt = [(OASISExpr.EBool true, [])]
|
|
6872 |
},
|
|
6873 |
{exec_custom = false; exec_main_is = "test_lo.ml"});
|
5906 | 6874 |
Doc
|
5907 | 6875 |
({
|
5908 | 6876 |
cs_name = "API";
|
5909 | 6877 |
cs_data = PropList.Data.create ();
|
5910 | |
cs_plugin_data = [];
|
5911 | |
},
|
|
6878 |
cs_plugin_data = []
|
|
6879 |
},
|
5912 | 6880 |
{
|
5913 | |
doc_type = (`Doc, "OCamlbuild", Some "0.3");
|
|
6881 |
doc_type = (`Doc, "OCamlbuild", Some "0.4");
|
5914 | 6882 |
doc_custom =
|
5915 | 6883 |
{
|
5916 | 6884 |
pre_command = [(OASISExpr.EBool true, None)];
|
5917 | |
post_command = [(OASISExpr.EBool true, None)];
|
5918 | |
};
|
|
6885 |
post_command = [(OASISExpr.EBool true, None)]
|
|
6886 |
};
|
5919 | 6887 |
doc_build =
|
5920 | 6888 |
[
|
5921 | 6889 |
(OASISExpr.ENot (OASISExpr.EFlag "docs"), false);
|
|
5929 | 6897 |
doc_format = OtherDoc;
|
5930 | 6898 |
doc_data_files = [];
|
5931 | 6899 |
doc_build_tools =
|
5932 | |
[ExternalTool "ocamldoc"; ExternalTool "ocamlbuild"];
|
5933 | |
});
|
|
6900 |
[ExternalTool "ocamldoc"; ExternalTool "ocamlbuild"]
|
|
6901 |
});
|
5934 | 6902 |
SrcRepo
|
5935 | 6903 |
({
|
5936 | 6904 |
cs_name = "trunk";
|
5937 | 6905 |
cs_data = PropList.Data.create ();
|
5938 | |
cs_plugin_data = [];
|
5939 | |
},
|
|
6906 |
cs_plugin_data = []
|
|
6907 |
},
|
5940 | 6908 |
{
|
5941 | 6909 |
src_repo_type = Hg;
|
5942 | 6910 |
src_repo_location =
|
|
5946 | 6914 |
src_repo_module = None;
|
5947 | 6915 |
src_repo_branch = None;
|
5948 | 6916 |
src_repo_tag = Some "release-$(pkg_version)";
|
5949 | |
src_repo_subdir = None;
|
5950 | |
})
|
|
6917 |
src_repo_subdir = None
|
|
6918 |
})
|
5951 | 6919 |
];
|
5952 | 6920 |
plugins =
|
5953 | 6921 |
[
|
5954 | |
(`Extra, "META", Some "0.3");
|
5955 | |
(`Extra, "StdFiles", Some "0.3");
|
5956 | |
(`Extra, "DevFiles", Some "0.3")
|
|
6922 |
(`Extra, "META", Some "0.4");
|
|
6923 |
(`Extra, "StdFiles", Some "0.4");
|
|
6924 |
(`Extra, "DevFiles", Some "0.4")
|
5957 | 6925 |
];
|
5958 | 6926 |
schema_data = PropList.Data.create ();
|
5959 | |
plugin_data = [];
|
5960 | |
};
|
|
6927 |
plugin_data = []
|
|
6928 |
};
|
5961 | 6929 |
oasis_fn = Some "_oasis";
|
5962 | |
oasis_version = "0.3.0";
|
5963 | |
oasis_digest = Some "\007Cμμϊ6J₯Θ!\140'\159\132ΓN";
|
|
6930 |
oasis_version = "0.4.0";
|
|
6931 |
oasis_digest = Some "Õ<\015Äjþ!u>*\025b¤|\012\003";
|
5964 | 6932 |
oasis_exec = None;
|
5965 | 6933 |
oasis_setup_args = [];
|
5966 | |
setup_update = false;
|
5967 | |
};;
|
|
6934 |
setup_update = false
|
|
6935 |
};;
|
5968 | 6936 |
|
5969 | 6937 |
let setup () = BaseSetup.setup setup_t;;
|
5970 | 6938 |
|
5971 | |
# 5973 "setup.ml"
|
|
6939 |
# 6941 "setup.ml"
|
5972 | 6940 |
(* OASIS_STOP *)
|
5973 | 6941 |
let () = setup ();;
|