kopia lustrzana https://github.com/Hamlib/Hamlib
Fix compilation when OS does not have libusb installed
https://github.com/Hamlib/Hamlib/issues/803pull/809/head
rodzic
9671a26858
commit
0806896e3b
|
@ -321,10 +321,11 @@ LIBUSB=""
|
|||
AC_ARG_VAR([LIBUSB_CFLAGS], [C compiler flags for libusb, overriding configure defaults])
|
||||
AC_ARG_VAR([LIBUSB_LIBS], [linker flags for libusb, overriding configure check (useful for specifying static libusb-1.0.a (see INSTALL))])
|
||||
|
||||
AS_IF([test x"${cf_with_libusb}" = "xyes"],
|
||||
[AS_IF([test -z $LIBUSB_LIBS],
|
||||
AS_IF([test x"${cf_with_libusb}" = "xyes"], [
|
||||
AS_IF([test -z $LIBUSB_LIBS],
|
||||
[AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBUSB_LIBS="-lusb-1.0"],
|
||||
[AC_MSG_WARN([libusb_init was not found in libusb-1.0--USB backends will be disabled])])
|
||||
[cf_with_libusb="no"]
|
||||
], [cf_with_libusb="yes"])
|
||||
|
||||
AS_IF([test x"${cf_with_libusb}" = "xyes"],
|
||||
|
|
|
@ -24,12 +24,13 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#if __has_include("libusb.h")
|
||||
#if defined(HAVE_LIBUSB_H)
|
||||
#include "libusb.h"
|
||||
#else
|
||||
#elif defined(HAVE_LIBUSB_1_0_LIBUSB_H)
|
||||
#include <libusb-1.0/libusb.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LIBUSB
|
||||
int verbose = 0;
|
||||
|
||||
static void print_endpoint_comp(const struct
|
||||
|
@ -410,3 +411,10 @@ int main(int argc, char *argv[])
|
|||
libusb_exit(NULL);
|
||||
return r;
|
||||
}
|
||||
#else
|
||||
int main()
|
||||
{
|
||||
puts("libusb not installed");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
Ładowanie…
Reference in New Issue