summaryrefslogtreecommitdiffstats
path: root/kcontrol/input/configure.in.in
blob: 0d656e2dc5b759bc5ac5a481ae8379720994a80c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
AC_ARG_WITH(libusb,
    [AC_HELP_STRING(--with-libusb,
        [enable control of some mouse models through libusb @<:@default=check@:>@])],
    [], with_libusb=check)

USB_LIBS=
USB_CFLAGS=
have_libusb=no
if test "x$with_libusb" != xno; then
    AC_PATH_PROG(LIBUSBCONFIG,libusb-config,no)
    if test $LIBUSBCONFIG != "no"; then
        USB_LIBS="$($LIBUSBCONFIG --libs)"
        USB_CFLAGS="$($LIBUSBCONFIG --cflags)"
    
        AC_CHECK_LIB(usb,main,
            [have_libusb=yes
             AC_DEFINE(HAVE_LIBUSB, 1, [Defined if you have libusb])],
            [], [$USB_LIBS]
        )
    fi
    if test "x$with_libusb" != xcheck && test "x$have_libusb" = xno; then
        AC_MSG_ERROR([--with-libusb was given, but test for libusb failed])
    fi
fi
AC_SUBST(USB_LIBS)
AC_SUBST(USB_CFLAGS)