summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--acinclude.m412
-rw-r--r--tools/Makefile.am8
-rw-r--r--tools/bccmd.c8
3 files changed, 25 insertions, 3 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 25fac86b..d8e731cd 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -142,6 +142,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
pie_enable=no
inotify_enable=${inotify_found}
expat_enable=${expat_found}
+ usb_enable=${usb_found}
glib_enable=no
obex_enable=${openobex_found}
input_enable=no
@@ -198,6 +199,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
expat_enable=${enableval}
])
+ AC_ARG_ENABLE(usb, AC_HELP_STRING([--enable-usb], [enable USB support]), [
+ usb_enable=${enableval}
+ ])
+
AC_ARG_ENABLE(glib, AC_HELP_STRING([--enable-glib], [enable GLib support]), [
glib_enable=${enableval}
])
@@ -275,6 +280,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
LDFLAGS="$LDFLAGS -pie"
fi
+ if (test "${usb_enable}" = "yes" && test "${usb_found}" = "yes"); then
+ AC_DEFINE(HAVE_LIBUSB, 1, [Define to 1 if you have USB library.])
+ fi
+
if (test "${glib_enable}" = "yes" && test "${glib_found}" = "yes"); then
if (test "${dbus_glib_found}" = "dummy"); then
AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define to 1 if you have D-Bus GLib bindings.])
@@ -291,6 +300,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
fi
AM_CONDITIONAL(INOTIFY, test "${inotify_enable}" = "yes" && test "${inotify_found}" = "yes")
+ AM_CONDITIONAL(USB, test "${usb_enable}" = "yes" && test "${usb_found}" = "yes")
AM_CONDITIONAL(OBEX, test "${obex_enable}" = "yes" && test "${openobex_found}" = "yes")
AM_CONDITIONAL(INPUTSERVICE, test "${input_enable}" = "yes")
AM_CONDITIONAL(SYNCSERVICE, test "${sync_enable}" = "yes" && test "${opensync_found}" = "yes")
@@ -302,7 +312,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AM_CONDITIONAL(CONFIGFILES, test "${configfiles_enable}" = "yes")
AM_CONDITIONAL(INITSCRIPTS, test "${initscripts_enable}" = "yes")
AM_CONDITIONAL(PCMCIARULES, test "${pcmciarules_enable}" = "yes")
- AM_CONDITIONAL(BCCMD, test "${bccmd_enable}" = "yes" && test "${usb_found}" = "yes")
+ AM_CONDITIONAL(BCCMD, test "${bccmd_enable}" = "yes")
AM_CONDITIONAL(AVCTRL, test "${avctrl_enable}" = "yes" && test "${usb_found}" = "yes")
AM_CONDITIONAL(HID2HCI, test "${hid2hci_enable}" = "yes" && test "${usb_found}" = "yes")
AM_CONDITIONAL(DFUTOOL, test "${dfutool_enable}" = "yes" && test "${usb_found}" = "yes")
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 21b2c3a2..0ebb351b 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -55,8 +55,12 @@ ciptool_LDADD = @BLUEZ_LIBS@
ppporc_LDADD = @BLUEZ_LIBS@
if BCCMD
-bccmd_SOURCES = bccmd.c csr.h csr.c csr_hci.c csr_usb.c csr_bcsp.c csr_h4.c csr_3wire.c ubcsp.h ubcsp.c
-bccmd_LDADD = @USB_LIBS@ @BLUEZ_LIBS@
+bccmd_SOURCES = bccmd.c csr.h csr.c csr_hci.c csr_bcsp.c csr_h4.c csr_3wire.c ubcsp.h ubcsp.c
+bccmd_LDADD = @BLUEZ_LIBS@
+if USB
+bccmd_SOURCES += csr_usb.c
+bccmd_LDADD += @USB_LIBS@
+endif
endif
if AVCTRL
diff --git a/tools/bccmd.c b/tools/bccmd.c
index 4ce06675..7f5deb5b 100644
--- a/tools/bccmd.c
+++ b/tools/bccmd.c
@@ -64,8 +64,10 @@ static inline int transport_open(int transport, char *device)
switch (transport) {
case CSR_TRANSPORT_HCI:
return csr_open_hci(device);
+#ifdef HAVE_LIBUSB
case CSR_TRANSPORT_USB:
return csr_open_usb(device);
+#endif
case CSR_TRANSPORT_BCSP:
return csr_open_bcsp(device);
case CSR_TRANSPORT_H4:
@@ -83,8 +85,10 @@ static inline int transport_read(int transport, uint16_t varid, uint8_t *value,
switch (transport) {
case CSR_TRANSPORT_HCI:
return csr_read_hci(varid, value, length);
+#ifdef HAVE_LIBUSB
case CSR_TRANSPORT_USB:
return csr_read_usb(varid, value, length);
+#endif
case CSR_TRANSPORT_BCSP:
return csr_read_bcsp(varid, value, length);
case CSR_TRANSPORT_H4:
@@ -102,8 +106,10 @@ static inline int transport_write(int transport, uint16_t varid, uint8_t *value,
switch (transport) {
case CSR_TRANSPORT_HCI:
return csr_write_hci(varid, value, length);
+#ifdef HAVE_LIBUSB
case CSR_TRANSPORT_USB:
return csr_write_usb(varid, value, length);
+#endif
case CSR_TRANSPORT_BCSP:
return csr_write_bcsp(varid, value, length);
case CSR_TRANSPORT_H4:
@@ -122,9 +128,11 @@ static inline void transport_close(int transport)
case CSR_TRANSPORT_HCI:
csr_close_hci();
break;
+#ifdef HAVE_LIBUSB
case CSR_TRANSPORT_USB:
csr_close_usb();
break;
+#endif
case CSR_TRANSPORT_BCSP:
csr_close_bcsp();
break;