standalone_sysroot_target="/mnt/build1/cln-mp2-ip/build-cargtopenstlinuxweston-stm32mp25-cargt-00395-00365v3/tmp-glibc/sysroots/stm32mp25-cargt-00395-00365v3"
standalone_sysroot_native="/mnt/build1/cln-mp2-ip/build-cargtopenstlinuxweston-stm32mp25-cargt-00395-00365v3/tmp-glibc/sysroots/x86_64"
orig=`pwd`; cd /mnt/build1/cln-mp2-ip/layers/openembedded-core; . ./oe-init-build-env /mnt/build1/cln-mp2-ip/build-cargtopenstlinuxweston-stm32mp25-cargt-00395-00365v3; cd $orig
export PATH=$standalone_sysroot_native//usr/bin:$standalone_sysroot_native//usr/bin/aarch64-ostl-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/cln-mp2-ip/layers/openembedded-core/meta/site/endian-little /mnt/build1/cln-mp2-ip/layers/openembedded-core/meta/site/arm-common /mnt/build1/cln-mp2-ip/layers/openembedded-core/meta/site/arm-64 /mnt/build1/cln-mp2-ip/layers/openembedded-core/meta/site/common-linux /mnt/build1/cln-mp2-ip/layers/openembedded-core/meta/site/common-glibc /mnt/build1/cln-mp2-ip/layers/openembedded-core/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-ostl-linux-gcc  -mcpu=cortex-a35+crc -mbranch-protection=standard --sysroot=$SDKTARGETSYSROOT"
export CXX="aarch64-ostl-linux-g++  -mcpu=cortex-a35+crc -mbranch-protection=standard --sysroot=$SDKTARGETSYSROOT"
export CPP="aarch64-ostl-linux-gcc -E  -mcpu=cortex-a35+crc -mbranch-protection=standard --sysroot=$SDKTARGETSYSROOT"
export AS="aarch64-ostl-linux-as "
export LD="aarch64-ostl-linux-ld  --sysroot=$SDKTARGETSYSROOT"
export GDB=aarch64-ostl-linux-gdb
export STRIP=aarch64-ostl-linux-strip
export RANLIB=aarch64-ostl-linux-ranlib
export OBJCOPY=aarch64-ostl-linux-objcopy
export OBJDUMP=aarch64-ostl-linux-objdump
export READELF=aarch64-ostl-linux-readelf
export AR=aarch64-ostl-linux-ar
export NM=aarch64-ostl-linux-nm
export M4=m4
export TARGET_PREFIX=aarch64-ostl-linux-
export CONFIGURE_FLAGS="--target=aarch64-ostl-linux --host=aarch64-ostl-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 "
export CPPFLAGS=""
export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"
export OECORE_DISTRO_VERSION="5.0.3-snapshot-20260821"
export OECORE_SDK_VERSION="5.0.3-snapshot"
export ARCH=arm64
export CROSS_COMPILE=aarch64-ostl-linux-
export OECORE_TUNE_CCARGS=" -mcpu=cortex-a35+crc -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
