[Omake] building C binding library

Anastasia Gornostaeva ermine at ermine.pp.ru
Mon Sep 17 21:23:17 PDT 2007


On Mon, Sep 17, 2007 at 05:11:15PM -0700, Aleksey Nogin wrote:
> On 17.09.2007 11:46, Anastasia Gornostaeva wrote:
> 
> > On Mon, Sep 17, 2007 at 09:49:52AM -0700, Aleksey Nogin wrote:
> > 
> >>  section
> >>     BYTE_ENABLED = true
> >>     OCAML_LINK_FLAGS += -cclib -lz
> >>     StaticCLibrary(mlzlib_stub, mlzlib_stub)
> >>     OCAML_CLIBS += mlzlib_stub
> >>     .DEFAULT: $(OCamlLibrary mlzlib, mlzlib)
> >>
> >>  Note that OMake's OCaml.om currently does not support linking "foreign" 
> >>  objects into libraries, so the above code links the mlzlib_stub.c into a C 
> >>  library first and then links in that library into the mlzlib OCaml library.
> > 
> > I copied that piece and removed only BYTE_ENABLED line out.
> > It does not work for me: it does not compile mlzlib_stub.c at all.
> > 
> 
> You are right - currently OCamlLibrary does not pay attention to
> OCAML_CLIBS, so you'll need to do thinks a bit more manually:
> 
> section
>    CFILES = mczlib_stub$(EXT_OBJ)
>    OCAML_LINK_FLAGS += -cclib -lz $(CFILES)
>    OCAMLLIBS = $(OCamlLibrary mlzlib, mlzlib)
>    $(OCAMLLIBS): $(CFILES)
>    .DEFAULT: $(OCAMLLIBS)

Now it does not put attentieon neither on INCLUDES nor CFLAGS variables.
Sorry.

ermine


More information about the Omake mailing list