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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 30C0CBC6B for ; Tue, 18 Sep 2007 20:00:54 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPCv70YmYrqmnWdsb2JhbACOEAICCw0I X-IronPort-AV: E=Sophos;i="4.20,269,1186351200"; d="scan'208";a="2876851" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 18 Sep 2007 20:02:01 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l8II1MhQ026847 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 18 Sep 2007 20:01:23 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPCv70YmYrqmnWdsb2JhbACOEAICCw0I X-IronPort-AV: E=Sophos;i="4.20,269,1186351200"; d="scan'208";a="2876849" Received: from smtp.01.com (HELO asav-1.01.com) ([38.98.186.166]) by mail3-smtp-sop.national.inria.fr with ESMTP; 18 Sep 2007 20:02:00 +0200 Received: from asav-1.01.com (localhost.localdomain [127.0.0.1]) by asav-1.01.com (8.13.1/8.13.1) with SMTP id l8II1w4V017185 for ; Tue, 18 Sep 2007 13:01:58 -0500 Received: from smtp-1.01.com (smtp-1.01.com [38.98.186.157]) by asav-1.01.com (asav-1.01.com [38.98.186.159]) id j8HD1w0304755078cy ret-id none; Tue, 18 Sep 2007 13:01:58 -0500 Received: from [192.168.1.12] (h-74-2-112-11.snfccasy.covad.net [74.2.112.11]) by smtp-1.01.com (Postfix) with ESMTP id 66B7A20009A for ; Tue, 18 Sep 2007 13:01:57 -0500 (CDT) Message-ID: <46F01294.7060806@skydeck.com> Date: Tue, 18 Sep 2007 11:01:56 -0700 From: Jake Donham User-Agent: Thunderbird 2.0.0.4 (X11/20070604) MIME-Version: 1.0 To: caml-list@inria.fr Subject: ocamlbuild: args to tags? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-FSL-MailScanner-Information: Please contact postmaster@01.com for more information X-FSL-MailScanner: Found to be clean X-FSL-MailScanner-SpamCheck: X-FSL-MailScanner-From: jake.donham@skydeck.com X-Miltered: at discorde with ID 46F01272.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 foo:01 -pp:01 foo:01 flags:01 preprocessor:01 preprocessor:01 arbitrary:02 dispatch:03 types:05 args:05 args:05 discussion:06 deriving:07 Hi, Is there a way to pass arguments to a preprocessor via the _tags file? (In particular, I have added a -classes option to Deriving to give default classes to all the types in a file.). Following the recent discussion, I have this in myocamlbuild.ml: dispatch begin function | After_rules -> flag ["ocaml"; "pp"; "deriving"] (A"deriving"); flag ["ocaml"; "pp"; "Show"] (S[A"-classes"; A"Show"]); So now if I put : deriving,Show in _tags I get -pp 'deriving -classes Show' in the command line. What I would like, however, is to be able to write : deriving(Show,Typeable) or : deriving,classes(Show,Typeable) i.e. to be able to pass some arbitrary args rather than hard-coding Show as a tag. Is there any way to do this? I don't understand how Ocamlbuild decides whether flags should be associated with the main command or with the preprocessor command; if I write classes(Foo) in _tags I get -classes Foo in the main command, no matter what I have tried in myocamlbuild.ml. Thanks, Jake