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=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id E0545BBAF for ; Wed, 8 Apr 2009 15:22:14 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj4DAF9B3EmBrw8EgWdsb2JhbACWHgEBFiK3A4N7Bg X-IronPort-AV: E=Sophos;i="4.39,344,1235948400"; d="scan'208";a="24206164" Received: from ext.lri.fr ([129.175.15.4]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 08 Apr 2009 15:22:14 +0200 Received: from localhost (localhost [127.0.0.1]) by ext.lri.fr (Postfix) with ESMTP id 520EEA44EF; Wed, 8 Apr 2009 15:22:14 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at lri.fr Received: from ext.lri.fr ([127.0.0.1]) by localhost (ext.lri.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dNvAyc8of7-A; Wed, 8 Apr 2009 15:22:14 +0200 (CEST) Received: from smtp.lri.fr (vhost3-23 [129.175.3.23]) by ext.lri.fr (Postfix) with ESMTP id 3A08FA44E6; Wed, 8 Apr 2009 15:22:14 +0200 (CEST) Received: from [129.175.4.107] (lri4-107 [129.175.4.107]) by smtp.lri.fr (Postfix) with ESMTP id 36148E058E; Wed, 8 Apr 2009 15:22:14 +0200 (CEST) Message-ID: <49DCA53C.4040401@lri.fr> Date: Wed, 08 Apr 2009 15:23:08 +0200 From: Romain Bardou User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Hans Ole Rafaelsen Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] ocamlbuild and ocamlfind - using multiple grammars in a project References: <49DC757D.6080701@simula.no> In-Reply-To: <49DC757D.6080701@simula.no> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; lri:01 ocamlfind:01 grammars:01 rafaelsen:01 ocamlfind:01 submodule:01 syntaxes:01 camlp:01 camlp:01 syntax:01 submodule:01 wiki:01 ocaml:01 syntax:01 foo:01 Hans Ole Rafaelsen a écrit : > Hi > > I'm trying to build a project using ocamlbuild with ocamlfind. One > submodule requires 'json-static' and another requires > 'bitstring.syntax'. The preprocessors requires different syntaxes, > resulting in the following error: > > ocamlfind: No unique value for the META variable 'preprocessor': package > camlp4 defines `camlp4', package bitstring.syntax defines `camlp4of' > > Is there a way to make a myocamlbuild.ml file to select the preprocessor > to use on a submodule/file basis? Yes. In the wiki plugin, you have lines such as: flag ["ocaml"; "compile"; "syntax_"^syntax] & S[A"-syntax"; A syntax]; This means that the "-syntax foo" option will only be added if a package "foo" exists AND your compiled file (i.e. ".ml") has tag "syntax_foo". So, just tag your files, but not two files with two syntax tags. > On a similar topic: Is it possible to tell ocamlbuild to use another > file than myocamlbuild.ml for additional build instructions? At the > moment I have a makefile that changes links to different files, but I'm > not happy too with this method. Unfortunately, not yet. -- Romain Bardou