From 2ae24a97eda6d454fd7fc49863652759fff2392c Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 12 Nov 2007 13:43:50 +0000 Subject: [PATCH] Makefile: Revert changeset 4738, fix bug #2187 differently. The original fix was breaking the build for non-current kernels, or at least making it more difficult than before. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5018 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + Makefile | 12 +++++------- etc/config.c | 5 ++++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index b039178e..4928727a 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ lm_sensors CHANGES file SVN-HEAD Library: Fix fschrc and fschmd support + Makefile: Revert changeset 4738, fix bug #2187 differently Program decode-dimms.pl: Fix DDR2 SDRAM module speed decoding Update manufacturer IDs. Program sensors: Hide spurious errors on missing f71872f voltage inputs diff --git a/Makefile b/Makefile index 7eff04d5..2639951f 100644 --- a/Makefile +++ b/Makefile @@ -83,10 +83,8 @@ 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 -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 +KERNELVERSION := $(shell $(CC) -I$(LINUX_HEADERS) -E etc/config.c | grep uts_release | cut -f 2 -d'"') +MODPREF := /lib/modules/$(KERNELVERSION) # 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 @@ -94,7 +92,7 @@ endif # 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., /$(KERNELVERSION))) +ifeq (,$(findstring /2.4., $(MODPREF))) SYSFS_SUPPORT := 1 else SYSFS_SUPPORT := @@ -102,7 +100,7 @@ endif #SYSFS_SUPPORT := 1 # Prevent 2.6+ users from using improper targets, as this won't work. -ifeq (,$(findstring /2.4., /$(KERNELVERSION))) +ifeq (,$(findstring /2.4., $(MODPREF))) ifeq (, $(MAKECMDGOALS)) $(error For 2.6 kernels and later, use "make user") endif @@ -322,7 +320,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 $(UTSRELEASE) ; \ + /sbin/depmod -a -F $(MODPREF)/build/System.map $(KERNELVERSION) ; \ fi else @echo "*** This is a \`staged' install using \"$(DESTDIR)\" as prefix." diff --git a/etc/config.c b/etc/config.c index 52c5c88b..93800b86 100644 --- a/etc/config.c +++ b/etc/config.c @@ -5,7 +5,10 @@ * that contain multiple UTS_RELEASE definitions in version.h. * * Note: since kernel 2.6.17, the definition of UTS_RELEASE has - * moved to so this no longer works. + * moved to . */ #include +#ifndef UTS_RELEASE +#include +#endif char *uts_release=UTS_RELEASE;