cdk_config

cdk_config is a tool to help you give correct arguments when compiling Ocaml programs.

Command line arguments

Currently, the following arguments are supported to generate direct arguments to the ocaml compilers: The following arguments are also available to give information on the CDK installation:

Anonymous arguments

Other arguments given to cdk_config are the names of the packages needed during the compilation. For example, if your program is using the wxlib widget toolkit library can compile its program using the following command:
# ocamlc -c `cdk_config -c wxlib` interface.ml
# ocamlc -o interface `cdk_config wxlib` interface.cmo
For native code:
# ocamlopt -c `cdk_config -opt -c wxlib` interface.ml
# ocamlopt -o interface `cdk_config -opt wxlib` interface.cmx
The output of cdk_config in this last example is:
# cdk_config -opt -c wxlib
 -I +xlib  
# cdk_config -opt wxlib
 unix.cmxa   str.cmxa   extlib.cmxa   common.cmxa   concur.cmxa   X11.cmxa   -I +xlib   wxlib.cmxa  

Anonymous arguments don't need to be sorted. Dependencies will be computed by cdk_config so that compilation will be correct anyway.

Using cdk_config for non-CDK programs

When cdk_config finds a package name package it doesn't know, he looks in the ocaml installation directory for a file called package.config . This file should have the following format: For wxlib, it would be:
-I +xlib
wxlib.cma
wxlib.cmxa
X11 unix
Notice that cdk_config will also add the libraries which are needed by X11 and unix , and so on.


Last modification April 13, 2001.