diff options
-rw-r--r-- | meta/classes/cross-canadian.bbclass | 1 | ||||
-rw-r--r-- | meta/classes/toolchain-scripts.bbclass | 30 | ||||
-rw-r--r-- | meta/recipes-core/meta/meta-environment.bb | 64 | ||||
-rw-r--r-- | meta/recipes-core/tasks/task-cross-canadian.bb | 1 |
4 files changed, 96 insertions, 0 deletions
diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass index 9edce31cb5..3f3a24dd57 100644 --- a/meta/classes/cross-canadian.bbclass +++ b/meta/classes/cross-canadian.bbclass @@ -15,6 +15,7 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S # Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS # OLD_MULTIMACH_ARCH := "${MULTIMACH_ARCH}" +OLD_MULTIMACH_TARGET_SYS := "${MULTIMACH_TARGET_SYS}" OLD_PACKAGE_ARCH := ${BASE_PACKAGE_ARCH} BASE_PACKAGE_ARCH = "${SDK_ARCH}-nativesdk" python () { diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass index c393d99644..a5b2bd129b 100644 --- a/meta/classes/toolchain-scripts.bbclass +++ b/meta/classes/toolchain-scripts.bbclass @@ -60,3 +60,33 @@ toolchain_create_tree_env_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## -I##SDKTARGETSYSROOT##${GXX_INCLUDEDIR}"' >> $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 +} diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb new file mode 100644 index 0000000000..da8d6612c9 --- /dev/null +++ b/meta/recipes-core/meta/meta-environment.bb @@ -0,0 +1,64 @@ +DESCRIPTION = "Packge of environment files for SDK" +LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ + file://${POKYBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +LICENSE = "MIT" +PR = "r0" + +EXCLUDE_FROM_WORLD = "1" + +inherit toolchain-scripts +# get target config site before inheritting corss-canadian +TARGET_CONFIG_SITE := "${@siteinfo_get_files(d)}" + +SDK_DIR = "${WORKDIR}/sdk" +SDK_OUTPUT = "${SDK_DIR}/image" +SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}" + +inherit cross-canadian + +GXX_INCLUDEDIR := "${target_includedir}/c++" + +do_generate_content[nostamp] = "1" +do_generate_content() { + + rm -rf ${SDK_OUTPUT} + mkdir -p ${SDK_OUTPUT}/${SDKPATH} + + siteconfig=${SDK_OUTPUT}/${SDKPATH}/site-config-${OLD_MULTIMACH_TARGET_SYS} + + touch $siteconfig + for sitefile in ${TARGET_CONFIG_SITE} ; do + cat $sitefile >> $siteconfig + done + + toolchain_create_sdk_env_script_for_installer + + # Add version information + versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${OLD_MULTIMACH_TARGET_SYS} + touch $versionfile + echo 'Distro: ${DISTRO}' >> $versionfile + echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile + echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile + echo 'Timestamp: ${DATETIME}' >> $versionfile +} +do_generate_content[recrdeptask] = "do_compile" +addtask generate_content before do_install after do_compile + +do_install[nostamp] = "1" +do_install() { + install -d ${D}/${SDKPATH} + install -m 0644 -t ${D}/${SDKPATH} ${SDK_OUTPUT}/${SDKPATH}/* +} + +PN = "meta-environment-${TRANSLATED_TARGET_ARCH}" +PACKAGES = "${PN}" +FILES_${PN}= " \ + ${SDKPATH}/* \ + " + +do_fetch[noexec] = "1" +do_unpack[noexec] = "1" +do_patch[noexec] = "1" +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_populage_sysroot[noexec] = "1" diff --git a/meta/recipes-core/tasks/task-cross-canadian.bb b/meta/recipes-core/tasks/task-cross-canadian.bb index 7170faaa96..64e53fe3a5 100644 --- a/meta/recipes-core/tasks/task-cross-canadian.bb +++ b/meta/recipes-core/tasks/task-cross-canadian.bb @@ -12,5 +12,6 @@ RDEPENDS_${PN} = "\ binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} \ gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} \ gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} \ + meta-environment-${TRANSLATED_TARGET_ARCH} \ " |