All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] meta-environment: Added package of meta-environment-${TARGET_ARCH} for environment files.
  2010-12-16  1:47 [PATCH 0/1] [BUGID #565] fixing. Added package of meta-environment-${TARGET_ARCH} Lianhao Lu
@ 2010-12-16  1:40 ` Lianhao Lu
  2010-12-16 15:49   ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Lianhao Lu @ 2010-12-16  1:40 UTC (permalink / raw)
  To: poky

[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>
---
 meta/classes/toolchain-scripts.bbclass         |   32 ++++++++++
 meta/recipes-core/meta/meta-environment.bb     |   75 ++++++++++++++++++++++++
 meta/recipes-core/tasks/task-cross-canadian.bb |    1 +
 3 files changed, 108 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-core/meta/meta-environment.bb

diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index c393d99..4093635 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -60,3 +60,35 @@ 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##${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##${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} --sysroot=##SDKTARGETSYSROOT##"' >> $script
+	echo 'export CXXFLAGS="${TARGET_CC_ARCH} --sysroot=##SDKTARGETSYSROOT## -I##SDKTARGETSYSROOT##${GXX_INCLUDEDIR}"' >> $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
+	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 0000000..255f2f3
--- /dev/null
+++ b/meta/recipes-core/meta/meta-environment.bb
@@ -0,0 +1,75 @@
+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"
+
+inherit meta toolchain-scripts
+
+TRANSLATED_TARGET_ARCH ?= "${TARGET_ARCH}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+SDK_DIR = "${WORKDIR}/sdk"
+SDK_OUTPUT = "${SDK_DIR}/image"
+
+SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}"
+
+# Save MULTIMACH_TARGET_SYS
+OLD_MULTIMACH_TARGET_SYS := "${MULTIMACH_TARGET_SYS}"
+MULTIMACH_TARGET_SYS = "${MULTIMACH_ARCH}${SDK_VENDOR}-${SDK_OS}"
+
+# Save PACKAGE_ARCH
+OLD_PACKAGE_ARCH := ${BASE_PACKAGE_ARCH}
+BASE_PACKAGE_ARCH = "${SDK_ARCH}-nativesdk"
+
+#change SSTATE_PKGARCH due to the PACKAGE_ARCH change
+SSTATE_PKGARCH = "${SDK_ARCH}"
+
+CONFIG_SITE = "${@siteinfo_get_files(d)}"
+GXX_INCLUDEDIR := "${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 ${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 7170faa..64e53fe 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} \
     "
 
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 0/1] [BUGID #565] fixing. Added package of meta-environment-${TARGET_ARCH}
@ 2010-12-16  1:47 Lianhao Lu
  2010-12-16  1:40 ` [PATCH 1/1] meta-environment: Added package of meta-environment-${TARGET_ARCH} for environment files Lianhao Lu
  0 siblings, 1 reply; 5+ messages in thread
From: Lianhao Lu @ 2010-12-16  1:47 UTC (permalink / raw)
  To: poky

This fixing is dependant upon the commit 78c0263 of bug #586 fixing on branch jzhang/sdkversion.

Pull URL: git://git.pokylinux.org/poky-contrib.git
  Branch: llu/bug565
  Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/bug565

Thanks,
    Lianhao Lu <lianhao.lu@intel.com>
---


Lianhao Lu (1):
  meta-environment: Added package of meta-environment-${TARGET_ARCH}
    for     environment files.

 meta/classes/toolchain-scripts.bbclass         |   32 ++++++++++
 meta/recipes-core/meta/meta-environment.bb     |   75 ++++++++++++++++++++++++
 meta/recipes-core/tasks/task-cross-canadian.bb |    1 +
 3 files changed, 108 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-core/meta/meta-environment.bb



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] meta-environment: Added package of meta-environment-${TARGET_ARCH} for environment files.
  2010-12-16  1:40 ` [PATCH 1/1] meta-environment: Added package of meta-environment-${TARGET_ARCH} for environment files Lianhao Lu
@ 2010-12-16 15:49   ` Richard Purdie
  2010-12-17  2:30     ` Lu, Lianhao
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2010-12-16 15:49 UTC (permalink / raw)
  To: Lianhao Lu; +Cc: poky

Hi Lianhao,

On Thu, 2010-12-16 at 09:40 +0800, Lianhao Lu wrote:
> [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>
> ---
>  meta/classes/toolchain-scripts.bbclass         |   32 ++++++++++
>  meta/recipes-core/meta/meta-environment.bb     |   75 ++++++++++++++++++++++++
>  meta/recipes-core/tasks/task-cross-canadian.bb |    1 +
>  3 files changed, 108 insertions(+), 0 deletions(-)
>  create mode 100644 meta/recipes-core/meta/meta-environment.bb

This recipe looks complex and seems to include a lot of
cross-canadian.bbclass.

Would it be possible to inherit that class instead and try and keep the
recipe simpler? You can always drop the "meta" inherit. I'm worried
about the amount of code duplication here.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] meta-environment: Added package of meta-environment-${TARGET_ARCH} for environment files.
  2010-12-16 15:49   ` Richard Purdie
