#!/usr/bin/env bash WRAPPER_LIBDIR="${WRAPPER_LIBDIR:=-L${STAGING_DIR:-/srv/openwrt/ar71xx/build/staging_dir/target-mips_34kc_musl-1.1.15}/lib/}" WRAPPER_OPTIONS="" WRAPPER_LIBS="-lc -lgcc_s -lssp_nonshared " WRAPPER_INCLIB="Y" while [ -n "$1" ] do WRAPPER_OPTIONS="$WRAPPER_OPTIONS $1" if [ "$1" = "-c" -o "$1" = "-E" -o "$1" = "-S" -o "$1" = "-MF" ] then WRAPPER_INCLIB="N" fi if [ "$1" = "-static" ] then WRAPPER_LIBS="-lc -lgcc_s -lssp_nonshared -lgcc_eh" fi shift done if [ "$WRAPPER_INCLIB" = "Y" ] then WRAPPER_OPTIONS="$WRAPPER_OPTIONS -nodefaultlibs $WRAPPER_LIBDIR -Wl,-Bdynamic,-luClibc++,-Bstatic,-lstdc++,-Bdynamic $WRAPPER_LIBS" fi exec mips-openwrt-linux-musl-g++ -fno-builtin -DGCC_HASCLASSVISIBILITY $WRAPPER_INCLUDEDIR $WRAPPER_OPTIONS