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.3 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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 1FFDCBC6B; Tue, 9 Oct 2007 16:11:36 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAEopC0fAXQImh2dsb2JhbACOSAIBCAop X-IronPort-AV: E=Sophos;i="4.21,249,1188770400"; d="scan'208";a="17754048" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 09 Oct 2007 16:11:35 +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 l99EBWvO000536 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK); Tue, 9 Oct 2007 16:11:35 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJcoC0dAFmAgh2dsb2JhbACOSAIBCAop X-IronPort-AV: E=Sophos;i="4.21,249,1188770400"; d="scan'208";a="4264925" Received: from unknown (HELO matthew.asmallorange.com) ([64.22.96.32]) by mail3-smtp-sop.national.inria.fr with ESMTP; 09 Oct 2007 16:11:34 +0200 Received: from [207.112.48.147] (helo=[192.168.11.8]) by matthew.asmallorange.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1IfFo0-0007kg-W1; Tue, 09 Oct 2007 10:11:32 -0400 Message-ID: <470B8BF5.2060105@marseda.com> Date: Tue, 09 Oct 2007 10:11:01 -0400 From: Alan Falloon User-Agent: Thunderbird 1.5.0.13 (X11/20070824) MIME-Version: 1.0 To: Nicolas Pouillard Cc: caml-list Subject: Re: [Caml-list] Re: ocamlbuild and c libs References: <23D3A6CC-0AE4-40A6-8626-4600C0EEE7C0@epfl.ch> <1191849838-sup-8791@ausone.inria.fr> In-Reply-To: <1191849838-sup-8791@ausone.inria.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - matthew.asmallorange.com X-AntiAbuse: Original Domain - inria.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marseda.com X-Miltered: at discorde with ID 470B8C14.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; libs:01 flags:01 stubs:01 libfoo:01 ocaml:01 cmo:01 dirs:01 stubs:01 dirs:01 ocaml:01 wiki:01 wrote:01 compile:01 caml-list:01 dependency:01 Nicolas Pouillard wrote: > Excerpts from Alan Falloon's message of Thu Oct 04 16:49:54 +0200 2007: >> Another useful addition would be to pass the include flags when >> compiling c stubs. Right now, you need to write a plugin even if you >> only want to include the other project directories. > > You can also specify include directories using tags. > > "libfoo": include That works for compiling ocaml ".ml -> .cmo" code, but not for c code ".c -> .o". I had to add this to my After_rules section: flag ["c"; "compile"] ( S( List.map (fun p -> S[A"-ccopt"; A("-I../"^p)]) !Ocamlbuild_pack.Options.include_dirs) ); To get the stubs to have the project include dirs. It is a big hack because what I really want to do is scan the C file and determine which header files is actually depends on and have them copied into the _build directory before compiling (notice the include flag has .. in it). However, I am having a really hard time figuring our how to reproduce the dependency magic implemented for the ocaml stuff, and at least this sort of works (as long as I don't expect the .o to rebuild when I touch the headers). Maybe this would make another good example for the Wiki.