summaryrefslogtreecommitdiff
path: root/rts/ghc.mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-12-04 14:36:14 +0000
committerIan Lynagh <igloo@earth.li>2009-12-04 14:36:14 +0000
commit3e18f8be62b06c846b52d79717f79d51e2060593 (patch)
tree23ec97dd15bb48f3dd78f09c76c4894ac86a88d3 /rts/ghc.mk
parent5c2220aa9aac0fefcba5abbfa3059a6ef138655f (diff)
downloadhaskell-3e18f8be62b06c846b52d79717f79d51e2060593.tar.gz
Link all dynamic libraries with the correct install_name on Mac OS/X.
This is a rerecord of Stephen Blackheath <oversensitive.pastors.stephen@blacksapphire.com>**20090930222855 to avoid conflicts.
Diffstat (limited to 'rts/ghc.mk')
-rw-r--r--rts/ghc.mk7
1 files changed, 6 insertions, 1 deletions
diff --git a/rts/ghc.mk b/rts/ghc.mk
index 853e3d8b43..f973b677c0 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -141,7 +141,8 @@ $(call cmm-suffix-rules,rts,dist,$1)
$(call hs-suffix-rules-srcdir,rts,dist,$1,$$(dir))
# hs-suffix-rules-srcdir is needed when BootingFromHc to get the .hc rules
-rts_$1_LIB = rts/dist/build/libHSrts$$($1_libsuf)
+rts_$1_LIB_NAME = libHSrts$$($1_libsuf)
+rts_$1_LIB = rts/dist/build/$$(rts_$1_LIB_NAME)
rts_$1_C_OBJS = $$(patsubst rts/%.c,rts/dist/build/%.$$($1_osuf),$$(rts_C_SRCS)) $$(patsubst %.c,%.$$($1_osuf),$$(rts_$1_EXTRA_C_SRCS))
rts_$1_S_OBJS = $$(patsubst rts/%.S,rts/dist/build/%.$$($1_osuf),$$(rts_S_SRCS))
@@ -158,6 +159,10 @@ $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend
"$$(RM)" $$(RM_OPTS) $$@
"$$(rts_dist_HC)" -shared -dynamic -dynload deploy \
-no-auto-link-packages `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
+ifeq "$(darwin_TARGET_OS)" "1"
+ # Ensure library's install name is correct before anyone links with it.
+ install_name_tool -id $(ghclibdir)/$$(rts_$1_LIB_NAME) $$@
+endif
else
$$(rts_$1_LIB) : $$(rts_$1_OBJS) rts/libs.depend
"$$(RM)" $$(RM_OPTS) $$@