This commit changes the sysroots path to be machine specific. Changes includes: 1) STAGING_DIR_TARGET and STRAGING_DIR_HOST points to machine specific paths. 2) task stamp files. Adding ${MACHINE} info into stamp files for do_populate_sysroots and do_package tasks. Add a BB_STAMPTASK_BLACKLIST to keep native, nativesdk, crosssdk, and cross-canadian stamp unchanged. 3) siteconfig path. Separate the site config path for different machines to avoid one machine adopting the cache file of another machine. 4) sstate. Add machine name to sstate manifest file. Change relocation code for sstate paths since sysroot is machine. Keep native, nativesdk, crosssdk, and cross-canadian unchanged. 5) toolchain scripts. Change the environment path to point to machine specific sysroots in toolchain scripts bbclass. 6) Relocate la files when populating to a different machine of the same architecture. 7) Exclude STAGING_DIR_TARGET and STAGING_DIR_HOST parameter from sstate siginfo since they contain ${MACHINE} information. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
93 lines
5 KiB
Text
93 lines
5 KiB
Text
inherit siteinfo
|
|
|
|
# This function creates an environment-setup-script for use in a deployable SDK
|
|
toolchain_create_sdk_env_script () {
|
|
# Create environment setup script
|
|
script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${MULTIMACH_TARGET_SYS}
|
|
rm -f $script
|
|
touch $script
|
|
echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:${SDKPATHNATIVE}${bindir_nativesdk}/${MULTIMACH_TARGET_SYS}:$PATH' >> $script
|
|
echo 'export PKG_CONFIG_SYSROOT_DIR=${SDKTARGETSYSROOT}' >> $script
|
|
echo 'export PKG_CONFIG_PATH=${SDKTARGETSYSROOT}${libdir}/pkgconfig' >> $script
|
|
echo 'export CONFIG_SITE=${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS}' >> $script
|
|
echo 'export CC=${TARGET_PREFIX}gcc' >> $script
|
|
echo 'export CXX=${TARGET_PREFIX}g++' >> $script
|
|
echo 'export GDB=${TARGET_PREFIX}gdb' >> $script
|
|
echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script
|
|
echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux"' >> $script
|
|
if [ "${TARGET_OS}" = "darwin8" ]; then
|
|
echo 'export TARGET_CFLAGS="-I${SDKTARGETSYSROOT}${includedir}"' >> $script
|
|
echo 'export TARGET_LDFLAGS="-L${SDKTARGETSYSROOT}${libdir}"' >> $script
|
|
# Workaround darwin toolchain sysroot path problems
|
|
cd ${SDK_OUTPUT}${SDKTARGETSYSROOT}/usr
|
|
ln -s /usr/local local
|
|
fi
|
|
echo 'export CFLAGS="${TARGET_CC_ARCH}"' >> $script
|
|
echo 'export CXXFLAGS="${TARGET_CC_ARCH}"' >> $script
|
|
echo "alias opkg='LD_LIBRARY_PATH=${SDKPATHNATIVE}${libdir_nativesdk} ${SDKPATHNATIVE}${bindir_nativesdk}/opkg-cl -f ${SDKPATHNATIVE}/${sysconfdir}/opkg-sdk.conf -o ${SDKPATHNATIVE}'" >> $script
|
|
echo "alias opkg-target='LD_LIBRARY_PATH=${SDKPATHNATIVE}${libdir_nativesdk} ${SDKPATHNATIVE}${bindir_nativesdk}/opkg-cl -f ${SDKTARGETSYSROOT}${sysconfdir}/opkg.conf -o ${SDKTARGETSYSROOT}'" >> $script
|
|
echo 'export POKY_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
|
|
echo 'export POKY_TARGET_SYSROOT="${SDKTARGETSYSROOT}"' >> $script
|
|
echo 'export POKY_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script
|
|
}
|
|
|
|
# This function creates an environment-setup-script in the TMPDIR which enables
|
|
# a Poky IDE to integrate with the build tree
|
|
toolchain_create_tree_env_script () {
|
|
script=${TMPDIR}/environment-setup-${MULTIMACH_TARGET_SYS}
|
|
rm -f $script
|
|
touch $script
|
|
echo 'export PATH=${PATH}' >> $script
|
|
echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script
|
|
echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script
|
|
|
|
echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script
|
|
|
|
echo 'export CC=${TARGET_PREFIX}gcc' >> $script
|
|
echo 'export CXX=${TARGET_PREFIX}g++' >> $script
|
|
echo 'export GDB=${TARGET_PREFIX}gdb' >> $script
|
|
echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script
|
|
echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${BUILD_SYS}"' >> $script
|
|
if [ "${TARGET_OS}" = "darwin8" ]; then
|
|
echo 'export TARGET_CFLAGS="-I${STAGING_DIR}${MACHINE}${includedir}"' >> $script
|
|
echo 'export TARGET_LDFLAGS="-L${STAGING_DIR}${MACHINE}${libdir}"' >> $script
|
|
# Workaround darwin toolchain sysroot path problems
|
|
cd ${SDK_OUTPUT}${SDKTARGETSYSROOT}/usr
|
|
ln -s /usr/local local
|
|
fi
|
|
echo 'export CFLAGS="${TARGET_CC_ARCH}"' >> $script
|
|
echo 'export CXXFLAGS="${TARGET_CC_ARCH}"' >> $script
|
|
echo 'export POKY_NATIVE_SYSROOT="${STAGING_DIR_NATIVE}"' >> $script
|
|
echo 'export POKY_TARGET_SYSROOT="${STAGING_DIR_TARGET}"' >> $script
|
|
}
|
|
|
|
# This function creates an environment-setup-script for use by the ADT installer
|
|
toolchain_create_sdk_env_script_for_installer () {
|
|
# Create environment setup script
|
|
script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${OLD_MULTIMACH_TARGET_SYS}
|
|
rm -f $script
|
|
touch $script
|
|
echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:${SDKPATHNATIVE}${bindir_nativesdk}/${OLD_MULTIMACH_TARGET_SYS}:$PATH' >> $script
|
|
echo 'export PKG_CONFIG_SYSROOT_DIR=##SDKTARGETSYSROOT##' >> $script
|
|
echo 'export PKG_CONFIG_PATH=##SDKTARGETSYSROOT##${target_libdir}/pkgconfig' >> $script
|
|
echo 'export CONFIG_SITE=${SDKPATH}/site-config-${OLD_MULTIMACH_TARGET_SYS}' >> $script
|
|
echo 'export CC=${TARGET_PREFIX}gcc' >> $script
|
|
echo 'export CXX=${TARGET_PREFIX}g++' >> $script
|
|
echo 'export GDB=${TARGET_PREFIX}gdb' >> $script
|
|
echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script
|
|
echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux"' >> $script
|
|
if [ "${TARGET_OS}" = "darwin8" ]; then
|
|
echo 'export TARGET_CFLAGS="-I##SDKTARGETSYSROOT##${target_includedir}"' >> $script
|
|
echo 'export TARGET_LDFLAGS="-L##SDKTARGETSYSROOT##{target_libdir}"' >> $script
|
|
# Workaround darwin toolchain sysroot path problems
|
|
cd ${SDK_OUTPUT}${SDKTARGETSYSROOT}/usr
|
|
ln -s /usr/local local
|
|
fi
|
|
echo 'export CFLAGS="${TARGET_CC_ARCH} --sysroot=##SDKTARGETSYSROOT##"' >> $script
|
|
echo 'export CXXFLAGS="${TARGET_CC_ARCH} --sysroot=##SDKTARGETSYSROOT##"' >> $script
|
|
echo 'export POKY_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
|
|
echo 'export POKY_TARGET_SYSROOT="##SDKTARGETSYSROOT##"' >> $script
|
|
echo 'export POKY_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script
|
|
echo 'export POKY_SDK_VERSION="${SDK_VERSION}"' >> $script
|
|
}
|