]> err.no Git - yubikey-personalization/commitdiff
Fix FreeBSD libusb detection.
authorFredrik Thulin <fredrik@yubico.com>
Sun, 6 Mar 2011 15:36:04 +0000 (16:36 +0100)
committerFredrik Thulin <fredrik@yubico.com>
Sun, 6 Mar 2011 15:36:04 +0000 (16:36 +0100)
configure.ac

index c31c589e8c9be6c4747a117b8eb44ce1aa080f82..f065f1bacdca354eaf4db5f75b5f1d63b59426ed 100644 (file)
@@ -83,18 +83,18 @@ if test "x$with_backend" = "xlibusb-1.0"; then
 fi
 
 if test x$with_backend = xlibusb; then
-  AC_LIB_HAVE_LINKFLAGS(usb,, [#include <usb.h>], [usb_init()])
-  if test "$ac_cv_libusb" != yes; then
+  AC_LIB_HAVE_LINKFLAGS(usb,, [#include <libusb.h>], [libusb_init(NULL)])
+  if test "$ac_cv_libusb" = yes; then
     # FreeBSD 8 has an implementation of the libusb-1.0 API in -lusb
-    AC_LIB_HAVE_LINKFLAGS(usb,, [#include <libusb.h>], [libusb_init(NULL)])
+    with_backend=libusb-1.0
+  else
+    AC_LIB_HAVE_LINKFLAGS(usb,, [#include <usb.h>], [usb_init()])
     if test "$ac_cv_libusb" != yes; then
       if test "$with_backend_orig" = "check"; then
        AC_MSG_ERROR([libusb-1.0 or libusb not found, please install one of them])
       else
         AC_MSG_ERROR([libusb not found, please install usb.h and libusb.so])
       fi
-    else
-      with_backend=libusb-1.0
     fi
   fi
 fi