On Tue, 12 May 2015, Alberto Luaces wrote:

Hello,

in an autoconf+automake+libtool C++ project containing only one program,
I want to run the executable before installing it.

Reading the manual I thought that it could be done with

libtool --mode=execute program_binary

but it fails, since there are undefined references to shared libraries
not installed in standard directories.

Can libtool solve this problem for me?

Libtool is supposed to solve this problem automatically for libraries in the build-tree built using libtool, or involved libraries which have a correct associated ".la" file. It is not uncommon for the .la files that libtool installs to be deleted, or for libraries to be put into a location other than the paths the .la file says they reside.

If the installed libraries violate the libtool expectations, then there are only the choices of building the software with a hard-coded run-path (-RLIBDIR or -Wl,-rpath,/libdir'), or using environment variables like LD_LIBRARY_PATH.

As a developer, I find using the run-path to be most reliable/convenient, but this may not be suitable when creating packaged binaries for installation.

Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool

Reply via email to