Index: /trunk/Config.kmk
===================================================================
--- /trunk/Config.kmk	(revision 9641)
+++ /trunk/Config.kmk	(revision 9642)
@@ -2579,7 +2579,7 @@
 
 #
-# Template for building Linux host tools (only for KBUILD_TARGET=l4)
-#
-TEMPLATE_VBOXLNXHOSTR3EXE                   = Template for building linux host programs.
+# Template for building Linux host tools (only for KBUILD_TARGET=l4).
+#
+TEMPLATE_VBOXLNXHOSTR3EXE                   = Template for building linux host programs when targeting L4.
 TEMPLATE_VBOXLNXHOSTR3EXE_INST              = $(INST_BIN)
 TEMPLATE_VBOXLNXHOSTR3EXE_BLD_TRG           = linux
@@ -2610,10 +2610,4 @@
 # Note: Make sure you don't break VBOXGUESTR3CPPEXE when changing this.
 #
-# For the time being, we force 32-bitness onto this and related
-# templates (via BLD_TRG_ARCH). When we start doing 64-bit guest
-# however, they will be reverted to follow KBUILD_TARGET_ARCH.
-# So, if someone sees any weirdness happening in a 64-bit build now,
-# try do a 32-bit cross build (kmk KBUILD_TARGET_ARCH=x86) first. It
-#
 TEMPLATE_VBOXGUESTR3EXE           = VBox Guest Program
 ifeq ($(KBUILD_TARGET),win)
@@ -2635,24 +2629,19 @@
 TEMPLATE_VBOXGUESTR3EXE_INST      = $(INST_ADDITIONS)
 TEMPLATE_VBOXGUESTR3EXE_DEFS     := $(TEMPLATE_VBOXR3EXE_DEFS) IN_GUEST IN_GUEST_R3 IN_RT_R3
-if1of ($(KBUILD_TARGET),l4 linux) # As few libs as possible on linux.
+ifeq ($(KBUILD_TARGET),linux) # As few libs as possible on linux.
  TEMPLATE_VBOXGUESTR3EXE_LIBS     = pthread rt m
 endif
-ifeq ($(KBUILD_TARGET),l4) # cross building linux on l4.
- TEMPLATE_VBOXGUESTR3EXE_BLD_TRG  = linux
- TEMPLATE_VBOXGUESTR3EXE_DLLSUFF  = .so
- TEMPLATE_VBOXGUESTR3EXE_SYSSUFF  = .ko
-endif
 
 #
 # Template for building R3 (dynamic) libraries for the guest additions.
 #
-TEMPLATE_VBOXGUESTR3DLL          = VBox Guest User Dynamic Libraries
-TEMPLATE_VBOXGUESTR3DLL_EXTENDS  = VBOXGUESTR3EXE
+TEMPLATE_VBOXGUESTR3DLL           = VBox Guest User Dynamic Libraries
+TEMPLATE_VBOXGUESTR3DLL_EXTENDS   = VBOXGUESTR3EXE
 ## @todo add a INSTFUN that separates dlls and libs.
 ifn1of ($(KBUILD_TARGET), os2 win)
- TEMPLATE_VBOXGUESTR3DLL_DEFS       = $(TEMPLATE_VBOXGUESTR3EXE_DEFS) PIC
- TEMPLATE_VBOXGUESTR3DLL_CFLAGS     = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fPIC
- TEMPLATE_VBOXGUESTR3DLL_CXXFLAGS   = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fPIC -fno-exceptions
- TEMPLATE_VBOXGUESTR3DLL_LDFLAGS    = $(TEMPLATE_VBOXGUESTR3EXE_LDFLAGS) -fPIC
+ TEMPLATE_VBOXGUESTR3DLL_DEFS     = $(TEMPLATE_VBOXGUESTR3EXE_DEFS) PIC
+ TEMPLATE_VBOXGUESTR3DLL_CFLAGS   = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fPIC
+ TEMPLATE_VBOXGUESTR3DLL_CXXFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fPIC -fno-exceptions
+ TEMPLATE_VBOXGUESTR3DLL_LDFLAGS  = $(TEMPLATE_VBOXGUESTR3EXE_LDFLAGS) -fPIC
 endif
 
