caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Guillaume Rousse <Guillaume.Rousse@inria.fr>
To: caml-list@inria.fr
Subject: findlib help: how to extract all compilation/linking flags ?
Date: Fri, 06 Oct 2006 10:57:14 +0200	[thread overview]
Message-ID: <45261A6A.5090407@inria.fr> (raw)

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 <package>

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 <package>
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


                 reply	other threads:[~2006-10-06  8:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45261A6A.5090407@inria.fr \
    --to=guillaume.rousse@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).