Index: wayland/1.6.0/Makefile
===================================================================
--- wayland/1.6.0/Makefile (revision 171)
+++ wayland/1.6.0/Makefile (revision 172)
@@ -92,6 +92,10 @@
extra_configure_switches += --enable-shared=yes
+TARGET_BIN_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX)
+TARGET_LIB_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX):/usr/lib/../lib$(LIBSUFFIX)
+
+
####### Dependencies
$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
@@ -181,11 +185,31 @@
wayland-server.pc ; \
)
# ======= Strip binaries =======
- @( cd $(WAYLAND_PKG); \
+ @( cd $(WAYLAND_PKG) ; \
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
)
+ifneq ($(CHRPATH),)
+ # ======= Set RPATH/RUNPATH for target binaries =======
+ @( cd $(WAYLAND_PKG)/usr/bin ; \
+ for file in `find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+ rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+ if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+ $(CHRPATH) -r $(TARGET_BIN_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+ fi ; \
+ done ; \
+ )
+ # ======= Set RPATH/RUNPATH for target shared objects =======
+ @( cd $(WAYLAND_PKG)/usr/lib$(LIBSUFFIX) ; \
+ for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+ rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+ if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+ $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+ fi ; \
+ done ; \
+ )
+endif
@touch $@
$(WAYLAND_PKG_DESCRIPTION_FILE): $(WAYLAND_PKG_DESCRIPTION_FILE_IN)
Index: wayland/1.6.0-x86_32/Makefile
===================================================================
--- wayland/1.6.0-x86_32/Makefile (revision 171)
+++ wayland/1.6.0-x86_32/Makefile (revision 172)
@@ -89,6 +89,10 @@
extra_configure_switches += --enable-shared=yes
+TARGET_BIN_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX)
+TARGET_LIB_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX):/usr/lib/../lib$(MULTILIB_X86_32_SUFFIX)
+
+
####### Dependencies
$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
@@ -137,11 +141,31 @@
wayland-server.pc ; \
)
# ======= Strip binaries =======
- @( cd $(WAYLAND_32_PKG); \
+ @( cd $(WAYLAND_32_PKG) ; \
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
)
+ifneq ($(CHRPATH),)
+ # ======= Set RPATH/RUNPATH for target binaries =======
+ @( cd $(WAYLAND_32_PKG)/usr/bin/32 ; \
+ for file in `find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+ rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+ if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+ $(CHRPATH) -r $(TARGET_BIN_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+ fi ; \
+ done ; \
+ )
+ # ======= Set RPATH/RUNPATH for target shared objects =======
+ @( cd $(WAYLAND_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+ for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+ rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+ if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+ $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+ fi ; \
+ done ; \
+ )
+endif
@touch $@
$(WAYLAND_32_PKG_DESCRIPTION_FILE): $(WAYLAND_32_PKG_DESCRIPTION_FILE_IN)