Index: trunk/Config.kmk
===================================================================
--- trunk/Config.kmk	(revision 11481)
+++ trunk/Config.kmk	(revision 11482)
@@ -2058,6 +2058,7 @@
 TEMPLATE_VBOXR3_DEFS.l4     = $(TEMPLATE_VBOXR3EXE_DEFS.l4) __PIC__
 TEMPLATE_VBOXR3_DEFS.darwin = $(TEMPLATE_VBOXR3EXE_DEFS.darwin) PIC
+TEMPLATE_VBOXR3_LDFLAGS.darwin = $(TEMPLATE_VBOXR3EXE_LDFLAGS.darwin) -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
 ifeq ($(filter-out solaris.x86 %.amd64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),)
- ifneq ($(KBUILD_TARGET),win)
+ ifn1of ($(KBUILD_TARGET), darwin win)
   TEMPLATE_VBOXR3_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS) PIC
   TEMPLATE_VBOXR3_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -fPIC
@@ -2354,5 +2355,5 @@
 TEMPLATE_VBOXMAINDLL_EXTENDS = VBOXMAINEXE
 ifeq ($(filter-out solaris.x86 %.amd64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),)
- ifneq ($(KBUILD_TARGET),win)
+ ifn1of ($(KBUILD_TARGET), darwin win)
   TEMPLATE_VBOXMAINDLL_DEFS     = PIC $(TEMPLATE_VBOXMAINEXE_DEFS)
   TEMPLATE_VBOXMAINDLL_CFLAGS   = -fPIC $(TEMPLATE_VBOXMAINEXE_CFLAGS)
@@ -2362,5 +2363,6 @@
 endif
 ifeq ($(KBUILD_TARGET),darwin)
- TEMPLATE_VBOXMAINDLL_LDFLAGS   = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS))
+ TEMPLATE_VBOXMAINDLL_LDFLAGS   = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS)) \
+	-current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
 endif
 
@@ -2568,5 +2570,6 @@
 TEMPLATE_VBOXQTGUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQTGUIEXE_LIBS))
 ifeq ($(KBUILD_TARGET),darwin)
- TEMPLATE_VBOXQTGUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQTGUIEXE_LDFLAGS))
+ TEMPLATE_VBOXQTGUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQTGUIEXE_LDFLAGS)) \
+	-current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
 endif
 ifeq ($(filter-out solaris.x86 %.amd64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),)
Index: trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk	(revision 11481)
+++ trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk	(revision 11482)
@@ -259,5 +259,6 @@
 TEMPLATE_VBOXQT4GUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQT4GUIEXE_LIBS))
 ifeq ($(KBUILD_TARGET),darwin)
- TEMPLATE_VBOXQT4GUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS))
+ TEMPLATE_VBOXQT4GUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS)) \
+	-current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
 endif
 ifeq ($(filter-out solaris.x86 %.amd64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),)
Index: trunk/src/libs/xpcom18a4/Makefile.kmk
===================================================================
--- trunk/src/libs/xpcom18a4/Makefile.kmk	(revision 11481)
+++ trunk/src/libs/xpcom18a4/Makefile.kmk	(revision 11482)
@@ -34,6 +34,6 @@
 XPCOM_PYMOD = VBox-xpcom-pymod VBox-xpcom-helper
 # bridge between PYMOD and VirtualBox, to minimize mods
-XPCOM_VBOX_HELPER=VBox-xpcom-helper
-PYTHON_LIBS  = python2.5
+XPCOM_VBOX_HELPER = VBox-xpcom-helper
+PYTHON_LIBS = python2.5
 endif
 
@@ -96,5 +96,6 @@
 TEMPLATE_XPCOM_LDFLAGS.darwin      = $(TEMPLATE_VBOXR3NP_LDFLAGS.darwin) \
                                      -fshort-wchar -fno-rtti -fno-exceptions -fpascal-strings \
-                                     -framework CoreServices -framework CoreFoundation -framework Foundation -framework AppKit -framework Carbon
+                                     -framework CoreServices -framework CoreFoundation -framework Foundation -framework AppKit -framework Carbon \
+                                     -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
 ifn1of ($(KBUILD_TARGET), os2 win)
  TEMPLATE_XPCOM_CXXFLAGS          += -fPIC
@@ -169,5 +170,5 @@
 TEMPLATE_XPCOMEXE_LIBS.linux       = dl $(LIB_PTHREAD)
 TEMPLATE_XPCOMEXE_LIBS.l4          = $(LIB_RUNTIME) $(VBOX_GCC_LIBGCC)
-TEMPLATE_XPCOMEXE_LDFLAGS.darwin   = -bind_at_load $(TEMPLATE_XPCOM_LDFLAGS.darwin)
+TEMPLATE_XPCOMEXE_LDFLAGS.darwin   = -bind_at_load $(filter-out -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD),$(TEMPLATE_XPCOM_LDFLAGS.darwin))
 TEMPLATE_XPCOMEXE_LDFLAGS.l4       = $(L4_DIR)/lib/x86_586/crt0.o \
     -T$(L4_DIR)/lib/x86_586/main_dyn.ld -nostdlib -lgcc \
