]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Added LD_RUN_PATH when linking shared libraries
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 29 Oct 2008 23:42:43 +0000 (00:42 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 29 Oct 2008 23:42:43 +0000 (00:42 +0100)
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.

snippets/linux

index c3b552b0c4c01ea21e3ce83f307c7ca5df2929ea..a5153a0ccccfb996406546aed76cae3c1f06707f 100644 (file)
@@ -387,7 +387,7 @@ $(1)_shared_libs = $$(patsubst %,$(USER_LIB_DIR)/lib%.$(SOLIB_EXT),$$(filter $$(
 #$$(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')