# HG changeset patch # User Rob Landley # Date 1201773620 21600 # Node ID a64a358ad792ed6c41090eae948eabb0f598cedd # Parent 75033cdf4c1cce88919590e6b82a9236a2f2a3ef Teach run-$ARCH.sh to understand --crosspath to use cross compiler via distcc. diff -r 75033cdf4c1c -r a64a358ad792 include.sh --- a/include.sh Thu Jan 31 03:59:32 2008 -0600 +++ b/include.sh Thu Jan 31 04:00:20 2008 -0600 @@ -276,16 +276,48 @@ export PATH="${CROSS}/bin:$PATH" export IMAGE="${BUILD}/image-${ARCH}.ext2" + # output run-$ARCH.sh script + + # Start with distcc setup + + cat > "$BUILD/run-$ARCH.sh" << 'EOF' +#!/bin/bash + +if [ "$1" == "--crosspath" ] +then + DCC="$(which distccd)" + [ -z "$DCC" ] && DCC="$2"/host/distcc + PATH=$2/distcc "$DCC" --listen 127.0.0.1 --log-stderr \ + --log-level error --daemon -a 127.0.0.1 --no-detach & # 2>/dev/null + DCC1=/tools/distcc: + CPUS=$[$(echo /sys/devices/system/cpu/cpu[0-9]* | wc -w)+0] + [ "$CPUS" -lt 1 ] && CPUS=1 + DCC2="DISTCC_HOSTS=10.0.2.2 CPUS=$CPUS" +else + DCC1= + DCC2= + CPUS="CPUS=1" +fi +EOF + + # Call the appropriate emulator emulator_command image-$ARCH.ext2 zImage-$ARCH \ - "rw init=/tools/bin/qemu-setup.sh panic=1 PATH=/tools/bin" \ - > "$BUILD/run-$ARCH.sh" && + 'rw init=/tools/bin/qemu-setup.sh panic=1 PATH=$DCC1/tools/bin $DCC2' \ + >> "$BUILD/run-$ARCH.sh" && + + # distcc cleanup + + echo -e '\nkill `jobs -p`' >> "$BUILD/run-$ARCH.sh" && chmod +x "$BUILD/run-$ARCH.sh" + else export WORK="${BUILD}/host-temp" mkdir -p "${WORK}" fi +[ $? -ne 0 ] && dienow + [ -z "$CLEANUP" ] && CLEANUP="rm -rf" [ -z "$CC" ] && CC=gcc if [ -z "$CPUS" ]