Tweak LIBUSB m4 script to not check for 'usb_debug' symbol on Windows, because the...
authorMichael Dickens <mdickens@nd.edu>
Mon, 1 Nov 2010 19:57:52 +0000 (15:57 -0400)
committerTom Rondeau <trondeau@vt.edu>
Wed, 24 Nov 2010 04:56:30 +0000 (23:56 -0500)
config/usrp_libusb.m4

index a434d379ddfb3382e1d554a7a2eb2a5797210658..e4f567ce4d1c99406f12bd8507c3b5951b55cfff 100644 (file)
@@ -135,21 +135,28 @@ AC_DEFUN([USRP_LIBUSB], [
         if test $libusbok = yes; then
           if test ${libusb_name} != "libusb-1.0"; then
             dnl PKGCONFIG found a legacy version of libusb; make sure the
-            dnl variable _usb_debug is available in the found library
-            AC_LANG_PUSH(C)
-            save_CPPFLAGS="$CPPFLAGS"
-            CPPFLAGS="$USB_INCLUDES"
-            save_LIBS="$LIBS"
-            LIBS="$USB_LIBS"
-            AC_MSG_CHECKING([$libusb_name for symbol usb_debug in library $usb_lib_name])
-            AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-              extern int usb_debug;]],
-              [[usb_debug = 0;]])],
-              [libusbok=yes],[libusbok=no])
-            AC_MSG_RESULT([$libusbok])
-            LIBS="$save_LIBS"
-            CPPFLAGS="$save_CPPFLAGS"
-            AC_LANG_POP(C)
+            dnl variable _usb_debug is available in the found library.
+           dnl Do not test on Windows, since that symbol is not defined.
+            case "$host_os" in
+              cygwin* | mingw*)
+              ;;
+            *)
+              AC_LANG_PUSH(C)
+              save_CPPFLAGS="$CPPFLAGS"
+              CPPFLAGS="$USB_INCLUDES"
+              save_LIBS="$LIBS"
+              LIBS="$USB_LIBS"
+              AC_MSG_CHECKING([$libusb_name for symbol usb_debug in library $usb_lib_name])
+              AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+                extern int usb_debug;]],
+                [[usb_debug = 0;]])],
+                [libusbok=yes],[libusbok=no])
+              AC_MSG_RESULT([$libusbok])
+              LIBS="$save_LIBS"
+              CPPFLAGS="$save_CPPFLAGS"
+              AC_LANG_POP(C)
+              ;;
+            esac
           fi
         fi
       fi