[vbox-dev] my patches for VirtualBox-4.2.0 on Fedora 17+
Sérgio Basto
sergio at serjux.com
Thu Sep 27 13:54:09 PDT 2012
On Qui, 2012-09-27 at 14:52 +0200, Michael Thayer wrote:
> Hello Sérgio, Felix,
>
> On 09/26/2012 10:02 AM, Michael Thayer wrote:
> [...]
> > On 09/26/2012 05:13 AM, Sérgio Basto wrote:
> >> As you may know, when we packaging rpms in Fedora, we try remove
> >> sources bundle.
> >> I done with X11, removing src/VBox/Additions/x11/x11include and
> >> src/VBox/Additions/x11/x11stubs
> >> I don't want that you do that upstream, but I had to modify some source
> >> vboxmouse.c, fakedri_drv.c and VBoxGuestR3LibRuntimeXF86.cpp
> > Wouldn't it be more sensible just to include a build option upstream to
> > only build one module against the system headers? I'm not a fan of
> > downstream patches either, so I'm all for finding a way to make the
> > upstream code usable for you. I'll give it a bit of a think and post a
> > patch suggestion.
>
> Here it is. Comments welcome!
>
> Regards,
>
> Michael
>
> $ svn di src/VBox/Additions/x11/vboxvideo/Makefile.kmk
> src/VBox/Additions/x11/vboxmouse/Makefile.kmk
> Index: src/VBox/Additions/x11/vboxvideo/Makefile.kmk
> ===================================================================
> --- src/VBox/Additions/x11/vboxvideo/Makefile.kmk (revision 80959)
> +++ src/VBox/Additions/x11/vboxvideo/Makefile.kmk (working copy)
> @@ -21,7 +21,9 @@
> #
> # Include sub-makefile(s).
> #
> -include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
> +ifndef VBOX_USE_SYSTEM_XORG_HEADERS
> + include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
> +endif
>
> vboxvideo_70_DEFS := \
> IN_MODULE XORG_7X RENDER=1 IN_RT_STATIC
> @@ -320,10 +322,30 @@
> vboxvideo_drv_113_SOURCES := $(vboxvideo_drv_15_SOURCES)
>
>
> +ifdef VBOX_USE_SYSTEM_XORG_HEADERS
> + # Build using local X.Org headers. We assume X.Org Server 1.7 or later.
> + DLLS := $(filter-out vboxvideo_drv_%,$(DLLS)) vboxvideo_drv_system
> + SYSMODS := $(filter-out vboxvideo_drv%,$(SYSMODS))
> + vboxvideo_drv_system_TEMPLATE = VBOXGUESTR3XORGMOD
> + vboxvideo_drv_system_CFLAGS := \
> + $(vboxvideo_drv_70_CFLAGS) -include xorg-server.h
> + vboxvideo_drv_system_DEFS := $(vboxvideo_15_DEFS)
> + vboxvideo_drv_system_INCS += \
> + $(PATH_ROOT)/src/VBox/Runtime/include \
> + /usr/include/x11 \
> + /usr/include/X11/dri \
> + /usr/include/libdrm \
> + /usr/include/xorg \
> + /usr/include/pixman-1
> + vboxvideo_drv_system_SOURCES := $(vboxvideo_drv_15_SOURCES)
> +endif
> +
> +
> # Check the undefined symbols in the X.Org modules against lists of
> allowed
> # symbols. Not very elegant, but it will catch problems early.
> ifdef VBOX_WITH_TESTCASES
> # ifndef VBOX_ONLY_ADDITIONS
> + ifndef VBOX_USE_SYSTEM_XORG_HEADERS
> if1of ($(KBUILD_TARGET),linux solaris)
> ifeq ($(KBUILD_HOST_ARCH),$(KBUILD_TARGET_ARCH))
> ifndef VBOX_ONLY_SDK
> @@ -446,6 +468,7 @@
> endif # ! VBOX_ONLY_SDK
> endif # eq ($(KBUILD_HOST_ARCH),$(KBUILD_TARGET_ARCH))
> endif # eq ($(KBUILD_TARGET),linux)
> + endif # ! VBOX_USE_SYSTEM_XORG_HEADERS
> # endif # ! VBOX_ONLY_ADDITIONS
> endif # VBOX_WITH_TESTCASES
>
> Index: src/VBox/Additions/x11/vboxmouse/Makefile.kmk
> ===================================================================
> --- src/VBox/Additions/x11/vboxmouse/Makefile.kmk (revision 80959)
> +++ src/VBox/Additions/x11/vboxmouse/Makefile.kmk (working copy)
> @@ -238,10 +238,20 @@
>
> endif # neq ($(KBUILD_TARGET),linux)
>
> +
> +ifdef VBOX_USE_SYSTEM_XORG_HEADERS
> + # As vboxmouse_drv is not needed at all for X.Org Server 1.7 and later
> do not
> + # build it in this case.
> + DLLS := $(filter-out vboxmouse_drv_%,$(DLLS))
> + SYSMODS := $(filter-out vboxmouse_drv%,$(SYSMODS))
> +endif
> +
> +
> # Check the undefined symbols in the X.Org modules against lists of
> allowed
> # symbols. Not very elegant, but it will catch problems early.
> ifdef VBOX_WITH_TESTCASES
> # ifndef VBOX_ONLY_ADDITIONS
> + ifndef VBOX_USE_SYSTEM_XORG_HEADERS
> ifeq ($(KBUILD_TARGET),linux)
> ifeq ($(KBUILD_HOST_ARCH),$(KBUILD_TARGET_ARCH))
> ifndef VBOX_ONLY_SDK
> @@ -360,6 +370,7 @@
> endif # ! VBOX_ONLY_SDK
> endif # eq ($(KBUILD_HOST_ARCH),$(KBUILD_TARGET_ARCH))
> endif # eq ($(KBUILD_TARGET),linux)
> + endif # ! VBOX_USE_SYSTEM_XORG_HEADERS
> # endif # ! VBOX_ONLY_ADDITIONS
> endif # VBOX_WITH_TESTCASES
Hi,
Looks good to me
as a little side note, we have in
VirtualBox-4.2.0/src/VBox/Additions/x11/vboxvideo/Makefile.kmk :
vboxvideo_70_DEFS := IN_MODULE XORG_7X RENDER=1 IN_RT_STATIC
vboxvideo_13_DEFS := $(vboxvideo_70_DEFS) VBOXVIDEO_13
vboxvideo_15_DEFS := $(vboxvideo_13_DEFS) VBOX_DRI NO_ANSIC PCIACCESS
XSERVER_LIBPCIACCESS
vboxvideo_drv_70_DEFS = $(vboxvideo_70_DEFS)
XORG_VERSION_CURRENT=700000000
vboxvideo_drv_13_DEFS := $(vboxvideo_13_DEFS)
XORG_VERSION_CURRENT=100300000
what I mean when I want know what DEFS for vboxvideo_drv_113, I got to
follow all attributions ... and can't comment any ...
Isn't more simple to read
vboxvideo_13_DEFS := IN_MODULE XORG_7X RENDER=1 IN_RT_STATIC
VBOXVIDEO_13
vboxvideo_15_DEFS := IN_MODULE XORG_7X RENDER=1 IN_RT_STATIC
VBOXVIDEO_13 VBOX_DRI NO_ANSIC PCIACCESS XSERVER_LIBPCIACCESS
vboxvideo_drv_113_DEFS := IN_MODULE XORG_7X RENDER=1 IN_RT_STATIC
VBOXVIDEO_13 VBOX_DRI NO_ANSIC PCIACCESS XSERVER_LIBPCIACCESS
XORG_VERSION_CURRENT=101300000
well is just a suggestion, since you, in VirtualBox-4.2.0, already have
simplify this, with 3 base defs (
vboxvideo_70_DEFS , vboxvideo_13_DEFS and vboxvideo_15_DEFS ).
Thanks,
--
Sérgio M. B.
More information about the vbox-dev
mailing list