man findlib.conf (Formats) - [Configuration of findlib/ocamlfind]c
NAME
findlib.conf - [Configuration of findlib/ocamlfind]c
GENERAL
There are three possibilities to configure the findlib library:c
Build time:c Before findlib is compiled, a "configure" script is invoked to figurec out the settings that are most likely to work on the system. Mostc settings are simply entered into text files and can easily be changedc after installation. The following properties cannot be changed laterc because they are compiled into the resulting binaries:c
h'-3m'z•h'3m'c The default location of the configuration file findlib.conf. However,c you can set a different location by the environment variablec OCAMLFIND_CONFc .c h'-3m'z•h'3m'c Whether the installed O'Caml version supports autolinking or not.c
Configuration file findlib.conf:c An initial version of this file is generated by the configure script,c but you are free to modify it later. Most important, this filec contains the system-wide search path used to look up packages, and thec default location where to install new packages.c
All files with the suffix ".conf" found in the directoryc findlib.conf.d are also scanned for parameters.c Environment variables:c The settings of findlib.conf can be overridden by environment variables.c
Last but not least, several settings can also be passed asc command-line options, or by invoking the functionc Findlib.initc .
findlib.conf
The directory containing findlib.conf is determined at build time (byc running the configure script), the fallback default isc /usr/local/etcc . You can set a different location byc changing the environment variable OCAMLFIND_CONFc which must contain the absolute path of findlib.conf.c
The file has the same syntax as METAc , i.e. it consists of ac number of lines with the formatc
variablec = "c valuec "c
Here is the list of allowed variables:c
pathc The search path for META files/package directories. The variablec enumerates directories which are separated by colons (Windows:c semicolons), and these directories are tried in turn to find a certainc package. More exactly, if d is such a directory and p the searchedc package, the search algorithm will first check whether d/p/METAc exists. In this case, this META file is taken, and d/p is the packagec directory. Second, the algorithm tries d/META.p, but the packagec directory must be specified in this META.p file by ac directoryc directive.c
Note that the first found META file is taken, so the order of thec directories in the search path counts.c
This variable is required.c
Example:c
path = "/usr/local/lib/ocaml/site-lib:/usr/lib/ocaml/site-lib"c
destdirc This variable determines the location where ocamlfindc installc puts the packages by default: If d is thisc directory, and p the package to install, a new subdirectory d/p willc be created containing all the files of the package.c
Example:c
destdir = "/usr/local/lib/ocaml/site-lib"c
This variable is required.c
metadirc If set, the command ocamlfind installc will put thec META files of packages into this directory (files are named META.pc where p=package name); otherwise the META files are put into thec package directories like any other file.c
Example:c
metadir = "/var/lib/findlib/metaregistry"c
This variable is optional. It is not used by default.c
ocamlcc ,c ocamloptc ,c ocamlcpc ,c ocamlmktopc ,c ocamldocc ,c ocamldepc ,c ocamlbrowserc If you want to call other executables than "ocamlc", "ocamlopt",c "ocamlcp", "ocamlmktop", "ocamldoc", "ocamldep", andc "ocamlbrowser", you canc set the names ofc the executables here. The command ocamlfindc looksc into these four variables to determine the names of the compilers toc call.c
Example:c
ocamlc = "ocamlc.opt"c
ocamlopt = "ocamlopt.opt"c
ocamlcp = "ocamlcp.opt"c
ocamlmktop = "ocamlmktop.opt"c
This variable is optional. It is not used by default.c
stdlibc This variable determines the location of the standard library. This mustc be the same directory for which the O'Caml compilers are configured.c
This variable is optional. It is not recommend to set this variablec unless you know what you are doing!c
ldconfc This variable determines the location of the ld.conf file. This mustc be the same file the O'Caml compilers read in; it is updated by ocamlfind when installing and removing packages. You can set thisc variable to the special value "c ignorec " to disablec the automatic modification of the ld.conf file.c
If not set, the ld.conf file is assumed to reside in the O'Camlc standard library directory.c
This variable is optional. It is not recommended to set this variablec unless you know what you are doing!c
Toolchains: It is possible to have variants of the original configuration.c These variants are called "toolchains" because they are intended toc select different compilers, e.g. patched compilers. In order toc set a variable for a certain toolchain, use the syntaxc
variablec (c toolchainc ) = "c valuec "cFor example:c
ocamlc(mypatch) = "ocamlc-mypatch"cWhen the toolchain "mypatch" is selected, this compiler will be used insteadc of the standard one.c
In order to switch to a certain toolchain, use the -toolchainc option of ocamlfindc .c
Environment
A number of environment variables modifies the behaviour ofc findlib/ocamlfind:c
OCAMLFIND_CONFc This variable overrides the location of the configuration filec findlib.conf. It must contain the absolute path name of this file.c
OCAMLPATHc This variable may contain an additional search path for packagec directories. It is treated as if the directories were prepended toc the configuration variable pathc .c
OCAMLFIND_DESTDIRc This variable overrides the configuration variablec destdirc .
OCAMLFIND_METADIRc This variable overrides the configuration variablec metadirc .
OCAMLFIND_COMMANDSc This variable overrides the configuration variablesc ocamlcc , ocamloptc ,c ocamlcpc , ocamlmktopc ,c ocamldocc , ocamldepc , and/orc ocamlbrowserc . Its value must conform to the syntaxc
ocamlc=c namec ocamlopt=c namec ocamlcp=c namec ocamlmktop=c namec ocamldoc=c namec ocamldep=c namec ocamlbrowser=c namec
Example:c
ocamlc=ocamlc-3.00 ocamlopt=ocamlopt-3.00 ocamlcp=ocamlcp-3.00 ocamlmktop=ocamlmktop-3.00c
CAMLLIBc or OCAMLLIBc This variable overrides the configuration variablec stdlibc .
OCAMLFIND_LDCONFc This variable overrides the configuration variablec ldconfc .