VirtualBox

Changeset 78446 in vbox


Ignore:
Timestamp:
May 8, 2019 10:57:05 AM (6 years ago)
Author:
vboxsync
Message:

Installer/Linux: remove last uses of KBUILD_EXTMOD to simplify building in-tree.
Currently we use the Make variable KBUILD_EXTMOD to distinguish between builds
inside the Linux kernel kbuild system and outside of it. However, if our
kernel modules are build inside a kernel tree as part of a kernel build this
does not work, as they are no longer external modules. So replace those
checks with checks against KERNELRELEASE, and remove other uses of the
variable while we are at it. Said other uses are inside the host module
top-level Make file. I am not actually aware of any users of this file,
though if we ever build those modules as part of a kernel build it might be
useful.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/Makefile

    r77956 r78446  
    1515#
    1616
    17 ifneq ($(KBUILD_EXTMOD),)
     17ifneq ($(KERNELRELEASE),)
    1818
    19 # Building from kBuild (make -C <kernel_directory> M=`pwd`).
    20 # KBUILD_EXTMOD is set to $(M) in this case.
     19# Building from kBuild (make -C <kernel_directory> M=`pwd`)
     20# or inside a kernel source tree.
    2121
    2222obj-m = vboxguest/ vboxsf/ vboxvideo/
    2323
    24 else # ! KBUILD_EXTMOD
     24else # ! KERNELRELEASE
    2525
    2626KBUILD_VERBOSE =
     
    108108.PHONY: vboxguest vboxsf vboxvideo all install clean check load
    109109
    110 endif # ! KBUILD_EXTMOD
     110endif # ! KERNELRELEASE
  • trunk/src/VBox/HostDrivers/linux/Makefile

    r76553 r78446  
    2424#
    2525
    26 ifneq ($(KBUILD_EXTMOD),)
     26ifneq ($(KERNELRELEASE),)
    2727
    28 # Building from kBuild (make -C <kernel_directory> M=`pwd`).
    29 # KBUILD_EXTMOD is set to $(M) in this case.
     28# Building from kBuild (make -C <kernel_directory> M=`pwd`),
     29# or inside a kernel source tree.
    3030
    3131obj-m = vboxdrv/
    32 ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetflt/Makefile),)
     32ifneq ($(wildcard $(CURDIR)/vboxnetflt/Makefile),)
    3333 obj-m += vboxnetflt/
    3434endif
    35 ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetadp/Makefile),)
     35ifneq ($(wildcard $(CURDIR)/vboxnetadp/Makefile),)
    3636 obj-m += vboxnetadp/
    3737endif
    38 ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxpci/Makefile),)
     38ifneq ($(wildcard $(CURDIR)/vboxpci/Makefile),)
    3939 obj-m += vboxpci/
    4040endif
    4141
    42 else # ! KBUILD_EXTMOD
     42else # ! KERNELRELEASE
    4343
    44 # convenience Makefile without KBUILD_EXTMOD
     44# convenience Makefile without KERNELRELEASE
    4545
    4646KBUILD_VERBOSE ?=
     
    147147        done
    148148
    149 endif # ! KBUILD_EXTMOD
     149endif # ! KERNELRELEASE
  • trunk/src/VBox/Installer/linux/Makefile-header.gmk

    r77740 r78446  
    188188INSTALL_MOD_DIR ?= misc
    189189MODULE_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KERN_VER)/$(INSTALL_MOD_DIR)
    190 
    191 #
    192 # The KBUILD_EXTMOD variable is used by 2.6.6 and later when build external
    193 # modules (see https://lwn.net/Articles/79984/).  It will be set to SUBDIRS
    194 # or M by the linux kernel makefile.  We fake it here for older kernels.
    195 #
    196 ## @todo Drop this KBUILD_EXTMOD glue once it has been removed from all our makefiles (see sharedfolders).
    197 ifndef CURDIR # for make < v3.79
    198  CURDIR := $(shell pwd)
    199 endif
    200 ifndef KBUILD_EXTMOD
    201  KBUILD_EXTMOD := $(CURDIR)
    202 endif
    203 
    204190
    205191# For VBOX_GCC_CHECK_CC
     
    240226$(warning dbg: KERN_VERSION     = $(KERN_VERSION))
    241227$(warning dbg: MODULE_DIR       = $(MODULE_DIR))
    242 $(warning dbg: KBUILD_EXTMOD    = $(KBUILD_EXTMOD))
    243228$(warning dbg: VBOX_MODULE_SRC_DIR = $(VBOX_MODULE_SRC_DIR))
    244229 endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette