This LD_RUN_PATH "hack" is the only way how I was able to link a program, which
depends in a shared library, which depends on another shared library. The
$ORIGIN didn't work here. The problem with this solution is that the absolute
path is compiled in the library.
#$$(warning $(1)_shared_libs = $$($(1)_shared_libs))
$(USER_LIB_DIR)/lib$(1).$(SOLIB_EXT): $$($(1)_shared_libs) $$($(1)_objslo)
@$(QUIET_CMD_ECHO) " LINK $$@"
- $(Q) $(CC) --shared -Xlinker -soname=lib$(1).$(SOLIB_EXT) -o $$@ $$($(1)_objslo) $$(LOADLIBES) $$($(1)_libs:%=-l%)
+ $(Q)LD_RUN_PATH=$(USER_LIB_DIR) $(CC) --shared -Xlinker -soname=lib$(1).$(SOLIB_EXT) -o $$@ $$($(1)_objslo) $$(LOADLIBES) $$($(1)_libs:%=-l%)
endef
-include $(shell find $(USER_BUILD_DIR) -name 'lib*.omkvar')