configure: barometer: fix i2c lib usage for 4.0
authorAndreas Hasenack <andreas.hasenack@canonical.com>
Sat, 6 Apr 2019 12:21:09 +0000 (13:21 +0100)
committerChris Hofstaedtler <zeha@debian.org>
Sat, 6 Apr 2019 12:21:09 +0000 (13:21 +0100)
Forwarded: https://github.com/collectd/collectd/issues/2646
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1742691
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886920
Last-Update: 2018-02-21

Gbp-Pq: Name i2c_detection.patch

Makefile.am
configure.ac
src/barometer.c

index 2ef24427cd28173aaa0d2e7449a024cca90acc07..5b4873502566f48f69b606fadfdee2c9875dc65e 100644 (file)
@@ -599,7 +599,7 @@ if BUILD_PLUGIN_BAROMETER
 pkglib_LTLIBRARIES += barometer.la
 barometer_la_SOURCES = src/barometer.c
 barometer_la_LDFLAGS = $(PLUGIN_LDFLAGS)
-barometer_la_LIBADD = -lm
+barometer_la_LIBADD = -lm -li2c
 endif
 
 if BUILD_PLUGIN_BATTERY
index f39096e7c27e114d0f0fea231ea84b041d47aeb6..9ddb1c7baf31019269736845512c3524f7bbf94d 100644 (file)
@@ -1883,7 +1883,7 @@ if test "x$ac_system" = "xLinux"; then
     [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
     [[
       #include <stdlib.h>
-      #include <linux/i2c-dev.h>
+      #include <i2c/smbus.h>
     ]]
   )
 else
index f698005cac4413e2be8a46ed7802daccb70ce596..e3d418d2a4eb6593e8789b8b39b3ac8610119c02 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <fcntl.h>
 #include <linux/i2c-dev.h>
+#include <i2c/smbus.h>
 #include <math.h>
 #include <stdint.h>
 #include <sys/ioctl.h>