[OE-core] [PATCH 4/8] external-csl-toolchain: cleanup, simplify, use base_libdir

Chris Larson clarson at kergoth.com
Tue May 1 20:02:06 UTC 2012


On Tue, May 1, 2012 at 10:54 AM, Chris Larson <clarson at kergoth.com> wrote:
> On Tue, May 1, 2012 at 10:26 AM, Khem Raj <raj.khem at gmail.com> wrote:
>> On Tue, May 1, 2012 at 8:58 AM, Christopher Larson <kergoth at gmail.com> wrote:
>>> Signed-off-by: Christopher Larson <kergoth at gmail.com>
>>> ---
>>>  meta/recipes-core/meta/external-csl-toolchain.bb |   55 +++++++++++-----------
>>>  1 files changed, 27 insertions(+), 28 deletions(-)
>>>
>>> diff --git a/meta/recipes-core/meta/external-csl-toolchain.bb b/meta/recipes-core/meta/external-csl-toolchain.bb
>>> index fb553ab..a14e958 100644
>>> --- a/meta/recipes-core/meta/external-csl-toolchain.bb
>>> +++ b/meta/recipes-core/meta/external-csl-toolchain.bb
>>> @@ -24,36 +24,40 @@ PROVIDES += "\
>>>        virtual/linux-libc-headers \
>>>  "
>>>  PV = "${CSL_VER_MAIN}"
>>> -PR = "r3"
>>> +PR = "r5"
>>>
>>>  #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2"
>>>
>>>  SRC_URI = "file://SUPPORTED"
>>>
>>>  do_install() {
>>> -       install -d ${D}${sysconfdir} ${D}${bindir} ${D}${sbindir} ${D}${base_bindir} ${D}${libdir}
>>> -       install -d ${D}${base_libdir} ${D}${base_sbindir} ${D}${datadir} ${D}/usr
>>> +       # Use optimized files if available
>>> +       sysroot="${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc"
>>> +       if [ -d $sysroot/${CSL_TARGET_CORE} ]; then
>>> +               sysroot="$sysroot/${CSL_TARGET_CORE}"
>>> +       fi
>>> +
>>> +       cp -a $sysroot${base_libdir}/. ${D}${base_libdir}
>>> +       cp -a $sysroot/etc/. ${D}${sysconfdir}
>>> +       cp -a $sysroot/sbin/. ${D}${base_sbindir}
>>>
>>> -       if [ -d ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE} ]; then
>>> -               cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/lib/.  ${D}${base_libdir}
>>> -               cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/etc/.  ${D}${sysconfdir}
>>> -               cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/sbin/. ${D}${base_sbindir}
>>> -               if [ ! -e ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/usr/include ]; then
>>> -                       cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/usr/include  ${D}/usr/
>>> +       install -d ${D}/usr
>>> +       for usr_element in bin libexec sbin share ${base_libdir}; do
>>> +               usr_path=$sysroot/usr/$usr_element
>>> +               cp -a $usr_path ${D}/usr/
>>> +       done
>>> +       for datadir_element in man info; do
>>> +               datadir_path=$sysroot/usr/$datadir_element
>>> +               if [ -e $datadir_path ]; then
>>> +                       cp -a $datadir_path ${D}${datadir}/
>>>                fi
>>> -               cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/usr/.  ${D}/usr/
>>> -       else
>>> -               cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/lib/.  ${D}${base_libdir}
>>> -               cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/etc/.  ${D}${sysconfdir}
>>> -               cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/sbin/. ${D}${base_sbindir}
>>> -               cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/usr/.  ${D}/usr/
>>> -       fi
>>> +       done
>>>
>>> -       if [ -e ${D}${prefix}/info ]; then
>>> -               mv ${D}${prefix}/info ${D}${infodir}
>>> -       fi
>>> -       if [ -e ${D}${prefix}/man ]; then
>>> -               mv ${D}${prefix}/man ${D}${mandir}
>>> +       # Some toolchains have headers under the core specific area
>>> +       if [ -e $sysroot/usr/include ]; then
>>> +               cp -a $sysroot/usr/include/. ${D}${includedir}
>>> +       else
>>> +               cp -a $sysroot/../usr/include/. ${D}${includedir}
>>>        fi
>>
>> can we avoid using /usr/ explicitly here
>
> If you change prefix, you *will* break things. The glibc in the
> external toolchain expects a particular layout. Changing that layout
> will break those expectations. I expect a better approach would be to
> use prefix and then add an explicit error if prefix is not /usr, but
> files copied will be identical either way.

I'll start work on another commit to apply after this series which does this.
-- 
Christopher Larson




More information about the Openembedded-core mailing list