Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: libusb-1.0 for NetBSD



On Wed, May 30, 2012 at 11:46 PM, Thomas Klausner <tk%giga.or.at@localhost> 
wrote:
> On Wed, May 30, 2012 at 10:18:59PM +0800, Xiaofan Chen wrote:
>> Thanks. You may want to try libusb-compat-0.1 as well.
>> http://www.libusb.org/wiki/libusb-compat-0.1
>
> I've packaged this as well and made it depend on libusbx for now.
>
> We need two switches in pkgsrc so users can decide on libusb1 vs.
> libusbx and libusb vs libusb-compat...

Thanks. Yes that is a good thing to let user chooses the options
they want to go.

Here is the build/run log for libusb-compat-0.1.4 release.

localhost$ ./configure --enable-examples-build
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... i386-unknown-netbsdelf6.0.
checking host system type... i386-unknown-netbsdelf6.0.
checking how to print strings... print -r
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... no
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... match_pattern
/lib[^/]+(\.so|_pic\.a)$
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... 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 for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... NetBSD ld.elf_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
checking for inline... inline
checking whether gcc and cc understand -c and -o together... yes
checking for pkg-config... /usr/pkg/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBUSB_1_0... yes
configure: creating ./config.status
config.status: creating libusb.pc
config.status: creating libusb-config
config.status: creating Makefile
config.status: creating libusb/Makefile
config.status: creating examples/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default commands

