Index: /trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk	(revision 60582)
+++ /trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk	(revision 60583)
@@ -5,5 +5,5 @@
 
 #
-# Copyright (C) 2007-2015 Oracle Corporation
+# Copyright (C) 2007-2016 Oracle Corporation
 #
 # This file is part of VirtualBox Open Source Edition (OSE), as
@@ -30,31 +30,59 @@
 PROGRAMS.win.x86 += VBoxServiceNT
 
+# Enable the timesync service within VBoxService.
+VBOX_WITH_VBOXSERVICE_TIMESYNC      := 1
+
+# Busybox-like toolbox, embedded into VBoxService.
+VBOX_WITH_VBOXSERVICE_TOOLBOX       := 1
+
+# VM-management functions, like memory ballooning and statistics.
+VBOX_WITH_VBOXSERVICE_MANAGEMENT    := 1
+
+if1of ($(KBUILD_TARGET), linux)
+ # CPU hotplugging.
+ VBOX_WITH_VBOXSERVICE_CPUHOTPLUG   := 1
+endif
+
+if1of ($(KBUILD_TARGET), win)
+ # Page Sharing (Page Fusion).
+ VBOX_WITH_VBOXSERVICE_PAGE_SHARING := 1
+endif
+
+ifdef VBOX_WITH_GUEST_PROPS
+ VBOX_WITH_VBOXSERVICE_VMINFO       := 1
+endif
+
+ifdef VBOX_WITH_GUEST_CONTROL
+ # Guest Control.
+ VBOX_WITH_VBOXSERVICE_CONTROL      := 1
+endif
+
 #
 # VBoxService
 #
 VBoxService_TEMPLATE      = NewVBoxGuestR3Exe
-VBoxService_DEFS          = VBOX_WITH_HGCM VBOXSERVICE_TIMESYNC VBOXSERVICE_MANAGEMENT VBOXSERVICE_TOOLBOX
+
+# Define features to be activate.
+VBoxService_DEFS         += \
+	$(if $(VBOX_WITH_VBOXSERVICE_CONTROL),VBOX_WITH_VBOXSERVICE_CONTROL,)           \
+	$(if $(VBOX_WITH_VBOXSERVICE_CPUHOTPLUG),VBOX_WITH_VBOXSERVICE_CPUHOTPLUG,)     \
+	$(if $(VBOX_WITH_VBOXSERVICE_MANAGEMENT),VBOX_WITH_VBOXSERVICE_MANAGEMENT,)     \
+	$(if $(VBOX_WITH_VBOXSERVICE_PAGE_SHARING),VBOX_WITH_VBOXSERVICE_PAGE_SHARING,) \
+	$(if $(VBOX_WITH_VBOXSERVICE_TIMESYNC),VBOX_WITH_VBOXSERVICE_TIMESYNC,)         \
+	$(if $(VBOX_WITH_VBOXSERVICE_TOOLBOX),VBOX_WITH_VBOXSERVICE_TOOLBOX,)           \
+	$(if $(VBOX_WITH_VBOXSERVICE_VMINFO),VBOX_WITH_VBOXSERVICE_VMINFO,)
+
+# Import global defines.
+VBoxService_DEFS         +=                                       \
+	$(if $(VBOX_WITH_DBUS),VBOX_WITH_DBUS,)                   \
+	$(if $(VBOX_WITH_GUEST_CONTROL),VBOX_WITH_GUEST_CONTROL,) \
+	$(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS,)     \
+	$(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,)
+
 VBoxService_DEFS         += \
 	VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
 VBoxService_DEFS.win     += _WIN32_WINNT=0x0501
-VBoxService_DEFS.os2      = VBOX_WITH_HGCM VBOXSERVICE_CLIPBOARD
-ifdef VBOX_WITH_DBUS
- VBoxService_DEFS        += VBOX_WITH_DBUS
-endif
-ifdef VBOX_WITH_GUEST_PROPS
- VBoxService_DEFS        += VBOX_WITH_GUEST_PROPS VBOXSERVICE_VMINFO
-endif
-ifdef VBOX_WITH_GUEST_CONTROL
- VBoxService_DEFS        += VBOX_WITH_GUEST_CONTROL VBOXSERVICE_CONTROL
-endif
-ifdef VBOX_WITH_MEMBALLOON
- VBoxService_DEFS        += VBOX_WITH_MEMBALLOON
-endif
-if1of ($(KBUILD_TARGET), win)
- VBoxService_DEFS        += VBOXSERVICE_PAGE_SHARING
-endif
-if1of ($(KBUILD_TARGET), linux)
- VBoxService_DEFS        += VBOXSERVICE_CPUHOTPLUG
-endif
+VBoxService_DEFS.os2      = VBOX_WITH_HGCM VBOX_WITH_VBOXSERVICE_CLIPBOARD
+
 ifdef VBOX_WITH_SHARED_FOLDERS
  # darwin freebsd
