view @ 1049:0e063506fd67

Add a symlink to the www/README file from the top level.
author Rob Landley <>
date Sun, 02 May 2010 16:16:51 -0500
parents 1b364391e821
children affef1edbdba
line wrap: on
line source


# Build a simple cross compiler for the specified target.

# This simple compiler has no thread support, no, doesn't include
# uClibc++, and is dynamically linked against the host's shared libraries.

# Its stripped down nature makes it easy to build on an arbitrary host, and
# provides just enough capability to build a root filesystem, and to be used
# as a distcc accelerator from within that system.

# Get lots of predefined environment variables and shell functions.

source sources/ || exit 1

# Parse the sources/targets/$1 directory

read_arch_dir "$1"

# If this target has a base architecture that's already been built, use that.

check_for_base_arch || exit 0

# Ok, we have work to do.  Announce start of stage.

echo "=== Building $STAGE_NAME"

# Build binutils, gcc, and ccwrap

FROM_ARCH= PROGRAM_PREFIX="${ARCH}-" build_section binutils
FROM_ARCH= PROGRAM_PREFIX="${ARCH}-" build_section gcc
FROM_ARCH= PROGRAM_PREFIX="${ARCH}-" build_section ccwrap

# Build C Library

build_section linux-headers
HOST_UTILS=1 build_section uClibc

cat > "${STAGE_DIR}"/README << EOF &&
Cross compiler for $ARCH

To use: Add the "bin" subdirectory to your \$PATH, and use "$ARCH-cc" as
your compiler.

The syntax used to build the Linux kernel is:



# Strip the binaries

if [ -z "$SKIP_STRIP" ]
  cd "$STAGE_DIR"
  for i in `find bin -type f` `find "$CROSS_TARGET" -type f`
    strip "$i" 2> /dev/null

# A quick hello world program to test the cross compiler out.
# Build hello.c dynamic, then static, to verify header/library paths.

echo "Sanity test: building Hello World."

"${ARCH}-gcc" -Os "${SOURCES}/toys/hello.c" -o "$WORK"/hello &&
"${ARCH}-gcc" -Os -static "${SOURCES}/toys/hello.c" -o "$WORK"/hello || dienow

# Tar it up


echo -e "\e[32mCross compiler toolchain build complete.\e[0m"