commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11473 - gnuradio/branches/developers/michaelld/libusb


From: michaelld
Subject: [Commit-gnuradio] r11473 - gnuradio/branches/developers/michaelld/libusb_darwin/config
Date: Fri, 24 Jul 2009 13:01:36 -0600 (MDT)

Author: michaelld
Date: 2009-07-24 13:01:36 -0600 (Fri, 24 Jul 2009)
New Revision: 11473

Modified:
   gnuradio/branches/developers/michaelld/libusb_darwin/config/usrp_libusb.m4
Log:
Removed legacy code for non-PKGCONFIG checking of LIBUSB.

Changed PKG_CONFIG displayed check name to "LIBUSB", from just "USB"
... but the Makefile-internal name will still be "USB".

Checks the version of LIBUSB to see if it is 1.0-compat or legacy
(0.1.10+).  If the former, then LIBUSB cannot be used; USRP requires
the legacy version.

Works on OSX 10.5, but should be cross-OS compatible.



Modified: 
gnuradio/branches/developers/michaelld/libusb_darwin/config/usrp_libusb.m4
===================================================================
--- gnuradio/branches/developers/michaelld/libusb_darwin/config/usrp_libusb.m4  
2009-07-24 15:12:15 UTC (rev 11472)
+++ gnuradio/branches/developers/michaelld/libusb_darwin/config/usrp_libusb.m4  
2009-07-24 19:01:36 UTC (rev 11473)
@@ -1,4 +1,4 @@
-dnl Copyright 2003,2008 Free Software Foundation, Inc.
+dnl Copyright 2003,2008,2009 Free Software Foundation, Inc.
 dnl 
 dnl This file is part of GNU Radio
 dnl 
@@ -19,28 +19,20 @@
 
 AC_DEFUN([USRP_LIBUSB], [
     libusbok=yes
-    PKG_CHECK_MODULES(USB, libusb, [], [
-        AC_LANG_PUSH(C)
-
-       AC_CHECK_HEADERS([usb.h], [], [libusbok=no; AC_MSG_RESULT([USRP 
requires libusb. usb.h not found. See http://libusb.sf.net])])
-
-       save_LIBS="$LIBS"
-       case "$host_os" in
-         darwin*)
-           LIBS="$LIBS -lIOKit"
-            ;;
-         *) ;;
-        esac
-
-       AC_SEARCH_LIBS(usb_bulk_write, [usb], [USB_LIBS="$LIBS"], [libusbok=no; 
AC_MSG_RESULT([USRP requires libusb. usb_bulk_write not found. See 
http://libusb.sf.net])])
-
-        LIBS="$save_LIBS"
-
-        AC_LANG_POP
-    ])
-
+    PKG_CHECK_MODULES(LIBUSB, libusb, [
+        dnl libusb.pc exists; check to see what type (legacy, or
+       dnl 1.0-compat) via the 'emulated' variable: exists in
+       dnl 1.0-compat, but not in legacy.
+       AC_MSG_CHECKING([if LIBUSB version is 1.0-compat or legacy (0.1.12)])
+        if test x`$PKG_CONFIG --variable=emulated libusb` = x; then
+           AC_MSG_RESULT([legacy])
+           libusbok=yes
+       else
+           AC_MSG_RESULT([1.0-compat])
+           libusbok=no
+       fi], [libusbok=no])
     if test x$libusbok = xyes; then
-        AC_SUBST(USB_LIBS)
+        AC_SUBST(USB_LIBS, $LIBUSB_LIBS)
        ifelse([$1], , :, [$1])
     else
         ifelse([$2], , :, [$2])





reply via email to

[Prev in Thread] Current Thread [Next in Thread]