-
Notifications
You must be signed in to change notification settings - Fork 411
/
ocaml_config.mli
190 lines (113 loc) · 3.51 KB
/
ocaml_config.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
(** Represent the output of [ocamlc -config] and contents of [Makefile.config].
This library is internal to dune and guarantees no API stability. *)
(** Represent a parsed and interpreted output of [ocamlc -config] and contents
of [Makefile.config]. *)
type t
val to_dyn : t Stdune.Dyn.Encoder.t
module Prog_and_args : sig
type t =
{ prog : string
; args : string list
}
end
(** {1 Raw bindings} *)
(** Represent the parsed but uninterpreted output of [ocamlc -config] or
contents of [Makefile.config]. *)
module Vars : sig
type t
val find : t -> string -> string option
val of_list_exn : (string * string) list -> t
val to_list : t -> (string * string) list
(** Parse the output of [ocamlc -config] given as a list of lines. *)
val of_lines : string list -> (t, string) result
end
(** {1 Creation} *)
module Origin : sig
type t =
| Ocamlc_config
| Makefile_config of Stdune.Path.t
end
module Os_type : sig
type t =
| Win32
| Unix
| Other of string
val to_string : t -> string
end
module Ccomp_type : sig
type t =
| Msvc
| Other of string
val to_dyn : t -> Stdune.Dyn.t
val to_string : t -> string
end
(** Interpret raw bindings (this function also loads the [Makefile.config] file
in the stdlib directory). *)
val make : Vars.t -> (t, Origin.t * string) result
(** {1 Query} *)
(** The following parameters match the variables in the output of
[ocamlc -config] but are stable across versions of OCaml. *)
val version : t -> int * int * int
val version_string : t -> string
val standard_library_default : t -> string
val standard_library : t -> string
val standard_runtime : t -> string
val ccomp_type : t -> Ccomp_type.t
val c_compiler : t -> string
val ocamlc_cflags : t -> string list
val ocamlc_cppflags : t -> string list
val ocamlopt_cflags : t -> string list
val ocamlopt_cppflags : t -> string list
val bytecomp_c_compiler : t -> Prog_and_args.t
val bytecomp_c_libraries : t -> string list
val native_c_compiler : t -> Prog_and_args.t
val native_c_libraries : t -> string list
val cc_profile : t -> string list
val architecture : t -> string
val model : t -> string
val int_size : t -> int
val word_size : t -> int
val system : t -> string
val asm : t -> Prog_and_args.t
val asm_cfi_supported : t -> bool
val with_frame_pointers : t -> bool
val ext_exe : t -> string
val ext_obj : t -> string
val ext_asm : t -> string
val ext_lib : t -> string
val ext_dll : t -> string
val os_type : t -> Os_type.t
val default_executable_name : t -> string
val systhread_supported : t -> bool
val host : t -> string
val target : t -> string
val profiling : t -> bool
val flambda : t -> bool
val spacetime : t -> bool
val safe_string : t -> bool
val exec_magic_number : t -> string
val cmi_magic_number : t -> string
val cmo_magic_number : t -> string
val cma_magic_number : t -> string
val cmx_magic_number : t -> string
val cmxa_magic_number : t -> string
val ast_impl_magic_number : t -> string
val ast_intf_magic_number : t -> string
val cmxs_magic_number : t -> string
val cmt_magic_number : t -> string
val natdynlink_supported : t -> bool
val supports_shared_libraries : t -> bool
val windows_unicode : t -> bool
(** {1 Values} *)
module Value : sig
type t =
| Bool of bool
| Int of int
| String of string
| Words of string list
| Prog_and_args of Prog_and_args.t
val to_string : t -> string
val to_dyn : t Stdune.Dyn.Encoder.t
end
val to_list : t -> (string * Value.t) list
val is_dev_version : t -> bool