@ 2010-12-17  2:30     ` Lu, Lianhao
  2010-12-20 17:29       ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Lu, Lianhao @ 2010-12-17  2:30 UTC (permalink / raw)
  To: Richard Purdie; +Cc: poky@yoctoproject.org

Hi Richard,

Richard Purdie wrote on 2010-12-16:
> Hi Lianhao,
> 
> On Thu, 2010-12-16 at 09:40 +0800, Lianhao Lu wrote:
>> [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>
>> ---
>>  meta/classes/toolchain-scripts.bbclass         |   32 ++++++++++
>>  meta/recipes-core/meta/meta-environment.bb     |   75
>>  ++++++++++++++++++++++++
>>  meta/recipes-core/tasks/task-cross-canadian.bb |    1 + 3 files
>>  changed, 108 insertions(+), 0 deletions(-)  create mode
>> 100644 meta/recipes-core/meta/meta-environment.bb
> 
> This recipe looks complex and seems to include a lot of cross-canadian.bbclass.
> 
> Would it be possible to inherit that class instead and try and keep
> the recipe simpler? You can always drop the "meta" inherit. I'm
> worried about the amount of code duplication here.
> 

The reason I didn't inherit the cross-canadian.bbclass in meta-environment.bb is that by doing this, there would be a problem in the siteinfo.bbclass which is used to generate the autoconf site config file for the target. It uses the variables of HOST_ARCH and HOST_OS which is replaced by SDK_ARCH and SDK_OS respectively in cross-canadian.bbclass. If we inherit the cross-canadian, we need to duplicate the code in siteinfo.bbclass to use TARGET_ARCH(OS) instead of the HOST_ARCH(OS). So we duplicate either for siteinfo.bbclass or for cross-canadian.bbclass. Any comment?

Best Regards,
-Lianhao Lu


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] meta-environment: Added package of meta-environment-${TARGET_ARCH} for environment files.
  2010-12-17  2:30     ` Lu, Lianhao
@ 2010-12-20 17:29       ` Richard Purdie
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2010-12-20 17:29 UTC (permalink / raw)
  To: Lu, Lianhao; +Cc: poky@yoctoproject.org

On Fri, 2010-12-17 at 10:30 +0800, Lu, Lianhao wrote:
> Hi Richard,
> 
> Richard Purdie wrote on 2010-12-16:
> > Hi Lianhao,
> > 
> > On Thu, 2010-12-16 at 09:40 +0800, Lianhao Lu wrote:
> >> [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>
> >> ---
> >>  meta/classes/toolchain-scripts.bbclass         |   32 ++++++++++
> >>  meta/recipes-core/meta/meta-environment.bb     |   75
> >>  ++++++++++++++++++++++++
> >>  meta/recipes-core/tasks/task-cross-canadian.bb |    1 + 3 files
> >>  changed, 108 insertions(+), 0 deletions(-)  create mode
> >> 100644 meta/recipes-core/meta/meta-environment.bb
> > 
> > This recipe looks complex and seems to include a lot of cross-canadian.bbclass.
> > 
> > Would it be possible to inherit that class instead and try and keep
> > the recipe simpler? You can always drop the "meta" inherit. I'm
> > worried about the amount of code duplication here.
> > 
> 
> The reason I didn't inherit the cross-canadian.bbclass in
> meta-environment.bb is that by doing this, there would be a problem in
> the siteinfo.bbclass which is used to generate the autoconf site
> config file for the target. It uses the variables of HOST_ARCH and
> HOST_OS which is replaced by SDK_ARCH and SDK_OS respectively in
> cross-canadian.bbclass. If we inherit the cross-canadian, we need to
> duplicate the code in siteinfo.bbclass to use TARGET_ARCH(OS) instead
> of the HOST_ARCH(OS). So we duplicate either for siteinfo.bbclass or
> for cross-canadian.bbclass. Any comment?

I see your problem. Normally I'd not suggest something like this but
there is a way we can solve the problem. You can put this at the top of
the file before HOST_ARCH and HOST_OS are changed:

TARGET_SITE_CONFIG := "${CONFIG_SITE}"

Then the data you need should be preserved in TARGET_SITE_CONFIG.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-12-20 17:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-16  1:47 [PATCH 0/1] [BUGID #565] fixing. Added package of meta-environment-${TARGET_ARCH} Lianhao Lu
2010-12-16  1:40 ` [PATCH 1/1] meta-environment: Added package of meta-environment-${TARGET_ARCH} for environment files Lianhao Lu
2010-12-16 15:49   ` Richard Purdie
2010-12-17  2:30     ` Lu, Lianhao
2010-12-20 17:29       ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.