caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Grigory Batalov <bga@tepkom.ru>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: ocaml support in autotools
Date: Fri, 04 Aug 2006 15:32:26 +1000	[thread overview]
Message-ID: <1154669546.5926.34.camel@rosella.wigram> (raw)
In-Reply-To: <20060804044055.79801082.bga@tepkom.ru>

On Fri, 2006-08-04 at 04:40 +0400, Grigory Batalov wrote:

BTW: anyone working on this should examine the Debian Ocaml Policy.
Sorry no link off hand, ask on

debian-ocaml-maint@lists-debian.org

At least any macros should work well with Debian packagers
requirements, people there have high expertise packaging Ocaml
stuff.

In particular .. you should note that 'detecting' ocaml libraries
is VERY HARD because they're locked to a fixed version of Ocaml:
the Ocaml ABI changes with every release (including patches).

AFAIK, you simply cannot 'autoconf' check a required library
is available: the check will not reveal the version of Ocaml
used to build that library .. and it must be built with
the version of Ocaml being used for this tarball build
or the library is useless.

I think what you actually need to do is:

(a) find the appropriate Ocaml program
(b) find the candidate library
(c) check the time stamps on both, and reject the library
unless its date is newer than the ocaml program.

[My own personal solution to this is (a) never use third party
libraries and (b) if I have to, bundle the source code:
always build everything from source. For C this would be
a nightmare .. for Ocaml it is no problem, the compiler
is so fast, and it gives you control of compilation options..
not that there are many]

>   We use OCAMLCDOTOPT for ocamlc.opt and OCAMLOPTDOTOPT for ocamlopt.opt
>   inside AC_PROG_OCAML macro, but they are not available to user yet.
> 
>   It seems like optimized tools work faster (?). What if we will prefer
>   optimized tools by default, but switch to bytecoded if user gives
>   --without-opttools configure argument ?

I think you have this procedure:

(a) you detect and set variable for support for

native compiler: one of: ocamlopt.opt, ocamlopt
bytecode compiler: one of: ocamlc.opt, ocamlc

interface compiler: one of: ocamlc.opt, ocamlc
 (this is the same program as bytecode compiler, but it 
  should be managed separately)

plus other tools (ocamldep, ocamldoc, findlinb, etc).

(b) There at least are 3 models of compilation:

native code, bytecode, standalone bytecode
(the latter is a single executable file containing the 
bytecode interpreter and bytecode in one package).

The user has several choices:

1. Chose fastest model: 
  native code if possible, otherwise bytecode

2. Chose standalone executable (rare):
  native code if possible, otherwise standalone bytecode

3. Chose bytecode

4. Chose native code

5. BOTH bytecode and nativecode 

Developers often want (5) both, but it plays interesting
havoc with naive build scripts: the generated programs
must have distinct names (libraries and object files
already do).

My own build system can't handle this :)

> > 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 ?
> 
>   I guess, we have found a broken findlib on some platform and desided
>   to optionally disable it.

Also because a developer may want to check a system builds
without requiring findlib.

but the real reason is simpler: some people write Makefiles
which require findlib, and will not work without it.

Some people write Makefiles that will not work with it.

Some people try to support both.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2006-08-04  5:32 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   ` [Caml-list] " Guillaume Rousse
2006-08-03 21:10     ` Erik de Castro Lopo
2006-08-04  0:40     ` Grigory Batalov
2006-08-04  5:32       ` skaller [this message]
2006-08-04  5:41         ` [Caml-list] " 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=1154669546.5926.34.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=bga@tepkom.ru \
    --cc=caml-list@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).