Hello folks.
Here some infos for installing cross-arm-compiler on a working fpc-lazarus system.
Many-many thanks to Kjooob who have done all the work
1. Install FPC and Lazarus sources and SVNHere is the best link i have find to install it (explanations are in French, just follow the command or use a translator)
http://lazarus-fr.espace-malin.fr/index.php?option=com_content&view=article&id=44:installer-lazarus-et-freepascal-svn-sous-ubuntu&catid=2:installation-de-lazarus&Itemid=4
In this tuto i have installed the sources folder in
/home/user/lazarus (!!!! Replace
user by your
user name in all the command following !!!!).
2. Install & Configure Binutils 1) Download binutils-2.20.tar.gz from
http://ftp.gnu.org/gnu/binutils/binutils-2.20.tar.gz2) Extract binutils-2.20.tar.gz in:
home/user/fpc_tools/binutils-2.20
3) From console :
cd /fpc_tools/binutils-2.20
4) From console :
./configure --target=arm-linux --disable-werror5) From console :
make6) From console :
sudo make install7) From console :
mkdir home/user/lazarus/fpc/binutils
ln -s /usr/local/bin/arm-linux-ar home/user/lazarus/fpc/binutils/ar
ln -s /usr/local/bin/arm-linux-ld home/user/lazarus/fpc/binutils/ld
sudo mv /usr/local/bin/arm-linux-as /usr/local/bin/arm-linux-as_org
8 ) From console :
sudo gedit /usr/local/bin/arm-linux-as
paste:
#!/bin/sh
/usr/local/bin/arm-linux-as_org -meabi=5 $@
9) save and close gedit
10) From console :
sudo chmod +x /usr/local/bin/arm-linux-as11) From console :
ln -s /usr/local/bin/arm-linux-as home/user/lazarus/fpc/binutils/as
3. Configure FPC for ARM:1) From console :
cd /lazarus/fpc/2.5.1/2) From console :
sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/user/lazarus/fpc/binutils/ OPT=-dFPC_ARMEL INSTALL_PREFIX=/usr 3) From console :
sudo gedit /etc/fpc.cfg4) Paste at end:
#DEFINE LAZARUS
-Fu/usr/lib/fpc/2.5.1/units/$fpctarget/*
-Fl/usr/lib/fpc/2.5.1/units/$fpctarget/rtl/
-a
-Sd
-Xd
-Xs
-O-
#IFDEF CPUARM
-XP/home/kjow/lazarus/fpc/binutils/
-Xr/usr/lib/fpc/2.5.1/units/arm-linux/rtl/
-Xr/home/kjow/lazarus/fpc/libcross
-XR/home/kjow/lazarus/fpc/
-darm
-Tlinux
#ENDIF
5) save and close gedit
6) From console :
sudo ln -sf /usr/lib/fpc/2.5.1/ppcrossarm /usr/local/bin/ppcarm4. Cross compile the LCL: From console :
sudo startlazarus From the IDE:
* Open Tools / Configure Build Lazarus / Advanced Build Options.
* In Target OS write
linux and in Target CPU write
arm.
* Set LCL and Package registration to Build (the middle radio button) and all other to None (left radio buttons).
* Click the Build button.
5. Set Targets: From the IDE:
* Set in Project / Compiler Options / Code / Target OS (-T):
Linux * Set in Project / Compiler Options / Code / Target CPU family (-P):
armThat all folks