关键字:海思3512 tcpdump 移植
不像TI的6446那样,海思3512的编译器 arm-samall-linux-gcc 没有集成pcap,所以在移植
tcpdump-4.0.0.tar.gz前先要交叉编译 libpcap-1.0.0.tar.gz。
一。交叉编译libpcap-1.0.0.tar.gz
[root@qljt libpcap-1.0.0]# pwd
/install/libpcap-1.0.0
[root@qljt libpcap-1.0.0]# vi configure
把下面内容注释掉。
#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; }; }
#fi
.......
# 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
[root@qljt libpcap-1.0.0]#./configure --host=arm CC=arm-hismall-linux-gcc --disable-ipv6
[root@qljt libpcap-1.0.0]# make
[root@qljt libpcap-1.0.0]# make install
二。下一步开始移植tcpdump-4.0.0.tar.gz
[root@qljt tcpdump-4.0.0]# pwd
/install/tcpdump-4.0.0
[root@qljt tcpdump-4.0.0]# vi configure
把下面内容注释掉
# 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
[root@qljt libpcap-1.0.0]#./configure --host=arm CC=arm-hismall-linux-gcc --disable-ipv6
[root@qljt libpcap-1.0.0]# vi Makefile
将INCLS项改为INCLS=-I.-I./../libpcap-1.0.0 -I$(srcdir)/missing -I/usr/local/include,
DEFS项改为DEFS=-DHAVE_CONFIG_H -I./../libpcap-1.0.0 -I/usr/local/include -I$(srcdir)missing -D_U="__attribute__((unused))"。
LDFLAGS=-L/usr/local/lib。
[root@qljt libpcap-1.0.0]#make
当前目录下有个tcpdump的二进制文件,这个就是交叉编译成功的tcpdump