Link all dynamic libraries with the correct install_name on Mac OS/X.
[ghc-hetmet.git] / rules / build-package-way.mk
index 26eacfe..ef4477f 100644 (file)
@@ -67,6 +67,7 @@ $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS)
        "$$($1_$2_HC)" $$($1_$2_$3_ALL_OBJS) \
          `$$($1_$2_$3_MKSTUBOBJS)` \
          -shared -dynamic -dynload deploy \
+            -dylib-install-name $(ghclibdir)/`basename "$$@" | sed 's/^libHS//;s/[-]ghc.*//'`/`basename "$$@"` \
          -no-auto-link-packages $$(addprefix -package,$$($1_$2_DEPS)) \
          -o $$@
 endif