for review: fix for "Including .c files in libraries."
Tyson Dowd
trd at cs.mu.OZ.AU
Mon Jan 26 21:32:14 AEDT 1998
On 26-Jan-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Tyson, can you please review this fix?
>
> On 20-Jan-1998, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > If you're creating a Mercury package, and want to link in a .c
> > file as part of the package, the MLLIBS mechanism mentioned in C
> > interface section of the Mercury Language Reference manual doesn't work
> > very well.
> >
> > It doesn't add any dependency of the library on the .o file (which you
> > can fix, but it's not documented), and, worse, only puts it in the .so,
> > not the .a (MLLIBS is not used to build in the .a - and rightly so).
> > It also doesn't handle the PIC regs trickery required under
> > Linux -- you need to add a .pic_o dependency yourself (and as my
> > previous bug report indicated, this causes mmake to delete your .c
> > file).
>
> Add support to Mmake for new variables MLOBJS and MLPICOBJS,
> since simply listing object files in MLLIBS doesn't do the
> right thing in the case when you're building a library package
> rather than a program.
>
> scripts/Mmake.vars.in:
> Add definitions of MLOBJS and MLPICOBJS.
>
> compiler/modules.m:
> Add code to use the $(MLOBJS) and $(MLPICOBJS) variables
> to the rules for building programs and libraries that are
> output in the generated `.dep' files.
>
> doc/user_guide.texi:
> Document the use of MLOBJS and MLPICOBJS.
>
This change is fine, but the section in the Mercury Language
Reference also needs to be updated (it really doesn't belong there,
but it's probably best to have it there).
Thanks for fixing this.
--
Tyson Dowd #
# Surreal humour isn't eveyone's cup of
trd at cs.mu.oz.au # fur.
http://www.cs.mu.oz.au/~trd #
More information about the developers
mailing list