On Darwin (with Mach-O), rpath works different compared to ELF systems.
It's not only sufficient to add -rpath to the linker (ld(1)) when
compiling an application that requires a library (.dylib), but it's also
necessary to add '@rpath' to the so-called "install path" when compiling
a library.

When compiling host-glib, the compiled programs are linked against
libintl from the ptxdist sysroot-host. The compiled programs cannot be
executed in that case. Setting DYLD_FALLBACK_LIBRARY_PATH fixed the
problem. This environment variable is something like LD_LIBRARY_PATH on
Linux.

Signed-off-by: Bernhard Walle <[email protected]>
---
 rules/pre/Rules.make |    7 ++++++-
 1 Datei geändert, 6 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/rules/pre/Rules.make b/rules/pre/Rules.make
index 1d09a18..522c90e 100644
--- a/rules/pre/Rules.make
+++ b/rules/pre/Rules.make
@@ -321,6 +321,10 @@ HOST_ENV_CXX               := CXX="$(HOSTCXX)"
 HOST_ENV_CPPFLAGS      := CPPFLAGS="$(HOST_CPPFLAGS)"
 HOST_ENV_LDFLAGS       := LDFLAGS="$(HOST_LDFLAGS)"
 
+ifeq ($(shell uname -s),Darwin)
+HOST_ENV_LIBRARY_PATH  := 
DYLD_FALLBACK_LIBRARY_PATH=$(PTXDIST_SYSROOT_HOST)/lib
+endif
+
 HOST_ENV_PKG_CONFIG    := \
        PKG_CONFIG_PATH="" \
        
PKG_CONFIG_LIBDIR="$(PTXDIST_SYSROOT_HOST)/lib/pkgconfig:$(PTXDIST_SYSROOT_HOST)/share/pkgconfig"
@@ -335,7 +339,8 @@ HOST_ENV    := \
        $(HOST_ENV_CPPFLAGS) \
        $(HOST_ENV_LDFLAGS) \
        $(HOST_ENV_PKG_CONFIG) \
-       $(HOST_ENV_PYTHONPATH)
+       $(HOST_ENV_PYTHONPATH) \
+       $(HOST_ENV_LIBRARY_PATH)
 
 
 HOST_AUTOCONF  := --prefix=
-- 
1.7.10.1


-- 
ptxdist mailing list
[email protected]

Reply via email to