diff options
author | Graham Gower <graham.gower@gmail.com> | 2010-07-06 10:17:14 +0930 |
---|---|---|
committer | Bernd Zeimetz <bernd@bzed.de> | 2010-07-06 16:20:17 +0200 |
commit | 8b0888c9f8e2121a91b961b614a2a660dfff088d (patch) | |
tree | 40483c712c09c963d12357ccc1e5e92aad2bf2f6 /configure.ac | |
parent | 5798a7dcf2f191292f0d82df3dbe8e46b8477ae9 (diff) | |
download | gpsd-8b0888c9f8e2121a91b961b614a2a660dfff088d.tar.gz |
fix configure test for libusb
The configure test for libusb fails on systems where libusb is
not in /usr/include and /usr/lib (e.g. 64 bit systems have
/usr/lib64 or e.g. when cross compiling).
Use pkg-config instead.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/configure.ac b/configure.ac index b10cdff8..fe902ff3 100644 --- a/configure.ac +++ b/configure.ac @@ -240,30 +240,12 @@ AC_CHECK_LIB(pthread, pthread_setcancelstate, AC_DEFINE([HAVE_LIBPTHREAD], [], [pthread libraries are present])]) AC_SUBST(LIBPTHREAD) -# -# We want libusb-1.x or later. Checking for this is messy in 2010 -# since many Linux systems ship with .0,1.x versions and that's -# what you get if you check naively for -lusb. -# -# We use the fact that the obsolete versions put their include file in -# /usr/include/usb.h, while the newer ones have it in -# /usr/include/libusb-*/libusb.h -# -AC_MSG_CHECKING([for libusb version >= 1.0.0]) -if test -f /usr/include/libusb-*/libusb.h ; -then - usb=$(basename /usr/lib/libusb-*.so | sed -e s/\.so// -e s/^lib//) - AC_DEFINE([HAVE_LIBUSB], [], [will link with -l$usb; ]) - LIBUSB=-l${usb} - INCUSB=-I/usr/include/lib${usb} - ac_libusb=yes - AC_MSG_RESULT([found.]) -else - ac_libusb=yes - AC_MSG_RESULT([not found.]) +PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.0, [ac_libusb=yes], [ac_libusb=no]) +AC_SUBST(LIBUSB_LIBS) +AC_SUBST(LIBUSB_CFLAGS) +if test x"$ac_libusb" = x"yes" ; then + AC_DEFINE([HAVE_LIBUSB], 1, [libusb support]) fi -AC_SUBST(LIBUSB) -AC_SUBST(INCUSB) AH_VERBATIM([_GNU_SOURCE], [/* Some libc's don't have strlcat/strlcpy. Local copies are provided */ |