@@ -64,22 +92,32 @@
 endif
 
-VBoxService_SOURCES       = \
-	VBoxService.cpp \
-	VBoxServiceTimeSync.cpp \
+VBoxService_SOURCES       =  \
+	VBoxService.cpp      \
 	VBoxServiceUtils.cpp \
-	VBoxServiceStats.cpp \
+	VBoxServiceStats.cpp
+
+ifdef VBOX_WITH_VBOXSERVICE_TIMESYNC
+ VBoxService_SOURCES     += \
+	VBoxServiceTimeSync.cpp
+endif
+
+ifdef VBOX_WITH_VBOXSERVICE_TOOLBOX
+ VBoxService_SOURCES     += \
 	VBoxServiceToolBox.cpp
-
-ifdef VBOX_WITH_GUEST_CONTROL
- VBoxService_SOURCES    += \
- 	VBoxServiceControl.cpp \
+endif
+
+ifdef VBOX_WITH_VBOXSERVICE_CONTROL
+ VBoxService_SOURCES     +=       \
+ 	VBoxServiceControl.cpp        \
 	VBoxServiceControlProcess.cpp \
 	VBoxServiceControlSession.cpp
 endif
 
-ifdef VBOX_WITH_MEMBALLOON
- VBoxService_SOURCES    += \
+ifdef VBOX_WITH_VBOXSERVICE_MANAGEMENT
+ VBoxService_SOURCES     += \
  	VBoxServiceBalloon.cpp
-endif
+ VBoxService_DEFS        += $(if $(VBOX_WITH_MEMBALLOON),VBOX_WITH_MEMBALLOON,)
+endif
+
 if1of ($(KBUILD_TARGET), win)
  VBoxService_SOURCES    += \
@@ -87,13 +125,13 @@
 endif
 
-ifdef VBOX_WITH_GUEST_PROPS
- VBoxService_SOURCES.win  = \
+ifdef VBOX_WITH_VBOXSERVICE_VMINFO
+ VBoxService_SOURCES.win += \
  	VBoxServiceVMInfo-win.cpp
- VBoxService_SOURCES     += \
- 	VBoxServiceVMInfo.cpp \
+ VBoxService_SOURCES     +=  \
+ 	VBoxServiceVMInfo.cpp    \
  	VBoxServicePropCache.cpp
 endif
 
-if1of ($(KBUILD_TARGET), linux)
+ifdef VBOX_WITH_VBOXSERVICE_CPUHOTPLUG
  VBoxService_SOURCES     += \
 	VBoxServiceCpuHotPlug.cpp
@@ -149,5 +187,5 @@
 VBoxServiceNT_TEMPLATE = NewVBoxGuestR3Exe
 VBoxServiceNT_EXTENDS  = VBoxService
-VBoxServiceNT_DEFS.win = _WIN32_WINNT=0x0400 TARGET_NT4 VBOXSERVICE_MANAGEMENT
+VBoxServiceNT_DEFS.win = _WIN32_WINNT=0x0400 TARGET_NT4 VBOX_WITH_VBOXSERVICE_MANAGEMENT
 
 VBoxServiceVMInfo.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
Index: /trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp	(revision 60582)
+++ /trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp	(revision 60583)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2007-2015 Oracle Corporation
+ * Copyright (C) 2007-2016 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -89,5 +89,5 @@
 
 #include "VBoxServiceInternal.h"
-#ifdef VBOX_WITH_GUEST_CONTROL
+#ifdef VBOX_WITH_VBOXSERVICE_CONTROL
 # include "VBoxServiceControl.h"
 #endif
