diff --git a/android/README.android b/android/README.android index 853d2b7bf..58b2689bf 100644 --- a/android/README.android +++ b/android/README.android @@ -12,6 +12,7 @@ Notes: ** FTDI USB to serial converter driver is not included in standard kernel. It should work on rooted device. ** But NET rigctl works fine * Backends are named libhamlib-vendor.so, I don't know how to include libraries without lib prefix into APK +* Check the location of libusb.h and define the corresponding macro accordingly in config.h. Happy hacking 73 Lada, OK1ZIA diff --git a/android/config.h b/android/config.h index dc3ac17e6..01a64a2aa 100644 --- a/android/config.h +++ b/android/config.h @@ -225,6 +225,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIBUSB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBUSB_1_0_LIBUSB_H 1 + /* Define to 1 if you have the `usleep' function. */ #define HAVE_USLEEP 1 diff --git a/configure.ac b/configure.ac index 287869e3e..e21871bf8 100644 --- a/configure.ac +++ b/configure.ac @@ -321,7 +321,7 @@ AS_IF([test -z $LIBUSB_LIBS], LIBUSB="" AS_IF([test x"${cf_with_libusb}" = "xyes"], - [AC_CHECK_HEADERS([libusb.h]) + [AC_CHECK_HEADERS([libusb.h libusb-1.0/libusb.h]) AC_DEFINE([HAVE_LIBUSB], [1], [Define if libusb-1.0 is available]) diff --git a/kit/dwt.c b/kit/dwt.c index 503860837..7411208e9 100644 --- a/kit/dwt.c +++ b/kit/dwt.c @@ -456,11 +456,15 @@ static const char* dwtdll_get_info(RIG *rig) } -#elif defined(HAVE_LIBUSB) && defined(HAVE_LIBUSB_H) - +#elif defined(HAVE_LIBUSB) && (defined(HAVE_LIBUSB_H) || defined(HAVE_LIBUSB_1_0_LIBUSB_H)) #include -#include + +#ifdef HAVE_LIBUSB_H +# include +#elif defined HAVE_LIBUSB_1_0_LIBUSB_H +# include +#endif #include "token.h" diff --git a/kit/elektor507.c b/kit/elektor507.c index dff543686..2de6e7027 100644 --- a/kit/elektor507.c +++ b/kit/elektor507.c @@ -33,7 +33,7 @@ #ifdef _WIN32 #define USE_FTDI_DLL -#elif defined(HAVE_LIBUSB) && defined(HAVE_LIBUSB_H) +#elif defined(HAVE_LIBUSB) && (defined(HAVE_LIBUSB_H) || defined(HAVE_LIBUSB_1_0_LIBUSB_H)) #define USE_LIBUSB #endif @@ -145,7 +145,12 @@ struct elektor507_extra_priv_data { #include -#include + +#ifdef HAVE_LIBUSB_H +# include +#elif defined HAVE_LIBUSB_1_0_LIBUSB_H +# include +#endif #define USB_VID_FTDI 0x0403 /* Future Technology Devices International */ diff --git a/kit/fifisdr.c b/kit/fifisdr.c index 04ea6fb8b..c551a8e4c 100644 --- a/kit/fifisdr.c +++ b/kit/fifisdr.c @@ -41,11 +41,15 @@ /* * Compile this model only if libusb is available */ -#if defined(HAVE_LIBUSB) && defined(HAVE_LIBUSB_H) +#if defined(HAVE_LIBUSB) && (defined(HAVE_LIBUSB_H) || defined(HAVE_LIBUSB_1_0_LIBUSB_H)) #include -#include +#ifdef HAVE_LIBUSB_H +# include +#elif defined HAVE_LIBUSB_1_0_LIBUSB_H +# include +#endif /* Selected request codes of the original AVR USB Si570 firmware */ diff --git a/kit/funcube.c b/kit/funcube.c index bab100442..69ee68317 100644 --- a/kit/funcube.c +++ b/kit/funcube.c @@ -42,10 +42,15 @@ /* * Compile this model only if libusb is available */ -#if defined(HAVE_LIBUSB) && defined(HAVE_LIBUSB_H) +#if defined(HAVE_LIBUSB) && (defined(HAVE_LIBUSB_H) || defined(HAVE_LIBUSB_1_0_LIBUSB_H)) #include -#include + +#ifdef HAVE_LIBUSB_H +# include +#elif defined HAVE_LIBUSB_1_0_LIBUSB_H +# include +#endif #include "funcube.h" diff --git a/kit/kit.c b/kit/kit.c index 0222dbc08..aaaa27df0 100644 --- a/kit/kit.c +++ b/kit/kit.c @@ -46,7 +46,7 @@ DECLARE_INITRIG_BACKEND(kit) rig_register(&miniVNA_caps); rig_register(&hiqsdr_caps); -#if (defined(HAVE_LIBUSB) && defined(HAVE_LIBUSB_H)) +#if (defined(HAVE_LIBUSB) && (defined(HAVE_LIBUSB_H) || defined(HAVE_LIBUSB_1_0_LIBUSB_H))) rig_register(&si570avrusb_caps); rig_register(&si570picusb_caps); rig_register(&si570peaberry1_caps); @@ -56,7 +56,7 @@ DECLARE_INITRIG_BACKEND(kit) rig_register(&fasdr_caps); rig_register(&funcubeplus_caps); #endif -#if (defined(HAVE_LIBUSB) && defined(HAVE_LIBUSB_H)) || defined(_WIN32) +#if (defined(HAVE_LIBUSB) && (defined(HAVE_LIBUSB_H) || defined(HAVE_LIBUSB_1_0_LIBUSB_H))) || defined(_WIN32) /* rigs with alternate DLL support on Win32 */ rig_register(&dwt_caps); rig_register(&elektor507_caps); diff --git a/kit/si570avrusb.c b/kit/si570avrusb.c index 5cdec8f5a..6fda2f096 100644 --- a/kit/si570avrusb.c +++ b/kit/si570avrusb.c @@ -41,10 +41,15 @@ /* * Compile this model only if libusb is available */ -#if defined(HAVE_LIBUSB) && defined(HAVE_LIBUSB_H) +#if defined(HAVE_LIBUSB) && (defined(HAVE_LIBUSB_H) || defined(HAVE_LIBUSB_1_0_LIBUSB_H)) #include -#include + +#ifdef HAVE_LIBUSB_H +# include +#elif defined HAVE_LIBUSB_1_0_LIBUSB_H +# include +#endif #include "si570avrusb.h" diff --git a/src/usb_port.c b/src/usb_port.c index 9bc6708a7..b7a0f8f05 100644 --- a/src/usb_port.c +++ b/src/usb_port.c @@ -40,7 +40,7 @@ /* * Compile only if libusb is available */ -#if defined(HAVE_LIBUSB) && defined(HAVE_LIBUSB_H) +#if defined(HAVE_LIBUSB) && (defined(HAVE_LIBUSB_H) || defined(HAVE_LIBUSB_1_0_LIBUSB_H)) #include @@ -51,7 +51,12 @@ #include #include -#include +#ifdef HAVE_LIBUSB_H +# include +#elif defined HAVE_LIBUSB_1_0_LIBUSB_H +# include +#endif + #include "usb_port.h"