From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 58573BC57 for ; Mon, 29 Nov 2010 21:52:23 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq8BAAOh80xQDPJ8kWdsb2JhbACjHwEBAQEJCwoHEQMfwxiFRwSKYYMa X-IronPort-AV: E=Sophos;i="4.59,277,1288566000"; d="scan'208";a="89943239" Received: from smtp02.smtpout.orange.fr (HELO smtp.smtpout.orange.fr) ([80.12.242.124]) by mail1-smtp-roc.national.inria.fr with ESMTP; 29 Nov 2010 21:52:23 +0100 Received: from giga ([86.217.111.83]) by mwinf5d04 with ME id d8sM1f00F1o0kB2038sMZ6; Mon, 29 Nov 2010 21:52:22 +0100 Received: from yocto.gallu.homelinux.org ([192.168.2.2]) by giga with smtp (Exim 4.69) (envelope-from ) id 1PNAhw-0006U3-FH; Mon, 29 Nov 2010 21:52:21 +0100 Received: by yocto.gallu.homelinux.org (sSMTP sendmail emulation); Mon, 29 Nov 2010 21:52:20 +0100 Date: Mon, 29 Nov 2010 21:52:20 +0100 From: Sylvain Le Gall To: Anastasia Gornostaeva Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: oasis Message-ID: <20101129205220.GB5831@yocto.gallu.homelinux.org> References: <20101126183832.GA10787@ermine.home> <20101127131005.GA2407@ermine.home> <20101129194622.GA41946@ermine.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101129194622.GA41946@ermine.home> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam: no; 0.00; le-gall:01 freetype:01 freetype:01 cflags:01 libs:01 variants:01 userspace:01 usr:01 usr:01 lib:01 lib:01 libs:01 flags:01 cflags:01 ocaml:01 Hello, On Mon, Nov 29, 2010 at 10:46:22PM +0300, Anastasia Gornostaeva wrote: > On Sun, Nov 28, 2010 at 05:17:35PM +0000, Sylvain Le Gall wrote: > > > My current state about this solution is: > > - defines BuildDepends: freetype2 (pkg-config), to make clear that there > > is a C build-depends > > - allow to override the defined variable freetype2_cflags and > > freetype2_libs. If they are both defined by user, don't even call > > pkg-config for this package > > There should be three variants: pkg-config, OS-based userspace policy > (/usr/include vs. /usr/local/include) and user-defined one. > I think the pkg-config is the starting point, it also defines the prefix of the setup.data variable that we will use. For you OS-based detection, I can propose a header(XXX), lib(XXX). This will be cumulative (i.e. you can define several header and lib). Example: BuildDepends: freetype2(pkg-config, header(freetype/freetype.h), lib(freetype), >= 2.0.4), oUnit The headers and libs fields are extra methods. If you define them, we will try to find a set of -Idirs that help to find the matching headers or a -Ldirs to find the matching libs. We will only do a detection using Sys.file_exists (i.e. don't try to link or anything similar). The detection method start with pkg-config and if it fails goes to headers/libs. > > Here is a new proposal about this: > > - use a PostConfigureCommand to invoke a shell script freetype2.sh > > - in freetype2.sh invoke freetype-config and output flags in setup.data > > using "echo 'freetype2_cflags = "$output"' >> setup.data' and > > "echo 'freetype2_libs = "$output"' >> setup.data' > > - add in _tags a "src/toto.cma: pkg_config_freetype2" > > - add in myocamlbuild.ml a "tag [pkg_config_freetyp2; compile; ocaml] & > > [... (* load the content of freetyp2_cflags *) ... ]" > > > > This is not simple but this is probably what I will do for the support > > of C libraries in 0.3.0. > > But it is the best solution now and partially works for me. > And please make the functions that loads setup.data and var_get data from it > to be public. Right now I attempt to play with your code in myocamlbuild.ml > and re-use it in my piece at bottom of the file. > I'm always ready to test/use oasis from darcs when you put there something new. > I not that down, I'll ping you ASAP. Cheers Sylvain Le Gall