b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | Patch reverts upstream commit: |
| 2 | https://github.com/collectd/collectd/commit/6124da7a48f28f54fc09ebeb942d1037516fe6ab |
| 3 | |
| 4 | The commit changed the detection path due to FreeBSD issues, |
| 5 | but apparently affects also Openwrt buildroot negatively. |
| 6 | |
| 7 | Original explanation: |
| 8 | From 6124da7a48f28f54fc09ebeb942d1037516fe6ab Mon Sep 17 00:00:00 2001 |
| 9 | Subject: [PATCH] Fix libmodbus detection on FreeBSD |
| 10 | |
| 11 | We look for modbus/modbus.h in /usr/local/include/modbus |
| 12 | but we should look for modbus.h |
| 13 | |
| 14 | This is only an issue on FreeBSD since /usr/local/include is not |
| 15 | in the default search path. |
| 16 | |
| 17 | Reversed patch to be applied: |
| 18 | |
| 19 | --- a/configure.ac |
| 20 | +++ b/configure.ac |
| 21 | @@ -3385,9 +3385,9 @@ if test "x$with_libmodbus" = "xyes"; the |
| 22 | SAVE_CPPFLAGS="$CPPFLAGS" |
| 23 | CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags" |
| 24 | |
| 25 | - AC_CHECK_HEADERS([modbus.h], |
| 26 | + AC_CHECK_HEADERS([modbus/modbus.h], |
| 27 | [with_libmodbus="yes"], |
| 28 | - [with_libmodbus="no (modbus.h not found)"] |
| 29 | + [with_libmodbus="no (modbus/modbus.h not found)"] |
| 30 | ) |
| 31 | |
| 32 | CPPFLAGS="$SAVE_CPPFLAGS" |
| 33 | --- a/src/modbus.c |
| 34 | +++ b/src/modbus.c |
| 35 | @@ -26,7 +26,7 @@ |
| 36 | #include "plugin.h" |
| 37 | #include "utils/common/common.h" |
| 38 | |
| 39 | -#include <modbus.h> |
| 40 | +#include <modbus/modbus.h> |
| 41 | #include <netdb.h> |
| 42 | #include <sys/socket.h> |
| 43 | |