summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Larson <kergoth@gmail.com>2012-04-16 15:32:16 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-03 15:48:03 +0100
commitfa514172ed8b02d7ce3aee9624ccd76c10fa37ac (patch)
treedc6416a15a5a540c93d023f15ccca3cc53be05be
parent6b2056250177cc569e57f2510afa5a142450c394 (diff)
downloadpoky-fa514172ed8b02d7ce3aee9624ccd76c10fa37ac.tar.gz
external-csl-toolchain: cleanup, simplify, use base_libdir
(From OE-Core rev: be158f5cb6650b761ac2f3649d071c051329a799) Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/meta/external-csl-toolchain.bb57
1 files changed, 28 insertions, 29 deletions
diff --git a/meta/recipes-core/meta/external-csl-toolchain.bb b/meta/recipes-core/meta/external-csl-toolchain.bb
index fb553ab898..a14e95867d 100644
--- a/meta/recipes-core/meta/external-csl-toolchain.bb
+++ b/meta/recipes-core/meta/external-csl-toolchain.bb
@@ -24,36 +24,40 @@ PROVIDES += "\
24 virtual/linux-libc-headers \ 24 virtual/linux-libc-headers \
25" 25"
26PV = "${CSL_VER_MAIN}" 26PV = "${CSL_VER_MAIN}"
27PR = "r3" 27PR = "r5"
28 28
29#SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2" 29#SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2"
30 30
31SRC_URI = "file://SUPPORTED" 31SRC_URI = "file://SUPPORTED"
32 32
33do_install() { 33do_install() {
34 install -d ${D}${sysconfdir} ${D}${bindir} ${D}${sbindir} ${D}${base_bindir} ${D}${libdir} 34 # Use optimized files if available
35 install -d ${D}${base_libdir} ${D}${base_sbindir} ${D}${datadir} ${D}/usr 35 sysroot="${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc"
36 36 if [ -d $sysroot/${CSL_TARGET_CORE} ]; then
37 if [ -d ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE} ]; then 37 sysroot="$sysroot/${CSL_TARGET_CORE}"
38 cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/lib/. ${D}${base_libdir}
39 cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/etc/. ${D}${sysconfdir}
40 cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/sbin/. ${D}${base_sbindir}
41 if [ ! -e ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/usr/include ]; then
42 cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/usr/include ${D}/usr/
43 fi
44 cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/usr/. ${D}/usr/
45 else
46 cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/lib/. ${D}${base_libdir}
47 cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/etc/. ${D}${sysconfdir}
48 cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/sbin/. ${D}${base_sbindir}
49 cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/usr/. ${D}/usr/
50 fi 38 fi
51 39
52 if [ -e ${D}${prefix}/info ]; then 40 cp -a $sysroot${base_libdir}/. ${D}${base_libdir}
53 mv ${D}${prefix}/info ${D}${infodir} 41 cp -a $sysroot/etc/. ${D}${sysconfdir}
54 fi 42 cp -a $sysroot/sbin/. ${D}${base_sbindir}
55 if [ -e ${D}${prefix}/man ]; then 43
56 mv ${D}${prefix}/man ${D}${mandir} 44 install -d ${D}/usr
45 for usr_element in bin libexec sbin share ${base_libdir}; do
46 usr_path=$sysroot/usr/$usr_element
47 cp -a $usr_path ${D}/usr/
48 done
49 for datadir_element in man info; do
50 datadir_path=$sysroot/usr/$datadir_element
51 if [ -e $datadir_path ]; then
52 cp -a $datadir_path ${D}${datadir}/
53 fi
54 done
55
56 # Some toolchains have headers under the core specific area
57 if [ -e $sysroot/usr/include ]; then
58 cp -a $sysroot/usr/include/. ${D}${includedir}
59 else
60 cp -a $sysroot/../usr/include/. ${D}${includedir}
57 fi 61 fi
58 62
59 rm ${D}${sysconfdir}/rpc 63 rm ${D}${sysconfdir}/rpc
@@ -61,18 +65,13 @@ do_install() {
61 65
62 mv ${D}${libdir}/bin/* ${D}${bindir}/ 66 mv ${D}${libdir}/bin/* ${D}${bindir}/
63 if [ -e ${D}${libdir}/bin/.debug ]; then 67 if [ -e ${D}${libdir}/bin/.debug ]; then
64 install -d ${D}${bindir}/.debug
65 mv ${D}${libdir}/bin/.debug/* ${D}${bindir}/.debug/ 68 mv ${D}${libdir}/bin/.debug/* ${D}${bindir}/.debug/
66 fi 69 fi
67 ln -s ../../bin/gdbserver ${D}${libdir}/bin/sysroot-gdbserver 70 ln -s ../../bin/gdbserver ${D}${libdir}/bin/sysroot-gdbserver
68 71
69 sed -i -e 's/__packed/__attribute__ ((packed))/' ${D}${includedir}/mtd/ubi-user.h 72 sed -i -e 's/__packed/__attribute__ ((packed))/' ${D}${includedir}/mtd/ubi-user.h
70 sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libc.so 73 sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libc.so
71 sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libpthread.so 74 sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libpthread.so
72}
73
74do_install_locale_append () {
75 rm -r ${D}${datadir}/locale ${D}${libdir}/locale
76} 75}
77 76
78SYSROOT_PREPROCESS_FUNCS += "external_toolchain_sysroot_adjust" 77SYSROOT_PREPROCESS_FUNCS += "external_toolchain_sysroot_adjust"