Make: add -rpath to LD_SEARCH_FLAGS#2280
Conversation
|
Re: runstatedir, this could be the source : |
|
Discovered similar “addition” happen with #2225 . |
|
The runstatedir option was added to autoconf back in 2013: GRASS did not support autoconf newer than 2.13 until recently (7.8.6). |
|
The GRASS´ |
|
With unpatched autoconf 2.69, the result is: --- configure.orig
+++ configure
@@ -4032,7 +4032,7 @@
SHLIB_SUFFIX=".so"
SHLIB_LD="${CC} -shared"
LDFLAGS="-Wl,--export-dynamic"
- LD_SEARCH_FLAGS='-Wl,-rpath-link,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath-link,${LIB_RUNTIME_DIR} -Wl,-rpath,${INST_DIR}/lib'
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
;;
*-pc-cygwin)The macOS build has, as you may have noticed, a similar set of flags for rpath based linking, so it looks sound in my eyes. Cannot test though. |
|
As a general note regarding autoconf version. Presently with GRASS, with a readily generated configure, it might be worth considering bumping to 2.71, as this dependency is only restricted for actual updating of the |
Yes, but the BSD builds were missing this rpath setting, in case of netbsd it was wrong, now fixed. |
nilason
left a comment
There was a problem hiding this comment.
I'm good with the changes related to the main issue, but I advice you to remove the runstatedir additions. They will be removed after next regeneration by a non-patched autoconf.
OK, the runstatedir additions have been removed. |
|
@metzm May I suggest to backport this to G8.0.x? Otherwise we'll not see this change for a while, as it takes time for the various distros to pick up the upcoming G8.2.x. |
* Make: add -rpath to LD_SEARCH_FLAGS
|
Backport done to 8.0.x as discussed with @metzm |
|
Backport done to 7.8.x as discussed with @metzm |
* Make: add -rpath to LD_SEARCH_FLAGS
* Make: add -rpath to LD_SEARCH_FLAGS
* Make: add -rpath to LD_SEARCH_FLAGS
Currently, the GDAL-GRASS plugin works only if the directory with GRASS libraries is added to
LD_LIBRARY_PATH, otherwise GRASS libraries don't find each other. This PR, together with the corresponding GDAL PR 5503, avoids the need to setLD_LIBRARY_PATHor add an entry to/etc/ld.so.conf.d/, instead the GDAL-GRASS plugin works out of the box without further adjustments to the system's paths with libraries in non-standard locations.The crucial change is in
aclocal.m4. Runningautoconfversion 2.69 resulted in more changes toconfigurethan expected, I am not sure if the addedrunstatedircould cause any harm. My tests succeeded so far.How to test
Failure with:
ogrinfo -so /path/to/grassdata/nc_spm_08/PERMANENT/vector/boundary_county/headThe GDAL error is that some shared GRASS libraries are not found.
Success with:
ogrinfo -so /path/to/grassdata/nc_spm_08/PERMANENT/vector/boundary_county/headNo GDAL errors.