view sources/sections/uClibc.build @ 1130:c222ae88733a

Add NO_CPLUSPLUS config option, to skip c++ support entirely.
author Rob Landley <rob@landley.net>
date Sun, 20 Jun 2010 16:25:35 -0500
parents affef1edbdba
children fb05d8a5fd77
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 is_in_list uClibc $USE_UNSTABLE &&
   [ -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 &&
mkdir -p "$STAGE_DIR/src" &&
cp .config "$STAGE_DIR/src/config-uClibc" &&
make_uClibc install || dienow

sed -i 's@/lib/@@g' "$STAGE_DIR/lib/libc.so" || dienow

# Build ldd and friends

if [ ! -z "$HOST_ARCH" ]
then
  # The uClibc utils/Makefile.in is crazy.  There's no way to specify a prefix,
  # or to pass in --static via CFLAGS.  Just build 'em by hand.

  "$ARCH-cc" utils/ldd.c -o "$STAGE_DIR/bin/${PROGRAM_PREFIX}ldd" --static \
    -I ldso/include -DBUILDING_LINKAGE &&
  "$ARCH-cc" utils/ldconfig.c utils/chroot_realpath.c \
    -o "$STAGE_DIR/bin/${PROGRAM_PREFIX}ldconfig" --static -I ldso/include \
    -DUCLIBC_RUNTIME_PREFIX='"/"' -DBUILDING_LINKAGE || dienow
fi