On Tue, Nov 23, 2010 at 11:14:06AM -0500, Wietse Venema wrote:

> > > In other words, we will still have to ship multiple Makfiles.
>
> > No, we can run "makedefs shared" to produce a shared-library build
> > and "makedefs static" to product a static build.
> 
> That was not clear from the patches. 

The patches to "makedefs" don't yet implement the logic to switch between the
two models, but the *Makefile* changes support both models, so the rest
is just a bit more work.

> I suppose it will be possible trouble to support "make" in the
> top-level directory as before, and let the build scripts make a
> sensible choice. If there is no need to expose choices, then don't.

The user interface is not entirely obvious. We have:

        make -f Makefile.init makefiles CCARGS='...' AUXLIBS='...'

If we stay with that model, then we would choose a default built-type
(say static), and add an optional variable for the top-level make:

    make -f Makefile.init makefiles \
        CCARGS='...' AUXLIBS='...' LINKAGE=dynamic

There is a bit of pain around the ultimate location of the shared
libraries, it needs to be known to "postconf" as another installation
parameter (not easily changed after the fact to a location that is not
on the default system library search path), and so we want it "CCARGS",
but we also need to use it to construct the Makefiles correctly with
the right "rpath" options. So we can either make this another
parameter:

    make -f Makefile.init makefiles \
        CCARGS='...' AUXLIBS='...' LINKAGE=dynamic SHLIB_DEST=/usr/lib

and internally append it to CCARGS, or compile a small piece of code
that prints just that parameter.

How aggressively do you want to pursue this?

-- 
        Viktor.

Reply via email to