Calculating dependencies >>> Unpacking source... >>> Unpacking libusb-0.1.10a.tar.gz to /var/tmp/portage/libusb-0.1.10a/work * Applying 0.1.10a-fbsd.patch ...  [ ok ] * Running eautoreconf in '/var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a' ... * Running aclocal... [ ok ] * Running libtoolize --copy --force --automake... [ ok ] * Running aclocal... [ ok ] * Running autoconf... [ ok ] * Running autoheader... [ ok ] * Running automake --add-missing --copy --foreign... [ ok ] * Running elibtoolize in: libusb-0.1.10a * Applying portage-1.2.0.patch ... * Applying max_cmd_len-1.5.0.patch ... * Applying sed-1.5.6.patch ... >>> Source unpacked. >>> Compiling source in /var/tmp//portage/libusb-0.1.10a/work/libusb-0.1.10a ... * econf: updating libusb-0.1.10a/config.guess with /usr/share/gnuconfig/config.guess * econf: updating libusb-0.1.10a/config.sub with /usr/share/gnuconfig/config.sub ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-debug --enable-build-docs --build=i686-pc-linux-gnu checking for a BSD-compatible install... /bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for style of include used by make... GNU checking for i686-pc-linux-gnu-gcc... i686-pc-linux-gnu-gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether i686-pc-linux-gnu-gcc accepts -g... yes checking for i686-pc-linux-gnu-gcc option to accept ANSI C... none needed checking dependency style of i686-pc-linux-gnu-gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for egrep... grep -E checking for ld used by i686-pc-linux-gnu-gcc... /usr/i686-pc-linux-gnu/bin/ld checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes checking for /usr/i686-pc-linux-gnu/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... i686-pc-linux-gnu-gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for i686-pc-linux-gnu-g++... i686-pc-linux-gnu-g++ checking whether we are using the GNU C++ compiler... yes checking whether i686-pc-linux-gnu-g++ accepts -g... yes checking dependency style of i686-pc-linux-gnu-g++... gcc3 checking how to run the C++ preprocessor... i686-pc-linux-gnu-g++ -E checking for i686-pc-linux-gnu-g77... no checking for i686-pc-linux-gnu-f77... no checking for i686-pc-linux-gnu-xlf... no checking for i686-pc-linux-gnu-frt... no checking for i686-pc-linux-gnu-pgf77... no checking for i686-pc-linux-gnu-fort77... no checking for i686-pc-linux-gnu-fl32... no checking for i686-pc-linux-gnu-af77... no checking for i686-pc-linux-gnu-f90... no checking for i686-pc-linux-gnu-xlf90... no checking for i686-pc-linux-gnu-pgf90... no checking for i686-pc-linux-gnu-epcf90... no checking for i686-pc-linux-gnu-f95... no checking for i686-pc-linux-gnu-fort... no checking for i686-pc-linux-gnu-xlf95... no checking for i686-pc-linux-gnu-ifc... no checking for i686-pc-linux-gnu-efc... no checking for i686-pc-linux-gnu-pgf95... no checking for i686-pc-linux-gnu-lf95... no checking for i686-pc-linux-gnu-gfortran... no checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for epcf90... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for gfortran... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from i686-pc-linux-gnu-gcc object... ok checking for objdir... .libs checking for i686-pc-linux-gnu-ar... i686-pc-linux-gnu-ar checking for i686-pc-linux-gnu-ranlib... i686-pc-linux-gnu-ranlib checking for i686-pc-linux-gnu-strip... i686-pc-linux-gnu-strip checking for correct ltmain.sh version... yes checking if i686-pc-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no checking for i686-pc-linux-gnu-gcc option to produce PIC... -fPIC checking if i686-pc-linux-gnu-gcc PIC flag -fPIC works... yes checking if i686-pc-linux-gnu-gcc static flag -static works... yes checking if i686-pc-linux-gnu-gcc supports -c -o file.o... yes checking whether the i686-pc-linux-gnu-gcc linker (/usr/i686-pc-linux-gnu/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by i686-pc-linux-gnu-g++... /usr/i686-pc-linux-gnu/bin/ld checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes checking whether the i686-pc-linux-gnu-g++ linker (/usr/i686-pc-linux-gnu/bin/ld) supports shared libraries... yes checking for i686-pc-linux-gnu-g++ option to produce PIC... -fPIC checking if i686-pc-linux-gnu-g++ PIC flag -fPIC works... yes checking if i686-pc-linux-gnu-g++ static flag -static works... yes checking if i686-pc-linux-gnu-g++ supports -c -o file.o... yes checking whether the i686-pc-linux-gnu-g++ linker (/usr/i686-pc-linux-gnu/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for what USB OS support... Linux checking for i686-pc-linux-gnu-gcc... (cached) i686-pc-linux-gnu-gcc checking whether we are using the GNU C compiler... (cached) yes checking whether i686-pc-linux-gnu-gcc accepts -g... (cached) yes checking for i686-pc-linux-gnu-gcc option to accept ANSI C... (cached) none needed checking dependency style of i686-pc-linux-gnu-gcc... (cached) gcc3 checking whether i686-pc-linux-gnu-gcc and cc understand -c and -o together... yes checking for a BSD-compatible install... /bin/install -c checking for ANSI C header files... (cached) yes checking for vprintf... yes checking for _doprnt... no checking for an ANSI C-conforming const... yes checking whether byte ordering is bigendian... no checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking for unistd.h... (cached) yes checking values.h usability... yes checking values.h presence... yes checking for values.h... yes checking for memmove... yes checking if we should build the documentation... yes checking for jade... jade checking for Doxygen tools... checking for dot... /usr/bin/dot checking for doxygen... /usr/bin/doxygen configure: creating ./config.status config.status: creating Makefile config.status: creating doc/Makefile config.status: creating libusb.spec config.status: creating libusb-config config.status: creating tests/Makefile config.status: creating README config.status: creating INSTALL.libusb config.status: creating usb.h config.status: creating config.h config.status: executing depfiles commands config.status: executing default commands cd . && /bin/sh /var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/missing --run autoheader rm -f stamp-h1 touch config.h.in cd . && /bin/sh ./config.status config.h config.status: creating config.h config.status: config.h is unchanged make all-recursive make[1]: Entering directory `/var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a' Making all in . make[2]: Entering directory `/var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a' if /bin/sh ./libtool --mode=compile i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT usb.lo -MD -MP -MF ".deps/usb.Tpo" -c -o usb.lo usb.c; \ then mv -f ".deps/usb.Tpo" ".deps/usb.Plo"; else rm -f ".deps/usb.Tpo"; exit 1; fi mkdir .libs i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT usb.lo -MD -MP -MF .deps/usb.Tpo -c usb.c -fPIC -DPIC -o .libs/usb.o i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT usb.lo -MD -MP -MF .deps/usb.Tpo -c usb.c -o usb.o >/dev/null 2>&1 if /bin/sh ./libtool --mode=compile i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT error.lo -MD -MP -MF ".deps/error.Tpo" -c -o error.lo error.c; \ then mv -f ".deps/error.Tpo" ".deps/error.Plo"; else rm -f ".deps/error.Tpo"; exit 1; fi i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -fPIC -DPIC -o .libs/error.o i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -o error.o >/dev/null 2>&1 if /bin/sh ./libtool --mode=compile i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT descriptors.lo -MD -MP -MF ".deps/descriptors.Tpo" -c -o descriptors.lo descriptors.c; \ then mv -f ".deps/descriptors.Tpo" ".deps/descriptors.Plo"; else rm -f ".deps/descriptors.Tpo"; exit 1; fi i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT descriptors.lo -MD -MP -MF .deps/descriptors.Tpo -c descriptors.c -fPIC -DPIC -o .libs/descriptors.o i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT descriptors.lo -MD -MP -MF .deps/descriptors.Tpo -c descriptors.c -o descriptors.o >/dev/null 2>&1 if /bin/sh ./libtool --mode=compile i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT linux.lo -MD -MP -MF ".deps/linux.Tpo" -c -o linux.lo linux.c; \ then mv -f ".deps/linux.Tpo" ".deps/linux.Plo"; else rm -f ".deps/linux.Tpo"; exit 1; fi i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT linux.lo -MD -MP -MF .deps/linux.Tpo -c linux.c -fPIC -DPIC -o .libs/linux.o i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -Wall -MT linux.lo -MD -MP -MF .deps/linux.Tpo -c linux.c -o linux.o >/dev/null 2>&1 /bin/sh ./libtool --mode=link i686-pc-linux-gnu-gcc -O3 -march=athlon-xp -pipe -Wall -o libusb.la -rpath /usr/lib -version-info 8:2:4 -release 0.1 -export-dynamic usb.lo error.lo descriptors.lo linux.lo i686-pc-linux-gnu-gcc -shared .libs/usb.o .libs/error.o .libs/descriptors.o .libs/linux.o -march=athlon-xp -Wl,-soname -Wl,libusb-0.1.so.4 -o .libs/libusb-0.1.so.4.4.2 (cd .libs && rm -f libusb-0.1.so.4 && ln -s libusb-0.1.so.4.4.2 libusb-0.1.so.4) (cd .libs && rm -f libusb.so && ln -s libusb-0.1.so.4.4.2 libusb.so) i686-pc-linux-gnu-ar cru .libs/libusb.a usb.o error.o descriptors.o linux.o i686-pc-linux-gnu-ranlib .libs/libusb.a creating libusb.la (cd .libs && rm -f libusb.la && ln -s ../libusb.la libusb.la) if /bin/sh ./libtool --mode=compile i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -MT usbpp.lo -MD -MP -MF ".deps/usbpp.Tpo" -c -o usbpp.lo usbpp.cpp; \ then mv -f ".deps/usbpp.Tpo" ".deps/usbpp.Plo"; else rm -f ".deps/usbpp.Tpo"; exit 1; fi i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -MT usbpp.lo -MD -MP -MF .deps/usbpp.Tpo -c usbpp.cpp -fPIC -DPIC -o .libs/usbpp.o i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -O3 -march=athlon-xp -pipe -MT usbpp.lo -MD -MP -MF .deps/usbpp.Tpo -c usbpp.cpp -o usbpp.o >/dev/null 2>&1 /bin/sh ./libtool --mode=link i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o libusbpp.la -rpath /usr/lib -version-info 8:2:4 -release 0.1 -export-dynamic -lusb usbpp.lo i686-pc-linux-gnu-g++ -shared -nostdlib /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/../../../crti.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/crtbeginS.o .libs/usbpp.o -Wl,--rpath -Wl,/var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/.libs /var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/.libs/libusb.so -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.5 -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/../../../../i686-pc-linux-gnu/lib -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/../../.. /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/libstdc++.so -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -L/var/tmp/portage/gcc-3.4.5/work/build/gcc -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib -lm -lc -lgcc_s /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/crtendS.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/../../../crtn.o -march=athlon-xp -Wl,-soname -Wl,libusbpp-0.1.so.4 -o .libs/libusbpp-0.1.so.4.4.2 (cd .libs && rm -f libusbpp-0.1.so.4 && ln -s libusbpp-0.1.so.4.4.2 libusbpp-0.1.so.4) (cd .libs && rm -f libusbpp.so && ln -s libusbpp-0.1.so.4.4.2 libusbpp.so) i686-pc-linux-gnu-ar cru .libs/libusbpp.a usbpp.o i686-pc-linux-gnu-ranlib .libs/libusbpp.a creating libusbpp.la (cd .libs && rm -f libusbpp.la && ln -s ../libusbpp.la libusbpp.la) make[2]: Leaving directory `/var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a' Making all in tests make[2]: Entering directory `/var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/tests' if i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.. -I.. -O3 -march=athlon-xp -pipe -Wall -MT testlibusb.o -MD -MP -MF ".deps/testlibusb.Tpo" -c -o testlibusb.o testlibusb.c; \ then mv -f ".deps/testlibusb.Tpo" ".deps/testlibusb.Po"; else rm -f ".deps/testlibusb.Tpo"; exit 1; fi /bin/sh ../libtool --mode=link i686-pc-linux-gnu-gcc -I.. -O3 -march=athlon-xp -pipe -Wall -o testlibusb testlibusb.o ../libusb.la mkdir .libs i686-pc-linux-gnu-gcc -I.. -O3 -march=athlon-xp -pipe -Wall -o .libs/testlibusb testlibusb.o ../.libs/libusb.so creating testlibusb if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.. -O3 -march=athlon-xp -pipe -MT descriptor_test.o -MD -MP -MF ".deps/descriptor_test.Tpo" -c -o descriptor_test.o descriptor_test.cpp; \ then mv -f ".deps/descriptor_test.Tpo" ".deps/descriptor_test.Po"; else rm -f ".deps/descriptor_test.Tpo"; exit 1; fi /bin/sh ../libtool --mode=link i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o descriptor_test descriptor_test.o ../libusbpp.la i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o .libs/descriptor_test descriptor_test.o ../.libs/libusbpp.so /var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/.libs/libusb.so /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/libstdc++.so -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -L/var/tmp/portage/gcc-3.4.5/work/build/gcc -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib creating descriptor_test if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.. -O3 -march=athlon-xp -pipe -MT id_test.o -MD -MP -MF ".deps/id_test.Tpo" -c -o id_test.o id_test.cpp; \ then mv -f ".deps/id_test.Tpo" ".deps/id_test.Po"; else rm -f ".deps/id_test.Tpo"; exit 1; fi /bin/sh ../libtool --mode=link i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o id_test id_test.o ../libusbpp.la i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o .libs/id_test id_test.o ../.libs/libusbpp.so /var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/.libs/libusb.so /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/libstdc++.so -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -L/var/tmp/portage/gcc-3.4.5/work/build/gcc -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib creating id_test if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.. -O3 -march=athlon-xp -pipe -MT find_hubs.o -MD -MP -MF ".deps/find_hubs.Tpo" -c -o find_hubs.o find_hubs.cpp; \ then mv -f ".deps/find_hubs.Tpo" ".deps/find_hubs.Po"; else rm -f ".deps/find_hubs.Tpo"; exit 1; fi /bin/sh ../libtool --mode=link i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o find_hubs find_hubs.o ../libusbpp.la i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o .libs/find_hubs find_hubs.o ../.libs/libusbpp.so /var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/.libs/libusb.so /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/libstdc++.so -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -L/var/tmp/portage/gcc-3.4.5/work/build/gcc -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib creating find_hubs if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.. -O3 -march=athlon-xp -pipe -MT find_mice.o -MD -MP -MF ".deps/find_mice.Tpo" -c -o find_mice.o find_mice.cpp; \ then mv -f ".deps/find_mice.Tpo" ".deps/find_mice.Po"; else rm -f ".deps/find_mice.Tpo"; exit 1; fi /bin/sh ../libtool --mode=link i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o find_mice find_mice.o ../libusbpp.la i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o .libs/find_mice find_mice.o ../.libs/libusbpp.so /var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/.libs/libusb.so /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/libstdc++.so -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -L/var/tmp/portage/gcc-3.4.5/work/build/gcc -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib creating find_mice if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.. -O3 -march=athlon-xp -pipe -MT get_resolution.o -MD -MP -MF ".deps/get_resolution.Tpo" -c -o get_resolution.o get_resolution.cpp; \ then mv -f ".deps/get_resolution.Tpo" ".deps/get_resolution.Po"; else rm -f ".deps/get_resolution.Tpo"; exit 1; fi /bin/sh ../libtool --mode=link i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o get_resolution get_resolution.o ../libusbpp.la i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o .libs/get_resolution get_resolution.o ../.libs/libusbpp.so /var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/.libs/libusb.so /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/libstdc++.so -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -L/var/tmp/portage/gcc-3.4.5/work/build/gcc -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib creating get_resolution if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.. -O3 -march=athlon-xp -pipe -MT hub_strings.o -MD -MP -MF ".deps/hub_strings.Tpo" -c -o hub_strings.o hub_strings.cpp; \ then mv -f ".deps/hub_strings.Tpo" ".deps/hub_strings.Po"; else rm -f ".deps/hub_strings.Tpo"; exit 1; fi /bin/sh ../libtool --mode=link i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o hub_strings hub_strings.o ../libusbpp.la i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o .libs/hub_strings hub_strings.o ../.libs/libusbpp.so /var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/.libs/libusb.so /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/libstdc++.so -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -L/var/tmp/portage/gcc-3.4.5/work/build/gcc -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib creating hub_strings if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.. -O3 -march=athlon-xp -pipe -MT driver_name.o -MD -MP -MF ".deps/driver_name.Tpo" -c -o driver_name.o driver_name.cpp; \ then mv -f ".deps/driver_name.Tpo" ".deps/driver_name.Po"; else rm -f ".deps/driver_name.Tpo"; exit 1; fi /bin/sh ../libtool --mode=link i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o driver_name driver_name.o ../libusbpp.la i686-pc-linux-gnu-g++ -O3 -march=athlon-xp -pipe -o .libs/driver_name driver_name.o ../.libs/libusbpp.so /var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/.libs/libusb.so /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/libstdc++.so -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/gcc-3.4.5/work/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -L/var/tmp/portage/gcc-3.4.5/work/build/gcc -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib creating driver_name make[2]: Leaving directory `/var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/tests' Making all in doc make[2]: Entering directory `/var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/doc' rm -rf html mkdir html jade -t sgml -d ./website.dsl\#html ./manual.sgml jade:./manual.sgml:1:55:W: cannot generate system identifier for public text "-//OASIS//DTD DocBook V4.2//EN" jade:./manual.sgml:10:0:E: reference to entity "BOOK" for which no system identifier could be generated jade:./manual.sgml:1:0: entity was defined here jade:./manual.sgml:12:9:E: there is no attribute "ID" jade:./manual.sgml:51:14:E: there is no attribute "ID" jade:./manual.sgml:56:119:E: there is no attribute "URL" jade:./manual.sgml:60:11:E: there is no attribute "ID" jade:./intro.sgml:2:14:E: there is no attribute "ID" jade:./api.sgml:12:296:E: there is no attribute "LINKEND" jade:./api.sgml:12:332:E: end tag for "XREF" omitted, but OMITTAG NO was specified jade:./api.sgml:12:282: start tag was here jade:./api.sgml:36:199:W: cannot generate system identifier for general entity "gt" jade:./api.sgml:36:199:E: general entity "gt" not defined and no default entity jade:./api.sgml:36:201:E: reference to entity "gt" for which no system identifier could be generated jade:./api.sgml:36:198: entity was defined here jade:./api.sgml:36:224:W: cannot generate system identifier for general entity "lt" jade:./api.sgml:36:224:E: general entity "lt" not defined and no default entity jade:./api.sgml:36:226:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./api.sgml:36:258:E: end tag for "XREF" omitted, but OMITTAG NO was specified jade:./api.sgml:36:102: start tag was here jade:./functions.sgml:3:16:E: there is no attribute "ID" jade:./functions.sgml:10:17:E: there is no attribute "ID" jade:./functions.sgml:21:25:E: end tag for "VOID" omitted, but OMITTAG NO was specified jade:./functions.sgml:20:12: start tag was here jade:./functions.sgml:38:25:E: end tag for "VOID" omitted, but OMITTAG NO was specified jade:./functions.sgml:37:12: start tag was here jade:./functions.sgml:55:25:E: end tag for "VOID" omitted, but OMITTAG NO was specified jade:./functions.sgml:54:12: start tag was here jade:./functions.sgml:57:282:E: end tag for "XREF" omitted, but OMITTAG NO was specified jade:./functions.sgml:57:122: start tag was here jade:./functions.sgml:72:25:E: end tag for "VOID" omitted, but OMITTAG NO was specified jade:./functions.sgml:71:12: start tag was here jade:./functions.sgml:115:236:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:115:255:E: end tag for "XREF" omitted, but OMITTAG NO was specified jade:./functions.sgml:115:73: start tag was here jade:./functions.sgml:133:245:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:151:255:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:169:235:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:172:134:E: end tag for "XREF" omitted, but OMITTAG NO was specified jade:./functions.sgml:172:89: start tag was here jade:./functions.sgml:191:228:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:208:153:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:230:222:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:233:256:E: end tag for "XREF" omitted, but OMITTAG NO was specified jade:./functions.sgml:233:205: start tag was here jade:./functions.sgml:233:256:E: end tag for "XREF" omitted, but OMITTAG NO was specified jade:./functions.sgml:233:159: start tag was here jade:./functions.sgml:238:23:E: there is no attribute "COLS" jade:./functions.sgml:274:267:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:274:286:E: end tag for "XREF" omitted, but OMITTAG NO was specified jade:./functions.sgml:274:103: start tag was here jade:./functions.sgml:305:237:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:326:274:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:346:312:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:367:267:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:368:141:E: end tag for "XREF" omitted, but OMITTAG NO was specified jade:./functions.sgml:368:18: start tag was here jade:./functions.sgml:390:307:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:418:181:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:439:176:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:467:192:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:488:186:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:516:290:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./functions.sgml:535:222:E: reference to entity "lt" for which no system identifier could be generated jade:./api.sgml:36:223: entity was defined here jade:./website.dsl:2:95:W: cannot generate system identifier for public text "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" jade:./website.dsl:18:37:E: no style-specification or external-specification with ID "DOCBOOK" libusb Developers Guide Johannes Erdfelt johannes@erdfelt.com 0.3 June 28, 2002 jerdfelt More cleanups. Add the rest of the API and clean up some places. Add some examples. Hopefully, this should document the entire 0.1 API now. 0.2 June 11, 2002 jerdfelt Cleanup, update for all of the changes that have happened in the last couple of months. 0.1 August 26, 2001 jerdfelt First stab. libusb Preface This document's purpose is to explain the API for libusb and how to use it to make a USB aware application Any suggestions, corrections and comments regarding this document can be sent to the author: Johannes Erdfelt or the libusb developers mailing list. Introduction Overview This documentation will give an overview of how the v0.1 libusb API works and relates to USB. Work is rapidly progressing on a newer version of libusb, to be v1.0, which will be a redesigned API and is intended to obsolete v0.1. You may want to check the libusb website to see if it is stable and recommended. This documentation assumes that you have a good understanding of USB and how it works. If you don't have a good understanding of USB, it is recommended you obtain the USB v1.1 and/or v2.0 specs and read them. libusb is geared towards USB 1.1, however from the perspective of libusb, USB 2.0 won't be a significant change for libusb Current OS support Linux (2.2, 2.4 and on) FreeBSD, NetBSD and OpenBSD Darwin/MacOS X API This is the external API for applications to use. The API is relatively lean and designed to have close analogies to the USB specification. The v0.1 API was mostly hacked together and kludged together without much forethought and as a result, it's missing quite a few features. v1.0 is intended to rectify this. Devices and interfaces The libusb API ties an open device to a specific interface. This means that if you want to claim multiple interfaces on a device, you should open the device multiple times to receive one usb_dev_handle for each interface you want to communicate with. Don't forget to call . Timeouts Timeout's in libusb are always specified in milliseconds. Data Types libusb uses both abstracted and non abstracted structures to maintain portability. Synchronous All functions in libusb v0.1 are synchronous, meaning the functions block and wait for the operation to finish or timeout before returning execution to the calling application. Asynchronous operation will be supported in v1.0, but not v0.1. Return values There are two types of return values used in libusb v0.1. The first is a handle returned by . The second is an int. In all cases where an int is returned, = 0 is a success and 0 is an error condition. Functions Core These functions comprise the core of libusb. They are used by all applications that utilize libusb. usb_init Initialize libusb Description void usb_init Just like the name implies, usb_init sets up some internal structures. usb_init must be called before any other libusb functions. usb_find_busses Finds all USB busses on system Description int usb_find_busses usb_find_busses will find all of the busses on the system. Returns the number of changes since previous call to this function (total of new busses and busses removed). usb_find_devices Find all devices on all USB devices Description int usb_find_devices usb_find_devices will find all of the devices on each bus. This should be called after . Returns the number of changes since the previous call to this function (total of new device and devices removed). usb_get_busses Return the list of USB busses found Description struct usb_bus *usb_get_busses usb_get_busses simply returns the value of the global variable usb_busses. This was implemented for those languages that support C calling convention and can use shared libraries, but don't support C global variables (like Delphi). Device operations This group of functions deal with the device. It allows you to open and close the device as well standard USB operations like setting the configuration, alternate settings, clearing halts and resetting the device. It also provides OS level operations such as claiming and releasing interfaces. usb_open Opens a USB device Description usb_dev_handle *usb_open struct *usb_device dev usb_open is to be used to open up a device for use. usb_open must be called before attempting to perform any operations to the device. Returns a handle used in future communication with the device. usb_close Closes a USB device Description int usb_close usb_dev_handle *dev usb_close closes a device opened with . No further operations may be performed on the handle after usb_close is called. Returns 0 on success or 0 on error. usb_set_configuration Sets the active configuration of a device Description int usb_set_configuration usb_dev_handle *dev int configuration usb_set_configuration sets the active configuration of a device. The configuration parameter is the value as specified in the descriptor field bConfigurationValue. Returns 0 on success or 0 on error. usb_set_altinterface Sets the active alternate setting of the current interface Description int usb_set_altinterface usb_dev_handle *dev int alternate usb_set_altinterface sets the active alternate setting of the current interface. The alternate parameter is the value as specified in the descriptor field bAlternateSetting. Returns 0 on success or 0 on error. usb_resetep Resets state for an endpoint Description int usb_resetep usb_dev_handle *dev unsigned int ep usb_resetep resets all state (like toggles) for the specified endpoint. The ep parameter is the value specified in the descriptor field bEndpointAddress. Returns 0 on success or 0 on error. Deprecated usb_resetep is deprecated. You probably want to use . usb_clear_halt Clears any halt status on an endpoint Description int usb_clear_halt usb_dev_handle *dev unsigned int ep usb_clear_halt clears any halt status on the specified endpoint. The ep parameter is the value specified in the descriptor field bEndpointAddress. Returns 0 on success or 0 on error. usb_reset Resets a device Description int usb_reset usb_dev_handle *dev usb_reset resets the specified device by sending a RESET down the port it is connected to. Returns 0 on success or 0 on error. Causes re-enumeration After calling usb_reset, the device will need to re-enumerate and thusly, requires you to find the new device and open a new handle. The handle used to call usb_reset will no longer work. usb_claim_interface Claim an interface of a device Description int usb_claim_interface usb_dev_handle *dev int interface usb_claim_interface claims the interface with the Operating System. The interface parameter is the value as specified in the descriptor field bInterfaceNumber. Returns 0 on success or 0 on error. Must be called! usb_claim_interface must be called before you perform any operations related to this interface (like , , etc). Return Codes code description -EBUSY Interface is not available to be claimed -ENOMEM Insufficient memory usb_release_interface Releases a previously claimed interface Description int usb_release_interface usb_dev_handle *dev int interface usb_release_interface releases an interface previously claimed with . The interface parameter is the value as specified in the descriptor field bInterfaceNumber. Returns 0 on success or 0 on error. Control Transfers This group of functions allow applications to send messages to the default control pipe. usb_control_msg Send a control message to a device Description int usb_control_msg usb_dev_handle *dev int requesttype int request int value int index char *bytes int size int timeout usb_control_msg performs a control request to the default control pipe on a device. The parameters mirror the types of the same name in the USB specification. Returns number of bytes written/read or 0 on error. usb_get_string Retrieves a string descriptor from a device Description int usb_get_string usb_dev_handle *dev int index int langid char *buf size_t buflen usb_get_string retrieves the string descriptor specified by index and langid from a device. The string will be returned in Unicode as specified by the USB specification. Returns the number of bytes returned in buf or 0 on error. usb_get_string_simple Retrieves a string descriptor from a device using the first language Description int usb_get_string_simple usb_dev_handle *dev int index char *buf size_t buflen usb_get_string_simple is a wrapper around usb_get_string that retrieves the string description specified by index in the first language for the descriptor and converts it into C style ASCII. Returns number of bytes returned in buf or 0 on error. usb_get_descriptor Retrieves a descriptor from a device's default control pipe Description int usb_get_descriptor usb_dev_handle *dev unsigned char type unsigned char index void *buf int size usb_get_descriptor retrieves a descriptor from the device identified by the type and index of the descriptor from the default control pipe. Returns number of bytes read for the descriptor or 0 on error. See for a function that allows the control endpoint to be specified. usb_get_descriptor_by_endpoint Retrieves a descriptor from a device Description int usb_get_descriptor_by_endpoint usb_dev_handle *dev int ep unsigned char type unsigned char index void *buf int size usb_get_descriptor_by_endpoint retrieves a descriptor from the device identified by the type and index of the descriptor from the control pipe identified by ep. Returns number of bytes read for the descriptor or 0 on error. Bulk Transfers This group of functions allow applications to send and receive data via bulk pipes. usb_bulk_write Write data to a bulk endpoint Description int usb_bulk_write usb_dev_handle *dev int ep char *bytes int size int timeout usb_bulk_write performs a bulk write request to the endpoint specified by ep. Returns number of bytes written on success or 0 on error. usb_bulk_read Read data from a bulk endpoint Description int usb_bulk_read usb_dev_handle *dev int ep char *bytes int size int timeout usb_bulk_read performs a bulk read request to the endpoint specified by ep. Returns number of bytes read on success or 0 on error. Interrupt Transfers This group of functions allow applications to send and receive data via interrupt pipes. usb_interrupt_write Write data to an interrupt endpoint Description int usb_interrupt_write usb_dev_handle *dev int ep char *bytes int size int timeout usb_interrupt_write performs an interrupt write request to the endpoint specified by ep. Returns number of bytes written on success or 0 on error. usb_interrupt_read Read data from a interrupt endpoint Description int usb_interrupt_read usb_dev_handle *dev int ep char *bytes int size int timeout usb_interrupt_read performs a interrupt read request to the endpoint specified by ep. Returns number of bytes read on success or 0 on error. Non Portable These functions are non portable. They may expose some part of the USB API on one OS or perhaps a couple, but not all. They are all marked with the string _np at the end of the function name. A C preprocessor macro will be defined if the function is implemented. The form is LIBUSB_HAS_ prepended to the function name, without the leading "usb_", in all caps. For example, if usb_get_driver_np is implemented, LIBUSB_HAS_GET_DRIVER_NP will be defined. usb_get_driver_np Get driver name bound to interface Description int usb_get_driver_np usb_dev_handle *dev int interface char *name int namelen This function will obtain the name of the driver bound to the interface specified by the parameter interface and place it into the buffer named name limited to namelen characters. Returns 0 on success or 0 on error. Implemented on Linux only. usb_detach_kernel_driver_np Detach kernel driver from interface Description int usb_detach_kernel_driver_np usb_dev_handle *dev int interface This function will detach a kernel driver from the interface specified by parameter interface. Applications using libusb can then try claiming the interface. Returns 0 on success or 0 on error. Implemented on Linux only. Examples There are some nonintuitive parts of libusb v0.1 that aren't difficult, but are probably easier to understand with some examples. Basic Examples Before any communication can occur with a device, it needs to be found. This is accomplished by finding all of the busses and then finding all of the devices on all of the busses: struct usb_bus *busses; usb_init(); usb_find_busses(); usb_find_devices(); busses = usb_get_busses(); After this, the application should manually loop through all of the busess and all of the devices and matching the device by whatever criteria is needed: struct usb_bus *bus; int c, i, a; /* ... */ for (bus = busses; bus; bus = bus->next) { struct usb_device *dev; for (dev = bus->devices; dev; dev = dev->next) { /* Check if this device is a printer */ if (dev->descriptor.bDeviceClass == 7) { /* Open the device, claim the interface and do your processing */ ... } /* Loop through all of the configurations */ for (c = 0; c < dev->descriptor.bNumConfigurations; c++) { /* Loop through all of the interfaces */ for (i = 0; i < dev->config[c].bNumInterfaces; i++) { /* Loop through all of the alternate settings */ for (a = 0; a < dev->config[c].interface[i].num_altsetting; a++) { /* Check if this interface is a printer */ if (dev->config[c].interface[i].altsetting[a].bInterfaceClass == 7) { /* Open the device, set the alternate setting, claim the interface and do your processing */ ... } } } } } } Examples in the source distribution The tests directory has a program called testlibusb.c. It simply calls libusb to find all of the devices, then iterates through all of the devices and prints out the descriptor dump. It's very simple and as a result, it's of limited usefulness in itself. However, it could serve as a starting point for a new program. Other Applications Another source of examples can be obtained from other applications. gPhoto uses libusb to communicate with digital still cameras. rio500 utils uses libusb to communicate with SONICblue Rio 500 Digital Audio Player. make[2]: *** [html/index.html] Erreur 1 make[2]: Leaving directory `/var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a/doc' make[1]: *** [all-recursive] Erreur 1 make[1]: Leaving directory `/var/tmp/portage/libusb-0.1.10a/work/libusb-0.1.10a' make: *** [all] Erreur 2 !!! ERROR: dev-libs/libusb-0.1.10a failed. !!! Function src_compile, Line 36, Exitcode 2 !!! emake failed !!! If you need support, post the topmost build error, NOT this status message.  ...done! >>> emerge (1 of 1) dev-libs/libusb-0.1.10a to / >>> checksums files ;-) libusb-0.1.8.ebuild >>> checksums files ;-) libusb-0.1.10a.ebuild >>> checksums files ;-) libusb-0.1.7-r1.ebuild >>> checksums files ;-) files/libusb-0.1.8-amd64-fPIC.patch >>> checksums files ;-) files/digest-libusb-0.1.8 >>> checksums files ;-) files/digest-libusb-0.1.10a >>> checksums files ;-) files/digest-libusb-0.1.7-r1 >>> checksums files ;-) files/0.1.10a-fbsd.patch >>> checksums src_uri ;-) libusb-0.1.10a.tar.gz