I get this error compiling sys-apps/usbutils on Gentoo/FreeBSD with profile 8.0: >>> Source configured. >>> Compiling source in /var/tmp/portage/sys-apps/usbutils-0.87-r1/work/usbutils-0.87 ... gmake -j1 gmake all-am gmake[1]: Entering directory `/var/tmp/portage/sys-apps/usbutils-0.87-r1/work/usbutils-0.87' i686-gentoo-freebsd8.0-gcc -DHAVE_CONFIG_H -I. -DDATADIR=\"/usr/share/misc\" -O2 -march=i686 -mtune=i686 -pipe -w -g0 -MT lsusb-lsusb.o -MD -MP -MF .deps/lsusb-lsusb.Tpo -c -o lsusb-lsusb.o `test -f 'lsusb.c' || echo './'`lsusb.c lsusb.c:35:22: error: byteswap.h: No such file or directory lsusb.c: In function 'treedump': lsusb.c:2970: error: 'R_OK' undeclared (first use in this function) lsusb.c:2970: error: (Each undeclared identifier is reported only once lsusb.c:2970: error: for each function it appears in.) gmake[1]: *** [lsusb-lsusb.o] Error 1 gmake[1]: Leaving directory `/var/tmp/portage/sys-apps/usbutils-0.87-r1/work/usbutils-0.87' gmake: *** [all] Error 2 * ERROR: sys-apps/usbutils-0.87-r1 failed: * emake failed * * Call stack: * ebuild.sh, line 48: Called src_compile * environment, line 2868: Called _eapi2_src_compile * ebuild.sh, line 640: Called die * The specific snippet of code: * emake || die "emake failed" * * If you need support, post the output of 'emerge --info =sys-apps/usbutils-0.87-r1', * the complete build log and the output of 'emerge -pqv =sys-apps/usbutils-0.87-r1'. * This ebuild is from an overlay: '/var/cache/portage/overlays/' * The complete build log is located at '/var/tmp/portage/sys-apps/usbutils-0.87-r1/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-apps/usbutils-0.87-r1/temp/environment'. * S: '/var/tmp/portage/sys-apps/usbutils-0.87-r1/work/usbutils-0.87' This error happens for a missing 'unistd.h' include directive inside the file lsusb.c. Attached there is an ebuild patch that fixes the issue. I have tested the new ebuild on Gentoo/FreeBSD and Gentoo/Linux (only x86 arch) and the package compiles and works as expected, but more testing is preferable. I hope this is useful. Mauro p.s.: watching the existing fbsd patch set in portage I have noticed that it adds to lsusb.c +#ifndef __FreeBSD__ #include <byteswap.h> +#endif instead to properly check the header existence using the autoconf macros and to use a more appropriated 'ifdef HAVE_BYTESWAP_H' directive inside the .c file, so I have rewritten that patch too; now the patch set is more portable (usbutils will compile not only on FreeBSD but also on all the Gentoo/*BSD and most probably also on Darwin and MACOSX).
Created attachment 228759 [details, diff] usbutils-0.87-r1.ebuild.patch
Created attachment 228761 [details, diff] usbutils-0.82-fbsd.patch
Created attachment 228765 [details, diff] usbutils-0.86-r2.ebuild.patch
patch looks fine to me if BSD team wants to verify + commit
(In reply to comment #4) > patch looks fine to me if BSD team wants to verify + commit > applied, thanks ps: i had to change the sed to makefile.am for the .pc file location