Build and install libafsrpc.so.2
authorBenjamin Kaduk <kaduk@mit.edu>
Mon, 8 Sep 2014 22:06:25 +0000 (18:06 -0400)
committerD Brashear <shadow@your-file-system.com>
Wed, 8 Oct 2014 14:49:36 +0000 (10:49 -0400)
During the libtool interim, we had been building a .0 but not
installing it.  Prior to the libtoolization of shlibafsrpc, we
had installed a libafsrpc.so.1.4 (though the 1.6 branch was
installing libafsrpc.so.1.5, "so we don't collide with the shlibafsrpc
versions on the master branch", which seems misguided).  Since there
have been backwards-incompatible ABI changes (e.g., rx_SetMaxMTU) since
the .1.4 version, we must bump the SONAME to .2.0.

At time of this writing, the libtool rules for updating the
version information is found at:
http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
and
http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html

This lets us consolidate the building of the shared and static libafsrpc
and their installation), as libtool will happily do both for us
at once.

We explicitly do not install the .la files, as our libtool use is
to be kept entirely internal.

Change-Id: I11bc3cbc80048d0192aadeb80b89d2772bcd01cd
Reviewed-on: http://gerrit.openafs.org/11461
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

src/libafsrpc/Makefile.in

index d8a8ba0..dc03648 100644 (file)
@@ -9,6 +9,12 @@ srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
 include @TOP_OBJDIR@/src/config/Makefile.libtool
 
+# Increment these according to libtool's versioning rules (look them up!)
+# The library output looks like libafsrpc.so.<current - age>.<revision>
+LT_current = 2
+LT_revision = 0
+LT_age = 0
+
 LT_objs = \
        $(top_builddir)/src/fsint/libfsint_pic.la \
        $(top_builddir)/src/rx/librx_pic.la \
@@ -25,7 +31,7 @@ LT_deps =
 
 LT_libs = $(LIB_hcrypto) $(LIB_roken) $(MT_LIBS)
 
-all: libafsrpc.la libafsrpc_pic.la \
+all: libafsrpc.la libafsrpc.a libafsrpc_pic.la \
        $(TOP_LIBDIR)/libafsrpc.a \
        $(TOP_LIBDIR)/libafsrpc_pic.a
 
@@ -46,6 +52,8 @@ libafsrpc_pic.la: $(LT_objs)
        $(LT_LDLIB_pic) $(LT_objs)
 
 # AIX needs libafsrpc to also be linked against the syscall import list
+# On most platforms, libtool will make shared and static libraries at the
+# same time, but not on AIX, so we need separate rules.
 libafsrpc.a: $(LT_objs) libafsrpc.la
        $(LT_LDLIB_static) $(LT_objs)
        @set -e; set -x; case "${SYS_NAME}" in \
@@ -59,13 +67,17 @@ ${TOP_LIBDIR}/libafsrpc.a: libafsrpc.a
 ${TOP_LIBDIR}/libafsrpc_pic.a: libafsrpc_pic.la
        ${INSTALL_DATA} .libs/libafsrpc_pic.a $@
 
-install: libafsrpc.a libafsrpc_pic.la
+install: libafsrpc.la libafsrpc.a libafsrpc_pic.la
        ${INSTALL} -d ${DESTDIR}${libdir}
+       $(LT_INSTALL_DATA) libafsrpc.la $(DESTDIR)$(libdir)/libafsrpc.la
+       $(RM) $(DESTDIR)$(libdir)/libafsrpc.la
        $(INSTALL_DATA) libafsrpc.a $(DESTDIR)$(libdir)/libafsrpc.a
        $(INSTALL_DATA) .libs/libafsrpc_pic.a $(DESTDIR)$(libdir)/libafsrpc_pic.a
 
-dest: libafsrpc.a
+dest: libafsrpc.la libafsrpc.a
        ${INSTALL} -d ${DEST}/lib
+       ${LT_INSTALL_DATA} libafsrpc.la ${DEST}/lib/libafsrpc.la
+       ${RM} ${DEST}/lib/libafsrpc.la
        ${INSTALL_DATA} libafsrpc.a ${DEST}/lib/libafsrpc.a
        ${INSTALL_DATA} .libs/libafsrpc_pic.a ${DEST}/lib/libafsrpc_pic.a