交叉编译libpcap-0.9.5.tar.gz
1. 声明环境变量:export PATH=/usr/local/arm/2.95.3/bin:$PATH
2. 解压libpcap-0.9.5.tar.gz,cd进入目录,修改confiugre文件,把下面两段注释掉
#if test -z "$with_pcap" && test "$cross_compiling" = yes; then
# { { echo "$as_me:$LINENO: error: pcap type not determined when cross-compiling; use --with-pcap=..." >&5
#echo "$as_me: error: pcap type not determined when cross-compiling; use --with-pcap=..." >&2;}
# { (exit 1); exit 1; }; }
# f i
.......
# if test $ac_cv_linux_vers = unknown ; then
# { { echo "$as_me:$LINENO: error: cannot determine linux version when cross-compiling" >&5
# echo "$as_me: error: cannot determine linux version when cross-compiling" >&2;}
# { (exit 1); exit 1; }; }
# fi
3. 执行./configure --host=arm-linux,这样就会使用arm-linux-gcc进行configure,生成Makefile
4. 修改Makefile的prefix项为prefix=/usr/local/arm/2.95.3/arm-linux,同时注意查看Makefile中的CC项,已经为arm-linux-gcc了,呵呵。
5. 接下来make,make install,完成了libpcap的编译和安装,查看/usr/local/arm/2.95.3/arm-linux/include,该目录下增加了三个pcap的文件库
编译 usbutils-0.90.tar.gz (包含lsusb工具)
下载usbutils-0.90.tar.gz解压进入
./configure CC=arm-none-linux-gnueabi-gcc
--host=arm-none-linux-gnueabi
LIBUSB_CFLAGS=/home/libusb-0.1.12/install/include LIBUSB_LIBS=/home/libusb-0.1.12/install/lib/libusb.so CPPFLAGS=-I/home/libusb-0.1.12/install/include
CFLAGS="-O2"
--prefix=/home/usbutils-0.90/install
make
make install
Looking for active driver ...
USB error: could not get bound driver: No data available
No driver found. Either detached before or never attached
USB error: error submitting URB: No such file or directory
Could not send INQUIRY message (error -2)
Trying to send message 1 to endpoint 0x01 ...
USB error: error submitting URB: No such file or directory
Sending the message returned error -2. Trying to continue
Resetting response endpoint 0x81
Resetting message endpoint 0x01
-> Run lsusb to note any changes. Bye.
出现这种问题修改文件drivers/usb/storage/unusual_devs.h,去掉对移植网卡ID的屏蔽,或者换个usb_modeswitch版本试试。