From 9e8b2808ef169b554819db23add3acc5ae33e984 Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 17 Jan 2015 16:34:41 -0800
Subject: [PATCH 4/6] MacPorts Only: Use full path for the dylib id instead of
 @rpath

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
 Makefile.rules | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git llvm_master/Makefile.rules macports_master/Makefile.rules
index 24cac3b..8775589 100644
--- llvm_master/Makefile.rules
+++ macports_master/Makefile.rules
@@ -598,7 +598,12 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
 ifneq ($(HOST_OS),Darwin)
   LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
 else
-  LD.Flags += -Wl,-install_name  -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
+  LD.Flags += -Wl,-install_name
+  ifdef LOADABLE_MODULE
+    LD.Flags += -Wl,"$(PROJ_libdir)/$(LIBRARYNAME)$(SHLIBEXT)"
+  else
+    LD.Flags += -Wl,"$(PROJ_libdir)/$(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)"
+  endif
 endif
 endif
 endif
-- 
2.4.5

