summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/meta/external-sourcery-toolchain.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/meta/external-sourcery-toolchain.bb')
-rw-r--r--meta/recipes-core/meta/external-sourcery-toolchain.bb149
1 files changed, 149 insertions, 0 deletions
diff --git a/meta/recipes-core/meta/external-sourcery-toolchain.bb b/meta/recipes-core/meta/external-sourcery-toolchain.bb
new file mode 100644
index 0000000000..41d86d628d
--- /dev/null
+++ b/meta/recipes-core/meta/external-sourcery-toolchain.bb
@@ -0,0 +1,149 @@
1require recipes-core/eglibc/eglibc-package.inc
2
3INHIBIT_DEFAULT_DEPS = "1"
4
5# License applies to this recipe code, not the toolchain itself
6SUMMARY = "External Sourcery G++ toolchain"
7LICENSE = "MIT"
8LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
9 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
10
11PROVIDES += "\
12 linux-libc-headers \
13 virtual/${TARGET_PREFIX}gcc \
14 virtual/${TARGET_PREFIX}g++ \
15 virtual/${TARGET_PREFIX}gcc-initial \
16 virtual/${TARGET_PREFIX}gcc-intermediate \
17 virtual/${TARGET_PREFIX}binutils \
18 virtual/${TARGET_PREFIX}libc-for-gcc \
19 virtual/${TARGET_PREFIX}libc-initial \
20 virtual/${TARGET_PREFIX}compilerlibs \
21 virtual/libc \
22 virtual/libintl \
23 virtual/libiconv \
24 glibc-thread-db \
25 libgcc \
26 eglibc \
27 virtual/linux-libc-headers \
28"
29PV = "${CSL_VER_MAIN}"
30PR = "r7"
31
32#SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2"
33
34SRC_URI = "file://SUPPORTED"
35
36do_install() {
37 # Use optimized files if available
38 sysroot="${EXTERNAL_TOOLCHAIN_SYSROOT}"
39
40 cp -a $sysroot${base_libdir}/. ${D}${base_libdir}
41 cp -a $sysroot/etc/. ${D}${sysconfdir}
42 cp -a $sysroot/sbin/. ${D}${base_sbindir}
43
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}
61 fi
62
63 rm ${D}${sysconfdir}/rpc
64 rm -r ${D}${datadir}/zoneinfo
65
66 mv ${D}${libdir}/bin/* ${D}${bindir}/
67 if [ -e ${D}${libdir}/bin/.debug ]; then
68 mv ${D}${libdir}/bin/.debug/* ${D}${bindir}/.debug/
69 fi
70 ln -s ../../bin/gdbserver ${D}${libdir}/bin/sysroot-gdbserver
71
72 sed -i -e 's/__packed/__attribute__ ((packed))/' ${D}${includedir}/mtd/ubi-user.h
73 sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libc.so
74 sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libpthread.so
75}
76
77SYSROOT_PREPROCESS_FUNCS += "external_toolchain_sysroot_adjust"
78external_toolchain_sysroot_adjust() {
79 dest_sysroot="$(${CC} -print-sysroot | sed -e's,^${STAGING_DIR_HOST},,; s,/$,,')"
80 if [ -n "$dest_sysroot" ]; then
81 rm -f ${SYSROOT_DESTDIR}/$dest_sysroot
82 ln -s . ${SYSROOT_DESTDIR}/$dest_sysroot
83 fi
84
85 # If the usr/lib directory doesn't exist, the toolchain fails to even
86 # try to find crti.o in a completely different directory (usr/lib64)
87 install -d ${SYSROOT_DESTDIR}/usr/lib
88}
89
90PACKAGES =+ "libgcc libgcc-dev libstdc++ libstdc++-dev libstdc++-staticdev linux-libc-headers linux-libc-headers-dev gdbserver gdbserver-dbg"
91
92# This test should be fixed to ignore .a files in .debug dirs
93INSANE_SKIP_${PN}-dbg = "staticdev"
94
95# We don't care about GNU_HASH in prebuilt binaries
96INSANE_SKIP_${PN}-utils += "ldflags"
97INSANE_SKIP_libstdc++ += "ldflags"
98INSANE_SKIP_libgcc += "ldflags"
99INSANE_SKIP_gdbserver += "ldflags"
100
101PKG_${PN} = "eglibc"
102PKG_${PN}-dev = "eglibc-dev"
103PKG_${PN}-staticdev = "eglibc-staticdev"
104PKG_${PN}-doc = "eglibc-doc"
105PKG_${PN}-dbg = "eglibc-dbg"
106PKG_${PN}-pic = "eglibc-pic"
107PKG_${PN}-utils = "eglibc-utils"
108PKG_${PN}-gconv = "eglibc-gconv"
109PKG_${PN}-extra-nss = "eglibc-extra-nss"
110PKG_${PN}-thread-db = "eglibc-thread-db"
111PKG_${PN}-pcprofile = "eglibc-pcprofile"
112
113PKGV = "${CSL_VER_LIBC}"
114PKGV_libgcc = "${CSL_VER_GCC}"
115PKGV_libgcc-dev = "${CSL_VER_GCC}"
116PKGV_libstdc++ = "${CSL_VER_GCC}"
117PKGV_libstdc++-dev = "${CSL_VER_GCC}"
118PKGV_libstdc++-staticdev = "${CSL_VER_GCC}"
119PKGV_linux-libc-headers = "${CSL_VER_KERNEL}"
120PKGV_linux-libc-headers-dev = "${CSL_VER_KERNEL}"
121PKGV_gdbserver = "${CSL_VER_GDB}"
122PKGV_gdbserver-dbg = "${CSL_VER_GDB}"
123
124FILES_libgcc = "${base_libdir}/libgcc_s.so.1"
125FILES_libgcc-dev = "${base_libdir}/libgcc_s.so"
126FILES_libstdc++ = "${libdir}/libstdc++.so.*"
127FILES_libstdc++-dev = "${includedir}/c++/${PV} \
128 ${libdir}/libstdc++.so \
129 ${libdir}/libstdc++.la \
130 ${libdir}/libsupc++.la"
131FILES_libstdc++-staticdev = "${libdir}/libstdc++.a ${libdir}/libsupc++.a"
132FILES_linux-libc-headers = "${includedir}/asm* \
133 ${includedir}/linux \
134 ${includedir}/mtd \
135 ${includedir}/rdma \
136 ${includedir}/scsi \
137 ${includedir}/sound \
138 ${includedir}/video \
139"
140FILES_gdbserver = "${bindir}/gdbserver ${libdir}/bin/sysroot-gdbserver"
141FILES_gdbserver-dbg = "${bindir}/.debug/gdbserver"
142
143CSL_VER_MAIN ??= ""
144
145python () {
146 if not d.getVar("CSL_VER_MAIN"):
147 raise bb.parse.SkipPackage("External CSL toolchain not configured (CSL_VER_MAIN not set).")
148}
149