Skip to contentSkip to conversation

build-sys: how to install pylibmount after libmount?

DISCUSSION Ruediger Meier 2 participants 3 messages Jun 3, 2014 – Jun 4, 2014 Util-Linux package

lore
Share & tools
lore
#0 lore raw

Hi,

This should be easy to reproduce if you don't have a global installed libmount.

$ sudo mkdir /usr/lib64/away
$ sudo mv /usr/lib64/libmount.* /usr/lib64/away
$ ./configure --disable-use-tty-group \
	--prefix=/tmp/dest \
	--with-python \
	--without-systemd \
	--enable-pylibmount \
	--enable-libmount \
	--enable-libblkid
$ make
$ sed -i 's/\(link_all_deplibs\)=.*/\1=no/' ./libtool
$ rm -rf /tmp/dest
$ make install
 /usr/bin/mkdir -p '/tmp/dest/lib64/python2.7/site-packages/libmount'
 /bin/sh ./libtool   --mode=install /usr/bin/install -c   
pylibmount.la '/tmp/dest/lib64/python2.7/site-packages/libmount'
libtool: install: warning: relinking `pylibmount.la'
libtool: install: 
(cd /tmp/util-linux; /bin/sh /tmp/util-linux/libtool  --silent --tag 
CC --mode=relink 
gcc -std=gnu99 -fsigned-char -fno-common -Wall -Werror=sequence-point -Wextra -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wno-missing-field-initializers -Wredundant-decls -Wsign-compare -Wtype-limits -Wuninitialized -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wunused-result -Wunused-variable -Wnested-externs -Wpointer-arith -Wstrict-prototypes -I/usr/include/python2.7 -I./libmount/src -fno-strict-aliasing -g -O2 -avoid-version -module -shared -export-dynamic -o 
pylibmount.la -rpath /tmp/dest/lib64/python2.7/site-packages/libmount 
libmount/python/pylibmount_la-pylibmount.lo 
libmount/python/pylibmount_la-fs.lo 
libmount/python/pylibmount_la-tab.lo 
libmount/python/pylibmount_la-context.lo libmount.la -lpython2.7 )
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: 
cannot find -lmount
collect2: error: ld returned 1 exit status
libtool: install: error: relink `pylibmount.la' with the above command 
before installing it
make[3]: *** [install-pylibmountexecLTLIBRARIES] Error 1
make[3]: Leaving directory `/tmp/util-linux'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/tmp/util-linux'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/tmp/util-linux'
make: *** [install] Error 2

Unfortunately some systems set per default
link_all_deplibs=no
instead of "unknown" in ./libtool. Don't know whether this is a bug in libtool or automake macros. But we could work around this if we would make sure to install pylibmount always after libmount.

This is how it looks in Makefile.in:

install-exec-am: install-binPROGRAMS install-dist_usrbin_execSCRIPTS \
        install-pylibmountexecLTLIBRARIES \
        install-pylibmountexecSCRIPTS install-sbinPROGRAMS \
        install-usrbin_execPROGRAMS install-usrlib_execLTLIBRARIES \
        install-usrsbin_execPROGRAMS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook

How could we force to put
install-pylibmountexecLTLIBRARIES
after
install-usrlib_execLTLIBRARIES

Or could we force somehow to disable that relinking?

cu,
Rudi

maintainer
#1 lore raw
Quoted 10 lines · Ruediger Meier

Hi,

This should be easy to reproduce if you don't have a global installed libmount.

$ sudo mkdir /usr/lib64/away
$ sudo mv /usr/lib64/libmount.* /usr/lib64/away
$ ./configure --disable-use-tty-group \
	--prefix=/tmp/dest \

Just note, it's usually bad idea to override the default prefix (especially for package like util-linux), it's better to use standard prefix and use "make install DESTDIR=/tmp/dest".

Quoted 15 lines

Unfortunately some systems set per default
link_all_deplibs=no
instead of "unknown" in ./libtool. Don't know whether this is a bug in libtool or automake macros. But we could work around this if we would make sure to install pylibmount always after libmount.

This is how it looks in Makefile.in:

install-exec-am: install-binPROGRAMS install-dist_usrbin_execSCRIPTS \
        install-pylibmountexecLTLIBRARIES \
        install-pylibmountexecSCRIPTS install-sbinPROGRAMS \
        install-usrbin_execPROGRAMS install-usrlib_execLTLIBRARIES \
        install-usrsbin_execPROGRAMS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
Quoted 4 lines

How could we force to put
install-pylibmountexecLTLIBRARIES
after
install-usrlib_execLTLIBRARIES

hmm.. I don't know, I think it's libtool job to generate the right order.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#2 lore raw
Quoted 9 lines · Karel Zak
Quoted 8 lines · Ruediger Meier

Hi,

This should be easy to reproduce if you don't have a global installed libmount.

$ sudo mkdir /usr/lib64/away
$ sudo mv /usr/lib64/libmount.* /usr/lib64/away
Quoted 6 lines
Quoted 2 lines
$ ./configure --disable-use-tty-group \
	--prefix=/tmp/dest \

Just note, it's usually bad idea to override the default prefix (especially for package like util-linux), it's better to use standard prefix and use "make install DESTDIR=/tmp/dest".

Yes, in this case I wanted to debug and reproduce "make distcheck" where --prefix is used.

Quoted 16 lines
Quoted 16 lines

Unfortunately some systems set per default
link_all_deplibs=no
instead of "unknown" in ./libtool. Don't know whether this is a bug in libtool or automake macros. But we could work around this if we would make sure to install pylibmount always after libmount.

This is how it looks in Makefile.in:
install-exec-am: install-binPROGRAMS install-dist_usrbin_execSCRIPTS \ install-pylibmountexecLTLIBRARIES

\
        install-pylibmountexecSCRIPTS install-sbinPROGRAMS \
        install-usrbin_execPROGRAMS install-usrlib_execLTLIBRARIES
\ install-usrsbin_execPROGRAMS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
Quoted 7 lines
Quoted 4 lines

How could we force to put
install-pylibmountexecLTLIBRARIES
after
install-usrlib_execLTLIBRARIES

hmm.. I don't know, I think it's libtool job to generate the right order.

I think too. libtool and automake can be assumed to be non-broken on devel machines. I thought there is still a little chance that we have incorrect pylibmount_la_DEPENDENCIES ot whatever. But I don't see it.

Anyway, I will just add a workaround for travis.yml until they update build-os:
./autogen.sh

  # workaround for broken pylibmount install relink
  sed -i 's/\(link_all_deplibs\)=no/\1=unknown/' ./configure

cu,
Rudi