diff options
author | Joshua Lock <josh@linux.intel.com> | 2010-08-11 16:53:03 +0100 |
---|---|---|
committer | Joshua Lock <josh@linux.intel.com> | 2010-08-11 18:04:52 +0100 |
commit | f05fd8dc5cc197635690d89c767fee7a8236897e (patch) | |
tree | b13436e2528269106d0247ad054e46a4318b485f | |
parent | 69ac39b90eec55831a9b601913a089838307b200 (diff) | |
download | openembedded-core-f05fd8dc5cc197635690d89c767fee7a8236897e.tar.gz openembedded-core-f05fd8dc5cc197635690d89c767fee7a8236897e.tar.bz2 openembedded-core-f05fd8dc5cc197635690d89c767fee7a8236897e.tar.xz openembedded-core-f05fd8dc5cc197635690d89c767fee7a8236897e.zip |
meta-ide-support: A dummy recipe to install everthing for target development
Move the environment-setup script generation into a separate class and adapt
meta-toolchain to use it.
Add a new dummy target, meta-ide-support, to install an appropriately
configured script to TMPDIR and ensure all of the required packages for target
development are available.
Signed-off-by: Joshua Lock <josh@linux.intel.com>
-rw-r--r-- | meta/classes/toolchain-scripts.bbclass | 51 | ||||
-rw-r--r-- | meta/packages/meta/meta-ide-support.bb | 15 | ||||
-rw-r--r-- | meta/packages/meta/meta-toolchain.bb | 24 |
3 files changed, 68 insertions, 22 deletions
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass new file mode 100644 index 000000000..8934e0bc5 --- /dev/null +++ b/meta/classes/toolchain-scripts.bbclass @@ -0,0 +1,51 @@ +# 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 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 +} + +# 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=${STAGING_DIR}/${TARGET_SYS}' >> $script + echo 'export PKG_CONFIG_PATH=${STAGING_DIR}/${TARGET_SYS}${libdir}/pkgconfig' >> $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 CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${BUILD_SYS}"' >> $script + if [ "${TARGET_OS}" = "darwin8" ]; then + echo 'export TARGET_CFLAGS="-I${STAGING_DIR}${TARGET_SYS}${includedir}"' >> $script + echo 'export TARGET_LDFLAGS="-L${STAGING_DIR}${TARGET_SYS}${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 +} diff --git a/meta/packages/meta/meta-ide-support.bb b/meta/packages/meta/meta-ide-support.bb new file mode 100644 index 000000000..0d564baa5 --- /dev/null +++ b/meta/packages/meta/meta-ide-support.bb @@ -0,0 +1,15 @@ +DESCRIPTION = "Meta package for ensuring the build directory contains all appropriate toolchain packages for using an IDE" +LICENSE = "MIT" +DEPENDS = "virtual/libc" +RDEPENDS = "task-sdk-host" +PR = "r0" + +inherit meta toolchain-scripts + +do_populate_ide_support () { + toolchain_create_tree_env_script +} + +do_populate_ide_support[nostamp] = "1" +do_populate_ide_support[recrdeptask] = "do_package_write" +addtask populate_ide_support before do_build after do_install diff --git a/meta/packages/meta/meta-toolchain.bb b/meta/packages/meta/meta-toolchain.bb index a53569b55..585adb4e1 100644 --- a/meta/packages/meta/meta-toolchain.bb +++ b/meta/packages/meta/meta-toolchain.bb @@ -2,7 +2,7 @@ DESCRIPTION = "Meta package for building a installable toolchain" LICENSE = "MIT" DEPENDS = "opkg-native opkg-utils-native virtual/fakeroot-native sed-native" -inherit meta +inherit meta toolchain-scripts SDK_DIR = "${WORKDIR}/sdk" SDK_OUTPUT = "${SDK_DIR}/image" @@ -79,27 +79,7 @@ do_populate_sdk() { cat $sitefile >> $siteconfig done - # Create environment setup script - script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${MULTIMACH_TARGET_SYS} - 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 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 + toolchain_create_sdk_env_script # Add version information versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} |