Fix kernel version detection (#2187).

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4738 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-09-01 08:09:49 +00:00
1 parent e4ecbc9a90
commit f96dc0266f
3 files changed
+11 -5

No files matched your search

+1
View File
@@ -5,6 +5,7 @@ SVN HEAD
Library: Fix a memory leak on error
Speed up sensors_get_ignored() a bit
Fix thmc50 support for Linux 2.6
Makefile: Fix kernel version detection (#2187)
Module fscher: Add missing read of control register (2.6 backport)
Module i2c-piix4: Add ATI SB700 support (2.6 backport)
Module lm93: Fix an array overrun (2.6 backport)
+7 -5
View File
@@ -83,8 +83,10 @@ CC := gcc
# This is the main modules directory into which the modules will be installed.
# The magic invocation will return something like this:
# /lib/modules/2.4.29
KERNELVERSION := $(shell $(CC) -I$(LINUX_HEADERS) -E etc/config.c | grep uts_release | cut -f 2 -d'"')
MODPREF := /lib/modules/$(KERNELVERSION)
ifneq (,$(findstring /2.4., /$(KERNELVERSION)))
UTSRELEASE := $(shell $(CC) -I$(LINUX_HEADERS) -E etc/config.c | grep uts_release | cut -f 2 -d'"')
MODPREF := /lib/modules/$(UTSRELEASE)
endif
# When building userspace for use with 2.4.x series kernels, we turn off
# sysfs support by default. You can override this (e.g. if you want
@@ -92,7 +94,7 @@ MODPREF := /lib/modules/$(KERNELVERSION)
# by uncommenting the line after the next endif. Keep in mind, if and only
# if you do this: you will need to install the libsysfs libraries on your
# kernel 2.4.x systems also.
ifeq (,$(findstring /2.4., $(MODPREF)))
ifeq (,$(findstring /2.4., /$(KERNELVERSION)))
SYSFS_SUPPORT := 1
else
SYSFS_SUPPORT :=
@@ -100,7 +102,7 @@ endif
#SYSFS_SUPPORT := 1
# Prevent 2.6+ users from using improper targets, as this won't work.
ifeq (,$(findstring /2.4., $(MODPREF)))
ifeq (,$(findstring /2.4., /$(KERNELVERSION)))
ifeq (, $(MAKECMDGOALS))
$(error For 2.6 kernels and later, use "make user")
endif
@@ -320,7 +322,7 @@ all :: user
install :: all user_install
ifeq ($(DESTDIR),)
-if [ -r $(MODPREF)/build/System.map -a -x /sbin/depmod ] ; then \
/sbin/depmod -a -F $(MODPREF)/build/System.map $(KERNELVERSION) ; \
/sbin/depmod -a -F $(MODPREF)/build/System.map $(UTSRELEASE) ; \
fi
else
@echo "*** This is a \`staged' install using \"$(DESTDIR)\" as prefix."
+3
View File
@@ -3,6 +3,9 @@
* get the kernel version from <linux/version.h>.
* A simple grep doesn't work for Mandrake and Red Hat distributions
* that contain multiple UTS_RELEASE definitions in version.h.
*
* Note: since kernel 2.6.17, the definition of UTS_RELEASE has
* moved to <linux/utsrelease.h> so this no longer works.
*/
#include <linux/version.h>
char *uts_release=UTS_RELEASE;