@@ -143,20 +143,20 @@
 } g_aServices[] =
 {
-#ifdef VBOXSERVICE_CONTROL
+#ifdef VBOX_WITH_VBOXSERVICE_CONTROL
     { &g_Control,       NIL_RTTHREAD, false, false, false, false, true },
 #endif
-#ifdef VBOXSERVICE_TIMESYNC
+#ifdef VBOX_WITH_VBOXSERVICE_TIMESYNC
     { &g_TimeSync,      NIL_RTTHREAD, false, false, false, false, true },
 #endif
-#ifdef VBOXSERVICE_CLIPBOARD
+#ifdef VBOX_WITH_VBOXSERVICE_CLIPBOARD
     { &g_Clipboard,     NIL_RTTHREAD, false, false, false, false, true },
 #endif
-#ifdef VBOXSERVICE_VMINFO
+#ifdef VBOX_WITH_VBOXSERVICE_VMINFO
     { &g_VMInfo,        NIL_RTTHREAD, false, false, false, false, true },
 #endif
-#ifdef VBOXSERVICE_CPUHOTPLUG
+#ifdef VBOX_WITH_VBOXSERVICE_CPUHOTPLUG
     { &g_CpuHotPlug,    NIL_RTTHREAD, false, false, false, false, true },
 #endif
-#ifdef VBOXSERVICE_MANAGEMENT
+#ifdef VBOX_WITH_VBOXSERVICE_MANAGEMENT
 # ifdef VBOX_WITH_MEMBALLOON
     { &g_MemBalloon,    NIL_RTTHREAD, false, false, false, false, true },
@@ -164,5 +164,5 @@
     { &g_VMStatistics,  NIL_RTTHREAD, false, false, false, false, true },
 #endif
-#if defined(VBOXSERVICE_PAGE_SHARING)
+#if defined(VBOX_WITH_VBOXSERVICE_PAGE_SHARING)
     { &g_PageSharing,   NIL_RTTHREAD, false, false, false, false, true },
 #endif
@@ -867,5 +867,5 @@
 #endif
 
-#ifdef VBOXSERVICE_TOOLBOX
+#ifdef VBOX_WITH_VBOXSERVICE_TOOLBOX
     /*
      * Run toolbox code before all other stuff since these things are simpler
@@ -879,5 +879,5 @@
 
     bool fUserSession = false;
-#ifdef VBOX_WITH_GUEST_CONTROL
+#ifdef VBOX_WITH_VBOXSERVICE_CONTROL
     /*
      * Check if we're the specially spawned VBoxService.exe process that
@@ -917,5 +917,5 @@
 #endif
 
-#ifdef VBOX_WITH_GUEST_CONTROL
+#ifdef VBOX_WITH_VBOXSERVICE_CONTROL
     /*
      * Check if we're the specially spawned VBoxService.exe process that
Index: /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp	(revision 60582)
+++ /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp	(revision 60583)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2012-2015 Oracle Corporation
+ * Copyright (C) 2012-2016 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -1303,5 +1303,5 @@
 #endif /* RT_OS_WINDOWS */
 
-#ifdef VBOXSERVICE_TOOLBOX
+#ifdef VBOX_WITH_VBOXSERVICE_TOOLBOX
     if (RTStrStr(pszExec, "vbox_") == pszExec)
     {
@@ -1317,5 +1317,5 @@
          */
         rc = vgsvcGstCtrlProcessResolveExecutable(pszExec, szExecExp, sizeof(szExecExp));
-#ifdef VBOXSERVICE_TOOLBOX
+#ifdef VBOX_WITH_VBOXSERVICE_TOOLBOX
     }
 #endif
Index: /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h	(revision 60582)
+++ /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h	(revision 60583)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2007-2015 Oracle Corporation
+ * Copyright (C) 2007-2016 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -166,9 +166,9 @@
 extern VBOXSERVICE  g_VMInfo;
 extern VBOXSERVICE  g_CpuHotPlug;
-#ifdef VBOXSERVICE_MANAGEMENT
+#ifdef VBOX_WITH_VBOXSERVICE_MANAGEMENT
 extern VBOXSERVICE  g_MemBalloon;
 extern VBOXSERVICE  g_VMStatistics;
 #endif
-#ifdef VBOXSERVICE_PAGE_SHARING
+#ifdef VBOX_WITH_VBOXSERVICE_PAGE_SHARING
 extern VBOXSERVICE  g_PageSharing;
 #endif
@@ -200,5 +200,5 @@
 #endif
 
-#ifdef VBOXSERVICE_TOOLBOX
+#ifdef VBOX_WITH_VBOXSERVICE_TOOLBOX
 extern bool                     VGSvcToolboxMain(int argc, char **argv, RTEXITCODE *prcExit);
 #endif
@@ -211,8 +211,8 @@
 #endif /* RT_OS_WINDOWS */
 
-#ifdef VBOXSERVICE_MANAGEMENT
+#ifdef VBOX_WITH_VBOXSERVICE_MANAGEMENT
 extern uint32_t                 VGSvcBalloonQueryPages(uint32_t cbPage);
 #endif
-#if defined(VBOXSERVICE_PAGE_SHARING)
+#if defined(VBOX_WITH_VBOXSERVICE_PAGE_SHARING)
 extern RTEXITCODE               VGSvcPageSharingWorkerChild(void);
 #endif
