From f8f8f24a5a496dba3903f00081d73ea59aa8ad02 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Mon, 25 Nov 2024 04:16:53 +0100 Subject: [PATCH] Move messages for libusb libusb_1_0 --- CMakeLists.txt | 8 ++++---- src/configure.ac | 35 +++++++++++++++++++---------------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b2b9813d..fabf73b1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,15 +411,15 @@ else() endif() if(HAVE_LIBUSB) - message(STATUS "DO HAVE libusb") + buildinfo_item("libusb" "DO HAVE") else() - message(STATUS "DON'T HAVE libusb") + buildinfo_item("libusb" "DON'T HAVE") endif() if(HAVE_LIBUSB_1_0) - message(STATUS "DO HAVE libusb_1_0") + buildinfo_item("libusb_1_0" "DO HAVE") else() - message(STATUS "DON'T HAVE libusb_1_0") + buildinfo_item("libusb_1_0" "DON'T HAVE") endif() if(HAVE_LIBHIDAPI) diff --git a/src/configure.ac b/src/configure.ac index 25d1bf6dd..32ed39bfb 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -213,6 +213,8 @@ AC_SUBST([LIBELF]) AC_SEARCH_LIBS([gethostent], [nsl]) AC_SEARCH_LIBS([setsockopt], [socket]) + + AH_TEMPLATE([HAVE_LIBUSB], [Define if USB support is enabled via libusb]) AC_CHECK_LIB([usb], [usb_get_string_simple], [have_libusb=yes]) @@ -232,6 +234,12 @@ if test "x$have_libusb" = xyes; then fi AC_SUBST([LIBUSB]) +AS_VAR_IF([have_libusb], [yes], [dnl + BUILDINFO_ITEM([libusb], [DO HAVE]) +], [dnl + BUILDINFO_ITEM([libusb], [DON'T HAVE]) +]) + AC_ARG_ENABLE( [libusb_1_0], AS_HELP_STRING([--disable-libusb_1_0], @@ -283,6 +291,17 @@ if test "x$have_libusb_1_0" = xyes && test "x$enabled_libusb_1_0" = xyes; then fi AC_SUBST([LIBUSB_1_0]) +AS_VAR_IF([have_libusb_1_0], [yes], [dnl + AS_VAR_IF([enabled_libusb_1_0], [yes], [dnl + BUILDINFO_ITEM([libusb_1_0], [DO HAVE]) + ], [dnl + BUILDINFO_ITEM([libusb_1_0], [DISABLED]) + ]) +], [dnl + BUILDINFO_ITEM([libusb_1_0], [DON'T HAVE]) +]) + + AH_TEMPLATE([HAVE_LIBHIDAPI], [Define if HID support is enabled via libhidapi]) AC_SEARCH_LIBS([hid_init], [hidapi hidapi-libusb hidapi-hidraw], @@ -737,22 +756,6 @@ echo "" echo "Configuration summary:" echo "----------------------" -if test "x$have_libusb" = xyes; then - echo "DO HAVE libusb" -else - echo "DON'T HAVE libusb" -fi - -if test "x$have_libusb_1_0" = xyes; then - if test "x$enabled_libusb_1_0" = xyes; then - echo "DO HAVE libusb_1_0" - else - echo "DISABLED libusb_1_0" - fi -else - echo "DON'T HAVE libusb_1_0" -fi - if test "x$have_libftdi1" = xyes; then echo "DO HAVE libftdi1" else