From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 9901BBC69 for ; Fri, 23 Nov 2007 13:04:55 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.21,456,1188770400"; d="scan'208";a="6107578" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail3-relais-sop.national.inria.fr with SMTP; 23 Nov 2007 13:04:54 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Fri, _d Nov 2007 13:04:06 +0100 From: "Nicolas Pouillard" Cc: caml-list Subject: Re: [Caml-list] Using findlib and a syntax extension with ocamlbuild To: Paolo Donadeo References: <4b5157c30711211521g38a5d7bbg204e1283b975f38@mail.gmail.com> In-Reply-To: <4b5157c30711211521g38a5d7bbg204e1283b975f38@mail.gmail.com> Date: Fri, 23 Nov 2007 13:04:06 +0100 Message-Id: <1195819440-sup-4781@ausone.inria.fr> User-Agent: Sup/0.2 Content-Type: text/plain; charset=UTF-8 X-Spam: no; 0.00; findlib:01 syntax:01 wiki:01 findlib:01 syntax:01 libs:01 compilation:01 libs:01 camlp:01 camlp:01 cmo:01 subdir:01 ocaml:01 dish:98 compile:01 Excerpts from Paolo Donadeo's message of Thu Nov 22 00:21:43 +0100 2007: > I'm fighting again with ocamlbuild. In the (excellent!) wiki I found > two useful recipes: how to use findlib with ocamlbuild and how to > compile source code using a syntax extension. Now it happens that I > have both these needs, and I'm not so sure how to mix the ingredients > and obtain a good dish. > > At the moment the solution I have discovered (by trial and error) > works well, but it doesn't seem very clean. > > The involved files in my source directory are these: > > ./xnuncc.ml > ./myocamlbuild.ml > ./ext_libs/openin-20070524/pa_openin.ml > ./_tags > > In xnuncc.ml I use the openin extension, and xnuncc.ml is the main > compilation unit. > > Here is the contents of _tags and the plugin for ocamlbuild: > > ======= 8< CUT HERE: _tags >8 ======= > or or or or : include > : include > true : dtypes > <**/pa_openin.ml> : camlp4of, use_camlp4of > "xnuncc.ml" : camlp4o, use_openin > ======= 8< END HERE: _tags >8 ======= (and many others) can be rewritten "dom" since it's constant. [...] > If I use "pa_openin.cmo", indeed, the result is an absurd (for me) > error message starting with: > [...] In a "dep" declaration include directories are not taken in account for building pathnames. > At the end of the story the question is: is this solution the best > possible for compiling a project with findlib and a syntax extension > present in a subdir of the project? Not yet (you can still factorise the "ext_libs/openin-20070524" and even compute it, since the plugin language is OCaml). -- Nicolas Pouillard aka Ertai