Check for libusb-1.0/libusb.h

Some distributions--Debian and Alpine tested--put libusb.h under the
libusb-1.0 directory.  Test for its presence and if found define
HAVE_LIBUSB_1_0_LIBUSB_H.  Also test for HAVE_LIBUSB or
HAVE_LIBUSB_1_0_LIBUSB_H and conditionally include the correct header
file in the sources.
libusb-1-0
Nate Bargmann 2016-02-15 08:10:07 -06:00
rodzic 8d7697c3bd
commit 9ec98e0fe3
10 zmienionych plików z 48 dodań i 16 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -225,6 +225,9 @@
/* Define to 1 if you have the <libusb.h> header file. */
#define HAVE_LIBUSB_H 1
/* Define to 1 if you have the <libusb-1.0/libusb.h> header file. */
/* #undef HAVE_LIBUSB_1_0_LIBUSB_H 1
/* Define to 1 if you have the `usleep' function. */
#define HAVE_USLEEP 1

Wyświetl plik

@ -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])

Wyświetl plik

@ -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 <errno.h>
#include <libusb.h>
#ifdef HAVE_LIBUSB_H
# include <libusb.h>
#elif defined HAVE_LIBUSB_1_0_LIBUSB_H
# include <libusb-1.0/libusb.h>
#endif
#include "token.h"

Wyświetl plik

@ -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 <errno.h>
#include <libusb.h>
#ifdef HAVE_LIBUSB_H
# include <libusb.h>
#elif defined HAVE_LIBUSB_1_0_LIBUSB_H
# include <libusb-1.0/libusb.h>
#endif
#define USB_VID_FTDI 0x0403 /* Future Technology Devices International */

Wyświetl plik

@ -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 <errno.h>
#include <libusb.h>
#ifdef HAVE_LIBUSB_H
# include <libusb.h>
#elif defined HAVE_LIBUSB_1_0_LIBUSB_H
# include <libusb-1.0/libusb.h>
#endif
/* Selected request codes of the original AVR USB Si570 firmware */

Wyświetl plik

@ -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 <errno.h>
#include <libusb.h>
#ifdef HAVE_LIBUSB_H
# include <libusb.h>
#elif defined HAVE_LIBUSB_1_0_LIBUSB_H
# include <libusb-1.0/libusb.h>
#endif
#include "funcube.h"

Wyświetl plik

@ -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);

Wyświetl plik

@ -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 <errno.h>
#include <libusb.h>
#ifdef HAVE_LIBUSB_H
# include <libusb.h>
#elif defined HAVE_LIBUSB_1_0_LIBUSB_H
# include <libusb-1.0/libusb.h>
#endif
#include "si570avrusb.h"

Wyświetl plik

@ -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 <stdlib.h>
@ -51,7 +51,12 @@
#include <sys/types.h>
#include <unistd.h>
#include <libusb.h>
#ifdef HAVE_LIBUSB_H
# include <libusb.h>
#elif defined HAVE_LIBUSB_1_0_LIBUSB_H
# include <libusb-1.0/libusb.h>
#endif
#include "usb_port.h"