caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Guillaume Rousse <Guillaume.Rousse@inria.fr>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] ocaml support in autotools
Date: Thu, 03 Aug 2006 14:56:05 +0200	[thread overview]
Message-ID: <44D1F265.4040401@inria.fr> (raw)
In-Reply-To: <44CE6483.9070205@tepkom.ru>

Dmitri Boulytchev wrote:
>     We are currently using a set of autoconf+automake customized scripts to
> configure and build all of our OCaml projects.  The scripts are available
> through http://oops.tepkom.ru/projects/template.
It seems the most advanced work from all I've been suggested to look at,
so I used it as a work base. I'd have some questions however about
desirable behaviour for those macros.

First, I'd like to keep interfaces and behaviour as close as possible
from standard autoconf macros, in particular avoid taking any decision
in the macro themselves. Very few of them, for example, throw an error
if test fails, they either set variable or takes an action as argument,
so as to let the programmer decides what to do.

So, I'd like to avoid any use of AC_MSG_ERROR or AC_MSG_WARN in those
macros, only AC_MSG_RESULT for printing information. The use of
action-if-not-found argument in macro checking for several programs is
also unpractical, as its exact semantic is quite fuzzy (what if one of
them but not the others are found ?). So, those macros should only set
useful variables, without side effect.

They are exceptions, tough, for compiler macros-related macros, such as
AC_PROG_CC and AC_PROG_CPP. I guess this is because they are unlikely to
get used in conditional context. So I guess it would be quite reasonable
to make AC_PROG_OCAML fails if no working ocaml is found. And probably
also AC_PROG_CAMLP4. But definitevely not for others, and particulary
for macros macros looking for ocamllex or ocamlyacc: in C world, lex and
yacc-generated sources are generally distributed, to make lex and yacc
use non mandatory on installation platforms, and as a consequence,
AC_PROG_LEX and AC_PROG_YACC are not fatal macros.

So my current opinion is:
- have AC_PROG_OCAML fails if ocamlc is not found
- have AC_PROG_CAMLP4 fails if ocamlp4 is not found
- have all other macros never fail

Second, what to do with optimised versions ? It is desirable for the
user or the developer to be able to select between optimised and
non-optimised version of a given tool ?

If not, having a single variable for each tool, silently defined to the
optimised version if available and usable, would be the best option.
OCAMLC would then correspond to ocamlc.opt or ocamlc

If yes, a combination of user options (through AC_ARG_ENABLE),
developper options (conditional macros arguments), or distinct variables
(OCAMLC and OCAMLC_OPT) would do the trick.

Third, I'd like some standard macro to allow the user to select if he
wants bytcode compilation, native compilation, or both, the same as you
have when using libtool for producing either static or dynamic
libraries. Does it makes senses to add those switches to AC_PROG_OCAML,
and to define additional variables, such as OCAML_WANT_BYTECODE and
OCAML_WANT_NATIVE ?

Fourth, in the AC_PROG_FINDLIB, there is a switch allowing the user to
disallow the use of ocamlfind, even if present on the system. Why is
thie behaviour desirable ?

BTW, my global ocaml knwoledge is quite slim, so I may miss details :)
-- 
Guillaume Rousse
Projet Estime, INRIA
Domaine de Voluceau
Rocquencourt - B.P. 105
78153 Le Chesnay Cedex - France


  parent reply	other threads:[~2006-08-03 12:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-31 16:14 Guillaume Rousse
2006-08-01  8:03 ` [Caml-list] " Stefano Zacchiroli
2006-08-01  8:15 ` Erik de Castro Lopo
2006-08-01  8:30   ` Christian Lindig
2006-08-01  8:51     ` Erik de Castro Lopo
2006-08-01 11:30     ` Hendrik Tews
2006-08-01 12:32       ` skaller
2006-08-01 12:50         ` Guillaume Rousse
2006-08-01 13:13           ` skaller
2006-08-02 12:46     ` Guillaume Rousse
2006-08-02 14:03       ` Christian Lindig
2006-08-01 11:27 ` Hendrik Tews
2006-08-01 11:51   ` Erik de Castro Lopo
2006-08-02 12:28   ` Guillaume Rousse
2006-08-01 17:37 ` Grigory Batalov
2006-08-02 12:29   ` [Caml-list] " Guillaume Rousse
     [not found] ` <44CE6483.9070205@tepkom.ru>
2006-08-03 12:56   ` Guillaume Rousse [this message]
2006-08-03 21:10     ` [Caml-list] " Erik de Castro Lopo
2006-08-04  0:40     ` Grigory Batalov
2006-08-04  5:32       ` [Caml-list] " skaller
2006-08-04  5:41         ` skaller
2006-08-04 12:38           ` Guillaume Rousse
2006-08-04  8:41         ` Anil Madhavapeddy
2006-09-08 14:52           ` Guillaume Rousse
2006-08-04 12:48         ` Stefano Zacchiroli
2006-08-05  0:36           ` skaller
2006-08-06  9:22             ` Stefano Zacchiroli
2006-09-08 14:52         ` Guillaume Rousse
2006-08-03 15:10   ` [Caml-list] " Guillaume Rousse
2006-08-03 21:12     ` Erik de Castro Lopo
2006-08-04 12:26       ` Guillaume Rousse
2006-08-04  1:15     ` Grigory Batalov
2006-08-03 22:42 ` [Caml-list] " Sylvain Le Gall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44D1F265.4040401@inria.fr \
    --to=guillaume.rousse@inria.fr \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).