diff options
Diffstat (limited to 'libffi/ghc.mk')
-rw-r--r-- | libffi/ghc.mk | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libffi/ghc.mk b/libffi/ghc.mk index 7104d046b9..92e11dddfa 100644 --- a/libffi/ghc.mk +++ b/libffi/ghc.mk @@ -84,10 +84,14 @@ libffi_DYNAMIC_PROG = $(libffi_HS_DYN_LIB).a libffi_DYNAMIC_LIBS = $(libffi_HS_DYN_LIB) else libffi_DYNAMIC_PROG = +ifeq "$(darwin_TARGET_OS)" "1" +libffi_DYNAMIC_LIBS = libffi/libffi$(soext) libffi/libffi.5$(soext) libffi/libffi.5.0.9$(soext) +else libffi_DYNAMIC_LIBS = libffi/dist-install/build/libffi.so \ libffi/dist-install/build/libffi.so.5 \ libffi/dist-install/build/libffi.so.5.0.9 endif +endif ifeq "$(BuildSharedLibs)" "YES" libffi_EnableShared=yes @@ -200,6 +204,10 @@ $(libffi_DYNAMIC_LIBS): $(libffi_STAMP_BUILD) # Rename libffi.so to libHSffi...so $(libffi_HS_DYN_LIB): $(libffi_DYNAMIC_LIBS) | $$(dir $$@)/. "$(CP)" $(word 1,$(libffi_DYNAMIC_LIBS)) $(libffi_HS_DYN_LIB) +ifeq "$(darwin_TARGET_OS)" "1" + # Ensure library's install name is correct before anyone links with it. + install_name_tool -id $(ghclibdir)/$(libffi_HS_DYN_LIB_NAME) $(libffi_HS_DYN_LIB) +endif $(eval $(call all-target,libffi,$(libffi_HS_DYN_LIB))) endif |