view build.sh @ 625:065e1a0f6697

The new distcc version notices the host has the python binary, and assumes it has the python-dev package installed as well supplying Python.h, which isn't remotely guaranteed. So trim the $PATH to prevent it from finding python.
author Rob Landley <rob@landley.net>
date Tue, 17 Feb 2009 13:53:50 -0600
parents 62affc4225e4
children ef758aacab0b
line wrap: on
line source

#!/bin/bash

# If run with no arguments, list architectures.

if [ $# -eq 0 ]
then
  echo "Usage: $0 ARCH [ARCH...]"
  sources/include.sh
  exit 1
fi

# Download source code and build host tools.

./download.sh || exit 1

# host-tools populates one directory with every command the build needs,
# so we can ditch the old $PATH afterwards.

time ./host-tools.sh || exit 1

# Run the steps in order for each architecture listed on the command line
for i in "$@"
do
  echo "=== Building ARCH $i"

  if [ -f "build/cross-compiler-$i.tar.bz2" ]
  then
    echo "=== Skipping cross-compiler-$i (already there)"
  else
	rm -rf "build/mini-native-$i.tar.bz2"
    time ./cross-compiler.sh $i || exit 1
  fi
  echo "=== native ($i)"
  if [ -f "build/mini-native-$i.tar.bz2" ]
  then
    echo "=== Skipping mini-native-$i (already there)"
  else
	rm -rf "build/system-image-$i.tar.bz2"
    time ./mini-native.sh $i || exit 1
  fi

  if [ -f "build/system-image-$i.tar.bz2" ]
  then
    echo "=== Skipping system-image-$i (already there)"
  else
    # We need to run this in a new session because the error handling behavior
    # of this kills everything in its current session, which can kill a wrapper
    # shell running us if we're not careful.
    time setsid ./system-image.sh $i || exit 1
  fi
done