Version française
Home     About     Download     Resources     Contact us    
Browse thread
Reading external references from cmo/cmx files
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Stéphane Glondu <steph@g...>
Subject: Re: [Caml-list] Reading external references from cmo/cmx files
Jason Noakes wrote:
> Are there any tools or examples that would allow me to take a .cmo or .cmx
> file and produce a list of the external modules that are referenced from
> that file?

There is ocamlobjinfo. But it seems to work only with bytecode objects
(.cmo/.cma).

> If I could just read a list of external module references out of a .cmo
> file I could topologically sort them on my own (or error out if there is a
> cycle).

You can use ocamlobjinfo on bytecode objects to get your sorted list.
The same order will likely work with native code objects.


Cheers,

-- 
Stéphane