Skip to content

Commit c74755b

Browse files
committed
Fix FreeBSD build, update docs regarding pkg-config
1 parent 07abf4c commit c74755b

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ uhubctl
1010
# Patches
1111
*.patch
1212
*.diff
13+
14+
# IDE config dirs
15+
.*/

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,19 @@ is using `winusb.sys` driver, which according to Microsoft does not support
164164
[necessary USB control requests](https://social.msdn.microsoft.com/Forums/sqlserver/en-US/f680b63f-ca4f-4e52-baa9-9e64f8eee101).
165165
This may be fixed if `libusb` starts supporting different driver on Windows.
166166

167-
Note that it is highly recommended to have `pkg-config` installed (many platforms provide it by default).
167+
Note that it is highly recommended to have utility `pkg-config` installed
168+
(many platforms provide it in package `pkg-config` or `pkgconf`,
169+
often it is installed by default).
168170

169171
First, you need to install library libusb-1.0 (version 1.0.13 or later is required,
170172
1.0.23 or later is recommended):
171173

172-
* Ubuntu: `sudo apt-get install libusb-1.0-0-dev`
173-
* Redhat: `sudo yum install libusb1-devel`
174-
* OpenSUSE: `sudo zypper install libusb-1_0-devel`
175-
* MacOS: `brew install libusb`, or `sudo port install libusb-devel`
176-
* FreeBSD: libusb is included by default
177-
* NetBSD: `sudo pkgin install libusb1 gmake pkg-config`
174+
* Ubuntu: `sudo apt-get install libusb-1.0-0-dev pkgconf`
175+
* Redhat: `sudo yum install libusb1-devel pkgconf`
176+
* OpenSUSE: `sudo zypper install libusb-1_0-devel pkgconf`
177+
* MacOS: `brew install libusb pkgconf`, or `sudo port install libusb-devel pkgconf`
178+
* FreeBSD: `pkg install gmake pkgconf` (libusb is included by default)
179+
* NetBSD: `sudo pkgin install libusb1 gmake pkgconf`
178180
* Windows: TBD?
179181

180182
To fetch uhubctl source and compile it:

uhubctl.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
#define LIBUSB_API_VERSION LIBUSBX_API_VERSION
3939
#endif
4040

41+
/* FreeBSD's libusb does not define LIBUSB_DT_SUPERSPEED_HUB */
42+
#if !defined(LIBUSB_DT_SUPERSPEED_HUB)
43+
#define LIBUSB_DT_SUPERSPEED_HUB 0x2a
44+
#endif
45+
4146
#if !defined(LIBUSB_API_VERSION)
4247
#error "libusb-1.0 is required!"
4348
#endif

0 commit comments

Comments
 (0)