Do not add libusb to PKG_CONFIG_REQUIRES unless it is located using this method. Fix build failure for software detecting libnfc using pkg-config on FreeBSD (at least) when libusb is part of the system.

This commit is contained in:
Romain Tartiere 2010-02-10 11:23:01 +00:00
parent 2a33e28db9
commit c8c03fe2e0

View file

@ -118,10 +118,12 @@ if test "x$enable_libusb" = "xyes"; then
# Search using pkg-config
if test x"$PKG_CONFIG" != "x"; then
PKG_CHECK_MODULES([LIBUSB], [libusb], [WITH_USB=1], [WITH_USB=0])
if test x"$WITH_USB" = "x1"; then
if test x"$PKG_CONFIG_REQUIRES" != x""; then
PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES,"
fi
PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libusb"
fi
fi
# Search using libusb-config