maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   FreePascal on Nokia 770 (https://talk.maemo.org/showthread.php?t=1846)

Amper_CZ 2006-04-21 21:07

FreePascal on Nokia 770
 
I was successfully used FreePascal 1.9.8 for build of simple console "Hello Nokia 770 World" application.

Compiled without problems, started without problems - just with How-to for Zaurus

I'll continue with testing and reporting

zApe 2006-04-22 08:21

Amper_CZ, can you add download link?

Amper_CZ 2006-04-23 17:45

Quote:

Originally Posted by zApe
Amper_CZ, can you add download link?

I don't have it now (I'm on 770 now) but I want prepare 770 Pascal how-to.

I was started with http://www.freepascal.org/wiki/index...ompile_For_ARM but there is few bugs (invalid links,names and so ...) but all required files can be located on Freepascal sourceforge.


best regards,
Amper

smartkenny 2006-04-30 16:33

The steps to setup FPC compilation environment
 
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.

bestone 2006-06-23 09:28

fpc on N770
 
Dear all,

Some months ago, I also could generate code via FPC for the N770. I even have made a Hildon unit . But I have to admit that I gave up because at the end of the day the generated code was really too big comparing to the same in C. Almost 8 time. I used many options of the free pascal compiler but still too big code. :mad:
If any of you have found a way to reduce the code size to at least 10% more that it equivalent to C I would be very pleased to know.

cheers,

Bertrand

norayr 2010-09-18 19:37

Re: FreePascal on Nokia 770
 
I think this is because freepascal compiled binaries are linked statically to the runtime. There is no such thing as separate libpascal.
If you try to compile programs with gcc statically then you will find out that resulting binaries are 5-10 times more fat than pascal compiled ones.
Anyway, this doesn't simplify your task.
I would suggest to use smartlinking (-XX flag, if libs are also compiled with smartlinking) and then UPX. You'll have binaries which are comparable, or even smaller than if you compile the same with gcc.

norayr 2011-05-05 20:27

Re: FreePascal on Nokia 770
 
Besides:
http://wiki.lazarus.freepascal.org/C...n_Maemo_device
http://wiki.maemo.org/Compile_FreePascal_on_device

Arrancamos 2011-05-08 19:19

Re: FreePascal on Nokia 770
 
oh great, u guys r great! soon I will be able to code in this nice language :) keep working keep trying cheers

gerdich 2011-05-13 14:52

Re: FreePascal on Nokia 770
 
Quote:

I think this is because freepascal compiled binaries are linked statically to the runtime. There is no such thing as separate libpascal
You can also write programs with pure gtk (without the component suite of lazarus).
They compile well and are dynamically linked to the libraries of the n900.
If the programs are stripped from debug information the binaries are not big.

I've just tried it.

ajack 2011-05-13 15:15

Re: FreePascal on Nokia 770
 
My question to you guys is, how do you create a .deb installer file from the binary you compiled? I just ported my program to maemo (using N900), and I do not know how to create a .deb for it. Using Ubuntu, so Ubuntu centric instructions are appreciated. :)


All times are GMT. The time now is 00:24.

vBulletin® Version 3.8.8