aboutsummaryrefslogtreecommitdiff
path: root/utils/collectd/patches/600-fix-libmodbus-detection.patch
blob: ff03547ddc1d1f904ec34eb66c7e095f89337bfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Patch reverts upstream commit:
https://github.com/collectd/collectd/commit/6124da7a48f28f54fc09ebeb942d1037516fe6ab

The commit changed the detection path due to FreeBSD issues,
but apparently affects also Openwrt buildroot negatively.

Original explanation:
  From 6124da7a48f28f54fc09ebeb942d1037516fe6ab Mon Sep 17 00:00:00 2001
  Subject: [PATCH] Fix libmodbus detection on FreeBSD

  We look for modbus/modbus.h in /usr/local/include/modbus
  but we should look for modbus.h

  This is only an issue on FreeBSD since /usr/local/include is not
  in the default search path.

Reversed patch to be applied:

--- a/configure.ac
+++ b/configure.ac
@@ -3385,9 +3385,9 @@ if test "x$with_libmodbus" = "xyes"; the
   SAVE_CPPFLAGS="$CPPFLAGS"
   CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
 
-  AC_CHECK_HEADERS([modbus.h],
+  AC_CHECK_HEADERS([modbus/modbus.h],
     [with_libmodbus="yes"],
-    [with_libmodbus="no (modbus.h not found)"]
+    [with_libmodbus="no (modbus/modbus.h not found)"]
   )
 
   CPPFLAGS="$SAVE_CPPFLAGS"
--- a/src/modbus.c
+++ b/src/modbus.c
@@ -26,7 +26,7 @@
 #include "plugin.h"
 #include "utils/common/common.h"
 
-#include <modbus.h>
+#include <modbus/modbus.h>
 #include <netdb.h>
 #include <sys/socket.h>