dlbeer/mspdebug

Can't build on Gentoo: usb.h: No such file

GrantEdwards opened this issue · 2 comments

Where does usb.h come from?

$ make
cc  -DUSE_READLINE  -O1 -Wall -Wno-char-subscripts -ggdb -I. -Isimio -Iformats -Itransport -Idrivers -Iutil -Iui -DLIB_DIR=\"/usr/local/lib/\"  -o util/btree.o -c util/btree.c
cc  -DUSE_READLINE  -O1 -Wall -Wno-char-subscripts -ggdb -I. -Isimio -Iformats -Itransport -Idrivers -Iutil -Iui -DLIB_DIR=\"/usr/local/lib/\"  -o util/expr.o -c util/expr.c
cc  -DUSE_READLINE  -O1 -Wall -Wno-char-subscripts -ggdb -I. -Isimio -Iformats -Itransport -Idrivers -Iutil -Iui -DLIB_DIR=\"/usr/local/lib/\"  -o util/list.o -c util/list.c
cc  -DUSE_READLINE  -O1 -Wall -Wno-char-subscripts -ggdb -I. -Isimio -Iformats -Itransport -Idrivers -Iutil -Iui -DLIB_DIR=\"/usr/local/lib/\"  -o util/sockets.o -c util/sockets.c
cc  -DUSE_READLINE  -O1 -Wall -Wno-char-subscripts -ggdb -I. -Isimio -Iformats -Itransport -Idrivers -Iutil -Iui -DLIB_DIR=\"/usr/local/lib/\"  -o util/sport.o -c util/sport.c
cc  -DUSE_READLINE  -O1 -Wall -Wno-char-subscripts -ggdb -I. -Isimio -Iformats -Itransport -Idrivers -Iutil -Iui -DLIB_DIR=\"/usr/local/lib/\"  -o util/usbutil.o -c util/usbutil.c
In file included from util/usbutil.c:22:
util/usbutil.h:23:10: fatal error: usb.h: No such file or directory
   23 | #include <usb.h>
      |          ^~~~~~~
compilation terminated.
make: *** [Makefile:244: util/usbutil.o] Error 1

libusb 1.0.26 is installed, but the only include file it provides is libusb.h:

$ equery files libusb
 * Searching for libusb ...
 * Contents of dev-libs/libusb-1.0.26:
/lib64
/lib64/libusb-1.0.so.0 -> libusb-1.0.so.0.3.0
/lib64/libusb-1.0.so.0.3.0
/usr
/usr/include
/usr/include/libusb-1.0
/usr/include/libusb-1.0/libusb.h
/usr/lib64
/usr/lib64/libusb-1.0.so
/usr/lib64/pkgconfig
/usr/lib64/pkgconfig/libusb-1.0.pc
/usr/share
/usr/share/doc
/usr/share/doc/libusb-1.0.26
/usr/share/doc/libusb-1.0.26/AUTHORS.bz2
/usr/share/doc/libusb-1.0.26/ChangeLog.bz2
/usr/share/doc/libusb-1.0.26/NEWS
/usr/share/doc/libusb-1.0.26/PORTING.bz2
/usr/share/doc/libusb-1.0.26/README.bz2
/usr/share/doc/libusb-1.0.26/TODO

Ah, I think I've got it: mspdebug depends on the old legacy libusb 0.1 API. To build on a "modern" Linux distro, you can use libusb-compat to provide backwards-compatibility for applications that expect that API. I should send a pull request to add that info to the README...

$ equery files libusb-compat
 * Searching for libusb-compat ...
 * Contents of dev-libs/libusb-compat-0.1.5-r3:
/lib64
/lib64/libusb-0.1.so.4 -> libusb-0.1.so.4.4.4
/lib64/libusb-0.1.so.4.4.4
/usr
/usr/bin
/usr/bin/libusb-config -> x86_64-pc-linux-gnu-libusb-config
/usr/bin/x86_64-pc-linux-gnu-libusb-config
/usr/include
/usr/include/usb.h
/usr/lib64
/usr/lib64/libusb.so
/usr/lib64/pkgconfig
/usr/lib64/pkgconfig/libusb.pc
/usr/share
/usr/share/doc
/usr/share/doc/libusb-compat-0.1.5-r3
/usr/share/doc/libusb-compat-0.1.5-r3/AUTHORS
/usr/share/doc/libusb-compat-0.1.5-r3/ChangeLog.bz2
/usr/share/doc/libusb-compat-0.1.5-r3/NEWS.bz2
/usr/share/doc/libusb-compat-0.1.5-r3/README.bz2

Update to README.txt in pull request 120