view sources/sections/ccwrap.sh @ 1684:7b4566efd8bd draft 1.2.8

Silence some asynchronous messages linux produces on top of the shell prompt.
author Rob Landley <rob@landley.net>
date Sun, 07 Sep 2014 10:39:51 -0500
parents c11a357ea92d
children 117f1c93212a
line wrap: on
line source

# build and install gcc wrapper

# Which compiler do we build the wrapper with, and should it be static?

[ "$BUILD_STATIC" == none ] && STATIC_FLAGS= || STATIC_FLAGS=--static
[ -z "$HOST_ARCH" ] && TEMP="$CC" || TEMP="${HOST_ARCH}-cc"
LIBC_TYPE=musl
[ ! -z "$UCLIBC_CONFIG" ] && [ -z "$MUSL" ] && LIBC_TYPE=uClibc

# Build wrapper binary

mkdir -p "$STAGE_DIR/bin" &&
"$TEMP" "$SOURCES/toys/ccwrap.c" -Os $CFLAGS \
  -o "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}cc" $STATIC_FLAGS \
  -DDYNAMIC_LINKER=\"/lib/ld-${LIBC_TYPE}.so.0\" &&
echo -e "#!/bin/bash\n\n${TOOLCHAIN_PREFIX}cc -E "'"$@"' \
  > "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}cpp" &&
chmod +x "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}cpp" || dienow