Made to Order Software Corporation Logo

RPATH not working in wxWidget

At my company we have the sandbox. This uses different free libraries that we compile within a specific directory (to not have problems with the system installation of a customer.) This means you need to include an RPATH in the binary (.ELF) files.

Most of the libraries that we use have a modern configure script that uses libtool. libtool knows how to automatically add the RPATH information to the libraries and binaries generated in a project.

The wxWidget library has a configuration script too, but it does not support the AC_PROG_LIBTOOL definition. This is annoying, to say the least. It took me quite a while to find a remedy to this problem. It was actually very simple, but not a usual way to fix this sort of problems!

I added the -rpath command line option to the LDFLAGS variable before calling the configure script. Thus, something like this:

LDFLAGS="... -Wl,-rpath -Wl,/usr/lib/mo/$VERSION/lib" ./configure ...

Then each time a link happens, it gets that additional command line option and automatically adds the RPATH to the libraries and tools of wxWidget. Now, it works a lot better and we do not have to mess around with the LD_LIBRARY_PATH variable!

Click for more info about the sandbox.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.