Help with configure.ac rule wanted

André Hentschel nerv at dawncrow.de
Tue Dec 22 11:49:31 CST 2015


Am 22.12.2015 um 18:35 schrieb Uwe Bonnes:
>>>>>> "Austin" == Austin English <austinenglish at gmail.com> writes:
> 
> 
>     Austin> It would be helpful if you shared your previous patch / what
>     Austin> you've tried that doesn't work.
> 
> Rule used so long:
> dnl **** Check for LIBUSB ****
> AC_SUBST(USBLIBS,"")
> AC_SUBST(USBINCL,"")
> if test "x$with_usb" != "xno"
> then
>     AC_CHECK_HEADERS([usb.h],
>         AC_CHECK_LIB(usb, usb_init,
>             [AC_DEFINE(HAVE_LIBUSB, 1, [Define if you have the libusb library and header])
>              USBLIBS="-lusb"]))
>     ac_save_CPPFLAGS="$CPPFLAGS"
>     if test "$PKG_CONFIG" != "false"
>     then
>         ac_usb_incl="`$PKG_CONFIG --cflags libusb-1.0`"
>         ac_usb_libs="`$PKG_CONFIG --libs libusb-1.0`"
>         CPPFLAGS="$ac_usb_incl $CPPFLAGS"
>     fi
>     AC_CHECK_HEADERS([libusb.h],
>         AC_CHECK_LIB(usb-1.0, libusb_init,
>             [AC_DEFINE(HAVE_LIBUSB, 1, [Define if you have the libusb library and header])
>              USBLIBS="$ac_usb_libs"
>              USBINCL="$ac_usb_incl"]))
>     CPPFLAGS="$ac_save_CPPFLAGS"
> fi
> WINE_NOTICE_WITH(usb,[test "x$ac_cv_lib_usb_usb_init" != "xyes" -a "x$ac_cv_lib_usb_1_0_libusb_init" != "xyes"],
>                  [libusb ${notice_platform}development files not found, USB won't be supported.])
> 
> What I tried last:
> 
> dnl **** Check for LIBUSB ****
> if test "x$with_usb" != "xno"
> then
>     WINE_PACKAGE_FLAGS(USB,[libusb-1.0],,,,
>         [AC_CHECK_HEADERS([libusb-1.0/usb.h])
>         if test "$ac_cv_header_usb_h" = "yes"
>         then
>             WINE_CHECK_SONAME(usb-1.0, libusb_init,,[USB_CFLAGS=""],[$USB_LIBS])
>         else
>             USB_CFLAGS=""
>         fi])
> fi
> 
> Cheers
> 


Hi,
This works fine here:

dnl **** Check for libusb ****
if test "x$with_usb" != "xno"
then
    WINE_PACKAGE_FLAGS(USB,[usb-1.0],,,,
        [AC_CHECK_HEADER([usb.h],
            [WINE_CHECK_SONAME(usb-1.0, libusb_init,,[USB_CFLAGS=""],[$USB_LIBS])],
            [USB_CFLAGS=""])])
fi

(note that you need to run autoconf and autoheader after you did your changes)



More information about the wine-devel mailing list