@@ -2660,11 +2649,11 @@
 # Template for building R3 (static) libraries for the guest additions.
 #
-TEMPLATE_VBOXGUESTR3LIB         = VBox Guest User Libraries
-TEMPLATE_VBOXGUESTR3LIB_EXTENDS = VBOXGUESTR3EXE
-TEMPLATE_VBOXGUESTR3LIB_INST    = $(INST_ADDITIONS_LIB)
+TEMPLATE_VBOXGUESTR3LIB           = VBox Guest User Libraries
+TEMPLATE_VBOXGUESTR3LIB_EXTENDS   = VBOXGUESTR3EXE
+TEMPLATE_VBOXGUESTR3LIB_INST      = $(INST_ADDITIONS_LIB)
 if1of ($(KBUILD_TARGET), solaris) ## @todo r=bird: Fix the *R3Mini template to VBOXGUESTR3DLL and remove this hack.
- TEMPLATE_VBOXGUESTR3LIB_DEFS       = $(TEMPLATE_VBOXGUESTR3EXE_DEFS) PIC
- TEMPLATE_VBOXGUESTR3LIB_CFLAGS     = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fPIC
- TEMPLATE_VBOXGUESTR3LIB_CXXFLAGS   = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fPIC -fno-exceptions
+ TEMPLATE_VBOXGUESTR3LIB_DEFS     = $(TEMPLATE_VBOXGUESTR3EXE_DEFS) PIC
+ TEMPLATE_VBOXGUESTR3LIB_CFLAGS   = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fPIC
+ TEMPLATE_VBOXGUESTR3LIB_CXXFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fPIC -fno-exceptions
 endif
 
@@ -2674,24 +2663,22 @@
 # This mostly about zapping the VBOXR3EXE linker flags and libraries.
 #
-TEMPLATE_VBOXGUESTR3XF86MOD         = VBox Guest Program with C++ library dependencies
+TEMPLATE_VBOXGUESTR3XF86MOD       = VBox Guest Program with C++ library dependencies
 TEMPLATE_VBOXGUESTR3XF86MOD_EXTENDS = VBOXGUESTR3EXE
 TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TYPE)      = $(NO_SUCH_VARIABLE)
 TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TARGET)    = $(NO_SUCH_VARIABLE)
-TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.linux              = $(NO_SUCH_VARIABLE)
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE)
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TYPE)   = $(NO_SUCH_VARIABLE)
-TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.linux           = $(NO_SUCH_VARIABLE)
-TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS                 = -r
-if1of ($(KBUILD_TARGET), freebsd linux l4 netbsd openbsd) # the gnu ld guys.
+TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS          = -r
+if1of ($(KBUILD_TARGET), dragonfly freebsd linux netbsd openbsd) # the gnu ld guys.
  TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.release = -S
  TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.x86     = -m elf_i386
  TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.amd64   = -m elf_x86_64
 endif
-TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS   = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS)   -fno-merge-constants -std=c99
-TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fno-merge-constants
-TEMPLATE_VBOXGUESTR3XF86MOD_SYSSUFF  = .o
-TEMPLATE_VBOXGUESTR3XF86MOD_LIBS     = \
+TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS  = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS)   -fno-merge-constants -std=c99
+TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS= $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fno-merge-constants
+TEMPLATE_VBOXGUESTR3XF86MOD_SYSSUFF = .o
+TEMPLATE_VBOXGUESTR3XF86MOD_LIBS  = \
 	$(VBOX_LIB_VBGL_R3_XFREE86)
-TEMPLATE_VBOXGUESTR3XF86MOD_DEFS     = $(TEMPLATE_VBOXGUESTR3DLL_DEFS) LOG_TO_BACKDOOR
+TEMPLATE_VBOXGUESTR3XF86MOD_DEFS  = $(TEMPLATE_VBOXGUESTR3DLL_DEFS) LOG_TO_BACKDOOR
 
 
@@ -2700,12 +2687,11 @@
 # This mostly about zapping unnecessary LIBS from VBOXGUESTR3DLL and adding some flags.
 #
-TEMPLATE_VBOXGUESTR3XORGMOD         = VBox Guest Program with C++ library dependencies
+TEMPLATE_VBOXGUESTR3XORGMOD       = VBox Guest Program with C++ library dependencies
 TEMPLATE_VBOXGUESTR3XORGMOD_EXTENDS = VBOXGUESTR3DLL
-TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.$(KBUILD_TYPE)      = $(NO_SUCH_VARIABLE)
-TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.$(KBUILD_TARGET)    = $(NO_SUCH_VARIABLE)
-TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.linux              = $(NO_SUCH_VARIABLE)
+TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.$(KBUILD_TYPE)     = $(NO_SUCH_VARIABLE)
+TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.$(KBUILD_TARGET)   = $(NO_SUCH_VARIABLE)
 TEMPLATE_VBOXGUESTR3XORGMOD_CFLAGS                  = $(TEMPLATE_VBOXGUESTR3DLL_CFLAGS) -std=c99
 TEMPLATE_VBOXGUESTR3XORGMOD_DEFS = $(TEMPLATE_VBOXGUESTR3DLL_DEFS) LOG_TO_BACKDOOR
-if1of ($(KBUILD_TARGET), linux l4)
+if1of ($(KBUILD_TARGET), linux)
  TEMPLATE_VBOXGUESTR3XORGMOD_LDFLAGS = $(TEMPLATE_VBOXGUESTR3DLL_LDFLAGS) -s
 endif
@@ -2720,10 +2706,10 @@
 # (This is mostly about undoing what was done to C++ for VBOXGUESTR3EXE.)
 #
-TEMPLATE_VBOXGUESTR3CPPEXE         = VBox Guest Program with C++ library dependencies
-TEMPLATE_VBOXGUESTR3CPPEXE_EXTENDS = VBOXGUESTR3EXE
+TEMPLATE_VBOXGUESTR3CPPEXE           = VBox Guest Program with C++ library dependencies
+TEMPLATE_VBOXGUESTR3CPPEXE_EXTENDS   = VBOXGUESTR3EXE
 ifeq ($(KBUILD_TARGET),win)
  # later if necessary
 else
- TEMPLATE_VBOXGUESTR3CPPEXE_TOOL   = $(TEMPLATE_VBOXR3EXE_TOOL)
+ TEMPLATE_VBOXGUESTR3CPPEXE_TOOL     = $(TEMPLATE_VBOXR3EXE_TOOL)
  TEMPLATE_VBOXGUESTR3CPPEXE_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS)
 endif
@@ -2733,14 +2719,14 @@
 # Template for building R0 drivers for the guest additions.
 #
-TEMPLATE_VBOXGUESTR0            = VBox Guest Driver
-TEMPLATE_VBOXGUESTR0_EXTENDS    = VBOXR0DRV
-TEMPLATE_VBOXGUESTR0_INST       = $(INST_ADDITIONS)
+TEMPLATE_VBOXGUESTR0             = VBox Guest Driver
+TEMPLATE_VBOXGUESTR0_EXTENDS     = VBOXR0DRV
+TEMPLATE_VBOXGUESTR0_INST        = $(INST_ADDITIONS)
 TEMPLATE_VBOXGUESTR0_SDKS.win.x86   = WIN32SDK W2K3DDK
 TEMPLATE_VBOXGUESTR0_SDKS.win.amd64 = W2K3DDK WINPSDKINCS
 TEMPLATE_VBOXGUESTR0_LIBS.win.x86   = \
 	$(PATH_SDK_W2K3DDK_LIB)/int64.lib
-TEMPLATE_VBOXGUESTR0_DEFS       = $(TEMPLATE_VBOXR0DRV_DEFS) IN_GUEST IN_GUEST_R0
+TEMPLATE_VBOXGUESTR0_DEFS        = $(TEMPLATE_VBOXR0DRV_DEFS) IN_GUEST IN_GUEST_R0
 ifeq ($(KBUILD_TARGET),solaris) # No VBI for the guest additions yet.
- TEMPLATE_VBOXGUESTR0_LDFLAGS   = -r
+ TEMPLATE_VBOXGUESTR0_LDFLAGS    = -r
 endif
 
@@ -2748,7 +2734,7 @@
 # Template for building R0 libraries for the guest additions.
 #
