* v4l-utils: rds-saa6588 doesn't compile if i2c-tools is installed
@ 2011-07-26 18:34 Frédéric L. W. Meunier
0 siblings, 0 replies; only message in thread
From: Frédéric L. W. Meunier @ 2011-07-26 18:34 UTC (permalink / raw)
To: linux-media
Not sure if it's the right place to report it.
At least here, v4l-utils doesn't compile if i2c-tools is installed,
because the latter installs a i2c-dev.h, like the kernel does with make
headers_install, but which is incompatible if used with i2c.h.
While rds-saa6588 isn't installed by default, it's compiled, and aborts:
In file included from rds-saa6588.c:16:0:
/usr/local/include/linux/i2c-dev.h:38:8: error: redefinition of 'struct i2c_msg'
/usr/include/linux/i2c.h:67:8: note: originally defined here
/usr/local/include/linux/i2c-dev.h:90:7: error: redefinition of 'union i2c_smbus_data'
/usr/include/linux/i2c.h:125:7: note: originally defined here
The same would happen if i2c-tools was installed in /usr, overwriting
the kernel header.
I think that a fix would be something like the following, which worked
in all scenarios for me:
diff -urN rds.old/Makefile rds/Makefile
--- rds.old/Makefile 2011-07-17 13:06:39.000000000 -0300
+++ rds/Makefile 2011-07-26 15:15:31.000000000 -0300
@@ -1,5 +1,7 @@
TARGETS = rds-saa6588
+override CPPFLAGS += -DLINUX_I2C_DEV_H
+
all: $(TARGETS)
-include *.d
diff -urN rds.old/rds-saa6588.c rds/rds-saa6588.c
--- rds.old/rds-saa6588.c 2011-07-17 13:06:39.000000000 -0300
+++ rds/rds-saa6588.c 2011-07-26 15:16:13.000000000 -0300
@@ -12,8 +12,12 @@
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/types.h>
+#ifdef LINUX_I2C_DEV_H
+#include <linux/i2c-dev.h>
+#else
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
+#endif
int debug;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-07-26 18:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-26 18:34 v4l-utils: rds-saa6588 doesn't compile if i2c-tools is installed Frédéric L. W. Meunier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.