From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 8BA707EE48 for ; Mon, 2 Mar 2015 19:24:30 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.09,676,1418079600"; d="scan'208";a="124041739" Received: from adijon-652-1-226-3.w83-196.abo.wanadoo.fr (HELO alcazar2) ([83.196.121.3]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 02 Mar 2015 19:24:28 +0100 Date: Mon, 2 Mar 2015 19:24:23 +0100 From: Maxence Guesdon To: caml-list@inria.fr Message-ID: <20150302192423.11734fc7@alcazar2> In-Reply-To: References: <20150302184846.2531e792@alcazar2> Organization: INRIA X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] syntax extensions with ocamlfind On Mon, 2 Mar 2015 18:07:40 +0000 Andreas Hauptmann wrote: > On Mon, 2 Mar 2015 18:48:46 +0100 > Maxence Guesdon wrote: > > > It seems that ocamlfind only supports camlp4 for preprocessors. Am I > > right ? Does anybody known how to achieve this ? > > Take a look at the META file of camlp5. If i remember right, it achieves > similar without native support inside ocamlfind. Indded, thanks. But it seems that ocamlfind can handle only one preprocessor, instead of building a command chaining the preprocessors. When I have more than one packages defining a preprocessor, I get: ocamlfind: Several packages are selected that specify preprocessors: package camlp4 defines `camlp4', package mypkg.syntax defines `./mypp' And the use of a preprocessor depends on having a "archive" variable defined like that: archive(syntax,preprocessor,dynamow) = "..." Which must not be empty to make the preprocessor used. If it's empty, then I get: ocamlfind: Using -syntax, but no package is selected specifying a preprocessor as required for -syntax Moreover, ocamlfind automatically adds a -I option to the preprocessor command, in my case I end up with -pp "mypp '-I' '/home/guesdon/.opam/4.02.1/lib/mypkg' So the preprocessor machinery seems very camlp{4,5} oriented. I think I'll just require the user to add -pp "ocamlfind mypkg/mypp" on command line option. Maxence