Don't hardcode the way we hardcode library locations.
When setting the RPATH, don't assume that the linker will understand `-Wl,-R/the/path', instead rely implicitly on Libtool's work to find the right flags and use them.
|@@ -403,7 +403,15 @@ dnl generated only once above (before we start the for loops).|
|if test x"$Boost_lib" = xyes; then|
|- Boost_lib_LDFLAGS="-L$boost_ldpath -Wl,-R$boost_ldpath"|
|+ # Because Boost is often installed in non-standard locations we want to|
|+ # hardcode the path to the library (with rpath). Here we assume that|
|+ # Libtool's macro was already invoked so we can steal its variable|
|+ # hardcode_libdir_flag_spec in order to get the right flags for ld.|
|+ eval boost_rpath=\"$hardcode_libdir_flag_spec\"|
|+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_rpath"|