[1/5] configure.ac: detect libusb-1.0
Damjan Jovanovic
damjan.jov at gmail.com
Sun Apr 18 03:23:18 CDT 2010
Changelog:
* configure.ac: detect libusb-1.0
Damjan Jovanovic
-------------- next part --------------
diff --git a/configure.ac b/configure.ac
index 4aa7cfd..acb5202 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,6 +69,7 @@ AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG]),
AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library]),
[if test "x$withval" = "xno"; then ac_cv_header_pthread_h=no; fi])
AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)]))
+AC_ARG_WITH(usb, AS_HELP_STRING([--without-usb],[do not use libusb]))
AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF]),
[if test "x$withval" = "xno"; then ac_cv_header_tiffio_h=no; fi])
AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)]))
@@ -1187,6 +1188,28 @@ fi
WINE_NOTICE_WITH(sane,[test "x$ac_cv_lib_soname_sane" = "x"],
[libsane ${notice_platform}development files not found, scanners won't be supported.])
+dnl *** Check for libusb-1.0 ****
+AC_SUBST(LIBUSBINCL,"")
+AC_SUBST(LIBUSBLIBS,"")
+if test "x$with_usb" != "xno"
+then
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test "$PKG_CONFIG" != "false"
+ then
+ ac_usb_libs="`$PKG_CONFIG --libs libusb-1.0 2>/dev/null`"
+ ac_usb_cflags="`$PKG_CONFIG --cflags libusb-1.0 2>/dev/null`"
+ CPPFLAGS="$CPPFLAGS $ac_usb_cflags"
+ fi
+ AC_CHECK_HEADER(libusb.h,
+ [AC_CHECK_LIB(usb-1.0,libusb_init,
+ [AC_DEFINE(HAVE_LIBUSB, 1, [Define if you have the libusb-1.0 library and header])
+ LIBUSBLIBS="$ac_usb_libs"
+ LIBUSBINCL="$ac_usb_cflags"],,$ac_usb_libs)])
+ CPPFLAGS="$ac_save_CPPFLAGS"
+fi
+WINE_NOTICE_WITH(usb,[test "x$ac_cv_lib_usb_1_0_libusb_init" != "xyes"],
+ [libusb-1.0 ${notice_platform}development files not found, USB won't be supported.])
+
dnl **** Check for libv4l1 ****
if test "x$with_v4l" != "xno"
then
More information about the wine-patches
mailing list