summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-23 07:29:27 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-23 07:29:27 +0000
commit1bc5e02b94a1524de2ccb7e2f0704a895ad77de6 (patch)
treed1ee946db06872db58968d3ec3cb606a497734d6 /tools
parent77a277e66743cd5f55cec8e4b5e61874bb6ab5b0 (diff)
Make it possible to disable USB support
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile.am8
-rw-r--r--tools/bccmd.c8
2 files changed, 14 insertions, 2 deletions
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;