Toolchain

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (Where to go from here)
m (Downloading and installing the toolchain)
Line 28: Line 28:
 
  tar xjvf ~/sources/openmoko-Snapshot-20071126-arm-linux-gnueabi-toolchain.tar.bz2
 
  tar xjvf ~/sources/openmoko-Snapshot-20071126-arm-linux-gnueabi-toolchain.tar.bz2
  
Finally, you need to alter the PATH variable so that the toolchain binaries in <tt>/usr/local/openmoko/arm/bin/</tt> can be found. You may want to do this in your <tt>.bashrc</tt>, so that it gets done automatically in the future. To do it manually:
+
Finally, whenever you want to use this toolchain, you need to alter some environment variables, so that your tools will be found. The toolchain provides a script to do that, so the only thing you need to do is to source it:
  
  export PATH=$PATH:/usr/local/openmoko/arm/bin/
+
  source /usr/local/openmoko/setup-environment.sh
  
 
= Using the toolchain to build a sample project  =
 
= Using the toolchain to build a sample project  =

Revision as of 13:20, 27 November 2007

Contents

Introduction

A toolchain is a set of tools that allows you to compile code. For OpenMoko, we have to differenciate the following use-cases:

  • Developing a single application

For this, you should use a prebuilt toolchain from the OpenMoko project. Here you can find a recipe to get started with this toolchain leading you through a series of steps to compile a project and run it on your target device. You might have heard about OpenEmbedded, however as an application programmer, you should not be using OpenEmbedded.

  • System Integration and customizing a distribution

For this task, you should use OpenEmbedded which builds its own cross compiler during the bootstrapping/build process. System Integration and customizing a distribution is out of scope of this page.

Prerequisites

You should be reasonably familiar with Linux and its command line tools, have an x86-compatible computer with at least 1G of free disk space. You should have experience with compiling programs from source using your local compiler. The remainder of this document will also assume you have write access in your home directory (~) and /usr/local/. If this is not the case, please call your local administrator for help.

Downloading and installing the toolchain

The prebuilt toolchain can be downloaded from [downloads.openmoko.org]:

mkdir ~/sources
cd ~/sources
wget http://downloads.openmoko.org/development/openmoko-Snapshot-20071126-arm-linux-gnueabi-toolchain.tar.bz2

Next, you want to extract it on your filesystem. This toolchain is not relocatable, it needs to be installed into /usr/local/openmoko/:

cd /
tar xjvf ~/sources/openmoko-Snapshot-20071126-arm-linux-gnueabi-toolchain.tar.bz2

Finally, whenever you want to use this toolchain, you need to alter some environment variables, so that your tools will be found. The toolchain provides a script to do that, so the only thing you need to do is to source it:

source /usr/local/openmoko/setup-environment.sh

Using the toolchain to build a sample project

First, download the sample project and extract it into your filesystem:

cd ~/sources
wget http://downloads.openmoko.org/development/openmoko-Sample-Project-20071126.tar.bz2
mkdir ~/coding
cd ~/coding
tar xjvf ~/sources/openmoko-Sample-Project-20071126.tar.bz2

Since this is the first time you configure the project, you need to call ./autogen.sh instead of ./configure to configure your sources.

cd ~/coding/openmoko-Sample-Project-20071126
./autogen.sh



Where to go from here

TODO: write (See: To-Do List)

Troubleshooting

TODO: write (See: To-Do List)
Personal tools

Introduction

A toolchain is a set of tools that allows you to compile code. For OpenMoko, we have to differenciate the following use-cases:

  • Developing a single application

For this, you should use a prebuilt toolchain from the OpenMoko project. Here you can find a recipe to get started with this toolchain leading you through a series of steps to compile a project and run it on your target device. You might have heard about OpenEmbedded, however as an application programmer, you should not be using OpenEmbedded.

  • System Integration and customizing a distribution

For this task, you should use OpenEmbedded which builds its own cross compiler during the bootstrapping/build process. System Integration and customizing a distribution is out of scope of this page.

Prerequisites

You should be reasonably familiar with Linux and its command line tools, have an x86-compatible computer with at least 1G of free disk space. You should have experience with compiling programs from source using your local compiler. The remainder of this document will also assume you have write access in your home directory (~) and /usr/local/. If this is not the case, please call your local administrator for help.

Downloading and installing the toolchain

The prebuilt toolchain can be downloaded from [downloads.openmoko.org]:

mkdir ~/sources
cd ~/sources
wget http://downloads.openmoko.org/development/openmoko-Snapshot-20071126-arm-linux-gnueabi-toolchain.tar.bz2

Next, you want to extract it on your filesystem. This toolchain is not relocatable, it needs to be installed into /usr/local/openmoko/:

cd /
tar xjvf ~/sources/openmoko-Snapshot-20071126-arm-linux-gnueabi-toolchain.tar.bz2

Finally, whenever you want to use this toolchain, you need to alter some environment variables, so that your tools will be found. The toolchain provides a script to do that, so the only thing you need to do is to source it:

source /usr/local/openmoko/setup-environment.sh

Using the toolchain to build a sample project

First, download the sample project and extract it into your filesystem:

cd ~/sources
wget http://downloads.openmoko.org/development/openmoko-Sample-Project-20071126.tar.bz2
mkdir ~/coding
cd ~/coding
tar xjvf ~/sources/openmoko-Sample-Project-20071126.tar.bz2

Since this is the first time you configure the project, you need to call ./autogen.sh instead of ./configure to configure your sources.

cd ~/coding/openmoko-Sample-Project-20071126
./autogen.sh



Where to go from here

TODO: write (See: To-Do List)

Troubleshooting

TODO: write (See: To-Do List)