Commit graph

12 commits

Author SHA1 Message Date
Nate Bargmann
d04364e685
Use pkgconf/pkg-config to test for libusb-1.0
As reported in GitHub issue #1892, configure on FreeBSD failed to search
for the name of the library correctly which is libusb.  As pkg-config
correctly holds the library name for linking, modify the search for
libusb-1.0 to use the pkg-config capability.  If pkg-config (now largely
replaced by pkgconf) is not installed or found, the modules depending on
it will be gracefull disabled, i.e. the configure script will complete
with those modules disabled.

Modify the output summary to use spaces instead of tabs as things were
not lining up nicely in my FreeBSD terminal.

Rename the Automake substituted variable 'HAVE_LIBUSB' to
'TESTS_HAVE_LIBUSB' to avoid confusion with identically named variable
written to include/hamlib/config.h.

Likewise, rename the AutoConf substituted name 'LIBUSB' to
'HAMLIB_PC_LIBUSB' to avoid confusion with the 'LIBUSB' string passed to
PKG_CHECK_MODULES.

Update hamlib.pc.in and tests/Makefile.am to use the new variable names.

Make sure all source files no longer reference HAVE_LIBUSB_H or
HAVE_LIBUSB_1_0_LIBUSB_H as these variables no longer exist.

Fix src/Makefile.am to provide include path for usb_port.c.
2025-09-17 21:31:37 -05:00
Daniele Forsi IU5HKX
39e155efe7 Fix include config.h
It should be included, with its path, before any hamlib include
and before any #ifdef that uses the symbols that it defines.
2025-08-30 11:18:51 +02:00
Diane Bruce
f25f21264f
Provide for updated FreeBSD USB device naming
FreeBSD will eventually have the less verbose bNumDeviceCaps instead of
bNumDeviceCapabilities The other changes are (hopefully) to be
upstreamed renaming bU2devExitLat to wU2devExitLat

FreeBSD in the head of the tree has
/usr/include/libusb20_desc.h:#define bNumDeviceCapabilities bNumDeviceCaps

So we have backward compatibility for this.
2025-07-20 15:40:12 -05:00
Mike Black W9MDB
e267c62764 astyle files 2023-12-16 11:37:58 -06:00
Mike Black W9MDB
d72127f29a Fix cppcheck warnings 2023-10-11 23:22:42 -05:00
Daniele Forsi IU5HKX
01a2dd23ed Fix cppcheck "missingInclude" informational message
Fixes:
tests/rigtestlibusb.c:30:0: information: Include file: "libusb.h" not found. [missingInclude]
2023-03-18 11:17:18 +01:00
Daniele Forsi IU5HKX
3f90086991 [tests] Fix includes 2023-02-16 19:08:24 +01:00
Mike Black W9MDB
e51e645d2a Fix rigtestlibusb.c to include config.h 2021-09-22 22:38:04 -05:00
Mike Black W9MDB
0806896e3b Fix compilation when OS does not have libusb installed
https://github.com/Hamlib/Hamlib/issues/803
2021-09-21 23:32:12 -05:00
Mike Black W9MDB
63240f1671 Fix rigtestlibusb test_wrapped_device for libusb-1.0.22 or less 2021-09-18 06:08:16 -05:00
Mike Black W9MDB
be3d79ce19 Change libusb warning in rigtestlibusb.c to Android-only
Doesn't appear wrapped usb devices are needed elsewhere
2021-09-17 10:09:39 -05:00
Mike Black W9MDB
12e184a0e8 Rename testlibusb to rigtestlibusb to avoid name collisions with other testlibusb.exe files 2021-09-15 23:45:16 -05:00
Renamed from tests/testlibusb.c (Browse further)