@@ -187,5 +188,5 @@
 ## @todo Verify that this doesn't blow up because of template inheriance ordering. (we're assuming XPCOMEXE is expanded when this is being used.)
 
-TEMPLATE_XPCOMBLDPROG_DEFS                       = $(TEMPLATE_BLDPROG_DEFS)                      $(TEMPLATE_XPCOMEXE_DEFS)
+TEMPLATE_XPCOMBLDPROG_DEFS                       = $(TEMPLATE_BLDPROG_DEFS)                       $(TEMPLATE_XPCOMEXE_DEFS)
 TEMPLATE_XPCOMBLDPROG_DEFS.$(KBUILD_TARGET)      = $(TEMPLATE_BLDPROG_DEFS.$(KBUILD_TARGET))      $(TEMPLATE_XPCOMEXE_DEFS.$(KBUILD_TARGET))
 TEMPLATE_XPCOMBLDPROG_DEFS.$(KBUILD_TARGET_ARCH) = $(TEMPLATE_BLDPROG_DEFS.$(KBUILD_TARGET_ARCH)) $(TEMPLATE_XPCOMEXE_DEFS.$(KBUILD_TARGET_ARCH))
@@ -265,5 +266,5 @@
 	VBoxXPCOM \
 	VBoxXPCOMIPCC \
-        $(XPCOM_PYMOD)
+	$(XPCOM_PYMOD)
 
 ifdef VBOX_WITH_TESTCASES
@@ -1123,6 +1124,6 @@
 	$(TARGET_VBox-xpcom-nspr) \
 	$(TARGET_$(XPCOM_PYTHON)) \
-        $(PYTHON_LIBS)            \
-	$(TARGET_VBoxXPCOMGlue_s) 
+	$(PYTHON_LIBS) \
+	$(TARGET_VBoxXPCOMGlue_s)
 
 ifeq ($(filter-out freebsd l4 linux netbsd openbsd,$(KBUILD_TARGET)),) # gnu ld.
@@ -1262,31 +1263,33 @@
 
 
+#
 # Python XPCOM bindings
+#
 VBox-xpcom-python_TEMPLATE = XPCOM
 VBox-xpcom-python_NOINST = 1
 VBox-xpcom-python_DEFS = _IMPL_NS_COM _IMPL_NS_BASE EXPORT_XPTI_API EXPORT_XPT_API VBOX_PYXPCOM
 VBox-xpcom-python_INCS += /usr/include/python2.5
-VBox-xpcom-python_SOURCES =                         	\
-	python/src/dllmain.cpp     			\
-        python/src/ErrorUtils.cpp  			\
-        python/src/PyGBase.cpp 				\
-        python/src/PyGInputStream.cpp			\
-        python/src/PyGModule.cpp			\
-        python/src/PyGStub.cpp				\
-        python/src/PyGWeakReference.cpp			\
-        python/src/PyIClassInfo.cpp			\
-        python/src/PyIComponentManager.cpp		\
-        python/src/PyIComponentManagerObsolete.cpp	\
-        python/src/PyIEnumerator.cpp			\
-        python/src/PyIID.cpp				\
-        python/src/PyIInputStream.cpp			\
-        python/src/PyIInterfaceInfo.cpp			\
-        python/src/PyIInterfaceInfoManager.cpp		\
-        python/src/PyISimpleEnumerator.cpp		\
-        python/src/PyISupports.cpp			\
-        python/src/PyIVariant.cpp			\
-        python/src/Pyxpt_info.cpp			\
-        python/src/TypeObject.cpp			\
-        python/src/VariantUtils.cpp			\
+VBox-xpcom-python_SOURCES = \
+	python/src/dllmain.cpp \
+	python/src/ErrorUtils.cpp \
+	python/src/PyGBase.cpp \
+	python/src/PyGInputStream.cpp \
+	python/src/PyGModule.cpp \
+	python/src/PyGStub.cpp \
+	python/src/PyGWeakReference.cpp \
+	python/src/PyIClassInfo.cpp \
+	python/src/PyIComponentManager.cpp \
+	python/src/PyIComponentManagerObsolete.cpp \
+	python/src/PyIEnumerator.cpp \
+	python/src/PyIID.cpp \
+	python/src/PyIInputStream.cpp \
+	python/src/PyIInterfaceInfo.cpp \
+	python/src/PyIInterfaceInfoManager.cpp \
+	python/src/PyISimpleEnumerator.cpp \
+	python/src/PyISupports.cpp \
+	python/src/PyIVariant.cpp \
+	python/src/Pyxpt_info.cpp \
+	python/src/TypeObject.cpp \
+	python/src/VariantUtils.cpp
 
 
@@ -1294,12 +1297,12 @@
 VBox-xpcom-helper_TEMPLATE = VBOXMAINCLIENTDLL
 VBox-xpcom-helper_NAME = VBoxHlp
