view sources/sections/uClibc.build @ 979:88b354c0eee1

Tweak mercurial repo entry and add link to current snapshot.
author Rob Landley <rob@landley.net>
date Tue, 16 Feb 2010 06:57:14 -0600
parents edf9264f2d26
children 1d776e44b908
line wrap: on
line source

# Build and install uClibc

make_uClibc()
{
 make -j $CPUS $VERBOSITY CROSS="${ARCH}-" \
  UCLIBC_LDSO_NAME=ld-uClibc KERNEL_HEADERS="$STAGE_DIR/include" \
  PREFIX="$STAGE_DIR/" RUNTIME_PREFIX=/ DEVEL_PREFIX=/ $1
}

# Configure

if unstable uClibc && [ -e "$CONFIG_DIR/$ARCH/miniconfig-alt-uClibc" ]
then
  cp "$CONFIG_DIR/$ARCH/miniconfig-alt-uClibc" "$WORK/mini.conf" || dienow
  echo using miniconfig-alt-uClibc
else
  cp "$SOURCES/baseconfig-uClibc" "$WORK/mini.conf" &&
  echo "$UCLIBC_CONFIG" >> "$WORK/mini.conf" || dienow
  echo Creating miniconfig for uClibc
fi

# Build and install

make KCONFIG_ALLCONFIG="$WORK/mini.conf" allnoconfig &&
cp .config "$STAGE_DIR/config-uClibc" &&
make_uClibc install || dienow

# Do we need host or target versions of ldd and such?

if [ ! -z "$HOST_UTILS" ]
then
  make_uClibc hostutils || dienow

  for i in $(cd utils; ls *.host | sed 's/\.host//')
  do
    cp utils/"$i".host "$STAGE_DIR/bin/$ARCH-$i" || dienow
  done
else
  make_uClibc install_utils || dienow

  # There's no way to specify a prefix for the uClibc utils; rename by hand.

  if [ ! -z "$PROGRAM_PREFIX" ]
  then
    mv "${STAGE_DIR}"/{sbin,bin}/ldconfig || dienow
    for i in ldd readelf ldconfig
    do
      mv "$STAGE_DIR/bin/"{"$i","${PROGRAM_PREFIX}$i"}
    done
  fi
fi