150 likes | 389 Views
Porting Applications. Speaker: Yi-Ji Jheng Date: 2007.12.12. Outline. Porting Applications. Porting Applications. Porting Applications. Porting some applications on Target Board hello.c tvia.c (osip) sip_reg.c (eXosip) rtpsend (ortp). Source Environment. /usr/local/toolchain.tar.gz
E N D
PortingApplications Speaker: Yi-Ji Jheng Date: 2007.12.12
Outline • Porting Applications
Porting Applications • Porting some applications on Target Board • hello.c • tvia.c (osip) • sip_reg.c (eXosip) • rtpsend (ortp)
Source Environment • /usr/local/toolchain.tar.gz • ap/ |-hello.c |-libeXosip-0.9.0.tar.gz |-libosip2-2.2.1.tar.gz |-ortp-0.13.1.tar.gz
Install Toolchain • #cd /usr/local • #tar zxvf toolchain.tar.gz • #PATH=$PATH:/usr/local/toolchain/bin • #mips-linux-gcc -v
Make hello.c • #cd ap/ • #mips-linux-gcc hello.c -o hello -static • #mips-linux-strip hello • # file hello • hello: ELF 32-bit MSBMIPS-I executable, MIPS, version 1 (SYSV), statically linked, stripped • Download on Target Board
Make libosip with toolchain • #tar zxvf libosip2-2.2.1.tar.gz • #cd ./libosip2-2.2.1 • #./configure \ --prefix=/usr/local \ --host=mips-linux \ --enable-static \ --disable-shared • #make • #make install • #ll /usr/local/lib
Make tvia.c • #cd ./src/test • #mips-linux-gcc tvia.c -o tvia \ -I/usr/src/ap/libosip2-2.2.1/include \ -losipparser2 \ -L/usr/local/lib \ -static • #mips-linux-strip tvia • #file tvia • tvia: ELF 32-bit MSB MIPS-I executable, MIPS, version 1 (SYSV), statically linked, stripped
Make eXosip with Toolchain • #tar zxvf libeXosip-0.9.0.tar.gz • #cd ./libeXosip-0.9.0 • #./configure \ --host=mips-linux --prefix=/usr/local \ --disable-shared --enable-static \ --enable-pthread --disable-tools \ --disable-phapi --disable-miniua \ --disable-josua --disable-glib --disable-ms \ --disable-ortp --disable-gsm --disable-ilbc • #make • #make install
Make sip_reg.c • #cd ./tools/ • #mips-linux-gcc sip_reg.c -o sip_reg \ -static \ -I/usr/local/include \ -leXosip -losip2 -losipparser2 -lpthread \ -L/usr/local/lib • #mips-linux-strip sip_reg • #file sip_reg • sip_reg: ELF 32-bit MSB MIPS-I executable, MIPS, version 1 (SYSV), statically linked, stripped
Make ortp with toolchain • #tar zxvf ortp-0.13.1.tar.gz • #cd ./ortp-0.13.1 • #./configure \ --host=mips-linux \ --prefix=/usr/local \ --disable-shared --enable-static \ --disable-ipv6 --enable-mode64bit=no • #make • #make install
Make rtpsend.c • #cd ./src/tests • #mips-linux-gcc rtpsend.c -o rtpsend \ -static \ -I/usr/local/include/ \ -lortp -lpthread \ -L/usr/local/lib • #mips-linux-strip rtpsend • # file rtpsend • rtpsend: ELF 32-bit MSB MIPS-I executable, MIPS, version 1 (SYSV), statically linked, stripped
Download Applications on Target Board • 1. Setup environment • Target board of network • #ifconfig eth1 <IP> netmask <netmask> • #route add default gw <gateway IP> • 2. Download ap. on PC that uses Winscp • 3. On Target Board and Use tftp command to download ap. • #tftp -g -r <filename> <tftp server IP> • 4. Execute ap. • #chmod 755 <ap.>