package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=00a6868b4dfa34565d0141b335622a81a0e8d5b9e3c6dfad025dabfa3df2db2a1302b492953bbbce30c3a4406c324fcec25250a00b38f6d18a69e15605e3b07e
doc/b0_b00_kit/B00_ocaml/Conf/index.html
Module B00_ocaml.Conf
Toolchain configuration.
This module provides access to the OCaml toolchain configuration as output by ocaml{c,opt} -config.
Configuration
The type for code generated by the OCaml compiler. Either bytecode or native-code.
val of_string : ?file:B0_std.Fpath.t -> string -> (t, string) Stdlib.resultof_string ~file data parses toolchain configuration from data as output by the compiler's -config option assuming it was read from file file (defaults to B0_std.Fpath.dash).
val write : B00.Memo.t -> comp:B00.Tool.t -> o:B0_std.Fpath.t -> unitwrite m ~o writes the toolchain configuration to o by running comp with -config.
val read : B00.Memo.t -> B0_std.Fpath.t -> t B0_std.Fut.tread m file reads a toolchain configuration from file.
Fields
val find : string -> t -> string optionfind f c looks up the field f in configuration c. See ocamlc -config for the list of fields.
val version : t -> int * int * int * string optionversion c is the compiler version string "major.minor[.patchlevel][+additional-info]" parsed using (major, minor, patch, additional-info). If patch-level is absent it is turned into a 0.
val where : t -> B0_std.Fpath.twhere c is the location of OCaml's library directory.
val asm_ext : t -> B0_std.Fpath.extasm_ext is the file extension for assembly files.
val dll_ext : t -> B0_std.Fpath.extdll_ext is the file extension for C dynamic libraries.
val exe_ext : t -> B0_std.Fpath.extext_ext is the file extension for executable binaries.
val lib_ext : t -> B0_std.Fpath.extext_lib is the file extension for C static libraries.
val obj_ext : t -> B0_std.Fpath.extobj_ext is the file extension for C object files.
val has_dynlink : t -> boolhas_dynlink determines whether the platform supports dynamic linking.
Converting
val to_string_map : t -> string B0_std.String.Map.tto_string_map c are the fields of c as a string map.
val of_string_map : string B0_std.String.Map.t -> (t, string) Stdlib.resultof_string_map m is a configuration from string map m. m needs at least on key for each parsed field above otherwise the function errors.