diff options
Diffstat (limited to 'meta/classes/toolchain-scripts.bbclass')
-rw-r--r-- | meta/classes/toolchain-scripts.bbclass | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass new file mode 100644 index 0000000000..8934e0bc56 --- /dev/null +++ b/meta/classes/toolchain-scripts.bbclass | |||
@@ -0,0 +1,51 @@ | |||
1 | # This function creates an environment-setup-script for use in a deployable SDK | ||
2 | toolchain_create_sdk_env_script () { | ||
3 | # Create environment setup script | ||
4 | script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${MULTIMACH_TARGET_SYS} | ||
5 | rm -f $script | ||
6 | touch $script | ||
7 | echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:${SDKPATHNATIVE}${bindir_nativesdk}/${MULTIMACH_TARGET_SYS}:$PATH' >> $script | ||
8 | echo 'export PKG_CONFIG_SYSROOT_DIR=${SDKTARGETSYSROOT}' >> $script | ||
9 | echo 'export PKG_CONFIG_PATH=${SDKTARGETSYSROOT}${libdir}/pkgconfig' >> $script | ||
10 | echo 'export CONFIG_SITE=${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS}' >> $script | ||
11 | echo 'export CC=${TARGET_PREFIX}gcc' >> $script | ||
12 | echo 'export CXX=${TARGET_PREFIX}g++' >> $script | ||
13 | echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux"' >> $script | ||
14 | if [ "${TARGET_OS}" = "darwin8" ]; then | ||
15 | echo 'export TARGET_CFLAGS="-I${SDKTARGETSYSROOT}${includedir}"' >> $script | ||
16 | echo 'export TARGET_LDFLAGS="-L${SDKTARGETSYSROOT}${libdir}"' >> $script | ||
17 | # Workaround darwin toolchain sysroot path problems | ||
18 | cd ${SDK_OUTPUT}${SDKTARGETSYSROOT}/usr | ||
19 | ln -s /usr/local local | ||
20 | fi | ||
21 | echo 'export CFLAGS="${TARGET_CC_ARCH}"' >> $script | ||
22 | echo 'export CXXFLAGS="${TARGET_CC_ARCH}"' >> $script | ||
23 | echo "alias opkg='LD_LIBRARY_PATH=${SDKPATHNATIVE}${libdir_nativesdk} ${SDKPATHNATIVE}${bindir_nativesdk}/opkg-cl -f ${SDKPATHNATIVE}/${sysconfdir}/opkg-sdk.conf -o ${SDKPATHNATIVE}'" >> $script | ||
24 | echo "alias opkg-target='LD_LIBRARY_PATH=${SDKPATHNATIVE}${libdir_nativesdk} ${SDKPATHNATIVE}${bindir_nativesdk}/opkg-cl -f ${SDKTARGETSYSROOT}${sysconfdir}/opkg.conf -o ${SDKTARGETSYSROOT}'" >> $script | ||
25 | } | ||
26 | |||
27 | # This function creates an environment-setup-script in the TMPDIR which enables a Poky IDE to integrate with the | ||
28 | # build tree | ||
29 | toolchain_create_tree_env_script () { | ||
30 | script=${TMPDIR}/environment-setup-${MULTIMACH_TARGET_SYS} | ||
31 | rm -f $script | ||
32 | touch $script | ||
33 | echo 'export PATH=${PATH}' >> $script | ||
34 | echo 'export PKG_CONFIG_SYSROOT_DIR=${STAGING_DIR}/${TARGET_SYS}' >> $script | ||
35 | echo 'export PKG_CONFIG_PATH=${STAGING_DIR}/${TARGET_SYS}${libdir}/pkgconfig' >> $script | ||
36 | |||
37 | echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script | ||
38 | |||
39 | echo 'export CC=${TARGET_PREFIX}gcc' >> $script | ||
40 | echo 'export CXX=${TARGET_PREFIX}g++' >> $script | ||
41 | echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${BUILD_SYS}"' >> $script | ||
42 | if [ "${TARGET_OS}" = "darwin8" ]; then | ||
43 | echo 'export TARGET_CFLAGS="-I${STAGING_DIR}${TARGET_SYS}${includedir}"' >> $script | ||
44 | echo 'export TARGET_LDFLAGS="-L${STAGING_DIR}${TARGET_SYS}${libdir}"' >> $script | ||
45 | # Workaround darwin toolchain sysroot path problems | ||
46 | cd ${SDK_OUTPUT}${SDKTARGETSYSROOT}/usr | ||
47 | ln -s /usr/local local | ||
48 | fi | ||
49 | echo 'export CFLAGS="${TARGET_CC_ARCH}"' >> $script | ||
50 | echo 'export CXXFLAGS="${TARGET_CC_ARCH}"' >> $script | ||
51 | } | ||