<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi Charles,<br><pre><i>At 2011-11-17 21:07:52,"Charles Lepple" <clepple@gmail.com> wrote:
>On Nov 16, 2011, at 8:10 PM, Andrew Min Chang wrote:
>
>> Oh, you gave me inspiration. The Difference between my NUT and testlibusb is: NUT is compiled with cross enviroment, while testlibusb was builded directly on the target board. I wonder if that made different. 
>> 
>> But still, NUT could not be configured even though testlibusb.c ran. Maybe my commands wrong?
>> # export PKG_CONFIG_PATH=/mnt/ARM_FS/lib/pkgconfig
>> # ./configure --with-usb --with-doc \
>> --host=arm-mv5sft-linux-gnueabi \
>> --prefix=/mnt/ARM_FS \
>> --with-usb-libs=-L/mnt/ARM_FS/lib \
>> --with-usb-includes=-I/mnt/ARM_FS/include
>> 
>> Accoding config.log, actually I found that libusb 0.1.12 was recognized (config.log attached). 
>
>If you have pkgconfig set up properly for the board, you should not need to pass --with-usb-*.
>
>Here's the output from config.log:
>
>configure:7259: checking for libusb version via pkg-config
>configure:7278: result: 0.1.12 found
>configure:7281: checking for libusb cflags
>configure:7298: result: -I/mnt/ARM_FS/include
>configure:7301: checking for libusb ldflags
>configure:7318: result: -L/mnt/ARM_FS/lib
>configure:7323: checking for usb.h
>configure:7323: arm-mv5sft-linux-gnueabi-gcc -c -I/mnt/ARM_FS/include  conftest.c >&5
>configure:7323: $? = 0
>configure:7323: result: yes
>configure:7338: checking for usb_init
>configure:7338: arm-mv5sft-linux-gnueabi-gcc -o conftest -I/mnt/ARM_FS/include   conftest.c -L/mnt/ARM_FS/lib >&5
>/tmp/ccbkkKUg.o: In function `main':
>conftest.c:(.text+0x8): undefined reference to `usb_init'
>collect2: ld returned 1 exit status
>
>Note the command line next to "configure:7338". It does not mention "-lusb", which refers to the libusb library itself. The "-L..." option simply tells the linker "search this directory for libraries specified with -l", but you still need to request that library.
>
>Try it without the --with-usb flags. If that still doesn't work, you may need to do something like "--with-usb-libs='-L/mnt/ARM_FS/lib -lusb'".<br><br></i>OK. I tried commands below:<br># export PKG_CONFIG_PATH=/mnt/ARM_FS/lib/pkgconfig<br>> ./configure --with-usb --with-doc \<br>> --host=arm-mv5sft-linux-gnueabi \<br>> --prefix=/mnt/ARM_FS<br>And I got the message "Asciidoc is required for documentation support and missing". This was not a important point, so I removed "--with-doc" and tried again. Then it worked! <br><br>But there came another problem. I ran:<br># make > make.log<br>And I got another error:<br><i>/root/uboot_NAS/cross/bin/../lib/gcc/arm-mv5sft-linux-gnueabi/4.3.2/../../../../arm-mv5sft-linux-gnueabi/bin/ld: warning: libupsclient.so.1, needed by ./.libs/libnutscan.so, not found (try using -rpath or -rpath-link)<br>./.libs/libnutscan.so: undefined reference to `upscli_splitaddr'<br>./.libs/libnutscan.so: undefined reference to `upscli_list_start'<br>./.libs/libnutscan.so: undefined reference to `upscli_list_next'<br>./.libs/libnutscan.so: undefined reference to `upscli_tryconnect'<br>collect2: ld returned 1 exit status<br>make[3]: *** [nut-scanner] Error 1<br>make[2]: *** [all] Error 2<br>make[1]: *** [all-recursive] Error 1<br>make: *** [all-recursive] Error 1</i><br><br>Uh... why does it search something like libups in cross compile tool? <br><i><br></i>The two log files are attached.<i><br><br> >
>> About libusb-compat, isn't that a interface to make programs compatible with later linusb-1.0?
>> Because libusb-compat is not able to be configured when dectectting libusb-0.1, even the oldest ver 0.1.0. libusb-compat config.log is attached, too.
>
>libusb-compat and libusb-1.0 should be equivalent to libusb-0.1.x. However, since NUT is developed with the libusb-0.1.x series, it does not make sense to have two variables (libusb-compat and libusb-1.0) when we could debug with one (libusb-0.1.x)
>
>> You can see the error message "checking for LIBUSB_1_0... configure: error: Package requirements (libusb-1.0 >= 0.9.1) were not met".
>
>In order to provide the libusb-0.1 API, libusb-compat depends on libusb-1.0. This is expected.</i><br><br> So, just use libusb-0.1.12 without libusb-compat is OK. Right? Now I use v0.1.12. </pre></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>