# configure script correctly handles --enable-shared/--disable-shared.
LIBPCAP_AUTORECONF = YES
-LIBPCAP_DEPENDENCIES = zlib \
- $(if $(BR2_PACKAGE_LIBUSB),libusb)
+LIBPCAP_DEPENDENCIES = zlib
LIBPCAP_CONF_ENV = ac_cv_linux_vers=2 \
ac_cv_header_linux_wireless_h=yes # configure misdetects this
LIBPCAP_CONF_OPT = --disable-yydebug --with-pcap=linux
+ifeq ($(BR2_PACKAGE_LIBUSB),y)
+LIBPCAP_CONF_OPT += --enable-canusb
+LIBPCAP_DEPENDENCIES += libusb
+else
+LIBPCAP_CONF_OPT += --disable-canusb
+endif
+
# microblaze needs -fPIC instead of -fpic
ifeq ($(BR2_microblaze),y)
LIBPCAP_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -fPIC"