On Thu, 9 Dec 2004, webmaster wrote:
> http://dev.starlink.ac.uk/bugzilla/show_bug.cgi?id=30
>
> ------- Additional Comments From [log in to unmask] 2004-12-09 16:50 -------
> #5 para 1: the object files built for shared and static libraries are
> kept separate (and the ones for the shared libraries go in .libs/, if I
> recall correctly), so the -fPIC ones are still available. But you don't
> want to be messing around with that. Instead...
>
> You want to create shared libraries which do not have dependencies on
> other libraries, yes? You can organise this using the starconf build
> system, I think. If there are _lots_ of these things might get a bit
> confusing, though.
>
> libtool has the notion of `convenience libraries' (see section `Linking
> static libraries' of the libtool manual). If you create a non-static
> convenience library, then libtool can subsequently use this to create
> either a static library or a shared library. If you give a library name
> as noinst_LTLIBRARIES=libblah_convenience.la in the blah component's
> Makefile.am, then automake will create such a library (see section
> `Building a shared library' in the automake manual). If you
> additionally say
>
> lib_LTLIBRARIES = libblah.la
> libblah_la_LIBADD = libblah_convenience.la
>
> then automake will create the libblah.la shared library as before. If
> _elsewhere_, however, you want to create the standalone shared library
> foo you need for webstart, which uses the libraries in components blah
> and bling, then you can do so with
>
> lib_LTLIBRARIES = libfoo-webstart.la
> libfoo_webstart_la_LIBADD = ../blah/libblah_convenience.la ../bling/libbling_convenience.la
>
> (or whatever the paths would be -- probably _not_ relative ones like
> that, though I see a headache developing), then that would create the
> shared library libfoo.la from the two convenience ones. Which sounds
> like what you're looking for. The world will probably end if you link
> against libfoo-webstart.la _and_ libblah.la, but it's not likely to
> occur to you to do so (I hope).
>
> This might need some experimentation and _elaborate_ documentation...
>
> Ought we to take this conversation to stardev rather as a chain of
> bugreport comments?
Hi Norman,
I've been thinking about this one today and nothing I've come up with is
very appealing, mostly because of the dependency problem of introducing
convenience libraries (SPLAT depends on NDF, so that pulls in a lot of
libraries, which may change from time-to-time, a problem I avoid at
present by using the usual linker scripts), but also because the JNI code
probably needs to become disjoint from STARJAVA (which means a
considerable amount of work and reorganisation etc.).
So one plan I've come up with is to make use of the "--with-pic"
configuration option of libtool. This makes all object code produced by
libtool position independent, which means no changes are needed to
STARJAVA, but we'd really have to make this the default build option (this
will introduce a very minor penalty when linking against the static
libraries, one we've carried for some libraries for years already).
This can be done by changing the defaults in the libtool.m4 file that gets
pulled into all the configure files, but maybe you know a better way.
Anyway any thoughts about this option?
Cheers,
Peter.
|