[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Trailing slash in directory spec confuses libtool
From: |
Jan Engelhardt |
Subject: |
Trailing slash in directory spec confuses libtool |
Date: |
Fri, 12 Aug 2016 22:06:19 +0200 (CEST) |
User-agent: |
Alpine 2.20 (LSU 67 2015-01-07) |
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.
- Trailing slash in directory spec confuses libtool,
Jan Engelhardt <=