Libtool installation issue with make install
Asked Answered
J

1

14

I use the following autotool steps to install my pacakges:

./configure
make
make install prefix=/my/path

However I got the following libtool warning "libtool: warning: remember to run 'libtool --finish /usr/local/lib' and "libtool: warning: 'lib/my.la' has not been installed in '/usr/local/lib'" when using the autotool to install my software package. If I change to the following command, the problem disappear:

./configure
make prefix=/my/path
make install prefix=/my/path

It looks like the first method doesn't substitute the prefix correctly to libtool. How can I avoid this problem?

Jotter answered 24/9, 2015 at 16:36 Comment(0)
O
14

Among the information that libtool archives record about the libraries they describe is the expected installation location. That information is recorded when the library is created. You can then install to a different location, but libtool will complain. Often, libtool's warning is harmless.

In order to avoid such a warning, you need to tell libtool the same installation location at build time that you do at install time. You present one way to do that in the question, but if you're using a standard Autotools build system then it is better to specify the installation prefix to configure:

./configure --prefix=/my/path
make
make install

Alternatively, if you're installing into a staging area, such as for building an RPM, then use DESTDIR at install time. libtool will still warn, but you'll avoid messing up anything else:

./configure
make
make install DESTDIR=/staging/area
Overelaborate answered 24/9, 2015 at 16:49 Comment(1)
I had this warning happen where I had a symlink to the installation directory. Even though the prefix and the actual installation directory were the same (after the symlink was resolved), libtool thought they were different directories, so it printed the warning. I fixed it by changing the prefix. I only had this because I have a custom build script that uses $cwd and manually cd's into different directories to run make, since it's significantly faster (>30 seconds) than using make -j install on the software I'm building. make -j install didn't have this issue.Priapism

© 2022 - 2024 — McMap. All rights reserved.