Using GCCSDK

From RISC OS

(Difference between revisions)
Jump to: navigation, search
(Specify what the output is)
(Using GCCSDK to cross-compile for RISC OS: More detail on build process internals)
Line 46: Line 46:
This will attempt to build in the ~/build/wget directory (that is, in build/wget in your home directory).  If the build is successful this will be deleted and the results placed in $GCCSDK_SRC/autobuilder/autobuilder_packages.  This is a Zip file which can be copied to RISC OS to be unpacked and run.  If not successful the ~/build/wget directory will remain for you to inspect.  The output from the build process is also saved in $GCCSDK_SRC/autobuilder/network/wget as either a file last-success or last-failure depending on what happened.
This will attempt to build in the ~/build/wget directory (that is, in build/wget in your home directory).  If the build is successful this will be deleted and the results placed in $GCCSDK_SRC/autobuilder/autobuilder_packages.  This is a Zip file which can be copied to RISC OS to be unpacked and run.  If not successful the ~/build/wget directory will remain for you to inspect.  The output from the build process is also saved in $GCCSDK_SRC/autobuilder/network/wget as either a file last-success or last-failure depending on what happened.
 +
 +
The cross-build process is controlled by files in the $GCCSDK_SRC/autobuilder/network/wget directory, mostly the 'setvars' file which is executed by $GCCSDK_SRC/autobuilder/build via fetch-program and build-program - look at these three scripts to see what's going on.  Sources are fetched automatically from the Debian project's source repository unless otherwise stated, then local patches (if any) are applied before configuring and building.
 +
 +
Porting a new package involves creating a new directory in a suitable place in $GCCSDK_SRC/autobuilder tree and producing a setvars file.  You may provide patch files in that directory with names ending in .p will be automatically applied.  Look at some of other packages' directories for examples.
See autobuilder documentation gccsdk/autobuilder/AutoBuilder.html ([http://www.riscos.info/websvn/filedetails.php?repname=gccsdk&path=%2Ftrunk%2Fautobuilder%2FAutoBuilder.html&rev=0&sc=0 or see HTML source from WebSVN]) for more detailed instructions.
See autobuilder documentation gccsdk/autobuilder/AutoBuilder.html ([http://www.riscos.info/websvn/filedetails.php?repname=gccsdk&path=%2Ftrunk%2Fautobuilder%2FAutoBuilder.html&rev=0&sc=0 or see HTML source from WebSVN]) for more detailed instructions.

Revision as of 10:34, 8 October 2006

Using GCCSDK to cross-compile for RISC OS

This is a quick outline of how to use GCCSDK and its autobuilder. We hope to expand this section soon.

Cross-compiling for RISC OS is done by using GCCSDK on Unix-alike host system, such as GNU/Linux, FreeBSD, Solaris, MacOS X or even Windows (under Cygwin). To get started, ensure you have a Subversion client installed for your system, and fetch the GCCSDK source to the current directory (which needs about 280MB disc space):

mkdir gccsdk
svn co svn://svn.riscos.info/gccsdk/branches/release_3_4_6/gcc gccsdk/gcc
svn co svn://svn.riscos.info/gccsdk/trunk/autobuilder gccsdk/autobuilder

Detailed instructions are given in the file gccsdk/gcc/README (or the WebSVN copy), however they are essentially as follows. Refer to the README where assumptions are noted.

You'll need at least the following programs (or later versions) installed on your Unix-alike machine:

gcc		version 3 recommended
svn (subversion)
bash		for this example
autoconf 	version 2.50
autoheader
bison		version 1.27
flex		version 2.5.4
gperf		version 2.7.2
sed		version 2.05
GNU make	version 3.80
makeinfo	version 4.2 (see README for Debian notes)

We also need to be able to write to a directory named /home/riscos (this can be changed, see the README). First we set the GCCSDK_SRC variable so this tutorial can refer to the position of the sources.

 bash
 export GCCSDK_SRC=$PWD/gccsdk

Then we build GCCSDK (this may take many minutes, depending on the speed of your computer):

 cd gccsdk/gcc
 autoconf ; autoheader
 ./do-configure
 make setup
 make build-cross
 make porting-scripts

Now use the autobuilder to build a package:

 mkdir ~/build
 cd ~/build
 $GCCSDK_HOME/autobuilder/build -v wget

This will attempt to build in the ~/build/wget directory (that is, in build/wget in your home directory). If the build is successful this will be deleted and the results placed in $GCCSDK_SRC/autobuilder/autobuilder_packages. This is a Zip file which can be copied to RISC OS to be unpacked and run. If not successful the ~/build/wget directory will remain for you to inspect. The output from the build process is also saved in $GCCSDK_SRC/autobuilder/network/wget as either a file last-success or last-failure depending on what happened.

The cross-build process is controlled by files in the $GCCSDK_SRC/autobuilder/network/wget directory, mostly the 'setvars' file which is executed by $GCCSDK_SRC/autobuilder/build via fetch-program and build-program - look at these three scripts to see what's going on. Sources are fetched automatically from the Debian project's source repository unless otherwise stated, then local patches (if any) are applied before configuring and building.

Porting a new package involves creating a new directory in a suitable place in $GCCSDK_SRC/autobuilder tree and producing a setvars file. You may provide patch files in that directory with names ending in .p will be automatically applied. Look at some of other packages' directories for examples.

See autobuilder documentation gccsdk/autobuilder/AutoBuilder.html (or see HTML source from WebSVN) for more detailed instructions.

Links

Personal tools