updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / hal-easy / fix-libusb-detection.patch
blobd4f966dec93be11529a5a04f9d34f064b87843b8
1 From fce91df8ba7f305c624baf1f06961c040b088ecc Mon Sep 17 00:00:00 2001
2 From: Joe Marcus Clarke <marcus@FreeBSD.org>
3 Date: Tue, 08 Dec 2009 00:05:27 +0000
4 Subject: Fix libusb detection on Linux
6 Adjust the FreeBSD libusb20 code so that it does not interfere with the
7 Linux libusb detection.
9 Reported by: Robby Workman <rw@rlworkman.net>
10 ---
11 diff --git a/configure.in b/configure.in
12 index a8fda51..8363595 100644
13 --- a/configure.in
14 +++ b/configure.in
15 @@ -479,9 +479,6 @@ if test "x$with_libpci" != xno ; then
16 fi
17 AM_CONDITIONAL([HAVE_LIBPCI], [test "x$USE_LIBPCI" = "xyes"])
19 -USE_LIBUSB20=no
20 -USE_LIBUSB=no
21 -LIBUSB20_LIBS=""
22 AC_ARG_WITH([backend],
23 AS_HELP_STRING([--with-backend=<name>],
24 [backend to use (linux/solaris/freebsd/dummy)]),
25 @@ -510,21 +507,25 @@ AM_CONDITIONAL(HALD_COMPILE_FREEBSD, [test x$HALD_BACKEND = xfreebsd], [Compilin
26 AM_CONDITIONAL(HALD_COMPILE_SOLARIS, [test x$HALD_BACKEND = xsolaris], [Compiling for Solaris])
27 AC_SUBST(HALD_BACKEND)
28 if test "x$HALD_BACKEND" = "xfreebsd"; then
29 - AC_CHECK_LIB([usb20], [libusb20_dev_get_info], [USE_LIBUSB20=yes], [USE_LIBUSB20=no])
30 -fi
31 -if test "x$USE_LIBUSB20" = "xno"; then
32 - AC_CHECK_LIB([usb], [libusb20_dev_get_info], [USE_LIBUSB=yes], [USE_LIBUSB=no])
33 -fi
34 -AM_CONDITIONAL([HAVE_LIBUSB20],[test "x$USE_LIBUSB20" = "xyes"])
35 -AM_CONDITIONAL([HAVE_LIBUSB20],[test "x$USE_LIBUSB" = "xyes"])
36 -if test "x$USE_LIBUSB20" = "xyes"; then
37 - AC_DEFINE(HAVE_LIBUSB20, 1, [Set if we need libusb20])
38 - LIBUSB20_LIBS="-lusb20"
39 -elif test "x$USE_LIBUSB" = "xyes"; then
40 - AC_DEFINE(HAVE_LIBUSB20, 1, [Set if we need libsub20])
41 - LIBUSB20_LIBS="-lusb"
42 + USE_BSDLIBUSB20=no
43 + USE_BSDLIBUSB=no
44 + LIBUSB20_LIBS=""
45 + AC_CHECK_LIB([usb20], [libusb20_dev_get_info], [USE_BSDLIBUSB20=yes], [USE_BSDLIBUSB20=no])
46 + if test "x$USE_BSDLIBUSB20" = "xno"; then
47 + AC_CHECK_LIB([usb], [libusb20_dev_get_info], [USE_BSDLIBUSB=yes], [USE_BSDLIBUSB=no])
48 + fi
49 + AM_CONDITIONAL([HAVE_LIBUSB20],[test "x$USE_BSDLIBUSB20" = "xyes" -o "x$USE_BSDLIBUSB" = "xyes"])
50 + if test "x$USE_BSDLIBUSB20" = "xyes"; then
51 + AC_DEFINE(HAVE_LIBUSB20, 1, [Set if we need libusb20])
52 + LIBUSB20_LIBS="-lusb20"
53 + elif test "x$USE_BSDLIBUSB" = "xyes"; then
54 + AC_DEFINE(HAVE_LIBUSB20, 1, [Set if we need libsub20])
55 + LIBUSB20_LIBS="-lusb"
56 + fi
57 + AC_SUBST(LIBUSB20_LIBS)
58 +else
59 + AM_CONDITIONAL([HAVE_LIBUSB20], [false])
61 -AC_SUBST(LIBUSB20_LIBS)
63 dnl DBUS API is subject to changes
64 AC_DEFINE_UNQUOTED(DBUS_API_SUBJECT_TO_CHANGE, [], [DBUS API is subject to change])
66 cgit v0.8.3-6-g21f6