X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=config%2Fusrp_libusb.m4;h=251f7df10160f7e6a4963e62d1947fdd6df064f3;hb=refs%2Fheads%2Fmaster;hp=4347bfba3320c76c40ff494b1fdc1e27653935c6;hpb=52dcaf0d09f7a0a547dc287dca521ba855369de4;p=debian%2Fgnuradio diff --git a/config/usrp_libusb.m4 b/config/usrp_libusb.m4 old mode 100644 new mode 100755 index 4347bfba..251f7df1 --- a/config/usrp_libusb.m4 +++ b/config/usrp_libusb.m4 @@ -30,6 +30,7 @@ AC_DEFUN([USRP_LIBUSB], [ libusbok=no have_libusb1=no + LIBUSB_PKG_CONFIG_NAME='' if test x$1 = xyes; then PKG_CHECK_MODULES(USB, libusb-1.0, [ libusbok=yes @@ -37,6 +38,7 @@ AC_DEFUN([USRP_LIBUSB], [ usb_header='libusb-1.0/libusb.h' usb_lib_func='libusb_bulk_transfer' usb_lib_name='usb-1.0' + LIBUSB_PKG_CONFIG_NAME='libusb-1.0' ]) else dnl not using libusb1 (for now); see if legacy version is found. @@ -45,17 +47,24 @@ AC_DEFUN([USRP_LIBUSB], [ dnl user's shell environment dnl see if the pkgconfig module 'libusb' is available - PKG_CHECK_MODULES(USB, libusb, [libusbok=yes], [libusbok=no]) + PKG_CHECK_MODULES(USB, libusb, [ + libusbok=yes + LIBUSB_PKG_CONFIG_NAME='libusb' + ], [libusbok=no]) dnl PKG_CHECK_MODULES does not work correctly when embedded if test $libusbok = no; then dnl if not, see if the pkgconfig module 'libusb-legacy' is available - PKG_CHECK_MODULES(USB, [libusb-legacy], [libusbok=yes], [libusbok=no]) + PKG_CHECK_MODULES(USB, [libusb-legacy], [ + libusbok=yes + LIBUSB_PKG_CONFIG_NAME='libusb-legacy' + ], [libusbok=no]) fi dnl set variables for further testing usb_header='usb.h' usb_lib_func='usb_bulk_write' usb_lib_name='usb' fi + AC_SUBST(LIBUSB_PKG_CONFIG_NAME) if test x$1 != xyes || test $have_libusb1 = yes; then dnl Either (1) libusb1 was specified and found; or dnl (2) libusb1 was not specified. Restart checking. @@ -90,17 +99,24 @@ AC_DEFUN([USRP_LIBUSB], [ AC_LANG_PUSH(C) save_LIBS="$LIBS" + LIBS="" case "$host_os" in darwin*) USB_LIBS="$USB_LIBS -lIOKit" + LIBS="$USB_LIBS" ;; *) ;; esac - LIBS="$LIBS $USB_LIBS" AC_CHECK_LIB([$usb_lib_name], [$usb_lib_func], [], [ libusbok=no AC_MSG_RESULT([USRP requires library '$usb_lib_name' with function '$usb_lib_func', which was either not found or was not usable. See http://www.libusb.org]) ]) + case "$host_os" in + cygwin* | mingw*) + USB_LIBS="$LIBS" + ;; + *) ;; + esac LIBS="$save_LIBS" AC_LANG_POP(C) fi