Skip to content

Commit

Permalink
x11-drivers/xf86-video-virtualbox-5.0.20: build kernel module with he…
Browse files Browse the repository at this point in the history
…lp of upstream Makefiles.

This commit builds on the prior work of Polynomial-C to compile vboxvideo.ko
using the upstream Makefile.module.kms.  A small patch is necessary to add a missing
include path to the build, and the rest of the changes are the addition of necessary
symlinks to allow the build to proceed.

Package-Manager: portage-2.2.26
  • Loading branch information
axs-gentoo committed May 3, 2016
1 parent 9ed0076 commit 9670bfc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/src/VBox/Additions/linux/drm/Makefile.module.kms 2016-04-28 09:08:06.000000000 -0400
+++ b/src/VBox/Additions/linux/drm/Makefile.module.kms 2016-05-03 15:11:22.134971872 -0400
@@ -38,7 +38,7 @@
MANGLING := $(KBUILD_EXTMOD)/include/VBox/VBoxGuestMangling.h
endif
MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(MANGLING)
-MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include)
+MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
# What on earth is this?
MOD_INCL += $(addprefix -I$(KBUILD_EXTMOD)/vboxvideo,/ /include)
MOD_INCL += -Iinclude/drm
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,19 @@ pkg_setup() {
}

src_prepare() {
# Prepare the vboxvideo_drm Makefiles
#cp "${FILESDIR}/Makefile.inc" "${MODULES_SRC_DIR}" || die
ln -s Makefile.module.kms "${MODULES_SRC_DIR}/Makefile" || die
#sed '/^include.*header/ainclude $(obj)/Makefile.inc' \
# -i "${MODULES_SRC_DIR}/Makefile.module.kms" || die
for incfile in Makefile.include.{head,foot}er ; do
ln -s "${S}/src/VBox/Installer/linux/${incfile}" \
"${MODULES_SRC_DIR}/${incfile}" || die
# Prepare the vboxvideo_drm Makefiles and build dir
eapply "${FILESDIR}"/${P}-Makefile.module.kms.patch
ln -sf Makefile.module.kms "${MODULES_SRC_DIR}"/Makefile || die
# All of these are expected to be in $(KBUILD_EXTMOD)/ so symlink them into place
local incfile incfiles=(
include
src/VBox/Runtime/r0drv
src/VBox/Installer/linux/Makefile.include.{head,foot}er
out/linux.${ARCH}/release/{product,version,revision}-generated.h
)
for incfile in ${incfiles[@]} ; do
ln -sf "${S}"/${incfile} \
"${MODULES_SRC_DIR}"/${incfile##*/} || die
done

# Remove shipped binaries (kBuild,yasm), see bug #232775
Expand Down Expand Up @@ -118,18 +123,14 @@ src_configure() {
}

src_compile() {
local targets=()

targets=(
local each targets=(
Runtime
Additions/common/VBoxGuestLib
GuestHost/OpenGL
Additions/x11/x11stubs
Additions/common/crOpenGL
Additions/x11/vboxvideo
#Additions/linux/drm
)

for each in ${targets[@]} ; do
pushd "${S}"/src/VBox/${each} $>/dev/null || die
MAKE="kmk" \
Expand All @@ -142,18 +143,18 @@ src_compile() {

if use dri ; then
local objdir="out/linux.${ARCH}/release/obj/vboxvideo_drv_system/src/VBox"
ln -s "${S}"/${objdir}/Additions/common/VBoxVideo/HGSMIBase.o \
${MODULES_SRC_DIR} || die
ln -s "${S}"/${objdir}/GuestHost/HGSMI/HGSMICommon.o \
${MODULES_SRC_DIR} || die
ln -s "${S}"/${objdir}/GuestHost/HGSMI/HGSMIMemAlloc.o \
${MODULES_SRC_DIR} || die
ln -s "${S}"/${objdir}/Runtime/common/alloc/heapoffset.o \
${MODULES_SRC_DIR} || die
ln -s "${S}"/${objdir}/Additions/common/VBoxVideo/Modesetting.o \
${MODULES_SRC_DIR} || die
ln -s "${S}"/${objdir}/Additions/common/VBoxVideo/VBVABase.o \
${MODULES_SRC_DIR} || die
# see the vboxvideo_drm_SOURCES list in Makefile.kmk for the below
targets=(
Additions/common/VBoxVideo/HGSMIBase.o
Additions/common/VBoxVideo/Modesetting.o
Additions/common/VBoxVideo/VBVABase.o
GuestHost/HGSMI/HGSMICommon.o
GuestHost/HGSMI/HGSMIMemAlloc.o
Runtime/common/alloc/heapoffset.o
)
for each in ${targets[@]} ; do
ln -sf "${S}"/${objdir}/${each} "${MODULES_SRC_DIR}"/${each##*/} || die
done

# Now creating the kernel modules. We must do this _after_
# we compiled the user-space tools as we need two of the
Expand Down

0 comments on commit 9670bfc

Please sign in to comment.