From 7eb36a199a72c8f02570af990d98a51a322030b1 Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Fri, 30 May 2003 03:13:07 +0000 Subject: [PATCH] handle multiple UTS_RELEASE definitions in linux/version.h; as suggested by Mark Hoffman. Also revert -dirafter which doesn't work for gcc 2.95.2. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1739 7894878c-1315-0410-8ee3-d5d059ff63e0 --- Makefile | 10 ++++++---- etc/config.c | 8 ++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 etc/config.c diff --git a/Makefile b/Makefile index 490e9258..03b7a639 100644 --- a/Makefile +++ b/Makefile @@ -84,12 +84,13 @@ DESTDIR := # This is the prefix that will be used for almost all directories below. PREFIX := /usr/local -# This is the directory into which the modules will be installed. +# This is the main modules directory into which the modules will be installed. # The magic invocation will return something like this: -# /lib/modules/2.2.15-ac9/misc +# /lib/modules/2.2.15-ac9 #MODDIR := /lib/modules/`grep UTS_RELEASE $(LINUX_HEADERS)/linux/version.h|cut -f 2 -d'"'`/misc -MODPREF := /lib/modules/`grep UTS_RELEASE $(LINUX_HEADERS)/linux/version.h|cut -f 2 -d'"'` #MODPREF := /lib/modules/$(KERNELVERSION) +#MODPREF := /lib/modules/`grep UTS_RELEASE $(LINUX_HEADERS)/linux/version.h|cut -f 2 -d'"'` +MODPREF := /lib/modules/`$(CC) -I$(LINUX_HEADERS) -E etc/config.c | grep uts_release |cut -f 2 -d'"'` # This is the directory where sensors.conf will be installed, if no other # configuration file is found @@ -178,7 +179,8 @@ GREP := grep # PROGCPPFLAGS/PROGCFLAGS is to create non-kernel object files (which are linked into executables). # ARCPPFLAGS/ARCFLAGS are used to create archive object files (static libraries). # LIBCPPFLAGS/LIBCFLAGS are for shared library objects. -ALL_CPPFLAGS := -I. -Ikernel/include -I$(I2C_HEADERS) -idirafter $(LINUX_HEADERS) +#ALL_CPPFLAGS := -I. -Ikernel/include -I$(I2C_HEADERS) -idirafter $(LINUX_HEADERS) +ALL_CPPFLAGS := -I. -Ikernel/include -I$(I2C_HEADERS) -I$(LINUX_HEADERS) ALL_CFLAGS := -O2 ifeq ($(DEBUG),1) diff --git a/etc/config.c b/etc/config.c new file mode 100644 index 00000000..ddf790cc --- /dev/null +++ b/etc/config.c @@ -0,0 +1,8 @@ +/* + * This is used by the top-level makefile to automagically + * get the kernel version from . + * A simple grep doesn't work for Mandrake and Red Hat distributions + * that contain multiple UTS_RELEASE definitions in version.h. + */ +#include +char *uts_release=UTS_RELEASE;