Skip to content

Commit 9ef8727

Browse files
committed
m4/nut_check_libmodbus.m4: make it visible when some libmodbus is found, but does not support libusb while we want it (and will fail NUT configure later) [networkupstools#2063]
Signed-off-by: Jim Klimov <[email protected]>
1 parent 9fae2f6 commit 9ef8727

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

m4/nut_check_libmodbus.m4

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ if test -z "${nut_have_libmodbus_seen}"; then
7272
AC_CHECK_FUNCS(modbus_set_byte_timeout, [], [nut_have_libmodbus=no])
7373
AC_CHECK_FUNCS(modbus_set_response_timeout, [], [nut_have_libmodbus=no])
7474
75-
AC_CHECK_FUNCS(modbus_new_rtu_usb, [nut_have_libmodbus_usb=yes], [nut_have_libmodbus_usb=no])
75+
AC_CHECK_FUNCS(modbus_new_rtu_usb, [nut_have_libmodbus_usb=yes], [
76+
AS_IF([test x"${nut_with_usb}" = xyes && test x"${nut_with_modbus}" = xyes && test x"${nut_have_libmodbus}" = xyes ], [
77+
AC_MSG_WARN([Both --with-modbus and --with-usb were requested, and a libmodbus was found, but it seems to not support USB. You may require a custom build per https://github.com/networkupstools/nut/wiki/APC-UPS-with-Modbus-protocol])
78+
])
79+
nut_have_libmodbus_usb=no
80+
])
7681
7782
dnl modbus_set_byte_timeout() and modbus_set_response_timeout()
7883
dnl in 3.0.x and 3.1.x have different args (since ~2013): the

0 commit comments

Comments
 (0)