Skip to content
Newer
Older
100644 130 lines (104 sloc) 2.79 KB
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 (**
19 Configuration for plugins files dependencies
20 @author Mathieu Barbin
21 *)
22
23 (** {6 Purpose} *)
24 (**
25 With the separation of plugins/packages, we want to be able to load some
26 plugins automatically if there are used by an imported package.
27
28 For that we need a way to add automatically in the command line of
29 the back-end compilation all the dependencies of the linked libraries.
30
31 Before the separation, these dependencies was added in the command line
32 of opa.
33 Now, thanks to this module and conf files of plugins, dependencies
34 can also be expressed in the opp directly, and automatically added
35 by the compiler.
36 *)
37
38 (** {6 Configuration} *)
39 (**
40 Any file called [*.conf] can be given in the command line of [opa-plugin-builder],
41 following this syntax:
42
43 {[
44 # comments are welcome at the begining of lines
45 [myproperty]
46 argument argument argument
47 argument argument
48
49 [myproperty:platform]
50 argument argument
51 ]}
52
53 Supported properties are:
54 {[
55 [mlcopt]
56 # extra options to be passed to ocaml compiler
57
58 [mllopt]
59 # extra options to be passed to ocaml linker
60
61 [mlinclude]
62 # extra path to be passed to ocaml (absolute only)
63
64 [cclib]
65 # options to the C linker
66
67 [ccopt]
68 # options to the C compiler and linker
69 ]}
70
71 Supported platforms are:
72 {[
73 linux
74 windows
75 mac
76 ]}
77 *)
78
79 (**
80 The type of the accumulated properties
81 *)
82 type properties = {
83 cclib : string list ;
84 ccopt : string list ;
85 mlcopt : string list ;
86 mllopt : string list ;
87 mlinclude : string list ;
88 mllibs : string list ;
89 }
90
91 type conf = {
92 all_platform: properties ;
93 linux: properties option ;
94 mac:properties option ;
95 windows: properties option ;
96 cygwin: properties option ;
97 }
98
99 type t
100
101 (**
102 The default configuration.
103 *)
104 val default : t
105
106 (**
107 <!> used by generated code
108 *)
109 val default_conf : conf
110
111 (**
112 Tell if a conf is equal to the default configuration
113 *)
114 val is_default : conf -> bool
115
116 (**
117 Fold confs using configration files
118 *)
119 val fold : filename:string -> t -> t
120
121 (**
122 Export at the end of the fold the conf
123 *)
124 val export : t -> conf
125
126 (**
127 Pretty print for debugging
128 *)
129 val pp : Format.formatter -> conf -> unit
Something went wrong with that request. Please try again.