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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id EC4F7BC6B for ; Mon, 17 Sep 2007 20:07:58 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAM5e7kbAXQInlGdsb2JhbACOFQIHBAYHCA X-IronPort-AV: E=Sophos;i="4.20,265,1186351200"; d="scan'208";a="925514" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 17 Sep 2007 20:08:58 +0200 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l8HI8Pxs025474 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 17 Sep 2007 20:08:26 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABhg7kZC+VLtmGdsb2JhbACOFQIHAgYRGA X-IronPort-AV: E=Sophos;i="4.20,265,1186351200"; d="scan'208";a="1321475" Received: from wx-out-0506.google.com ([66.249.82.237]) by mail2-smtp-roc.national.inria.fr with ESMTP; 17 Sep 2007 20:08:57 +0200 Received: by wx-out-0506.google.com with SMTP id h28so1421941wxd for ; Mon, 17 Sep 2007 11:08:56 -0700 (PDT) Received: by 10.90.29.18 with SMTP id c18mr3195999agc.1190052536215; Mon, 17 Sep 2007 11:08:56 -0700 (PDT) Received: from laptop44.umd.edu ( [129.2.175.66]) by mx.google.com with ESMTPS id t26sm6753836ele.2007.09.17.11.08.54 (version=SSLv3 cipher=OTHER); Mon, 17 Sep 2007 11:08:55 -0700 (PDT) Date: Mon, 17 Sep 2007 14:08:49 -0400 From: "Hezekiah M. Carty" To: Nicolas Pouillard Cc: Inria Ocaml Mailing List Subject: Re: [Caml-list] ocamlbuild .inferred.mli problem Message-ID: <20070917180849.GA3012@laptop44.umd.edu> References: <20070916023623.GA10905@laptop44.chn.comcast.net> <1190038867-sup-9845@ausone.inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1190038867-sup-9845@ausone.inria.fr> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: "Hezekiah M. Carty" X-Miltered: at concorde with ID 46EEC299.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; mli:01 camlp:01 -pp:01 camlp:01 cmo:01 flags:01 ocaml:01 ocaml:01 cmo:01 -pp:01 compilation:01 ocamldep:01 syntax:01 wiki:01 2007,:98 On Mon, 17 Sep 2007, Nicolas Pouillard wrote: > > I have also tried creating a myocamlbuild.ml to get around this, but > > using something like this in myocamlbuild.ml: > > > > flag ["use_openin"] > > (S [A "-I"; A "+camlp4"; A "-pp"; A "camlp4o pa_openin.cmo"]);; > > You certainly don't want to add these flags to any commands that treat a file > that is tagged use_openin. You certainly want to add them only for ocaml > preprocessing. > > flag ["ocaml"; "pp"; "use_openin"] > (A"pa_openin.cmo");; > This gets me a little bit closer I think, but I'm still not able to make ocamlbuild do what I want. Here's the current code - test.ml: let sum l = open List in fold_left (+) 0 l _tags: "test.ml": use_openin myocamlbuild.ml: open Ocamlbuild_plugin;; open Command;; flag ["ocaml"; "pp"; "use_openin"] (A "pa_openin.cmo");; Using the above "flag ..." line adds "-pp pa_openin.cmo" to the compilation command line using the following line in _tags: "test.ml": use_openin If I change the _tags line to: "test.ml": camlp4o, use_openin the output from ocamlbuild test.cma is: + /home/hcarty/Applications/godi/bin/ocamldep.opt -pp 'pa_openin.cmo camlp4o' -modules test.ml > test.ml.depends sh: pa_openin.cmo: command not found Preprocessing error on file test.ml How do I fix this to properly use a syntax extension such as pa_openin.cmo and be able to specify the location of the .cmo, but only for the files which need that specific extension? ie. add "-I +camlp4" to the ocaml* command line, and have the -pp value in the correct order. I apologize for asking such a basic question, but I haven't been able to figure out the answer from the user's guide or other examples I've found. Once this is all worked out I would be happy to add this to a wiki somewhere. Thanks, Hez