caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* findlib help: how to extract all compilation/linking flags ?
@ 2006-10-06  8:57 Guillaume Rousse
  0 siblings, 0 replies; only message in thread
From: Guillaume Rousse @ 2006-10-06  8:57 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-06  8:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-06  8:57 findlib help: how to extract all compilation/linking flags ? Guillaume Rousse

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).