2013年6月17日 星期一

[Embedded System] How to compile libpcap-1.1.1 and tcpdump-4.1.1 into Embedded System


[Embedded System] How to compile libpcap-1.1.1 and tcpdump-4.1.1 into Embedded System



1. Download  libpcap-1.1.1 and tcpdump-4.1.1 from http://www.tcpdump.org/#latest-release.

After download the source code, then decompress it.



2. Start to compile the source code.



###########################################

#  libpcap-1.1.1

#! /bin/sh

PATH=/Int/build/bin:$PATH # Change path. Let the compiler know where is i686-cm-linux-gcc.



export CPPFLAGS=""

export LDFLAGS=""

export CFLAGS=""

export AR=i686-cm-linux-ar

export AS=i686-cm-linux-as

export LD=i686-cm-linux-ld

export RANLIB=i686-cm-linux-ranlib

export CC=i686-cm-linux-gcc

export NM=i686-cm-linux-nm

export YACC=i686-cm-linux-yacc

export ARCH=arm



./configure --target=i686-cm-linux \

--host=i686-cm-linux \

--prefix=/home/happy/test/libpcap \

--exec-prefix=/home/happy/test/libpcap



make

make install



###########################################

#  tcpdump-4.1.1

#! /bin/sh

PATH=/Int/build/bin:$PATH # Change path. Let the compiler know where is i686-cm-linux-gcc.



export CPPFLAGS=""

export LDFLAGS="-L/home/happy/test/libpcap/lib"

export CFLAGS=""

export AR=i686-cm-linux-ar

export AS=i686-cm-linux-as

export LD=i686-cm-linux-ld

export RANLIB=i686-cm-linux-ranlib

export CC=i686-cm-linux-gcc

export NM=i686-cm-linux-nm

export YACC=i686-cm-linux-yacc

export ARCH=arm



./configure \

--target=i686-cm-linux \

--host=i686-cm-linux \

--prefix=/home/happy/test/tcpdump \

--exec-prefix=/home/happy/test/tcpdump



make

make install

###########################################





Reference :



0 意見:

張貼留言