Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: -- (:)
From: Jacques GARRIGUE <garrigue@k...>
Subject: Re: [Caml-list] MacOS port and file formats
> From: Mary Fernandez <>
> > 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