Stuff to get rid of the LM_SENSORS define

Until now, all installed include files depended on a #defined variable
LM_SENSORS: if it was defined, other files were included as "somefile.h"
instead of <linux/somefile.h>. This was clearly dangerous, and is fixed
now, by automatically deleting the offending lines from the include file
when it is installed.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@180 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Frodo Looijaard committed 1999-01-28 15:36:01 +00:00
1 parent f31a1f45f2
commit face12a534
8 files changed
+60 -21

No files matched your search

+14 -3
View File
@@ -20,10 +20,21 @@
# verbatim in the rules, until it is redefined.
MODULE_DIR := kernel/include
KERNELINCLUDEHEADERFILES := $(MODULE_DIR)/sensors.h $(MODULE_DIR)/isa.h \
$(MODULE_DIR)/smbus.h $(MODULE_DIR)/i2c-dev.h
KERNELINCLUDEFILES := $(MODULE_DIR)/sensors.h $(MODULE_DIR)/isa.h \
$(MODULE_DIR)/smbus.h $(MODULE_DIR)/i2c-dev.h
install-all-kernel-include:
$(MKDIR) $(SYSINCLUDEDIR)
$(INSTALL) -o root -g root -m 644 $(SRCHEADERFILES) $(SYSINCLUDEDIR)
for file in $(KERNELINCLUDEFILES) ; do \
$(RM) $$file.install; \
$(GREP) -v '/\* TBD \*/' $$file > $$file.install; \
$(INSTALL) -o root -g root -m 644 $$file.install \
$(SYSINCLUDEDIR)/`basename $$file`; \
$(RM) $$file.install; \
done
install :: install-all-kernel-include
clean-all-kernel-include:
$(RM) $(KERNELINCLUDEFILES:.h=.h.install)
clean :: clean-all-kernel-include
+10 -5
View File
@@ -18,16 +18,21 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Important note: */ /* TBD */
/* Lines like these, with the 'TBD' remark (To Be Deleted) */ /* TBD */
/* WILL BE DELETED when this file is installed. */ /* TBD */
/* This allows us to get rid of the ugly LM_SENSORS define */ /* TBD */
#ifndef SENSORS_I2C_DEV_H
#define SENSORS_I2C_DEV_H
#ifdef LM_SENSORS
#include "i2c.h"
#include "smbus.h"
#else /* ndef LM_SENSORS */
#ifdef LM_SENSORS /* TBD */
#include "i2c.h" /* TBD */
#include "smbus.h" /* TBD */
#else /* ndef LM_SENSORS */ /* TBD */
#include <linux/i2c.h>
#include <linux/smbus.h>
#endif /* def LM_SENSORS */
#endif /* def LM_SENSORS */ /* TBD */
#include <linux/types.h>
+10 -4
View File
@@ -18,6 +18,12 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Important note: */ /* TBD */
/* Lines like these, with the 'TBD' remark (To Be Deleted) */ /* TBD */
/* WILL BE DELETED when this file is installed. */ /* TBD */
/* This allows us to get rid of the ugly LM_SENSORS define */ /* TBD */
#ifndef SENSORS_SENSOR_H
#define SENSORS_SENSOR_H
@@ -36,11 +42,11 @@
#include <asm/semaphore.h>
#endif
#ifdef LM_SENSORS
#include "i2c.h"
#else /* ndef LM_SENSORS */
#ifdef LM_SENSORS /* TBD */
#include "i2c.h" /* TBD */
#else /* ndef LM_SENSORS */ /* TBD */
#include <linux/i2c.h>
#endif /* def LM_SENSORS */
#endif /* def LM_SENSORS */ /* TBD */
/* Note that this driver is *not* built upon smbus.c, but is parallel to it.
We do not need SMBus facilities if we are on the ISA bus, after all */
-1
View File
@@ -18,7 +18,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* This is a stub files, that either includes <linux/i2c.h> (the kernel
header) or "i2c/i2c.h" (the header in the i2c directory). */
+10 -4
View File
@@ -18,6 +18,12 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Important note: */ /* TBD */
/* Lines like these, with the 'TBD' remark (To Be Deleted) */ /* TBD */
/* WILL BE DELETED when this file is installed. */ /* TBD */
/* This allows us to get rid of the ugly LM_SENSORS define */ /* TBD */
#ifndef SENSORS_SENSOR_H
#define SENSORS_SENSOR_H
@@ -36,11 +42,11 @@
#include <asm/semaphore.h>
#endif
#ifdef LM_SENSORS
#include "i2c.h"
#else /* ndef LM_SENSORS */
#ifdef LM_SENSORS /* TBD */
#include "i2c.h" /* TBD */
#else /* ndef LM_SENSORS */ /* TBD */
#include <linux/i2c.h>
#endif /* def LM_SENSORS */
#endif /* def LM_SENSORS */ /* TBD */
/* Note that this driver is *not* built upon smbus.c, but is parallel to it.
We do not need SMBus facilities if we are on the ISA bus, after all */
+6
View File
@@ -18,6 +18,12 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Important note: */ /* TBD */
/* Lines like these, with the 'TBD' remark (To Be Deleted) */ /* TBD */
/* WILL BE DELETED when this file is installed. */ /* TBD */
/* This allows us to get rid of the ugly LM_SENSORS define */ /* TBD */
#ifndef SENSORS_SENSORS_H
#define SENSORS_SENSORS_H
+9 -4
View File
@@ -18,6 +18,11 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Important note: */ /* TBD */
/* Lines like these, with the 'TBD' remark (To Be Deleted) */ /* TBD */
/* WILL BE DELETED when this file is installed. */ /* TBD */
/* This allows us to get rid of the ugly LM_SENSORS define */ /* TBD */
#ifndef SENSORS_SMBUS_H
#define SENSORS_SMBUS_H
@@ -56,11 +61,11 @@ union smbus_data {
#include <asm/semaphore.h>
#endif
#ifdef LM_SENSORS
#include "i2c.h"
#else
#ifdef LM_SENSORS /* TBD */
#include "i2c.h" /* TBD */
#else /* TBD */
#include <linux/i2c.h>
#endif
#endif /* TBD */
/* Declarations, to keep the compiler happy */
struct smbus_driver;