VirtualBox

Changeset 5234 in vbox


Ignore:
Timestamp:
Oct 11, 2007 10:38:58 AM (17 years ago)
Author:
vboxsync
Message:

improve kernel version check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/linux/Makefile

    r5227 r5234  
    6464# kernel base directory
    6565ifndef KERN_DIR
     66 # build for the current kernel, version check
    6667 KERN_DIR := /lib/modules/$(shell uname -r)/build
    6768 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
     
    7273  $(warning Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again.)
    7374 endif
     75 # check if versions match -- works only for later 2.6 kernels
     76 VBOX_KERN_VER := $(shell $(MAKE) -sC $(KERN_DIR) kernelrelease 2> /dev/null || true)
     77 ifneq ($(VBOX_KERN_VER),)
     78  ifneq ($(VBOX_KERN_VER),$(shell uname -r))
     79   $(error Error: /usr/src/linux (version $(VBOX_KERN_VER)) does not match the current kernel (version $(shell uname -r)))
     80  endif
     81 endif
    7482else
     83 # build for a dedicated kernel, no version check
    7584 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    7685  $(error Error: KERN_DIR does not point to a directory.)
     
    8695endif
    8796
    88 # module install dir.
     97# module install dir, only for current kernel
    8998ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
    9099 ifndef MODULE_DIR
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