From 9cb654d2b488f1a9f82e97aa4de48344d62ed45c Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Tue, 3 Nov 1998 02:05:49 +0000 Subject: [PATCH] Added CONFIG_MODVERSIONS magic The i2c modules now compile and insert without any problem. If I only had a VIA mainboard... git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6 7894878c-1315-0410-8ee3-d5d059ff63e0 --- Makefile | 14 ++++++++++++-- i2c/Module.mk | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index acb5dad2..bd7e1ef7 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,13 @@ -# Uncomment the second line on SMP systems if the magic invocation fails. +# Uncomment the third line on SMP systems if the magic invocation fails. +SMP := $(shell if grep -q '^SMP[[:space:]]*=' /usr/src/linux/Makefile; then echo 1; else echo 0; fi) #SMP := 0 #SMP := 1 -SMP := $(shell if grep -q '^SMP[[:space:]]*=' /usr/src/linux/Makefile; then echo 1; else echo 0; fi) + +# Uncomment the second or third line if the magic invocation fails. +# We need to know whether CONFIG_MODVERSIONS is defined. +MODVER := $(shell if cat /usr/include/linux/config.h /usr/include/linux/autoconf.h 2>/dev/null | grep -q '^[[:space:]]*\#define[[:space:]]*CONFIG_MODVERSIONS[[:space:]]*1'; then echo 1; else echo 0; fi) +#MODVER := 0 +#MODVER := 1 # Uncomment the second line if you do not want to compile the included # i2c modules. WARNING! If the i2c module version does not match the @@ -60,6 +66,10 @@ CFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \ -Wcast-align -Wwrite-strings -Wnested-externs -Winline endif +ifeq ($(MODVER),1) +CFLAGS += -DMODVERSIONS -include /usr/include/linux/modversions.h +endif + .PHONY: all clean install version package # Make all the default rule diff --git a/i2c/Module.mk b/i2c/Module.mk index 080aed1c..3d82d26d 100644 --- a/i2c/Module.mk +++ b/i2c/Module.mk @@ -14,7 +14,7 @@ all :: $(TARGETS) install :: $(TARGETS) $(MKDIR) $(MODDIR) - install -o root -g root -m 644 $(MODDIR) $(TARGETS) + install -o root -g root -m 644 $(TARGETS) $(MODDIR) clean :: $(RM) $(TARGETS) $(TARGETS:.o=.d)