[m-rev.] For review: Fix Darwin shared libs on source distribution

Julien Fischer juliensf at cs.mu.OZ.AU
Sun Oct 31 03:00:11 AEDT 2004


On Sun, 31 Oct 2004, Ian MacLarty wrote:

> On 30 Oct 2004, at 12:51, Julien Fischer wrote:
>
> >
> > On Sat, 30 Oct 2004, Ian MacLarty wrote:
> >
> >> For review by anyone.
> >>
> >> Please note the comment for library/Mmakefile.  Is this acceptable?
> >>
> >> Estimated hours taken: 4
> >> Branches: main
> >>
> >> Fix shared libs on Mac OS X for the source distribution.  The problem
> >> is that
> >> the source distribution is generated on a Linux PC, so the
> >> Darwin-specific
> >> -install_name option is not passed to the linker in the .dep files.
> >>
> > I guess this fixes the immediate problem but you will end up specifying
> > -install_name twice if the source distribution is generated on Mac OS
> > X.
> > (you've mentioned that below but it should be more prominent in the log
> > message).
> >
> I'm beginning to think my original changes which added some extra
> options to the Mercury compiler might have been more trouble than
> they're worth.  The idea was to get the -install_name option to be
> passed correctly to the automatically generated .dep files, but this
> makes them non-portable since -install_name is a Darwin specific
> option.  (Are the .dep files meant to be portable?)
>
I'm not sure - in most cases (except this one) it wouldn't matter.

> Maybe a better solution is to disable the new mmc options altogether
> and just pass the -install_name option manually in all the relevant
> Mmakefiles which would avoid the problem with it getting passed twice
> if the source distribution were generated and compiled on a Mac OS X
> system.
>
Breaking everything else in order to support (a currently non-existant)
OS X configured source distribution seems pointless.

The install_name options should be set manually when:
i) We're building from a source distribution
ii) The source distribution was not configured on powerpc*apple*darwin*

It should be possible to have configure work out whether (ii) is
true or not by looking at one of the .c files.

Alternatively we could just go back to static linking for source
distributions at the moment

> If a user wanted to build a shared lib on Darwin the new mmc options
> would still be passed - we just disable them for the Mercury build.
> Alternatively maybe the new mmc options should be removed altogether
> (since they result in non-portable .dep files) and replaced with some
> comments in the user guide about how to set up a Mmakefile to build
> shared libs on Mac OS X.
>
> Any thoughts?
>
I don't like the idea of removing support for the new compiler options.
As far as possible I'd like the way of building shared libaries to differ
as little as possible for each platform.

Cheers,
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list