[opam-devel] conf- libraries and stub cmas: time for ocaml-discover?
Christophe.Troestler at umons.ac.be
Mon Aug 26 21:03:24 BST 2013
On Mon, 26 Aug 2013 11:57:40 +0100, Anil Madhavapeddy wrote:
> [...] Ideally, we would be able to query three types of information
> from a conf package installation:
> - an ML file that has values exposing cflags/lflags as OCaml values.
> This can be used by discover.ml scripts (as used in Core or Lwt)
> - a CMA file that embeds the dynamic linking flags via cclib, including
> adding -Wl,--no-as-needed on newer systems like Ubuntu. This lets a
> Ctypes using dynamic linking (Ctypes.Foreign) just add a CMA to the
> link line and have the correct gcc/clang libraries work.
> - The final thing is some way to pass the right CFLAGS/LDFLAGS to
> compile up generated C stubs with the right include/library paths to
> gcc (either from Ctypes, or via the traditional camlidl/swig outputs).
> Presumably this would be a raw shell fragment in a file, as usually
> output by autoconf.
Sounds good to me. For the last point, it is also important that
these flags are available in a way that makes adding ocamlbuild rules
using these flags easy. Maybe, the C compiler and CFLAGS/LDFLAGS can
be duplicated in the first ML file (and then the configure phase — say
in oasis — may generate the proper rules).
More information about the opam-devel