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 478E2BC57 for ; Sun, 28 Nov 2010 18:17:49 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhUFAOMc8kxQW+UMgWdsb2JhbACVCI4BFQEBFiIiwDqFRwSKYQ X-IronPort-AV: E=Sophos;i="4.59,271,1288566000"; d="scan'208";a="89517276" Received: from lo.gmane.org ([80.91.229.12]) by mail1-smtp-roc.national.inria.fr with ESMTP; 28 Nov 2010 18:17:48 +0100 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PMksk-0000AY-S1 for caml-list@inria.fr; Sun, 28 Nov 2010 18:17:46 +0100 Received: from avelizy-155-1-41-182.w83-204.abo.wanadoo.fr ([83.204.200.182]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 28 Nov 2010 18:17:46 +0100 Received: from sylvain by avelizy-155-1-41-182.w83-204.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 28 Nov 2010 18:17:46 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: oasis Date: Sun, 28 Nov 2010 17:17:35 +0000 (UTC) Message-ID: References: <20101126183832.GA10787@ermine.home> <20101127131005.GA2407@ermine.home> X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: avelizy-155-1-41-182.w83-204.abo.wanadoo.fr User-Agent: slrn/pre1.0.0-18 (Linux) X-Spam: no; 0.00; le-gall:01 freetype:01 freetype:01 cflags:01 libs:01 librares:01 cflags:01 libs:01 flags:01 flags:01 ocaml:01 didnt:98 config:01 config:01 invoke:01 On 27-11-2010, Anastasia Gornostaeva wrote: > On Sat, Nov 27, 2010 at 10:20:38AM +0000, Sylvain Le Gall wrote: >> Hi, >> >> On 26-11-2010, Anastasia Gornostaeva wrote: >> > Hello. >> > >> > How can I substitute in setup.ml (not in _oasis file) values for >> > CCOpt and CCLib fields? I think it is better to substitute them from >> > setup.data, if I could to put proper values to setup.data. >> > For example: >> > CCOpt: $freetype_ccopt >> > and put to setup.data output of `freetype-config --clib` for field >> > freetype_ccopt. >> >> As I answer you in private: there will be pkg-config support in 0.3.0. >> This will solve this issue, at least. >> (e.g. you will be able to define: >> BuildDepends: freetype2 (pkg-config), oUnit, ...) > > Sorry, but i didnt receive your mail.. I resent it, but it doesn't contains the ultimate solution, just what I said here. > And pkg-config probably is not best solution on bsd and macosx systems because > it does not guarante nothing. > The best (and common) solution is CFLAGS and LIBS env variables. :-) > Or this pkg-config will allow custom paths for those C librares that do not > depend on pkg-config at concrete systems? > > [...] 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 > >> > I need a way to substitute paths. >> > >> >> A last solution, you can apply right now, is to override this call: >> let () = setup ();; >> (last line of setup.ml) >> >> by >> >> let f pkg = >> (* Call freetype-config and add flags where >> needed in pkg >> *) >> ... >> >> let () = BaseSetup.setup (f setup_t);; > > Interesting way. Thanks, I'll ckeck it right how. > As you state privately, this indeed has also problem because you also need to do it in myocamlbuild.ml. 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. Regards, Sylvain Le Gall