[PATCH v4 0/1] MR10279: configure.ac: fixes libusb detection on FreeBSD
This fixes libusb detection on FreeBSD. I don't have a simple program to test though, nor a specific peripheral that need such access. I haven't build on GNU/Linux, but I think that it should not be impacted (hopefully, the build cluster will tell us). -- v4: configure.ac: fixes libusb detection on FreeBSD https://gitlab.winehq.org/wine/wine/-/merge_requests/10279
From: Thibault Payet <contact@thibaultpayet.fr> --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d597bad3750..1b76df54445 100644 --- a/configure.ac +++ b/configure.ac @@ -1579,9 +1579,9 @@ WINE_NOTICE_WITH(sane,[test "$ac_cv_lib_sane_sane_init" != "yes"], dnl **** Check for libusb **** if test "x$with_usb" != "xno" then - WINE_PACKAGE_FLAGS(USB,[libusb-1.0],[-lusb-1.0],,, + WINE_PACKAGE_FLAGS(USB,[libusb-1.0],[-lusb-1.0],[-lusb],, [AC_CHECK_HEADER([libusb.h], - [AC_CHECK_LIB(usb-1.0,libusb_interrupt_event_handler,[:],[USB_LIBS=""],[$USB_LIBS])], + [AC_CHECK_FUNC(libusb_interrupt_event_handler,[ac_cv_lib_usb_1_0_libusb_interrupt_event_handler="yes"],[USB_LIBS=""])], [USB_LIBS=""])]) fi WINE_NOTICE_WITH(usb,[test "$ac_cv_lib_usb_1_0_libusb_interrupt_event_handler" != "yes"], -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10279
So I removed the platform checks and used AC_CHECK_FUNC instead. I still had to add an optional -lusb for WINE_PACKAGE_FLAGS, but I guess since it is already using pkg-config to check stuff, this should works on Linux too. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10279#note_142914
Do we really need the -lusb part? If pkg-config is working it shouldn't be necessary, and if it's not I'm nervous it'd potentially break things. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10279#note_142915
Without the -lusb it does not seems to works, here the output from the log: ``` configure:17995: libusb-1.0 cflags: configure:17996: libusb-1.0 libs: -lusb configure:18006: checking for libusb.h configure:18006: gcc14 -std=gnu23 -m64 -c -O2 -pipe -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gc c14 -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include conftest.c >&5 configure:18006: $? = 0 configure:18006: result: yes configure:18009: checking for libusb_interrupt_event_handler configure:18009: gcc14 -std=gnu23 -m64 -o conftest -O2 -pipe -fstack-protector-strong -Wl,-rpath=/usr/loc al/lib/gcc14 -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -Wl,-rpath=/u sr/local/lib/gcc14 -L/usr/local/lib/gcc14 conftest.c -L/usr/local/lib >&5 /usr/local/bin/ld: /tmp//ccACD5OE.o: in function `main': conftest.c:(.text.startup+0x5): undefined reference to `libusb_interrupt_event_handler' collect2: error: ld returned 1 exit status configure:18009: $? = 1 ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10279#note_142916
Shouldn't we be doing the AC_CHECK_FUNC with the library that pkg-config gave us? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10279#note_142917
participants (3)
-
Elizabeth Figura (@zfigura) -
Thibault Payet -
Thibault Payet (@thpayet)