Cross compile tcpdump:
Step 1: Down libpcap-1.3.0.tar.gz form http://www.tcpdump.org/
Step 2: Down tcpdump-4.3.0.tar.gz form http://www.tcpdump.org/
Step 3: Tar xvf libpcap-1.3.0.tar.gz
Step 4: Tar xvf tcpdump-4.3.0.tar.gz
Step 5: CD libpcap-1.3.0, touch cross_configure.sh as follow:
Mips_toolchain_dir =/opt/mips-4.4/bin
Export cross_compile = "$ {mips_toolchain_dir}/MIPS-Linux-GNU -"
Export AR = "$ {cross_compile} ar"
Export as = "$ {cross_compile}"
Export LD = "$ {cross_compile} lD"
Export Nm = "$ {cross_compile} nm"
Export cc = "$ {cross_compile} gcc-OS-pipe-O2-mtune = mips32r2-mabi = 32-d_largefile_source-d_largefile64_source-d_file_offset_bits = 64-El"
Export fc = "$ {cross_compile} gfortran"
Export ranlib = "$ {cross_compile} ranlib"
Export strip = "$ {cross_compile} strip"
Export objcopy = "$ {cross_compile} objcopy"
Export cflags = "-OS-pipe-O2-mtune = mips32r2-mabi = 32-d_largefile_source-d_largefile64_source-d_file_offset_bits = 64-El"
Export cxxflags = "-OS-pipe-O2-mtune = mips32r2-mabi = 32-d_largefile_source-d_largefile64_source-d_file_offset_bits = 64-El"
./Configure -- target = mipsel-Linux -- Host = mipsel-Linux -- With-pcap = Linux
Step 6:./cross_configure.sh, make
Step 7: CD tcpdump-4.3.0, touch cross_configure.sh as follow:
Mips_toolchain_dir =/opt/mips-4.4/bin
Export cross_compile = "$ {mips_toolchain_dir}/MIPS-Linux-GNU -"
Export AR = "$ {cross_compile} ar"
Export as = "$ {cross_compile}"
Export LD = "$ {cross_compile} lD"
Export Nm = "$ {cross_compile} nm"
Export cc = "$ {cross_compile} gcc-OS-pipe-O2-mtune = mips32r2-mabi = 32-d_largefile_source-d_largefile64_source-d_file_offset_bits = 64-El"
Export fc = "$ {cross_compile} gfortran"
Export ranlib = "$ {cross_compile} ranlib"
Export strip = "$ {cross_compile} strip"
Export objcopy = "$ {cross_compile} objcopy"
Export cflags = "-OS-pipe-O2-mtune = mips32r2-mabi = 32-d_largefile_source-d_largefile64_source-d_file_offset_bits = 64-El"
Export cxxflags = "-OS-pipe-O2-mtune = mips32r2-mabi = 32-d_largefile_source-d_largefile64_source-d_file_offset_bits = 64-El"
./Configure -- target = mipsel-Linux -- Host = mipsel-Linux
Step 8:./cross_configure.sh, make
Step 9: CP tcpdump-4.3.0/tcpdump to target board.
Step A: Use "tcpdump-W test. Cap" Capture packages and save to test. Cap file.