diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-06-22 20:34:12 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-06-22 20:34:12 +0100 |
commit | 92f36df441052ab6bb8516cc19be65f2ca4010fd (patch) | |
tree | e8dd44605f4c3faca71bf1f3b422d40a68e0d5a0 /rules/build-prog.mk | |
parent | 499d6988663043d0e0a0732f865324e959139927 (diff) | |
download | haskell-92f36df441052ab6bb8516cc19be65f2ca4010fd.tar.gz |
Fix the dynmaic library paths in the libs, as well as in the programs
Part of #7833
Diffstat (limited to 'rules/build-prog.mk')
-rw-r--r-- | rules/build-prog.mk | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 17d64da1c9..8c49946f1c 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -260,19 +260,9 @@ else ifeq "$$($1_$2_LINK_WITH_GCC)" "NO" $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) | $$$$(dir $$$$@)/. $$(call cmd,$1_$2_HC) -o $$@ $$($1_$2_$$($1_$2_PROGRAM_WAY)_ALL_HC_OPTS) $$(LD_OPTS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_GHC_LD_OPTS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) -ifeq "$$(TargetOS_CPP)" "darwin" -ifneq "$3" "0" + ifeq "$$($1_$2_PROGRAM_WAY)" "dyn" -# Use relative paths for all the libraries -ifneq "$$($1_$2_TRANSITIVE_DEP_NAMES)" "" - install_name_tool $$(foreach d,$$($1_$2_TRANSITIVE_DEP_NAMES), -change $$(TOP)/$$($$($$d_INSTALL_INFO)_dyn_LIB) @loader_path/../$$d-$$($$($$d_INSTALL_INFO)_VERSION)/$$($$($$d_INSTALL_INFO)_dyn_LIB_NAME)) $$@ -endif -# Use relative paths for the RTS. Rather than try to work out which RTS -# way is being linked, we just change it for all ways - install_name_tool $$(foreach w,$$(rts_WAYS), -change $$(TOP)/$$(rts_$$w_LIB) @loader_path/../rts-$$(rts_VERSION)/$$(rts_$$w_LIB_NAME)) $$@ - install_name_tool -change $$(TOP)/$$(wildcard libffi/build/inst/lib/libffi.*.dylib) @loader_path/../rts-$$(rts_VERSION)/libffi.dylib $$@ -endif -endif + $(call relative-dynlib-references,$1,$2,$3) endif else $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) | $$$$(dir $$$$@)/. |