next up previous contents index
Next: Compiling busybox-0.60.5 Up: Setting up the uClibc Previous: Setting up the uClibc   Contents   Index


Setting up uClibc

First, we need to download the appropriate source package:


Table 4.1: Source package, size and URL for uclibc.
Package Size License URL
uClibc-0.9.19 1.4 MB LGPLv2 http://www.uclibc.org/downloads/uClibc-0.9.19.tar.bz2


I'm assuming, you'll collect the package sources under ~/Dreamcast/SRC, so we can unpack the archive with:

$ cd Dreamcast/BUILD
$ bunzip2 -c ../SRC/uClibc-0.9.19.tar.bz2 | \
  tar -xv -C .
$ cd uClibc-0.9.19

Now, we have to set up some environment variables for getting the correct options in the configuration menu:

$ export TARGET_ARCH=sh
$ export NATIVE_CC=gcc
$ export CROSS=sh4-linux-
$ export KERNEL_SOURCE=/home/christian/Dreamcast\
  /KERNEL/linux

If you've logged out meanwhile, you have to set up the correct $PATH and $PREFIXenvironment settings:

$ export PREFIX=/home/christian/Dreamcast\
  /toolchain
$ export PATH=$PREFIX/bin:$PATH

Now, we're ready for setting up the Makefile for uClibc:

$ make menuconfig

Please select the following options for running programs compiled against uClibc on your SEGA Dreamcast:


Table 4.2: Configuration for uClibc for running on SEGA Dreamcast.
Option Type
Target Processor Type SH4
Target Processor Endianness Little Endian
Target CPU has MMU *
Enable floating point number support *
Please check the correct location of the kernel headers.  
POSIX Threading Support *
Malloc Implementation malloc
Shadow Password Support *
Regular Expression Support *
Support only Unix 98 PTYs *
Assume that /dev/pts is a devpts or devfs filesystem *
Remote Procedure Call (RPC) support *
Full RPC support *


Please check also that the option uClibc development environment is set to:

$PREFIX/$(TARGET)-linux-uclibc

Any option not mentioned in table 4.2 has to be unselected. Now it's time for compiling and installing:

$ make all
$ su -c "make install"
$ cd ..

You should have a new toolchain located under:

$PREFIX/sh-linux-uclibc/*

These last steps are necessary for compiling the following sources without any errors:

$ unset TARGET_ARCH
$ unset NATIVE_CC
$ unset CROSS
$ unset KERNEL_SOURCE
$ export UCLIBC=/home/Dreamcast\
  /toolchain/sh-linux-uclibc

Next, it's time for testing our new toolchain.


next up previous contents index
Next: Compiling busybox-0.60.5 Up: Setting up the uClibc Previous: Setting up the uClibc   Contents   Index
Christian Berger 2004-10-19