libtool: Serialize building libfoo.la and libfoo.a
We have a few libraries where we have separate targets to build
libfoo.la (to get libfoo.so) and libfoo.a. Currently, these targets
can be built in parallel, and both are built with libtool. This can
cause problems because of two behaviors with libtool:
- When running --mode=link for libfoo.a or libfoo.la, it effectively
runs 'rm -rf .libs/libfoo.*' to clean up its work area.
- When running --mode=link for libfoo.a, libtool sets up some scratch
space in .libs/libfoo.ax to unpack various static libs.
So when 'make libfoo.a' is running, libtool creates a .libs/libfoo.ax
dir, and unpacks various object files inside of it. If while that is
running, 'make libfoo.la' runs, it causes libtool to remove that
directory and all its contents. This causes 'make libfoo.a' to fail
with confusing messages like this (for libafsrpc.a):
/bin/sh ../../libtool --quiet --mode=link --tag=CC gcc -static -O -o libafsrpc.a [...]
find: '.libs/libafsrpc.ax/libopr_pic.a': No such file or directory
ar: .libs/libafsrpc.ax/libfsint_pic.a/afscbint.cs.o: No such file or directory
make[3]: *** [Makefile:59: libafsrpc.a] Error
To avoid this, prevent building libfoo.la and libfoo.a at the same
time, by just making libfoo.la depend on libfoo.a. Do this for all of
the libraries we build in this way: libafshcrypto, libkopenafs,
libafsauthent, and libafsrpc.
Change-Id: I821768b3b4cd99cf5bf98605068773347ada0fb2
Reviewed-on: https://gerrit.openafs.org/14017
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>