diff --git a/configure b/configure
index d7267045510858abf865439f4ea9b0a8adc48f8b..e983d2311d7ca49731b79a66f997a3a57372f7dd 100755
--- a/configure
+++ b/configure
@@ -336,7 +336,7 @@ v4l="no"
 audio_oss="no"
 dv1394="no"
 ffserver="no"
-SHFLAGS="-dynamiclib -Wl,-single_module"
+SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(libdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
 extralibs=""
 darwin="yes"
 strip="strip -x"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 5f24dbb9a32bb1bef6718ce67ac2947424d0d6b4..6063dc1a9297b501b400134a103dab0e958ae7bf 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -392,11 +392,6 @@ ifeq ($(TARGET_ARCH_SPARC64),yes)
 CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
 endif
 
-# Darwin specific stuff
-ifeq ($(CONFIG_DARWIN),yes)
-SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBPREF)avcodec$(SLIBSUF),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION)
-endif
-
 SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
 OBJS := $(OBJS) $(ASM_OBJS)
 
diff --git a/libavcodec/libpostproc/Makefile b/libavcodec/libpostproc/Makefile
index 81d3aaaa318a1d83cf0bc37f0db44afeeef36626..d8c778273772a7188f4dadc2c20b76c7e3339810 100644
--- a/libavcodec/libpostproc/Makefile
+++ b/libavcodec/libpostproc/Makefile
@@ -1,3 +1,4 @@
+#FIXME: This Makefile differs from all the others for no good reason...
 
 include ../../config.mak
 
@@ -8,11 +9,7 @@ SPPLIBNAME = $(SLIBPREF)postproc$(SLIBSUF)
 SPPLIBMAJOR = $(SPPLIBNAME).$(SPPMAJOR)
 SPPLIB = $(SPPLIBNAME).$(SPPVERSION)
 LIBVERSION = $(SPPLIB)
-ifeq ($(CONFIG_DARWIN),yes)
-SPPLIBMAJOR = $(SLIBPREF)postproc.$(SPPMAJOR)$(SLIBSUF)
-SPPLIB = $(SLIBPREF)postproc.$(SPPVERSION)$(SLIBSUF)
-SHFLAGS += -Wl,-install_name,$(libdir)/$(SPPLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION)
-endif
+SLIBNAME = $(SLIBPREF)postproc$(SLIBSUF)
 endif
 PPLIB = $(LIBPREF)postproc$(LIBSUF)
 
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 41927f7035cede3aa3d2569e5c5c1aa1a400e373..8db1c59127cd50a9e718dd9cb8006fee471a1393 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -83,9 +83,6 @@ ifeq ($(BUILD_SHARED),yes)
 LIBVERSION=$(LAVFMAJOR)
 SLIBNAME= $(SLIBPREF)avformat$(SLIBSUF)
 AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
-ifeq ($(CONFIG_DARWIN),yes)
-SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION)
-endif
 endif
 
 SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
diff --git a/libavutil/Makefile b/libavutil/Makefile
index d27a369ec6a327f195d9b35d030ab853ede5a560..47ce5520ee8d911fc4e39af1779144ddce916678 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -24,9 +24,6 @@ LIB= $(LIBPREF)avutil$(LIBSUF)
 ifeq ($(BUILD_SHARED),yes)
 LIBVERSION=$(LAVUMAJOR)
 SLIBNAME= $(SLIBPREF)avutil$(SLIBSUF)
-ifeq ($(CONFIG_DARWIN),yes)
-SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION)
-endif
 endif
 
 all: $(LIB) $(SLIBNAME)
diff --git a/vhook/Makefile b/vhook/Makefile
index 945b4bd06249a59dd046d69cdbe280f9ebc920d3..f473a6e8d36614cf4ccfed444d66ae5e2a9c4da7 100644
--- a/vhook/Makefile
+++ b/vhook/Makefile
@@ -4,8 +4,9 @@ VPATH=$(SRC_PATH)/vhook
 
 CFLAGS=-fPIC $(SHCFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavutil -DHAVE_AV_CONFIG_H
 
+#FIXME: This needs to be in configure/config.mak
 ifeq ($(CONFIG_DARWIN),yes)
-	SHFLAGS += -flat_namespace -undefined suppress
+	SHFLAGS = -dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(libdir)/vhook/$@
 endif
 HOOKS=null$(SLIBSUF) fish$(SLIBSUF) ppm$(SLIBSUF) watermark$(SLIBSUF)
 
@@ -36,11 +37,7 @@ drawtext$(SLIBSUF): drawtext.o
 	$(CC) $(LDFLAGS) -g -o $@ $(SHFLAGS) $< `freetype-config --libs`
 
 %$(SLIBSUF): %.o
-ifeq ($(CONFIG_DARWIN),yes)
-	$(CC) $(LDFLAGS) $(SHFLAGS) -Wl,-install_name,$(libdir)/vhook/$@ -g -o $@ $<
-else
 	$(CC) $(LDFLAGS) -g -o $@ $(SHFLAGS) $<
-endif
 
 clean:
 	rm -f *.o *.d .depend *$(SLIBSUF) *~