Popcorn Hour Toolchain on Fedora 10

I've finally got the popcorn hour toolchain to compile on fedora 10.

Here I'll present a step-by-step how-to.

Step 1: Get the toolchain source

First you'll need to get the toolchain source: Syabas NMT (SMP8634) toolchain.

I used the version smp86xx_toolchain.20080505.tar.bz2.

Step 2: Ensure some dependent packages are installed

Next ensure that the following packages are installed, you can use Add/Remove software if you prefer:

$ yum install flex bison gettext genromfs ncurses-devel texinfo

There may be other packages you need to install, just install as needed.

Step 3: Build the toolchain

Now, I'll break the building into several steps since this is not so straight forward.

Build Step 1: Extract the toolchain

$ cd ~
$ mkdir toolchain
$ cd toolchain
$ tar xvf ~/Download/smp86xx_toolchain.20080505.tar.bz2

Build Step 2: make menuconfig

$ cd smp86xx_toolchain.20080505
$ export CFLAGS=-Wno-error
$ make menuconfig

Select Toolchain Options --->
Select Kernel Headers options (Linux 2.6.11.0 kernel headers) --->
Select uCLibc version 0.9.28.3 --->
Select binUtils version 2.17 --->
Select gcc version 4.0.4 --->

Select Exit
Select Exit

Save your new configuration.

Build Step 3: The first make attempt

$ make

This will complain about your compiler version (GCC 4.x), this is expected, just ignore it.

It wont take long before this fails complaining that `makeinfo' is missing on your system, although it is.

Build Step 4: Fixing the makefile for makeinfo

The bug here is that makeinfo version 4.12 is being seen as less than 4.9.. We'll just hack the makefile to fix (there is probably a better way, but this works):

$ vi ~/toolchain/smp86xx_toolchain.20080505/toolchain_build_mipsel_nofpu/binutils-2.17-build/Makefile

(if your not comfortable in vi, use gedit or whatever text editor you like)

Find the line like (your home dir name will be different):

MAKEINFO = /home/mr_stuff/toolchain/smp86xx_toolchain.20080505/toolchain_build_mipsel_nofpu/binutils-2.17/missing makeinfo

and change it to:

MAKEINFO = /usr/bin/makeinfo

Build Step 5: The second make attempt

Call make again:

$ make

When the build is done, the file toolchain-path.env will be created, that contains the environment settings necessary to use the toolchain.

Either make it executable and run it in your shell or source it in you shell before starting any cross compiling.

Running like:

$ cd ~/toolchain/smp86xx_toolchain.20080505/
$ ./toolchain-path.env

Or sourced like:

$ cd ~/toolchain/smp86xx_toolchain.20080505/
$ . toolchain-path.env

Now you're ready to compile..

Typically I have found I need to do the following to build a package for this tool chain..

Building a library for use in your toolchain

I am not sure if these steps are correct, but it's all I have managed to get working.

Let's say we want to build libpcre to use in our toolchain.

First download the library source and extract it.

$ cd toolchain
$ mkdir libpcre
$ cd libpcre
$ tar xvf ~/Download/pcre-7.8.tar.gz
$ cd pcre-7.8

Before running ./configure, it's best to run:

$ autoreconf -vfi

Then to build, I find I need to pass extra parameters to ./configure like:

$ ./configure --host=mipsel-linux --prefix=~/toolchain/smp86xx_toolchain.20080505/build_mipsel_nofpu/staging_dir/

The prefix will tell configure where to put the output when a make install is done.

Then the standard make && make install can be done:

$ make && make install

This should build and install your library to /toolchain/smp86xx_toolchain.20080505/build_mipsel_nofpu/staging_dir/

Getting an error when trying this

Hey im getting an error when i try to do this . (im working on a virtual machine but i doubt that would cause the problem)

this is the error im getting

Applying toolchain/kernel-headers/linux-libc-headers-2.6.11.0-cdrom.patch using plaintext:
toolchain/patch-kernel.sh: 44: patch: not found
Patch failed! Please fix toolchain/kernel-headers/linux-libc-headers-2.6.11.0-cdrom.patch!
make: *** [/home/adrian/toolchain/smp86xx_toolchain.20080505/toolchain_build_mipsel_nofpu/linux/.patched] Error 1

Can you please let me know what im doing wrong ? :)

Thank you

try "sudo apt-get install

try "sudo apt-get install patch"

Thx

Thx worked :) now to go to the cross compiling bit :D