view sources/include.sh @ 870:2330aa12c5f9

Now that we cross compile busybox statically by default, remove it from native build.
author Rob Landley <rob@landley.net>
date Thu, 29 Oct 2009 22:43:13 -0500
parents 3794d9a0be4c
children 850da666acc6
line wrap: on
line source

#!/bin/echo "This file is sourced, not run"

# Set up all the environment variables and functions for a build stage.
# This file is sourced, not run.

umask 022

# Tell bash not to cache the $PATH because we modify it.  Without this, bash
# won't find new executables added after startup.
set +h

# Include two other files:

[ -e config ] && source config
source sources/functions.sh

# What host compiler should we use?

[ -z "$CC" ] && export CC=cc

# How many processors should make -j use?

if [ -z "$CPUS" ]
then
  export CPUS=$(echo /sys/devices/system/cpu/cpu[0-9]* | wc -w)
  [ "$CPUS" -lt 1 ] && CPUS=1
fi

# Where are our working directories?

TOP=`pwd`
export SOURCES="${TOP}/sources"
export SRCDIR="${TOP}/packages"
export BUILD="${TOP}/build"
export HOSTTOOLS="${BUILD}/host"

# Set a default non-arch

ARCH_NAME=host
export WORK="${BUILD}/host-temp"

# Retain old $PATH in case we re-run host-tools.sh with different options.

export OLDPATH="$PATH"

# Adjust $PATH

if [ "$PATH" != "$(hosttools_path)" ]
then
  if [ -f "$HOSTTOOLS/busybox" ]
  then
    PATH="$(hosttools_path)"
  else
    PATH="$(hosttools_path):$PATH"
  fi
fi

# Setup for $RECORD_COMMANDS

# WRAPPY_LOGPATH is set unconditionally in case host-tools.sh needs to
# enable wrapping partway through its own build.  Extra environment variables
# don't actually affect much, it's changing $PATH that changes behavior.

[ -z "$STAGE_NAME" ] && STAGE_NAME=`echo $0 | sed 's@.*/\(.*\)\.sh@\1@'`
[ -z "$WRAPPY_LOGDIR" ] && WRAPPY_LOGDIR="$BUILD"
export WRAPPY_LOGPATH="$WRAPPY_LOGDIR/cmdlines.${STAGE_NAME}.setupfor"
if [ ! -z "$RECORD_COMMANDS" ] && [ -f "$BUILD/wrapdir/wrappy" ]
then
  export WRAPPY_REALPATH="$PATH"
  PATH="$BUILD/wrapdir"
fi

# This is an if instead of && so the exit code of include.sh is reliably 0
if [ ! -z "$BUILD_VERBOSE" ]
then
  VERBOSITY="V=1"
fi