Version française
Home     About     Download     Resources     Contact us    
Browse thread
Ocamlbuild with findlib + camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dario Teixeira <darioteixeira@y...>
Subject: Re: [Caml-list] Ocamlbuild with findlib + camlp4
> Nice!  Apart  the link with findlib.cma that is not supported yet and could
> be with  the  multiple-plugins support in ocamlbuild. I think that one can
> easily build a generic plugin for ocamlfind packages.

Hi,

I hope so too.  However, note that no one has managed yet to provide a solution
to my original question, namely of integrating Ocamlbuild with findlib *and*
camlp4.  Perhaps I should have explained better what this entails:

Suppose you are using the Sexplib syntax extension.  This syntax extension
depends on Sexplib itself and on another syntax extension, offered by the
Type-conv package.  The META package for Sexplib should contain the following:
(note that the version currently shipping with GODI is incomplete)

###############################################################
name="sexplib"
version="3.0.0"
description="Sexplib - automated S-expression conversions"
requires="bigarray"
archive(byte)="sexplib.cma"
archive(native)="sexplib.cmxa"

package "statements" (
  requires = "sexplib,type-conv.statements,camlp4"
  version = "3.0.0"
  description = "Syntax extension for Sexplib"
  archive(syntax,preprocessor) = "pa_sexp_conv.cmo"
  archive(syntax,toploop) = "pa_sexp_conv.cmo"
  )
###############################################################


To compile with Findlib a data.ml file that makes use of the Sexplib syntax
extension is very simple.  You just have to specify the "sexplib.statements"
package, and findlib will *automatically* take care of also loading libraries
or even other syntax extensions needed by sexplib.statements:

ocamlfind ocamlc -package sexplib.statements -syntax camlp4o -c data.ml


Why am I insisting on this?  Because when we manage to integrate these
three tools, we will essentially have solved the very common request of
providing easy access to common syntax extensions (just last week there was
an OSR on this subject).  All that will be required to compile a file such as
data.ml using the Sexplib syntax extension will be to add a line "<data.ml>:
use_sexplib.statements" to the _tags file.  You won't even need to create
a custom Ocamlbuild plugin or anything, because this findlib support could
be provided by a default plugin (living on $HOME/.ocamlbuild or something).

So, Nicolas, is this altogether feasible with the current Ocamlbuild?
(And if so, could you lent us a hand -- you are of course the most
competent person to do so).

Kind regards,
Dario



      ___________________________________________________________ 
Rise to the challenge for Sport Relief with Yahoo! For Good  

http://uk.promotions.yahoo.com/forgood/