summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2010-12-16 09:40:08 +0800
committerRichard Purdie <rpurdie@linux.intel.com>2010-12-21 08:53:20 +0000
commit6a31a2a89e60a3890239b7ff889b9ee1c249faf5 (patch)
treee4737eebba32c602837dcec80f1e06bff4cdd490
parent05963b0a1b1a685a3df3d39477312bb629579fb4 (diff)
downloadpoky-6a31a2a89e60a3890239b7ff889b9ee1c249faf5.tar.gz
meta-environment: Added package of meta-environment-${TARGET_ARCH} for
environment files. [BUGID #565] Fixing bug #565, added package of meta-environment-${TARGET_ARCH} for environment files used by cross-canadian toolchain. Also corrected the situation of empty config site file for target. Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
-rw-r--r--meta/classes/cross-canadian.bbclass1
-rw-r--r--meta/classes/toolchain-scripts.bbclass30
-rw-r--r--meta/recipes-core/meta/meta-environment.bb64
-rw-r--r--meta/recipes-core/tasks/task-cross-canadian.bb1
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
15# Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS 15# Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS
16# 16#
17OLD_MULTIMACH_ARCH := "${MULTIMACH_ARCH}" 17OLD_MULTIMACH_ARCH := "${MULTIMACH_ARCH}"
18OLD_MULTIMACH_TARGET_SYS := "${MULTIMACH_TARGET_SYS}"
18OLD_PACKAGE_ARCH := ${BASE_PACKAGE_ARCH} 19OLD_PACKAGE_ARCH := ${BASE_PACKAGE_ARCH}
19BASE_PACKAGE_ARCH = "${SDK_ARCH}-nativesdk" 20BASE_PACKAGE_ARCH = "${SDK_ARCH}-nativesdk"
20python () { 21python () {
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 () {
60 echo 'export POKY_NATIVE_SYSROOT="${STAGING_DIR_NATIVE}"' >> $script 60 echo 'export POKY_NATIVE_SYSROOT="${STAGING_DIR_NATIVE}"' >> $script
61 echo 'export POKY_TARGET_SYSROOT="${STAGING_DIR_TARGET}"' >> $script 61 echo 'export POKY_TARGET_SYSROOT="${STAGING_DIR_TARGET}"' >> $script
62} 62}
63
64# This function creates an environment-setup-script for use by the ADT installer
65toolchain_create_sdk_env_script_for_installer () {
66 # Create environment setup script
67 script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${OLD_MULTIMACH_TARGET_SYS}
68 rm -f $script
69 touch $script
70 echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:${SDKPATHNATIVE}${bindir_nativesdk}/${OLD_MULTIMACH_TARGET_SYS}:$PATH' >> $script
71 echo 'export PKG_CONFIG_SYSROOT_DIR=##SDKTARGETSYSROOT##' >> $script
72 echo 'export PKG_CONFIG_PATH=##SDKTARGETSYSROOT##${target_libdir}/pkgconfig' >> $script
73 echo 'export CONFIG_SITE=${SDKPATH}/site-config-${OLD_MULTIMACH_TARGET_SYS}' >> $script
74 echo 'export CC=${TARGET_PREFIX}gcc' >> $script
75 echo 'export CXX=${TARGET_PREFIX}g++' >> $script
76 echo 'export GDB=${TARGET_PREFIX}gdb' >> $script
77 echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script
78 echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux"' >> $script
79 if [ "${TARGET_OS}" = "darwin8" ]; then
80 echo 'export TARGET_CFLAGS="-I##SDKTARGETSYSROOT##${target_includedir}"' >> $script
81 echo 'export TARGET_LDFLAGS="-L##SDKTARGETSYSROOT##{target_libdir}"' >> $script
82 # Workaround darwin toolchain sysroot path problems
83 cd ${SDK_OUTPUT}${SDKTARGETSYSROOT}/usr
84 ln -s /usr/local local
85 fi
86 echo 'export CFLAGS="${TARGET_CC_ARCH} --sysroot=##SDKTARGETSYSROOT##"' >> $script
87 echo 'export CXXFLAGS="${TARGET_CC_ARCH} --sysroot=##SDKTARGETSYSROOT## -I##SDKTARGETSYSROOT##${GXX_INCLUDEDIR}"' >> $script
88 echo 'export POKY_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
89 echo 'export POKY_TARGET_SYSROOT="##SDKTARGETSYSROOT##"' >> $script
90 echo 'export POKY_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script
91 echo 'export POKY_SDK_VERSION="${SDK_VERSION}"' >> $script
92}
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 @@
1DESCRIPTION = "Packge of environment files for SDK"
2LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
3 file://${POKYBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4LICENSE = "MIT"
5PR = "r0"
6
7EXCLUDE_FROM_WORLD = "1"
8
9inherit toolchain-scripts
10# get target config site before inheritting corss-canadian
11TARGET_CONFIG_SITE := "${@siteinfo_get_files(d)}"
12
13SDK_DIR = "${WORKDIR}/sdk"
14SDK_OUTPUT = "${SDK_DIR}/image"
15SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}"
16
17inherit cross-canadian
18
19GXX_INCLUDEDIR := "${target_includedir}/c++"
20
21do_generate_content[nostamp] = "1"
22do_generate_content() {
23
24 rm -rf ${SDK_OUTPUT}
25 mkdir -p ${SDK_OUTPUT}/${SDKPATH}
26
27 siteconfig=${SDK_OUTPUT}/${SDKPATH}/site-config-${OLD_MULTIMACH_TARGET_SYS}
28
29 touch $siteconfig
30 for sitefile in ${TARGET_CONFIG_SITE} ; do
31 cat $sitefile >> $siteconfig
32 done
33
34 toolchain_create_sdk_env_script_for_installer
35
36 # Add version information
37 versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${OLD_MULTIMACH_TARGET_SYS}
38 touch $versionfile
39 echo 'Distro: ${DISTRO}' >> $versionfile
40 echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile
41 echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile
42 echo 'Timestamp: ${DATETIME}' >> $versionfile
43}
44do_generate_content[recrdeptask] = "do_compile"
45addtask generate_content before do_install after do_compile
46
47do_install[nostamp] = "1"
48do_install() {
49 install -d ${D}/${SDKPATH}
50 install -m 0644 -t ${D}/${SDKPATH} ${SDK_OUTPUT}/${SDKPATH}/*
51}
52
53PN = "meta-environment-${TRANSLATED_TARGET_ARCH}"
54PACKAGES = "${PN}"
55FILES_${PN}= " \
56 ${SDKPATH}/* \
57 "
58
59do_fetch[noexec] = "1"
60do_unpack[noexec] = "1"
61do_patch[noexec] = "1"
62do_configure[noexec] = "1"
63do_compile[noexec] = "1"
64do_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} = "\
12 binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} \ 12 binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} \
13 gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} \ 13 gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} \
14 gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} \ 14 gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} \
15 meta-environment-${TRANSLATED_TARGET_ARCH} \
15 " 16 "
16 17