Mike Frysinger wrote:
> On Friday 19 October 2007, Jason wrote:
>> If I have two projects which use the same toolchain, is it sufficient to
>> do the following?
>>
>> crossdev --target armeb-softfloat-linux-gnu
>> SYSROOT=/usr/armeb-softfloat-linux-gnu
>>
>> Set up SYSROOT with make.globals, and so on
>>
>> mkdir /usr/armeb-softfloat-linux-gnu-nslu2
>> cp -ax /usr/armeb-softfloat-linux-gnu/* \
>> /usr/armeb-softfloat-linux-gnu-nslu2/
>>
>> Then repeat for the second armeb project.
>
> mmm not quite ... the SYSROOT is for the system packages which implies no
> tailoring should really be done. TGTROOT is where all customization should
> be done. if you want to do the customization in the SYSROOT, then it'd be
> better to have separate sysroots ... so something like:
> /usr/armeb-booga1_softfloat-linux-gnu/
> /usr/armeb-booga2_softfloat-linux-gnu/
> these are tuples that'll work with crossdev:
> crossdev --target armeb-booga1_softfloat-linux-gnu
So, my xmerge script (based on [1]) should look like this:
###############
#!/bin/bash
CBUILD=$(portageq envvar CHOST)
PORTAGE_CONFIGROOT="${TGTROOT}"
ROOT="${TGTROOT}"
export CBUILD PORTAGE_CONFIGROOT ROOT
emerge $*
###############
And when I set up my environment, I do the following:
# mkdir -p ${TGTROOT}/etc/portage/profile
# vim ${TGTROOT}/etc/make.conf
# cp /etc/make.globals ${TGTROOT}/etc/
# ln -sn /usr/portage/profiles/path/to/profile \
${TGTROOT}/etc/make.profile
Finally, xkmake:
##########
#!/bin/bash
source ${TGTROOT}/etc/make.conf
XARCH="${ARCH}"
XCC="${CHOST}-"
make ARCH="${XARCH}" CROSS_COMPILE="${XCC}" \
INSTALL_MOD_PATH="${TGTROOT}" $*
##########
And my target image building script can strip out
${TGTROOT}/usr/{src,include} and ${TGTROOT}/etc/portage from the image
since I don't need them at runtime.
Would this configuration mean I don't have to xmerge build dependencies
twice (Once to SYSROOT and then the TGTROOT)?
It's good to know that crossdev will handle '*-booga1_softfloat-*-*'
correctly, but I don't see the point of building three copies of the
exact same toolchain for three different projects. Unless there's
something else crossdev is doing for me that I'm missing in the above.
Am I?
If I set PORTAGE_CONFIGROOT=TGTROOT, will portage look at TGTROOT for
build dependencies or still go to SYSROOT?
It looks like this boils down to me wanting to have multiple, unique
target images (and portage configs) for a given cross toolchain and by
default, crossdev sets up SYSROOT as a single target image and portage
config per toolchain. Does what I've outlined above correctly work
around this?
I think I'm missing something magical about SYSROOT. :-)
thx,
Jason.
[1] - http://www.gentoo.org/proj/en/base/embedded/cross-development.xml
--
[EMAIL PROTECTED] mailing list