-TEMPLATE_VBOXGUESTR0LIB         = VBox Guest Driver Libraries
-TEMPLATE_VBOXGUESTR0LIB_EXTENDS = VBOXGUESTR0
-TEMPLATE_VBOXGUESTR0LIB_INST    = $(INST_ADDITIONS_LIB)
+TEMPLATE_VBOXGUESTR0LIB          = VBox Guest Driver Libraries
+TEMPLATE_VBOXGUESTR0LIB_EXTENDS  = VBOXGUESTR0
+TEMPLATE_VBOXGUESTR0LIB_INST     = $(INST_ADDITIONS_LIB)
 
 
@@ -2757,17 +2743,17 @@
 #   The _MINI and _SHARED are both compiled as PIC and intended for linking into a .so/.dll/.dylib.
 #
-VBOX_LIB_IPRT_GUEST_R3          = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3$(VBOX_SUFF_LIB)
-VBOX_LIB_IPRT_GUEST_R3_MINI     = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3Mini$(VBOX_SUFF_LIB)
-VBOX_LIB_IPRT_GUEST_R0          = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR0$(VBOX_SUFF_LIB)
+VBOX_LIB_IPRT_GUEST_R3           = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3$(VBOX_SUFF_LIB)
+VBOX_LIB_IPRT_GUEST_R3_MINI      = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3Mini$(VBOX_SUFF_LIB)
+VBOX_LIB_IPRT_GUEST_R0           = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR0$(VBOX_SUFF_LIB)
 ifeq ($(KBUILD_TARGET_ARCH),x86)
- VBOX_LIB_IPRT_GUEST_R0_NT4     = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR0NT4$(VBOX_SUFF_LIB)
-else
- VBOX_LIB_IPRT_GUEST_R0_NT4     = $(VBOX_LIB_IPRT_GUEST_R0)
-endif
-VBOX_LIB_VBGL_R3                = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3Lib$(VBOX_SUFF_LIB)
-VBOX_LIB_VBGL_R3_XFREE86        = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3LibXFree86$(VBOX_SUFF_LIB)
-VBOX_LIB_VBGL_R3_SHARED         = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3LibShared$(VBOX_SUFF_LIB)
-VBOX_LIB_VBGL_R0BASE            = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR0LibBase$(VBOX_SUFF_LIB)
-VBOX_LIB_VBGL_R0                = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR0Lib$(VBOX_SUFF_LIB)
+ VBOX_LIB_IPRT_GUEST_R0_NT4      = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR0NT4$(VBOX_SUFF_LIB)
+else
+ VBOX_LIB_IPRT_GUEST_R0_NT4      = $(VBOX_LIB_IPRT_GUEST_R0)
+endif
+VBOX_LIB_VBGL_R3                 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3Lib$(VBOX_SUFF_LIB)
+VBOX_LIB_VBGL_R3_XFREE86         = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3LibXFree86$(VBOX_SUFF_LIB)
+VBOX_LIB_VBGL_R3_SHARED          = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3LibShared$(VBOX_SUFF_LIB)
+VBOX_LIB_VBGL_R0BASE             = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR0LibBase$(VBOX_SUFF_LIB)
+VBOX_LIB_VBGL_R0                 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR0Lib$(VBOX_SUFF_LIB)
 
 
Index: /trunk/src/VBox/Additions/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/Makefile.kmk	(revision 9641)
+++ /trunk/src/VBox/Additions/Makefile.kmk	(revision 9642)
@@ -2,17 +2,4 @@
 ## @file
 # Top-level makefile for the VirtualBox Guest Additions.
-#
-# Cross building of the additions is generally done by remote building
-# by means of smbfs, cifs, VBOX_ONLY_ADDITIONS=1 and setting KBUILD_TARGET
-# to the desired target.
-#
-# Limited support for cross building the windows additions using wine
-# is provided. There are a couple of issues with the approach (lack of
-# signing, no VC++ 8 support, ++) that makes it unsuitable for releases.
-#
-# Building the linux additions as part of the l4 build is ok because
-# l4 is built on a linux platform. This is why we have to check if
-# KBUILD_TARGET is l4 or linux in some places, though most of the magic
-# is done in the templates (Config.kmk).
 #
 
@@ -36,4 +23,13 @@
 include	$(KBUILD_PATH)/subheader.kmk
 
