Trailing slash in directory spec confuses libtool

Jan Engelhardt <[email protected]>
Newsgroups gmane.comp.gnu.libtool.general
Message-ID <[email protected]>
Given certain circumstances, libtool 2.4.2 fails to install a library. 
(a) The target directory spec contains a trailing slash
(b) The library to install is linking to another just-built one in a 
different path.

$ cat Makefile
AC_INIT([foo], [0])
AM_INIT_AUTOMAKE([foreign])
AC_PROG_CC
LT_INIT
AC_DISABLE_STATIC
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

$ cat Makefile.am
lib_LTLIBRARIES = libbase.la
libbase_la_SOURCES = foo.c
phpdir = /usr/lib/php/extensions/
php_LTLIBRARIES = foo.la
foo_la_SOURCES = foo.c
foo_la_LDFLAGS = -module -avoid-version
foo_la_LIBADD = libbase.la

$ cat foo.c
int dummy;

== What's observed ==
$ autoreconf -fi; ./configure; make install DESTDIR=/tmp/YY
[…snip…]
libtool: install: ranlib /tmp/YY/usr/local/lib/libbase.a
libtool: install: warning: remember to run `libtool --finish /usr/local/lib'
 /usr/bin/mkdir -p '/tmp/YY/usr/lib/php/extensions/'
 /bin/sh ./libtool   --mode=install /usr/bin/install -c   foo.la '/tmp/YY/usr/lib/php/extensions/'
libtool: install: error: cannot install `foo.la' to a directory not ending in /usr/lib/php/extensions/
Makefile:411: recipe for target 'install-phpLTLIBRARIES' failed
make[1]: *** [install-phpLTLIBRARIES] Error 1

$ cat foo.la
[…]
# Directory that this library needs to be installed in:
libdir='/usr/lib/php/extensions/'
[…]


== What should have happened instead ==
Produce a .la file whose "libdir" variable contains no trailing slash(es) so
that libtool --mode=install won't trip,
and/or
make libtool robust so that it can deal with trailing slash(es) read from
$libdir.

_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.