view sources/sections/ccwrap.sh @ 1737:1acbe7e78d9d draft

Switch from bz2 to gz tarball output. bz2 is slowly being replaced by lz variants, but gzip isn't going anywhere. (It retains a niche as a streaming protocol, it's the 80/20 solution optimizing for speed, low memory requirements, and simple compressor implementation.)
author Rob Landley <rob@landley.net>
date Fri, 20 Feb 2015 13:12:45 -0600
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