This archive contains standard, useful autoconf macros for detecting OCaml, findlib, OCaml packages, etc.
It allows to compile ocaml project with benefits of powerful autoconf features (C dependencies, library dependencies, multi platform, cross compilation). The ocaml compilation part can be handled with standard Makefiles or ocamlbuild.
This project contains improvements on the base project, with no activity since 2009, which home page is: http://ocaml-autoconf.forge.ocamlcore.org/. Improvements are :
- revised documentation entry
- improvements on use of autoconf macros in ocaml.m4
- access via github
- Olivier Andrieu
- Jean-Christophe Filliâtre
- Richard W.M. Jones
- Georges Mariano
- Stefano Zacchiroli
Copy ocaml.m4 into the autoconf macros directory of your project (usually m4/, but could be changed with AC_CONFIG_MACRO_DIR). Then you would want to add the following lines to configure.ac :
m4_include([m4/ocaml.m4]) AC_PROG_OCAML() AC_PROG_FINDLIB
You are ready to include ocaml-autoconf macros in configure.ac. Once it is done, use something like this:
ocaml-autoconf is an extension to autoconf. You will need to learn how to use autoconf before, which is the most difficult part. One should follow a tutorial on the net.
Then have a look at some ocaml projects that uses ocaml-autoconf :
ocaml-autoconf macros reference manual :
- one good way is to look at ocaml.m4 file, along with the autoconf reference manual beside
- also, the ocaml-autoconf reference manual is almost up to date
See the examples/ directory for a project skeleton using ocaml-autoconf, autoconf, and automake for an ocaml project.
Optional installation of macro and man page
To build the manual page, you'll need 'perldoc' (part of Perl).
To build the manual page, etc., do:
To install the manual page and macro centrally, do:
You can then use :
Development home page: https://github.com/william3/ocaml-autoconf
to download repository, either use the 'Download' button of this webpage, or use :
git clone https://github.com/william3/ocaml-autoconf