Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
william3 committed Aug 22, 2013
1 parent 79403b2 commit 711a58f
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions README.md
@@ -1,7 +1,7 @@
This archive contains standard, useful autoconf macros for detecting
OCaml, findlib, OCaml packages, etc.

It allows to compile ocaml project with benefits of autoconf features (C dependencies, library dependencies, multi platform, cross compilation). The ocaml compilation part can be handled with standard Makefiles or ocamlbuild.
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 :
Expand All @@ -22,34 +22,38 @@ Authors
Use
---

Copy ocaml.m4 into the autoconf macros directory of your project (usually m4/, but can be changed with AC_CONFIG_MACRO_DIR in configure.ac or configure.in). If it does not exists, create it :
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 :

mkdir m4
aclocal -I m4
m4_include([m4/ocaml.m4])
AC_PROG_OCAML()
AC_PROG_FINDLIB

Then refere to ocaml related macros from your configure.ac or configure.in file. Almost every OCaml project should use AC_PROG_OCAML first and probably AC_PROG_FINDLIB right after it.

You can build and install ocaml.m4 man page, then access it using :

man ocaml.m4
You are ready to include ocaml-autoconf macros in configure.ac. Once it is done, use something like this:

autoreconf -fi

Documentation
-------------

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 an ocaml project that uses ocaml-autoconf : https://forge.ocamlcore.org/projects/lablgtk/
Then have a look at some ocaml projects that uses ocaml-autoconf :
* https://forge.ocamlcore.org/projects/lablgtk/
* http://www.cairographics.org/cairo-ocaml/

To understand the macros, the best way is to look at ocaml.m4 macro file, with the autoconf reference manual beside : http://www.gnu.org/software/autoconf/manual/index.html
ocaml-autoconf macros reference manual :
* one good way is to look at ocaml.m4 file, along with the [autoconf reference manual] [1] beside
* also, the [ocaml-autoconf reference manual] [2] is almost up to date

a reference manual almost up to date, specific to ocaml macros, is available at http://forge.ocamlcore.org/docman/view.php/69/53/ocaml.m4.html
[1]: http://www.gnu.org/software/autoconf/manual/index.html
[2]: http://forge.ocamlcore.org/docman/view.php/69/53/ocaml.m4.html "ocaml-autoconf reference manual"

See the examples/ directory for a project skeleton using ocaml-autoconf,
autoconf, and automake for an ocaml project.

Building ocaml macros documentation
-----------------------------------

Optional installation of macro and man page
-------------------------------------------

To build the manual page, you'll need 'perldoc' (part of Perl).

Expand All @@ -61,6 +65,11 @@ To install the manual page and macro centrally, do:

make install

You can then use :

man ocaml.m4


Development
-----------

Expand Down

0 comments on commit 711a58f

Please sign in to comment.