A have a project build with GNU autotools. Now I have a tiny change and only want to copy one single library libmylib.so and one program myprog.x (using that library) from the whole collection.
I do not want to use make install because I have to be very careful not to overwrite all the other stuff.
When I do
ldd .libs/myprog.x
I see that the library used is — as expected — the freshly built library and not that one in /usr/lib/.
$ ldd .libs/myprog.x
libmylib.so.0 => /home/user/project/.libs/libmylib.so.0 (0x003bb000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00f57000)
libc.so.6 => /lib/tls/libc.so.6 (0x00948000)
libz.so.1 => /usr/lib/libz.so.1 (0x0024e000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00ee7000)
How can I tell make or libtool to relink myprog.x so that I can copy it manually to /usr/bin/? After copying libmylib.so to /usr/lib/ of course.
(I worked this out by running
make -n install | less.)You probably want to install the libraries and program (if it’s linked using libtool) with libtool, so try something like:
Libtool might ask you to run a
./libtool --mode=finishcommand as well. I’d trust its advice. Before doing any of this, I’d run the commands with the--dry-runoption and withoutsudoto see what exactly is going to happen.Note that I’m not running the system
libtool, but the one that was created by theconfigurescript.