void-packages/srcpkgs/virtualbox-ose/patches/013-Makefile.patch

61 lines
2.0 KiB
Diff

--- a/src/VBox/HostDrivers/linux/Makefile
+++ b/src/VBox/HostDrivers/linux/Makefile
@@ -33,25 +33,25 @@
# SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
#
-ifneq ($(KERNELRELEASE),)
+ifneq ($(KBUILD_EXTMOD),)
# Building from kBuild (make -C <kernel_directory> M=`pwd`),
-# or inside a kernel source tree.
+# KBUILD_EXTMOD is set to $(M) in this case.
obj-m = vboxdrv/
- ifneq ($(wildcard $(CURDIR)/vboxnetflt/Makefile),)
+ ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetflt/Makefile),)
obj-m += vboxnetflt/
endif
- ifneq ($(wildcard $(CURDIR)/vboxnetadp/Makefile),)
+ ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetadp/Makefile),)
obj-m += vboxnetadp/
endif
- ifneq ($(wildcard $(CURDIR)/vboxpci/Makefile),)
+ ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxpci/Makefile),)
obj-m += vboxpci/
endif
-else # ! KERNELRELEASE
+else # ! KBUILD_EXTMOD
-# convenience Makefile without KERNELRELEASE
+# convenience Makefile without KBUILD_EXTMOD
ifndef SUDO
ifneq ($(shell id -u),0)
@@ -133,7 +133,7 @@ install-vboxpci:
install: install-vboxdrv install-vboxnetflt install-vboxnetadp install-vboxpci
# Look for wrapper modules, sorting them so vmmr0 is first.
-VBOX_WRAPPER_DIRS := $(notdir $(wildcard $(CURDIR)/vbox_*))
+VBOX_WRAPPER_DIRS := $(notdir $(wildcard $(KBUILD_EXTMOD)/vbox_*))
ifneq ($(VBOX_WRAPPER_DIRS),)
VBOX_WRAPPER_DIRS := $(filter vbox_vmmr0,$(VBOX_WRAPPER_DIRS)) $(sort $(filter-out vbox_vmmr0,$(VBOX_WRAPPER_DIRS)))
endif
@@ -176,7 +176,7 @@ buildid:
buildid=`readelf -n $${module} | sed -ne 's/^.*Build ID: *\([[:xdigit:]][[:xdigit:]]\)\(.*\)$$/\1\/\2/p' `; \
if [ -n "$${buildid}" ]; then \
mkdir -p ~/.debug/.build-id/`dirname $${buildid}`; \
- ln -sfn -- "$(CURDIR)/$${module}" ~/.debug/.build-id/$${buildid}; \
+ ln -sfn -- "$(KBUILD_EXTMOD)/$${module}" ~/.debug/.build-id/$${buildid}; \
else \
echo "warning: No build ID for $${module}"; \
fi \
@@ -244,5 +244,5 @@ load: unload
fi; \
done
-endif # ! KERNELRELEASE
+endif # ! KBUILD_EXTMOD