standalone_sysroot_target="/mnt/build1/cicd/work/imx-scarthgap/bld-xw/tmp/sysroots/imx93-cargt-00363-00365"
standalone_sysroot_native="/mnt/build1/cicd/work/imx-scarthgap/bld-xw/tmp/sysroots/x86_64"
orig=`pwd`; cd /mnt/build1/cicd/work/imx-scarthgap/sources/poky; . ./oe-init-build-env /mnt/build1/cicd/work/imx-scarthgap/bld-xw; cd $orig
export PATH=$standalone_sysroot_native//usr/bin:$standalone_sysroot_native//usr/bin/aarch64-poky-linux:$PATH
export PKG_CONFIG_SYSROOT_DIR=$standalone_sysroot_target
export PKG_CONFIG_PATH=$standalone_sysroot_target/usr/lib/pkgconfig:$standalone_sysroot_target/usr/share/pkgconfig
export CONFIG_SITE="/mnt/build1/cicd/work/imx-scarthgap/sources/poky/meta/site/endian-little /mnt/build1/cicd/work/imx-scarthgap/sources/poky/meta/site/arm-common /mnt/build1/cicd/work/imx-scarthgap/sources/poky/meta/site/arm-64 /mnt/build1/cicd/work/imx-scarthgap/sources/poky/meta/site/common-linux /mnt/build1/cicd/work/imx-scarthgap/sources/poky/meta/site/common-glibc /mnt/build1/cicd/work/imx-scarthgap/sources/poky/meta/site/common"
export SDKTARGETSYSROOT=$standalone_sysroot_target
export OECORE_NATIVE_SYSROOT=$standalone_sysroot_native
export OECORE_TARGET_SYSROOT=$standalone_sysroot_target
export OECORE_ACLOCAL_OPTS="-I $standalone_sysroot_native/usr/share/aclocal"
export OECORE_BASELIB="lib"
export OECORE_TARGET_ARCH="aarch64"
export OECORE_TARGET_OS="linux"
export CC="aarch64-poky-linux-gcc  -march=armv8-a+crc+crypto -mbranch-protection=standard -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=$SDKTARGETSYSROOT"
export CXX="aarch64-poky-linux-g++  -march=armv8-a+crc+crypto -mbranch-protection=standard -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=$SDKTARGETSYSROOT"
export CPP="aarch64-poky-linux-gcc -E  -march=armv8-a+crc+crypto -mbranch-protection=standard -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=$SDKTARGETSYSROOT"
export AS="aarch64-poky-linux-as "
export LD="aarch64-poky-linux-ld  --sysroot=$SDKTARGETSYSROOT"
export GDB=aarch64-poky-linux-gdb
export STRIP=aarch64-poky-linux-strip
export RANLIB=aarch64-poky-linux-ranlib
export OBJCOPY=aarch64-poky-linux-objcopy
export OBJDUMP=aarch64-poky-linux-objdump
export READELF=aarch64-poky-linux-readelf
export AR=aarch64-poky-linux-ar
export NM=aarch64-poky-linux-nm
export M4=m4
export TARGET_PREFIX=aarch64-poky-linux-
export CONFIGURE_FLAGS="--target=aarch64-poky-linux --host=aarch64-poky-linux --build=x86_64-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"
export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types "
export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types "
export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed  -Wl,-z,relro,-z,now"
export CPPFLAGS=""
export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"
export OECORE_DISTRO_VERSION="6.6-scarthgap"
export OECORE_SDK_VERSION="6.6-scarthgap"
export ARCH=arm64
export CROSS_COMPILE=aarch64-poky-linux-
export OECORE_TUNE_CCARGS=" -march=armv8-a+crc+crypto -mbranch-protection=standard"

# Append environment subscripts
if [ -d "$OECORE_TARGET_SYSROOT/environment-setup.d" ]; then
    for envfile in $OECORE_TARGET_SYSROOT/environment-setup.d/*.sh; do
	    . $envfile
    done
fi
if [ -d "$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
    for envfile in $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
	    . $envfile
    done
fi

if [ -d "$OECORE_NATIVE_SYSROOT//usr/share/post-relocate-setup.d/" ]; then
	for s in $OECORE_NATIVE_SYSROOT//usr/share/post-relocate-setup.d/*; do
		if [ ! -x $s ]; then
			continue
		fi
		$s "$1"
		status=$?
		if [ $status != 0 ]; then
			echo "post-relocate command \"$s $1\" failed with status $status" >&2
			exit $status
		fi
	done
fi
