diff options
author | Filipe Brandenburger | 2016-02-05 19:13:40 +0100 |
---|---|---|
committer | Filipe Brandenburger | 2016-02-05 20:03:09 +0100 |
commit | 324330aca6443dcc8ae795652b0df0f4d4c37d88 (patch) | |
tree | 759947c6a774261eb0752658cef5e224afde7d1e /Makefile.am | |
parent | Revert "build-sys: Order pylibmount after usrlib on install" (diff) | |
download | kernel-qcow2-util-linux-324330aca6443dcc8ae795652b0df0f4d4c37d88.tar.gz kernel-qcow2-util-linux-324330aca6443dcc8ae795652b0df0f4d4c37d88.tar.xz kernel-qcow2-util-linux-324330aca6443dcc8ae795652b0df0f4d4c37d88.zip |
build-sys: Properly order install dependencies of pylibmount
Introduce a dependency so that libmount.so is installed before
pylibmount.so, so that when libtool tries to relink it, it can find
libmount.so in the destdir.
We introduce this additional make rule through an AC_SUBST variable, to
prevent automake from trying to interpret that. This trick has been
suggested in http://stackoverflow.com/a/8643550.
This fixes a failure of `make install DESTDIR=...` when trying to relink
pylibmount against libmount.la. libtool will look for libmount.so under
${DESTDIR}/${libdir} in that case, but if it is not yet present there,
libtool assumes it is a system installed library and use -lmount
instead, which causes the following failure if libmount is not installed
on the base system yet:
libtool: install: warning: relinking `pylibmount.la'
libtool: install: (... libtool --mode=relink gcc -o pylibmount.la \
-rpath /usr/lib/python2.7/dist-packages/libmount \
libmount/python/*.lo libmount.la ... -lpython2.7 \
-inst-prefix-dir /path/to/destdir)
/usr/bin/ld: cannot find -lmount
collect2: error: ld returned 1 exit status
libtool: install: error: relink `pylibmount.la' ...
make[3]: *** [install-pylibmountexecLTLIBRARIES] Error 1
This seems to be a previously encountered issue, since automake includes
a hack to insert such a dependency rule to install all libLTLIBRARIES
before attempting to install binPROGRAMS, initially introduced in the
commit below:
http://git.savannah.gnu.org/cgit/automake.git/commit/?id=bd4a1d5ad1a72fa780a8b7fd6c365a5dad2e6220
Also related bug from Ubuntu tracker:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1442076
Tested that `make install` starts working again after this commit, even
when libmount-dev is not installed on the system. Also confirmed that
`make distcheck` is now functional.
Confirmed that the all the files expected in the Python directory (both
__init__.py and pylibmount.so) are present after an install.
Tested that parallel install works, the dependency is always respected
since it's explicit.
Inspected the generated Makefile and confirmed that the definition of
install-pylibmountexecLTLIBRARIES (generated by automake) and the
explicit dependency we introduced are both present.
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 758c4f285..f5322b3da 100644 --- a/Makefile.am +++ b/Makefile.am @@ -96,6 +96,14 @@ include bash-completion/Makemodule.am include tests/Makemodule.am +# pylibmountexec module must be installed after usrlib_exec libraries, +# otherwise the libtool relink step will fail to find libmount.la and +# will try -lmount which is possibly not available. +# +# So introduce this dependency rule: +# install-pylibmountexecLTLIBRARIES: install-usrlib_execLTLIBRARIES +@verbatim_pylibmount_dependency@ + # # Don't rely on configure.ac AC_CONFIG_FILES for install paths. # |