How to build a shared library (.so) without hardcoded full dependency paths?
I need to build two 3rd party shared libraries, so their .so files will be reused by other projects. However, after build one of these libraries contains hardcoded path to another. This path is invalid on other machines and causes linker warnings. How can I prevent the full path from being embedded in the resulting .so files? Details: First library source: ~/dev/A Second library source: ~/dev/B Both of them have configure script to generate make files. Library B depends on A . So, first I build A : $ ~/dev/A/configure --prefix=~/dev/A-install $ make && make install Then I build B : $ ~/dev/B