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=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 59FB1BC50 for ; Fri, 6 Oct 2006 10:57:15 +0200 (CEST) Received: from [128.93.8.195] (alceste.inria.fr [128.93.8.195]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k968vEtj026358 for ; Fri, 6 Oct 2006 10:57:15 +0200 Message-ID: <45261A6A.5090407@inria.fr> Date: Fri, 06 Oct 2006 10:57:14 +0200 From: Guillaume Rousse User-Agent: Thunderbird 1.5.0.7 (X11/20060915) MIME-Version: 1.0 To: caml-list@inria.fr Subject: findlib help: how to extract all compilation/linking flags ? X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 45261A6A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; guillaume:01 guillaume:01 findlib:01 compilation:01 flags:01 findlib:01 flags:01 ocamlc:01 dependencies:01 dependencies:01 compilation:01 ocamlfind:01 predicates:01 byte:01 ocamlfind:01 I'm trying to use findlib query mode to extract all flags needed for compiling and linking a program with dependency against a findlib-enabled package. I know I could use findlib as a transparent wrapper for ocamlc, but I'm relunctant to do it. Mostly because in mixed dependencies scenarios (both findlib-aware and findlib-unaware), I'd like to have all dependencies handled consistantly, not some through wrapper and some other through explicit flags. Second, because I'd prefer to mimic the pkgconfig usage, which is to extract information only. So far, I found than the only flags needed for compilation seems to be available trough ocamlfind query -i-format -separator ' ' -recursive I'm less sure for linking flags. It seems I need to combine the result of -i-format, -l-format, -o-format and -a-format, thus requesting the use of -format option, with additional target predicates (byte or native). However, I'm not sure it is safe to mix all of them in a single command: ocamlfind query -format '-I %d -ccopt -L%d %O %A' -separator ' ' -recursive -predicates native As it will intermix -I, -L options, other linking options and packages names. Maybe it would be safer to split them in two different set of options. So, basically, how much different variables do I need, and should I combine them, both for compiling and for linking ? Yes, I know I could read ocamlfind code to understand what the wrapper does, but I'm not really an ocaml guru... -- Guillaume Rousse Projet Estime, INRIA Domaine de Voluceau Rocquencourt - B.P. 105 78153 Le Chesnay Cedex - France