GnuPoc tool package
===================

First you have to install the compiler needed for your SDK. The rest of
the toolchain can be used through wine, or be used in (more or less
compatible) native versions, included here.

These tools can also be used with SDKs in the sdk2unix-style by Rudolf
König.


GCC for S60 1st and 2nd ed
--------------------------

Download the source to the GCC version for symbian,
from http://www.symbianos.org/download/gcc-539-2aeh-source.tar.bz2
or http://www.martin.st/symbian/gcc-539-2aeh-source.tar.bz2. Then
compile and install it using the install_gcc_539 script:

./install_gcc_539 gcc-539-2aeh-source.tar.bz2 ~/symbian-gcc

If there are build problems, make sure curses development libraries are
installed, the errors if this is missing aren't too descriptive.


GCC for S60 3rd/5th ed, UIQ 3 and Symbian^3
-------------------------------------------

On linux, you can use the prebuilt binaries from CodeSourcery,
http://www.codesourcery.com/gnu_toolchains/arm/releases/2005Q1C,
select IA32 GNU/Linux, or from
http://www.martin.st/symbian/gnu-csl-arm-2005Q1C-arm-none-symbianelf-i686-pc-linux-gnu.tar.bz2.
To use these, just extract the package to a directory - run these commands
in your home directory:

mkdir csl-gcc
cd csl-gcc
tar -jxvf ../gnu-csl-arm-2005Q1C-arm-none-symbianelf-i686-pc-linux-gnu.tar.bz2

Otherwise (on other platforms), you can build the CodeSourcery GCC from
source. Download the source package from the CodeSourcery url above, or
from
http://www.martin.st/symbian/gnu-csl-arm-2005Q1C-arm-none-symbianelf.src.tar.bz2.

In this case, compile it using the install_csl_gcc script:

./install_csl_gcc gnu-csl-arm-2005Q1C-arm-none-symbianelf.src.tar.bz2 ~/csl-gcc

This requires that you have flex and bison installed.


Experimental GCC 4.x for S60 3rd/5th ed, UIQ 3 and Symbian^3
------------------------------------------------------------

If you for some reason want to use a newer GCC version, there
is experimental support for this. The currently supported
releases are CodeSourcery 2009q1-162, 4.4-172 and 2011.09-67,
in addition to the standard one above. They can be downloaded from
http://www.codesourcery.com/sgpp/lite/arm/portal/release822 (for 2009q1-162),
http://www.codesourcery.com/sgpp/lite/arm/portal/release1258 (for 4.4-172) and
https://sourcery.mentor.com/sgpp/lite/arm/portal/release1991 (for 2011.09-67).
Select IA32 GNU/Linux TAR, IA32 GNU/Linux Installer, IA32 Mac
OS X Installer, or Source TAR for other platforms, depending
on which ones are available for the release you chose.

If using the IA32 GNU/Linux TAR package, just extract it:
tar -jxvf arm-2009q1-162-arm-none-symbianelf-i686-pc-linux-gnu.tar.bz2
If using the installer version, just download the installer,
make it executable (using chmod +x) and launch it.

For the 2009q1-162 version, fix libgcc.a in the extracted directory:
./fix_csl_gcc_div ~/arm-2009q1
(This command should be executed in the gnupoc-package/tools
directory, and ~/arm-2009q1 is where the toolchain was
extracted above). This step isn't required for the 4.4-172 release.

For the 2011.09-67 version, add the object files from libgcc_eh.a to
libgcc.a, by running:
./fix_csl_gcc_eh ~/arm-2011.09


In order to build from source:
./install_csl_gcc_2009q1 arm-2009q1-162-arm-none-symbianelf.src.tar.bz2 ~/csl-gcc-2009q1
or:
./install_csl_gcc_4.4-172 symbian-adt-4.4-172-arm-none-symbianelf.src.tar.bz2 ~/csl-gcc-4.4-172
or:
./install_csl_gcc_2011.09-67 arm-2011.09-67-arm-none-symbianelf.src.tar.bz2 ~/csl-gcc-2011.09-67

See more info about using the newer GCC versions on
http://wiki.forum.nokia.com/index.php/How_to_use_GCCE_4_with_Symbian_SDKs.
Most of the issues mentioned there should be automatically worked
around by the gnupoc SDK patches.


The rest of the toolchain
-------------------------

If you want to use native versions of the SDK tools instead of running
them through wine (using the native versions is strongly suggested),
compile and install them using the appropriate script:

./install_eka1_tools ~/symbian-gcc

or

./install_eka2_tools ~/csl-gcc

depending on which toolchain they're for. (EKA1 is for S60 1st and 2nd ed,
EKA2 is for S60 3rd/5th and UIQ 3.0 onwards.) Note, both EKA1 and EKA2
tools require zlib, the EKA2 tools also require openssl libraries.



The tools for eka2 includes a hacked version of gnu make, to handle
external makefiles which uses dos-style paths with backslashes. This,
toghether with the mifconv replacement, a symlink named rem and a small
script named del, seems to be able to handle many icon makefiles. In some,
however, there might be some case issues.

Rcomp is somewhat hacked, to handle both Symbian 6 resources (by
adding the -6 flag) and to handle some new things in resources in 9.
This included cleaning up the lexer and grammar files so that flex and
yacc could generate new code from them. This also added some changes to
the integration with the rest of the application. In practice, this might
give less informative error messages.

This package also includes a drop-in-replacement for elf2e32. It doesn't
support all the command line parameters the original one does, but works
for building binaries in all tested cases.

Makesis is a modified version of the original makesis-2 released by Symbian.
The parser has been modified to support the new pkg file syntax, the
sis file generation backend is written from scratch. This also contains
a signsis replacement and a makekeys replacement (with slightly different
syntax compared to the original makekeys).

If you have problem with any of these native tools, just remove it from
the toolchain directory, and the build scripts will use the original exe
with wine instead, and let me know about the problems.



Martin Storsjo
martin@martin.st

