module Conf: sig endThings it can do at build time:
It handles the command line parameters for all of the above, and returns a Conf.t - or configuration.
A configuration is a string to value mapping. It is generated by the Conf.configure function
from a configuration_item list. Each item, in order, is passed the current configuration, and
returns a potentially modified configuration.
type value =
| |
StringList of |
(* | A space separated string must be passed by the user. | *) |
| |
String of |
|||
| |
Bool of |
type t
typekey =string
typedoc =string
type configuration_item =
| |
FindLib of |
| |
Path of |
| |
Param of |
| |
Custom of |
val standard_spec : (configuration_item * bool) listval findlib_check : ?min:string -> ?max:string -> string -> configuration_itemfindlib_check name checks that a findlib package called name
exists. If min or max are specified, then it ensures the package
has a version within those constraints.val path_search : ?doc:string -> string -> string list -> configuration_itempath_search name doc paths performs a rudimentary search through the list of
paths. This provides a method for locating libraries that don't have any
other way to be found.val param : ?doc:string -> string -> value -> configuration_itemparam name defaultvalue provides a compile-time parameter that can be overridden
by the user. The default value is mandatory so that ocamlconf knows what type the user
should be supplying.val custom : (t -> t) -> configuration_itemcustom f allows you to have a totally custom configuration function that takes in the
configuration so far, and returns a possibly modified configuration. You only need to use this
if other configuration items depend on the results, otherwise you can just program you custom
stuff into your configure.mlval configure : (configuration_item * bool) list -> tconfiguration_item list, supplemented with a bool to
say whether to show each item to the user, and returns the
configuration that results from all the tests are command-line
parameters.
At this stage, the command line will be parsed and help output will
be provided to users who request it, using the documentation strings
you may or may not have provided when creating configuration items.
val conf_value : t -> string -> valueval conf_stringlist : t -> string -> string listvalue variant
type, to save you a couple lines of code - keeping the configure.ml small is keyval conf_string : t -> string -> stringval conf_bool : t -> string -> boolval output_config_file : t -> string -> unitval summarize_config : t -> (configuration_item * bool) list -> string