English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
MacOS port and file formats
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-01-02 (12:23)
From: Jacques GARRIGUE <garrigue@k...>
Subject: Re: [Caml-list] MacOS port and file formats
> From: Mary Fernandez <mff@research.att.com>
> > We create a native-code, dynamically linked
> > C library that includes our O'Caml library, the O'Caml runtime,
> > and several other C libraries that our application depends upon
> > the unix, nums, str libraries plus an external PCRE library.
> If your concern is darwin, then there is a simple answer: you can just
> get the installed static library, and turn it into a dynamic library,
> as all C code on darwin is position independent. Just look for the
> correct linker incantation in the darwin manual.

In case you could not find it, here is the incantation:

  ld -dylib -all_load -flat_namespace -undefined suppress 
    /usr/local/lib/ocaml/libunix.a -ldylib1.o -o libunix.dylib

You can also link all these libraries directly in your dynamic linked
C library, without creating individual dlls (but this works only for
platforms such as darwin, where all code is position independent).

Jacques Garrigue