Discussion:
[libhid-discuss] OS X build
Edgar Fuß
2015-01-13 18:11:01 UTC
Permalink
src/Makefile uses -lIOKit, which doesn’t work on recent versions of OS X. It should be using -framework IOKit instead.
On a related note, I don’t understand why it quotes CoreFoundation (on the same line).
Charles Lepple
2015-01-14 00:10:28 UTC
Permalink
Post by Edgar Fuß
src/Makefile uses -lIOKit, which doesn’t work on recent versions of OS X. It should be using -framework IOKit instead.
On a related note, I don’t understand why it quotes CoreFoundation (on the same line).
To be honest, it should be using the output of `libusb-config --libs` instead (which implicitly addresses both of those points).

But once you do that, you are still fighting the OS X USB HID drivers. At one point, it was possible to install a "codeless KEXT" to prevent the kernel HID drivers from binding to the USB device, but I am not sure if that is still an option. At the very least, it probably requires a developer certificate.

You may want to check out the HIDAPI project instead - if I recall correctly, it uses the native HID interface on OS X (probably on Windows as well).
--
- Charles Lepple
http://ghz.cc/charles/
Peter Stuge
2015-01-14 02:15:07 UTC
Permalink
Post by Charles Lepple
But once you do that, you are still fighting the OS X USB HID drivers.
At one point, it was possible to install a "codeless KEXT" to prevent
the kernel HID drivers from binding to the USB device, but I am not
sure if that is still an option.
Since 10.8 it is not.
Post by Charles Lepple
You may want to check out the HIDAPI project instead - if I recall
correctly, it uses the native HID interface on OS X (probably on
Windows as well).
Yes and yes. Also on Linux, although it is optional there. Always use
it with the respective native backend as opposed to the libusb-1.0
backend. libusb is not appropriate for HID class devices.


//Peter
Edgar Fuß
2015-01-14 11:18:17 UTC
Permalink
Thanks for your quick reply.
Post by Charles Lepple
To be honest, it should be using the output of `libusb-config --libs`
instead (which implicitly addresses both of those points).
Yes, probably.
Post by Charles Lepple
But once you do that, you are still fighting the OS X USB HID drivers. [...]
You may want to check out the HIDAPI project instead [...]
Well, to be honest, I just wanted avrdude from pkgsrc to build. It has a dependency on libhid which I needed to satisfy somehow. My AVR programmer is connected via a USB-RS232 dongle, not as a HID device, so I in fact don't really care whether the libhid I built actually works.
Charles Lepple
2015-04-21 02:56:30 UTC
Permalink
Post by Edgar Fuß
Thanks for your quick reply.
Post by Charles Lepple
To be honest, it should be using the output of `libusb-config --libs`
instead (which implicitly addresses both of those points).
Yes, probably.
Post by Charles Lepple
But once you do that, you are still fighting the OS X USB HID drivers. [...]
You may want to check out the HIDAPI project instead [...]
Well, to be honest, I just wanted avrdude from pkgsrc to build. It has a dependency on libhid which I needed to satisfy somehow. My AVR programmer is connected via a USB-RS232 dongle, not as a HID device, so I in fact don't really care whether the libhid I built actually works.
Hi Edgar,

I was just looking at the avrdude source code, and it seems like their check for libhid is only for the Windows hid.lib (with "HidD_" prefix on the symbols):

http://svn.savannah.nongnu.org/viewvc/trunk/avrdude/configure.ac?revision=1350&root=avrdude&view=markup

You may want to check and see if your version is actually linking against the other libhid (with "hid_" symbol prefixes), and if not, let the pkgsrc people know.

- Charles

Loading...