# build and install gcc wrapper # Which compiler do we build the wrapper with, and should it be static? test $BUILD_STATIC == none && global STATIC_FLAGS := '' || global STATIC_FLAGS := '--static' test -z $HOST_ARCH && global TEMP := $CC || global TEMP := ""$(HOST_ARCH)-cc"" global LIBC_TYPE := 'musl' test ! -z $UCLIBC_CONFIG && test -z $MUSL && global 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'"' \ $(ELF2FLT:+-DELF2FLT) && # ${HOST_ARCH:+${ELF2FLT:+-DELF2FLT}} && 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