+#
+# Cross building of the additions is generally done by remote building
+# by means of smbfs, cifs, VBOX_ONLY_ADDITIONS=1 and setting KBUILD_TARGET
+# and KBUILD_TARGET_ARCH to the desired target and architecture.
+#
+# Limited support for cross building the windows additions using wine
+# is provided. There are a couple of issues with the approach (lack of
+# signing, no VC++ 8 support, ++) that makes it unsuitable for releases.
+#
 #
 # Note! VBOX_WITH_ADDITIONS is checked for by our parent makefile.
Index: /trunk/src/VBox/Additions/linux/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/linux/Makefile.kmk	(revision 9641)
+++ /trunk/src/VBox/Additions/linux/Makefile.kmk	(revision 9642)
@@ -24,10 +24,7 @@
 include	$(KBUILD_PATH)/subheader.kmk
 
-# This can only be built on a real Linux system.
-if1of ($(KBUILD_TARGET),linux l4)
- include $(PATH_SUB_CURRENT)/module/Makefile.kmk
- include $(PATH_SUB_CURRENT)/daemon/Makefile.kmk
- include $(PATH_SUB_CURRENT)/sharedfolders/Makefile.kmk
-endif
+include $(PATH_SUB_CURRENT)/module/Makefile.kmk
+include $(PATH_SUB_CURRENT)/daemon/Makefile.kmk
+include $(PATH_SUB_CURRENT)/sharedfolders/Makefile.kmk
 
 ifndef VBOX_OSE
@@ -39,5 +36,5 @@
 
 VBOX_PATH_LINUX_ADDITION_INSTALLER := $(PATH_SUB_CURRENT)/installer
-VBOX_PATH_X11_ADDITION_INSTALLER := $(PATH_ROOT)/src/VBox/Additions/x11/installer
+VBOX_PATH_X11_ADDITION_INSTALLER   := $(PATH_ROOT)/src/VBox/Additions/x11/installer
 
 include	$(KBUILD_PATH)/subfooter.kmk
Index: /trunk/src/VBox/Additions/x11/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/x11/Makefile.kmk	(revision 9641)
+++ /trunk/src/VBox/Additions/x11/Makefile.kmk	(revision 9642)
@@ -24,5 +24,5 @@
 
 # Include sub-makefiles.
-if1of ($(KBUILD_TARGET), freebsd l4 linux solaris)
+if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris)
  include $(PATH_SUB_CURRENT)/xclient/Makefile.kmk
  include $(PATH_SUB_CURRENT)/xgraphics/Makefile.kmk
Index: /trunk/src/VBox/Additions/x11/xgraphics/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/x11/xgraphics/Makefile.kmk	(revision 9641)
+++ /trunk/src/VBox/Additions/x11/xgraphics/Makefile.kmk	(revision 9642)
@@ -27,5 +27,5 @@
 # vboxvideo_drv
 #
-if1of ($(KBUILD_TARGET),linux l4)
+if1of ($(KBUILD_TARGET), linux)
  SYSMODS += vboxvideo_drv
  vboxvideo_drv_TEMPLATE = VBOXGUESTR3XF86MOD
@@ -103,5 +103,5 @@
 	vboxvideo_68.c \
 	vboxutils_68.c
-endif   # target linux, l4
+endif   # target linux
 
 
@@ -116,5 +116,5 @@
 DLLS += vboxvideo_drv_70
 vboxvideo_drv_70_TEMPLATE = VBOXGUESTR3XORGMOD
-if1of ($(KBUILD_TARGET), l4 linux)
+if1of ($(KBUILD_TARGET), linux)
  vboxvideo_drv_70_CFLAGS += \
 	-Wno-conversion -Wno-unused-parameter $(VBOX_GCC_Wno-variadic-macros) # template?
Index: /trunk/src/VBox/Additions/x11/xmouse/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/x11/xmouse/Makefile.kmk	(revision 9641)
+++ /trunk/src/VBox/Additions/x11/xmouse/Makefile.kmk	(revision 9642)
@@ -28,5 +28,5 @@
 # vboxmouse_drv
 #
-if1of ($(KBUILD_TARGET),linux l4)
+if1of ($(KBUILD_TARGET), linux)
  SYSMODS += vboxmouse_drv
  vboxmouse_drv_TEMPLATE = VBOXGUESTR3XF86MOD
