#!/bin/sh -e
[ -z "$DEBUG" ] || set -x
echo "########## host-gcc-final-12.3.0: host install ##########"
cd /home/ych/rk3568/buildroot
PATH="/home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/bin:/home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" PKG_CONFIG="/home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/lib/pkgconfig:/home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/share/pkgconfig"  /usr/bin/make -j21 install -C /home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/build/host-gcc-final-12.3.0/build
cd /home/ych/rk3568/buildroot
if [ ! -e /home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/bin/aarch64-buildroot-linux-gnu-cc ]; then ln -f /home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/bin/aarch64-buildroot-linux-gnu-gcc /home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/bin/aarch64-buildroot-linux-gnu-cc; fi
cd /home/ych/rk3568/buildroot
/usr/bin/install -D -m 0755 /home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/build/host-gcc-final-12.3.0/toolchain-wrapper /home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/bin/toolchain-wrapper
cd /home/ych/rk3568/buildroot
cd /home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/bin; for i in aarch64-buildroot-linux-gnu-*; do case "$i" in *.br_real) ;; *-ar|*-ranlib|*-nm) ln -snf $i aarch64-linux${i##aarch64-buildroot-linux-gnu}; ;; *cc|*cc-*|*++|*++-*|*cpp|*-gfortran|*-gdc) rm -f $i.br_real; mv $i $i.br_real; ln -sf toolchain-wrapper $i; ln -sf toolchain-wrapper aarch64-linux${i##aarch64-buildroot-linux-gnu}; ln -snf $i.br_real aarch64-linux${i##aarch64-buildroot-linux-gnu}.br_real; ;; *) ln -snf $i aarch64-linux${i##aarch64-buildroot-linux-gnu}; ;; esac; done
cd /home/ych/rk3568/buildroot
rm -f -rf  /home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/share/info/dir