localhost$ make
make  all-recursive
Making all in libusb
/bin/ksh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
-I..    -fvisibility=hidden -std=gnu99 -fgnu89-inline -Wall -Wundef
-Wunused -Wstrict-prototypes -Werror-implicit-function-declaration
-Wno-pointer-sign -Wshadow -I/usr/pkg/include/libusb-1.0 -g -O2 -MT
libusb_la-core.lo -MD -MP -MF .deps/libusb_la-core.Tpo -c -o
libusb_la-core.lo `test -f 'core.c' || echo './'`core.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden
-std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes
-Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow
-I/usr/pkg/include/libusb-1.0 -g -O2 -MT libusb_la-core.lo -MD -MP -MF
.deps/libusb_la-core.Tpo -c core.c  -fPIC -DPIC -o
.libs/libusb_la-core.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden
-std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes
-Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow
-I/usr/pkg/include/libusb-1.0 -g -O2 -MT libusb_la-core.lo -MD -MP -MF
.deps/libusb_la-core.Tpo -c core.c -o libusb_la-core.o >/dev/null 2>&1
mv -f .deps/libusb_la-core.Tpo .deps/libusb_la-core.Plo
/bin/ksh ../libtool --tag=CC    --mode=link gcc -fvisibility=hidden
-std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes
-Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow
-I/usr/pkg/include/libusb-1.0  -g -O2 -version-info 8:4:4  -release
0.1  -o libusb.la -rpath /usr/local/lib libusb_la-core.lo
-L/usr/pkg/lib -lusb-1.0
libtool: link: warning: library `/usr/pkg/lib/libusb-1.0.la' was moved.
libtool: link: gcc -shared  .libs/libusb_la-core.o   -Wl,-rpath
-Wl,/usr/pkg/lib -Wl,-rpath -Wl,/usr/pkg/lib -L/usr/pkg/lib
/usr/pkg/lib/libusb-1.0.so    -pthread -Wl,-soname -Wl,libusb-0.1.so.8
-o .libs/libusb-0.1.so.8.4
libtool: link: (cd ".libs" && rm -f "libusb-0.1.so.8" && ln -s
"libusb-0.1.so.8.4" "libusb-0.1.so.8")
libtool: link: (cd ".libs" && rm -f "libusb.so" && ln -s
"libusb-0.1.so.8.4" "libusb.so")
libtool: link: ar cru .libs/libusb.a  libusb_la-core.o
libtool: link: ranlib .libs/libusb.a
libtool: link: ( cd ".libs" && rm -f "libusb.la" && ln -s
"../libusb.la" "libusb.la" )
Making all in examples
gcc -DHAVE_CONFIG_H -I. -I.. -I../libusb    -std=gnu99 -fgnu89-inline
-Wall -Wundef -Wunused -Wstrict-prototypes
-Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g
-O2 -MT lsusb.o -MD -MP -MF .deps/lsusb.Tpo -c -o lsusb.o lsusb.c
mv -f .deps/lsusb.Tpo .deps/lsusb.Po
/bin/ksh ../libtool --tag=CC    --mode=link gcc -std=gnu99
-fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes
-Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g
-O2    -o lsusb lsusb.o ../libusb/libusb.la -lusb
libtool: link: warning: library `/usr/pkg/lib/libusb-1.0.la' was moved.
libtool: link: warning: library `/usr/pkg/lib/libusb-1.0.la' was moved.
libtool: link: gcc -std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused
-Wstrict-prototypes -Werror-implicit-function-declaration
-Wno-pointer-sign -Wshadow -g -O2 -o .libs/lsusb lsusb.o
-L/usr/pkg/lib ../libusb/.libs/libusb.so /usr/pkg/lib/libusb-1.0.so
-pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/pkg/lib
gcc -DHAVE_CONFIG_H -I. -I.. -I../libusb    -std=gnu99 -fgnu89-inline
-Wall -Wundef -Wunused -Wstrict-prototypes
-Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g
-O2 -MT testlibusb.o -MD -MP -MF .deps/testlibusb.Tpo -c -o
testlibusb.o testlibusb.c
mv -f .deps/testlibusb.Tpo .deps/testlibusb.Po
/bin/ksh ../libtool --tag=CC    --mode=link gcc -std=gnu99
-fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes
-Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g
-O2    -o testlibusb testlibusb.o ../libusb/libusb.la -lusb
libtool: link: warning: library `/usr/pkg/lib/libusb-1.0.la' was moved.
libtool: link: warning: library `/usr/pkg/lib/libusb-1.0.la' was moved.
libtool: link: gcc -std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused
-Wstrict-prototypes -Werror-implicit-function-declaration
-Wno-pointer-sign -Wshadow -g -O2 -o .libs/testlibusb testlibusb.o
-L/usr/pkg/lib ../libusb/.libs/libusb.so /usr/pkg/lib/libusb-1.0.so
-pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/pkg/lib

localhost$ cd examples/

localhost$ ./lsusb
1366:0101

localhost$ ./testlibusb -v
Dev #2: SEGGER - J-Link
  - Serial Number: xxxxxxxxxx
  wTotalLength:         32
  bNumInterfaces:       1
  bConfigurationValue:  1
  iConfiguration:       0
  bmAttributes:         c0h
  MaxPower:             50
    bInterfaceNumber:   0
    bAlternateSetting:  0
    bNumEndpoints:      2
    bInterfaceClass:    255
    bInterfaceSubClass: 255
    bInterfaceProtocol: 255
    iInterface:         0
      bEndpointAddress: 81h
      bmAttributes:     02h
      wMaxPacketSize:   64
      bInterval:        0
      bRefresh:         0
      bSynchAddress:    0
      bEndpointAddress: 02h
      bmAttributes:     02h
      wMaxPacketSize:   64
      bInterval:        0
      bRefresh:         0
      bSynchAddress:    0

With libusb-1.0 in, I believe more packages can be ported
to NetBSD.

I am probably the first one to try out libusb-1.0 under
NetBSD and I hope more people here will try it out,
report success and failures and improve the current codes.

The initial commit to add NetBSD support is here.
http://git.libusb.org/?p=libusb.git;a=commit;h=de41604560a57b2279ac1d0a10b8192a9224d284;js=1


-- 
Xiaofan


Home | Main Index | Thread Index | Old Index