Sunday, April 30, 2006

 

The steps to setup Free Pascal compilation environment for Nokia 770

1. Install a normal FPC rpm for i386 linux, you'd better use the newest FPC release.

2. Download a FPC tarball for arm linux. The newest one I can find is 2.0.0. Unpack and copy to the directory in step1. Normally it's /usr/lib/fpc/2.0.2/units/arm-linux.

3. Install a ftp software on you 770, and try to copy the whole /usr/lib and /lib to your Desktop. And if it reports can't find some .so file when
compiling, make a link to the .so file. Such as, it reports: can't find shared library libpango-1.0.so, run "ln -s libpango-1.0.so.0 libpango-1.0.so". This will be a tedious work.

4. Write programs in FPC, and write a bash script to compile. My script is like this: (compile.sh)

#! /bin/sh

NoDebug=" -CX -Xs -XX "

if [ "$1" ]; then

echo "Compile for: $1"
rm *.ppu *.o

fi

if [ "$1" = "maemo" ]; then

MaemoLib="/home/kenny/temp/lib"
ARMLinux="/usr/lib/fpc/2.0.2/units/arm-linux"

ppcarm $NoDebug -XParm-linux- -n -Fu$ARMLinux -Fu$ARMLinux/* -Fl$MaemoLib test.pp

elif [ "$1" = "i386" ]; then

fpc $NoDebug test.pp

else

echo "Usage:"
echo " ./compile maemo"
echo " ./compile i386"

fi


Use this script, you can run "./compile i386" to compile and test on your desktop; and run "./compile maemo" to compile and transfer to your 770.

This page is powered by Blogger. Isn't yours?