Centralize the handling of install_name and rpath.
[oota-llvm.git] / Makefile.rules
index d668b23afbb98edc8d25475e9c6e9addb297e276..3f1c2afe73d4802ee82378ec413f87f61d93b1cc 100644 (file)
@@ -589,6 +589,8 @@ ifdef SHARED_LIBRARY
 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)"
 endif
 endif
 endif