Difference between revisions of "Setup Cross Compile For ARM/hu"

From Lazarus wiki
Jump to navigationJump to search
m
m
Line 2: Line 2:
  
 
Hamarosan...
 
Hamarosan...
 +
<!--
 +
== Cross Compile with FPC for ARM (e.g. Zaurus) ==
 +
 +
* First, setup a cross compilation environment; you can get more information about this here [http://www.cartel-securite.fr/pbiondi/zaurus/crosscompile.html], here [http://www.nautilus6.org/operation/doc/wide-memo-nautilus6-zaurus-ccenv-setup-00.txt] and here [http://projects.buici.com/arm/cross/].
 +
* Install the lastest native fpc [http://sourceforge.net/project/showfiles.php?group_id=89339 from sourceforge]
 +
* get an arm fpc snapshot from the downloads page of [http://users.pandora.be/Jan.Van.hijfte/qtforfpc/qtedemo.html FPC Qt Binding for Zaurus]
 +
* Download it to somedir. The name of the tar file may be different ofcourse
 +
<tt>
 +
cd somedir<br>
 +
tar zxvf arm-linux-fpc.i386-linux-20050217.tar.gz
 +
</tt>
 +
* you will find a 'lib/fpc/1.9.7/units/arm-linux/...' dir. The version may be '1.9.8' or higher.
 +
* create FPC library directory structure for fpc in a lib dir on your system
 +
* most systems use '/usr/local/lib', some use '/usr'
 +
<tt>
 +
mkdir -p /usr/local/lib/fpc/1.9.7/units<br>
 +
cp -fr lib/fpc/1.9.7/units/arm-linux /usr/local/lib/fpc/1.9.7/units/
 +
</tt>
 +
* copy the fpc cross compiler to its default place
 +
<tt>
 +
cp lib/fpc/1.9.7/ppcarm /usr/local/lib/fpc/1.9.7
 +
</tt>
 +
* set a soft link to it in a bin dir in your path
 +
* most distributions use '/usr/local/bin', some '/usr/bin'
 +
<tt>
 +
ln -sf /usr/local/lib/fpc/1.9.7/ppcarm /usr/local/bin/ppcarm
 +
</tt>
 +
* verify you can call ppcarm, it should return something like '1.9.7' and not 'command not found'
 +
<tt>
 +
ppcarm -iV
 +
</tt>
 +
* download [ftp://ftp.freepascal.org/pub/fpc/snapshot/v19/arm-linux/binutils.tar.gz FPC 1.9.x ARM binutils] to somedir
 +
<tt>
 +
cd somedir<br>
 +
tar zxvf binutils.tar.gz<br>
 +
</tt>
 +
* copy the 2 programs in the tar to a bin dir in your path
 +
<tt>
 +
cp arm-linux-* /usr/local/bin<br>
 +
</tt>
 +
* create a 'Hello World' program and compile it
 +
<tt>
 +
echo "program hello; begin writeln('Hello World'); end." > hello.pas<br>
 +
ppcarm -XParm-linux- hello.pas<br>
 +
</tt>
 +
* output should be something like this:
 +
 +
  # ppcarm -XParm-linux- hello.pas
 +
  Free Pascal Compiler version 1.9.7 [2005/02/17] for arm
 +
  Copyright (c) 1993-2005 by Florian Klaempfl
 +
  Target OS: Linux for ARM
 +
  Compiling hello.pas
 +
  Assembling hello
 +
  Linking hello
 +
  1 Lines compiled, 0.2 sec
 +
 +
* Copy it to the home directory of the user 'zaurus' on your zaurus device.
 +
* With a ssh setup this could be as simple as:
 +
<tt>scp hello zaurus:/home/zaurus</tt>
 +
* Install terminal program on your Zaurus. For a Zaurus SL6000: see manual on CD.
 +
* Run the terminal program. On a SL6000 the console will default to user 'zaurus' in its home dir /home/zaurus
 +
* Run the program
 +
<tt>
 +
./hello
 +
</tt>
 +
* Output should be something like:
 +
Hello World
 +
-->

Revision as of 14:27, 6 June 2009

Template:Translate

Hamarosan...