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
[Caml-list] [long] not-so-static binaries on Mac OS X
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-07-08 (15:11)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] [long] not-so-static binaries on Mac OS X
> My next aim was therefore to statically link only certain libraries (in
> my case all the ocaml related libraries) and dinamically link only
> against the Mac OS X library: "/usr/lib/libSystem.B.dylib".
> [...]

I'd suggest you investigate the following options:

- ocamlopt -noautolink
    This will disable the automatic linking of C libraries that
    are mentioned in OCaml libraries.  E.g. normally when you
    link graphics.cmxa, the "-lX11" library is automatically
    added to the linker command line.  With this option, it will
    not be added, so you can put ..../libX11.a on the command line
    instead of -lX11.
- ocamlopt -output-obj
    This is even more radical: a .o file containing only the Caml code
    will be generated, and you're in full control over what C libraries
    to link with it to get the final executable.

Hope this helps,

- Xavier Leroy

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: