# Building NetSurf on RISC OS

This document outlines the process required to get a build system for NetSurf set up on a RISC OS machine.

- Requirements
- Quick start
- Fetching and unpacking the libraries
- Acquiring and compiling the source

Last updated 21 March 2008

## Requirements

- A Filing System which supports long filenames
- !GCC 3.4.6 release 3 or later (http://gccsdk.riscos.info/)
- OSLib 6.80 or later (http://ro-oslib.sf.net/)
- Perl 5.8.8 or later (http://www.cp15.org/programming/)
- RISC OS SVN client (http://www.cp15.org/versioncontrol/)

## Quick start

This section details quick-start instructions for getting NetSurf compiled under RISC OS. If you want more detail, see the rest of this document.

1. Download and install the requirements listed above.
2. Download and install the pre-assembled tool and library tree (2.3MB).
3. Force the RISC OS SVN client to handle ,xxx extensions correctly by issuing `*Set svn$filetypeext ""`.
4. Check out the latest source code from SVN.

       svn co svn://svn.netsurf-browser.org/trunk/netsurf

5. Set the CSD appropriately, set the next slot to 6000k and invoke `make` from a TaskWindow.

## Fetching and unpacking the libraries

1. Download and unpack the pre-assembled tool and library tree (2.6MB).
2. Double-click on !NSTools to open the tree.
3. Consult the !NSTools.!Help file in conjunction with http://netsurf.strcprstskrzkrk.co.uk/developer/ in order to determine if any libraries need updating.
4. If necessary, merge any updated libraries into the !NSTools directory structure, renaming files into RISC OS format as appropriate (i.e. `foo/h` becomes `h.foo`). This should produce a directory tree like:

           !NSTools
             |
             | -- bin
             |       |
             |       | -- c
             |
             | -- include
             |       |
             |       | -- curl
             |       |     |
             |       |     | -- h
             |       |
             |       | -- h
             |       |
             |       | -- libxml
             |       |      |
             |       |      | -- h
             |       |
             |       | -- openssl
             |       |      |
             |       |      | -- h
             |
             | -- lib
                     |
                     | -- o

   with the headers in the "h" directories. [This step may not be required, depending upon the naming format used for the pre-built libraries]
5. Remove any filename extensions from the files in the lib directory (e.g. `libxml2/a` becomes `libxml2`)

## Acquiring and compiling the source

1. Force the RISC OS SVN client to handle ,xxx extensions correctly by issuing `*Set svn$filetypeext ""`. (This may be set permanently by uncommenting the appropriate line in !SVN's !Boot file)
2. Use the RISC OS SVN client to check the source out from SVN, using the following command:

       svn checkout svn://svn.netsurf-browser.org/trunk/netsurf

   This will check the latest sources out into a subfolder in the currently selected directory (CSD) entitled "netsurf". This folder is the root of the source tree. Diagrammatically:

            netsurf
              |
              | -- !NetSurf
              | -- content
              | -- css
              | -- debug
              | -- desktop
              | -- gtk
              | -- Docs
              | -- image
              | -- render
              | -- riscos
              | -- utils

3. Set the netsurf directory as your CSD, set the next slot to 6000k and invoke `make` from a TaskWindow
4. Go and make a cup of tea whilst the build happens (it takes approximately 30 minutes on a StrongARM RiscPC)