-VBox-xpcom-helper_DEFS = 
-VBox-xpcom-helper_SOURCES =  \
-       python/src/module/helper.cpp
+VBox-xpcom-helper_DEFS =
+VBox-xpcom-helper_SOURCES = \
+	python/src/module/helper.cpp
 
 # Python Client Module
-PY_PATH=sdk/bindings/com/python/xpcom
-PY_DEST=$(PATH_BIN)/$(PY_PATH)
-PY_SAMPLE=$(PATH_BIN)/sdk/bindings/com/python/sample
+PY_PATH = sdk/bindings/com/python/xpcom
+PY_DEST = $(PATH_BIN)/$(PY_PATH)
+PY_SAMPLE = $(PATH_BIN)/sdk/bindings/com/python/sample
 
 VBox-xpcom-pymod_TEMPLATE = XPCOM
@@ -1309,36 +1312,38 @@
 VBox-xpcom-pymod_DEFS = _IMPL_NS_COM _IMPL_NS_BASE EXPORT_XPTI_API EXPORT_XPT_API VBOX_PYXPCOM
 VBox-xpcom-pymod_INCS += /usr/include/python2.5 python/src
-VBox-xpcom-pymod_SOURCES =                         	\
-	python/src/module/_xpcom.cpp              
+VBox-xpcom-pymod_SOURCES = \
+	python/src/module/_xpcom.cpp
 VBox-xpcom-pymod_LIBS = $(TARGET_VBox-xpcom-helper)
 VBox-xpcom-pymod_LDFLAGS += $(PATH_BIN)/VBoxXPCOM.so
-VBox-xpcom-pymod_DEPS =       		\
-        $(PY_DEST)/components.py   	\
-	$(PY_DEST)/file.py         	\
-	$(PY_DEST)/__init__.py     	\
-	$(PY_DEST)/nsError.py      	\
-	$(PY_DEST)/primitives.py   	\
-	$(PY_DEST)/xpcom_consts.py 	\
-        $(PY_DEST)/xpt.py          	\
-	$(PY_DEST)/client/__init__.py 	\
-	$(PY_DEST)/server/__init__.py   \
+VBox-xpcom-pymod_DEPS = \
+	$(PY_DEST)/components.py \
+	$(PY_DEST)/file.py \
+	$(PY_DEST)/__init__.py \
+	$(PY_DEST)/nsError.py \
+	$(PY_DEST)/primitives.py \
+	$(PY_DEST)/xpcom_consts.py \
+	$(PY_DEST)/xpt.py \
+	$(PY_DEST)/client/__init__.py \
+	$(PY_DEST)/server/__init__.py \
 	$(PY_DEST)/server/enumerator.py \
-	$(PY_DEST)/server/factory.py  	\
-	$(PY_DEST)/server/loader.py     \
-	$(PY_DEST)/server/module.py     \
-	$(PY_DEST)/server/policy.py     \
-	$(PY_SAMPLE)/vbox.py            \
+	$(PY_DEST)/server/factory.py \
+	$(PY_DEST)/server/loader.py \
+	$(PY_DEST)/server/module.py \
+	$(PY_DEST)/server/policy.py \
+	$(PY_SAMPLE)/vbox.py \
 	$(TARGET_VBox-xpcom-helper)
 
 $(PY_DEST):
-	$(QUIET)$(MKDIR) -p $@
-	$(QUIET)$(MKDIR) -p $(PY_SAMPLE)
-	$(QUIET)$(MKDIR) -p $@/client
-	$(QUIET)$(MKDIR) -p $@/server
+	$(QUIET)$(MKDIR) -p -- \
+		$@ \
+		$(PY_SAMPLE) \
+		$@/client \
+		$@/server
 
 $(PY_DEST)/%.py: $(PATH_SUB_CURRENT)/python/%.py $(PY_DEST)
-	$(QUIET)$(CP) $< $@
+	$(QUIET)$(CP) -f -- $< $@
+
 $(PY_SAMPLE)/%.py: $(PATH_SUB_CURRENT)/python/sample/%.py $(PY_DEST)
-	$(QUIET)$(CP) $< $@
+	$(QUIET)$(CP) -f -- $< $@
 
 
@@ -1351,9 +1356,9 @@
 	ipc/ipcd/daemon/src/ipcCommandModule.cpp
 ifeq ($(KBUILD_TARGET),win)
-VBoxXPCOMIPCD_SOURCES += \
-	ipc/ipcd/daemon/src/ipcdWin.cpp
+ VBoxXPCOMIPCD_SOURCES += \
+ 	ipc/ipcd/daemon/src/ipcdWin.cpp
 else
-VBoxXPCOMIPCD_SOURCES += \
-	ipc/ipcd/daemon/src/ipcdUnix.cpp
+ VBoxXPCOMIPCD_SOURCES += \
+ 	ipc/ipcd/daemon/src/ipcdUnix.cpp
 endif
 
