[m-users.] Can I put the C standalone interface object file in the mercury library

Julien Fischer jfischer at opturion.com
Fri Sep 14 11:38:03 AEST 2018

Hi Charles,

On Thu, 13 Sep 2018, Charles Shuller wrote:

> It seems like it would be a bit nicer if the standalone interface
> object file were added to the mercury library by doing something
> like: 
>     ar rs libmercury_lib.a libmercury_lib_interface.o
> Will this break something??  It's not clear to me if the interface is
> kept separate for a good reason or if it just happens to have been
> implemented that way.

You are assuming that there is a library in to which the object file
could be included being built at the same time as the standalone
interface.  While that's true in your case and in the example from
the samples directory, it isn't neccesarily true in general; the set
of libraries for which a standlone interface is being generated may
have alredy been built.

That said, it would probably be possible to addtionally support
something along the lines of

    $ mmc --include-standalone-interface --make libmylib

which would cause the compiler to build the library, generate the
standalone interface and then include it in the archive or shared


More information about the users mailing list