package topkg

  1. Overview
  2. Docs

OCaml configuration.

OCaml system configuration

type conf = t
type t

The type for OCaml configurations.

val v : conf -> os -> t

v c os is the configuration of the OCaml system for the OS os obtained by reading the output of tool "ocamlc" os with the -config option.

val find : string -> t -> string option

find k c looks up key k in configuration c.

val version : t -> int * int * int * string option

version is the compiler version string "major.minor[.patchlevel][+additional-info]" parsed into (major, minor, patch, additional-info).

val ext_asm : t -> string

ext_asm is the file extension for assembly files, e.g. ".s".

val ext_obj : t -> string

ext_asm is the file extension for C object files, e.g. ".o".

val ext_lib : t -> string

ext_lib is the file extension for C static libraries, e.g. ".a".

val ext_dll : t -> string

ext_dll is the file extension for C dynamically linked libraries, e.g. ".so".

val ext_exe : t -> string

ext_exe is the file extension for binary executables, e.g. ".exe" or "". Until at least OCaml 4.03 this information is not readily available (see PR #7173) and discovered as described in this message.

val native : t -> bool

native is true if native compilation (i.e. ocamlopt) is available. Until at least OCaml 4.03 this information is not readily available (see PR #7173) and true is returned iff the standard library directory has the libasmrun C static library.

native_dynlink is true if native dynamic linking is available. Until at least OCaml 4.03 this information is not readily available (see PR #7173) and true is returned iff the standard library directory has the dynlink.cmxa library.

val supports_shared_libraries : t -> bool

supports_shared_libraries is true if compilation of C shared libraries is supported. Until OCaml 4.08 this information is not readily available (see PR 1691). Before that it checks for the existence of either "libasmrun_shared" ^ ext_dll c or "libcamlrun_shared" ^ ext_dll c in the standard library directory.

val word_size : t -> int

word_size is the bit size of one word on the OS that will execute the programs produced by the compiler (i.e. the value of Sys.word_size in these programs). Until at least OCaml 4.03 this information is not readily available (see PR #7173) and the information is read from the C SIZEOF_PTR macro defined in the file caml/config.h of the standard library directory.

val dump : Format.formatter -> t -> unit

dump ppf c prints an unspecified representation of c on ppf.

OCaml

Innovation. Community. Security.