Subject: libarch and shared lib version numbers
To: None <tech-userlevel@netbsd.org>
From: Simon Burge <simonb@netbsd.org>
List: tech-userlevel
Date: 06/09/1999 16:19:26
Folks,

I've nearly finished hacking on lib/libarch so that the manpages are
built for all architectures, but I've hit one stumbling block.

What I've done so far is for the top level Makefile to include the
Makefile.inc from each arch subdir unconditionally, and the arch dir
Makefile.inc's only define a SRCS= line (and whatever else they need) if
${MACHINE_ARCH} matches what they are.  All the MAN+= lines are outside
of this check and so every architecture build all the manpages.

Where is currently falls apart is that the shlib_version file in each
subdir isn't found by the top-level Makefile, so no shared version of
the library gets built.

There's a couple of ways around this:

 A) Use one shlib_version at the top level, and bump it whenever any of
    the archs add a function.  Yucky.

 B) Define SHLIB_MAJOR and SHLIB_MINOR in the arch Makefile.inc's.  Also
    yucky, and needlessly duplicates some of the smarts of <bsd.lib.mk>
    which we really shouldn't know anything about at this level.

 C) Change <bsd.lib.mk> so we can specify a location for the
    shlib_version file (SHLIB_VERSION_FILE?), and default to
    ${.CURDIR}/shlib_version.  I think this is the cleanest solution.

 D) Go to a merger of the current and new schemes where the library is
    built as it was (the ".if exists(arch/Makefile)" stuff, but the
    manpages are done a separate pass with Makefile.inc's like I have
    working now.  Not too bad, and easiest to implement.

Any help or suggestions from the peanut gallery?

Simon.