Use dynamic linking instead of hardcoded rpath. lib/init/grass.py: Use LD_RUN_PATH instead of DYLD_LIBRARY_PATH to pass lib path to ctypesgen --- configure.orig 2024-07-27 15:32:01 +++ configure 2024-07-29 10:02:38 @@ -5240,10 +5240,10 @@ *-apple-darwin*) SHLIB_CFLAGS="-fno-common" SHLIB_SUFFIX=".dylib" - SHLIB_LD="${CC} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name @rpath/lib\${LIB_NAME}\${SHLIB_SUFFIX}" - SHLIB_LDX="${CXX} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name @rpath/lib\${LIB_NAME}\${SHLIB_SUFFIX}" + SHLIB_LD="${CC} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name \${INST_DIR}/lib/lib\${LIB_NAME}\${SHLIB_SUFFIX}" + SHLIB_LDX="${CXX} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name \${INST_DIR}/lib/lib\${LIB_NAME}\${SHLIB_SUFFIX}" LDFLAGS="-Wl,-rpath,${INSTDIR}/lib,-rpath,\${GISBASE}/lib" - LD_LIBRARY_PATH_VAR="LD_RUN_PATH" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" ;; *-sun-solaris*) # Note: If _REENTRANT isn't defined, then Solaris --- aclocal.m4.orig 2023-06-24 12:01:41.000000000 +0200 +++ aclocal.m4 2023-06-24 18:06:08.000000000 +0200 @@ -512,10 +512,10 @@ *-apple-darwin*) SHLIB_CFLAGS="-fno-common" SHLIB_SUFFIX=".dylib" - SHLIB_LD="${CC} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name @rpath/lib\${LIB_NAME}\${SHLIB_SUFFIX}" - SHLIB_LDX="${CXX} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name @rpath/lib\${LIB_NAME}\${SHLIB_SUFFIX}" + SHLIB_LD="${CC} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name \${INST_DIR}/lib/lib\${LIB_NAME}\${SHLIB_SUFFIX}" + SHLIB_LDX="${CXX} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name \${INST_DIR}/lib/lib\${LIB_NAME}\${SHLIB_SUFFIX}" LDFLAGS="-Wl,-rpath,${INSTDIR}/lib,-rpath,\${GISBASE}/lib" - LD_LIBRARY_PATH_VAR="LD_RUN_PATH" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" ;; *-sun-solaris*) # Note: If _REENTRANT isn't defined, then Solaris --- lib/init/grass.py.orig 2024-07-27 15:32:01 +++ lib/init/grass.py 2024-07-29 10:01:46 @@ -97,7 +97,7 @@ GRASS_VERSION = "@GRASS_VERSION_NUMBER@" GRASS_VERSION_MAJOR = "@GRASS_VERSION_MAJOR@" GRASS_VERSION_MINOR = "@GRASS_VERSION_MINOR@" -LD_LIBRARY_PATH_VAR = "@LD_LIBRARY_PATH_VAR@" +LD_LIBRARY_PATH_VAR = "LD_RUN_PATH" CONFIG_PROJSHARE = os.environ.get("GRASS_PROJSHARE", "@CONFIG_PROJSHARE@") # Get the system name