diff options
| author | Mike Turquette <mturquette@gmail.com> | 2009-01-23 15:53:25 +0000 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-01-23 15:53:25 +0000 |
| commit | 063f2efff16bd2b411b25b7bc9f19c2c59bbf81d (patch) | |
| tree | 5ce6edfff858efee371645230dc54aaf13901f06 /meta/packages | |
| parent | aa8de0e94129217f2a5390f84f429658d5f16de4 (diff) | |
| download | poky-063f2efff16bd2b411b25b7bc9f19c2c59bbf81d.tar.gz | |
Add 2008q3 CSL toolchain support
Diffstat (limited to 'meta/packages')
| -rw-r--r-- | meta/packages/meta/external-csl-toolchain_2008q3-72.bb | 276 |
1 files changed, 276 insertions, 0 deletions
diff --git a/meta/packages/meta/external-csl-toolchain_2008q3-72.bb b/meta/packages/meta/external-csl-toolchain_2008q3-72.bb new file mode 100644 index 0000000000..c5dde36e9c --- /dev/null +++ b/meta/packages/meta/external-csl-toolchain_2008q3-72.bb | |||
| @@ -0,0 +1,276 @@ | |||
| 1 | INHIBIT_DEFAULT_DEPS = "1" | ||
| 2 | |||
| 3 | PROVIDES = "\ | ||
| 4 | linux-libc-headers \ | ||
| 5 | virtual/arm-none-linux-gnueabi-gcc \ | ||
| 6 | virtual/arm-none-linux-gnueabi-g++ \ | ||
| 7 | virtual/arm-none-linux-gnueabi-gcc-initial \ | ||
| 8 | virtual/arm-none-linux-gnueabi-gcc-intermediate \ | ||
| 9 | virtual/arm-none-linux-gnueabi-binutils \ | ||
| 10 | virtual/arm-none-linux-gnueabi-libc-for-gcc \ | ||
| 11 | virtual/libc \ | ||
| 12 | virtual/libintl \ | ||
| 13 | virtual/libiconv \ | ||
| 14 | glibc-thread-db \ | ||
| 15 | virtual/linux-libc-headers " | ||
| 16 | RPROVIDES = "glibc-utils libsegfault glibc-thread-db" | ||
| 17 | PACKAGES_DYNAMIC = "glibc-gconv-*" | ||
| 18 | PR = "r1" | ||
| 19 | |||
| 20 | #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-${PV}-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 \ | ||
| 21 | |||
| 22 | SRC_URI = "file://SUPPORTED" | ||
| 23 | |||
| 24 | do_install() { | ||
| 25 | echo "EXTERNAL_TOOLCHAIN is ${EXTERNAL_TOOLCHAIN}" | ||
| 26 | install -d ${D}${sysconfdir} ${D}${bindir} ${D}${sbindir} ${D}${base_bindir} ${D}${libdir} | ||
| 27 | install -d ${D}${base_libdir} ${D}${base_sbindir} ${D}${datadir} | ||
| 28 | |||
| 29 | cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/lib/* ${D}${base_libdir} | ||
| 30 | cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/etc/* ${D}${sysconfdir} | ||
| 31 | cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/sbin/* ${D}${base_sbindir} | ||
| 32 | cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/usr/* ${D}/usr | ||
| 33 | } | ||
| 34 | |||
| 35 | do_stage() { | ||
| 36 | install -d ${STAGING_INCDIR} | ||
| 37 | cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/usr/include/* ${STAGING_INCDIR} | ||
| 38 | |||
| 39 | install -d ${STAGING_LIBDIR} | ||
| 40 | cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/usr/lib/* ${STAGING_LIBDIR} | ||
| 41 | |||
| 42 | install -d ${STAGING_DIR_TARGET}${layout_base_libdir} | ||
| 43 | cp -a ${EXTERNAL_TOOLCHAIN}/arm-none-linux-gnueabi/libc/lib/* ${STAGING_DIR_TARGET}${base_libdir} | ||
| 44 | |||
| 45 | sed -e "s# /lib# ../../lib#g" \ | ||
| 46 | -e "s# /usr/lib# .#g" \ | ||
| 47 | ${STAGING_LIBDIR}/libc.so > ${STAGING_LIBDIR}/temp | ||
| 48 | mv ${STAGING_LIBDIR}/temp ${STAGING_LIBDIR}/libc.so | ||
| 49 | |||
| 50 | sed -e "s# /lib# ../../lib#" \ | ||
| 51 | -e "s# /usr/lib# .#g" \ | ||
| 52 | ${STAGING_LIBDIR}/libpthread.so > ${STAGING_LIBDIR}/temp | ||
| 53 | mv ${STAGING_LIBDIR}/temp ${STAGING_LIBDIR}/libpthread.so | ||
| 54 | } | ||
| 55 | |||
| 56 | PACKAGES = "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers" | ||
| 57 | FILES_libgcc = "${base_libdir}/libgcc_s.so.1" | ||
| 58 | FILES_libgcc-dev = "${base_libdir}/libgcc_s.so" | ||
| 59 | FILES_libstdc++ = "${libdir}/libstdc++.so.*" | ||
| 60 | FILES_libstdc++-dev = "${includedir}/c++/${PV} \ | ||
| 61 | ${libdir}/libstdc++.so \ | ||
| 62 | ${libdir}/libstdc++.la \ | ||
| 63 | ${libdir}/libstdc++.a \ | ||
| 64 | ${libdir}/libsupc++.la \ | ||
| 65 | ${libdir}/libsupc++.a" | ||
| 66 | FILES_linux-libc-headers = "${includedir}/asm* \ | ||
| 67 | ${includedir}/linux \ | ||
| 68 | ${includedir}/mtd \ | ||
| 69 | ${includedir}/rdma \ | ||
| 70 | ${includedir}/scsi \ | ||
| 71 | ${includedir}/sound \ | ||
| 72 | ${includedir}/video \ | ||
| 73 | " | ||
| 74 | |||
| 75 | PACKAGES += "glibc-dbg glibc catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile" | ||
| 76 | |||
| 77 | libc_baselibs = "/lib/libc* /lib/libm* /lib/ld* /lib/libpthread* /lib/libresolv* /lib/librt* /lib/libutil* /lib/libnsl* /lib/libnss_files* /lib/libnss_compat* /lib/libnss_dns* /lib/libdl* /lib/libanl* /lib/libBrokenLocale*" | ||
| 78 | |||
| 79 | FILES_glibc = "${sysconfdir} ${libc_baselibs} /sbin/ldconfig ${libexecdir}/* ${datadir}/zoneinfo" | ||
| 80 | FILES_glibc-dev = "${includedir}" | ||
| 81 | FILES_ldd = "${bindir}/ldd" | ||
| 82 | FILES_libsegfault = "/lib/libSegFault*" | ||
| 83 | FILES_glibc-extra-nss = "/lib/libnss*" | ||
| 84 | FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen ${libdir}/*.so" | ||
| 85 | FILES_nscd = "${sbindir}/nscd*" | ||
| 86 | FILES_glibc-utils = "${bindir}/* ${sbindir}/*" | ||
| 87 | FILES_glibc-gconv = "${libdir}/gconv/*" | ||
| 88 | FILES_glibc-dbg += " ${libdir}/gconv/.debug ${libexecdir}/*/.debug ${base_libdir}/.debug ${libdir}/.debug" | ||
| 89 | FILES_catchsegv = "${bindir}/catchsegv" | ||
| 90 | RDEPENDS_catchsegv = "libsegfault" | ||
| 91 | FILES_glibc-pcprofile = "/lib/libpcprofile.so" | ||
| 92 | FILES_glibc-thread-db = "/lib/libthread_db*" | ||
| 93 | RPROVIDES_glibc-dev += "libc-dev" | ||
| 94 | LEAD_SONAME = "libc.so.6" | ||
| 95 | |||
| 96 | DESCRIPTION_sln = "glibc: create symbolic links between files" | ||
| 97 | DESCRIPTION_nscd = "glibc: name service cache daemon for passwd, group, and hosts" | ||
| 98 | DESCRIPTION_glibc-extra-nss = "glibc: nis, nisplus and hesiod search services" | ||
| 99 | DESCRIPTION_ldd = "glibc: print shared library dependencies" | ||
| 100 | DESCRIPTION_localedef = "glibc: compile locale definition files" | ||
| 101 | DESCRIPTION_glibc-utils = "glibc: misc utilities like iconf, local, gencat, tzselect, rpcinfo, ..." | ||
| 102 | |||
| 103 | FILES_sln = "${base_sbindir}/sln" | ||
| 104 | FILES_localedef = "${bindir}/localedef" | ||
| 105 | |||
| 106 | |||
| 107 | TMP_LOCALE="/tmp/locale${libdir}/locale" | ||
| 108 | |||
| 109 | locale_base_postinst() { | ||
| 110 | #!/bin/sh | ||
| 111 | |||
| 112 | if [ "x$D" != "x" ]; then | ||
| 113 | exit 1 | ||
| 114 | fi | ||
| 115 | |||
| 116 | rm -rf ${TMP_LOCALE} | ||
| 117 | mkdir -p ${TMP_LOCALE} | ||
| 118 | if [ -f ${libdir}/locale/locale-archive ]; then | ||
| 119 | cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/ | ||
| 120 | fi | ||
| 121 | localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s | ||
| 122 | mkdir -p ${libdir}/locale/ | ||
| 123 | mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/ | ||
| 124 | rm -rf ${TMP_LOCALE} | ||
| 125 | } | ||
| 126 | |||
| 127 | locale_base_postrm() { | ||
| 128 | #!/bin/sh | ||
| 129 | |||
| 130 | rm -rf ${TMP_LOCALE} | ||
| 131 | mkdir -p ${TMP_LOCALE} | ||
| 132 | if [ -f ${libdir}/locale/locale-archive ]; then | ||
| 133 | cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/ | ||
| 134 | fi | ||
| 135 | localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s --prefix=/tmp/locale %s | ||
| 136 | mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/ | ||
| 137 | rm -rf ${TMP_LOCALE} | ||
| 138 | } | ||
| 139 | |||
| 140 | python package_do_split_gconvs () { | ||
| 141 | import os, re | ||
| 142 | if (bb.data.getVar('PACKAGE_NO_GCONV', d, 1) == '1'): | ||
| 143 | bb.note("package requested not splitting gconvs") | ||
| 144 | return | ||
| 145 | |||
| 146 | if not bb.data.getVar('PACKAGES', d, 1): | ||
| 147 | return | ||
| 148 | |||
| 149 | libdir = bb.data.getVar('libdir', d, 1) | ||
| 150 | if not libdir: | ||
| 151 | bb.error("libdir not defined") | ||
| 152 | return | ||
| 153 | datadir = bb.data.getVar('datadir', d, 1) | ||
| 154 | if not datadir: | ||
| 155 | bb.error("datadir not defined") | ||
| 156 | return | ||
| 157 | |||
| 158 | gconv_libdir = os.path.join(libdir, "gconv") | ||
| 159 | charmap_dir = os.path.join(datadir, "i18n", "charmaps") | ||
| 160 | locales_dir = os.path.join(datadir, "i18n", "locales") | ||
| 161 | binary_locales_dir = os.path.join(libdir, "locale") | ||
| 162 | |||
| 163 | do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern='glibc-gconv-%s', description='gconv module for character set %s', extra_depends='glibc-gconv') | ||
| 164 | |||
| 165 | do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern='glibc-charmap-%s', description='character map for %s encoding', extra_depends='') | ||
| 166 | |||
| 167 | def calc_locale_deps(fn, pkg, file_regex, output_pattern, group): | ||
| 168 | deps = [] | ||
| 169 | f = open(fn, "r") | ||
| 170 | c_re = re.compile('^copy "(.*)"') | ||
| 171 | i_re = re.compile('^include "(\w+)".*') | ||
| 172 | for l in f.readlines(): | ||
| 173 | m = c_re.match(l) or i_re.match(l) | ||
| 174 | if m: | ||
| 175 | dp = legitimize_package_name('glibc-localedata-%s' % m.group(1)) | ||
| 176 | if not dp in deps: | ||
| 177 | deps.append(dp) | ||
| 178 | f.close() | ||
| 179 | if deps != []: | ||
| 180 | bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d) | ||
| 181 | |||
| 182 | do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='') | ||
| 183 | bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' glibc-gconv', d) | ||
| 184 | |||
| 185 | f = open(os.path.join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r") | ||
| 186 | supported = f.readlines() | ||
| 187 | f.close() | ||
| 188 | |||
| 189 | dot_re = re.compile("(.*)\.(.*)") | ||
| 190 | |||
| 191 | # Collate the locales by base and encoding | ||
| 192 | encodings = {} | ||
| 193 | for l in supported: | ||
| 194 | l = l[:-1] | ||
| 195 | (locale, charset) = l.split(" ") | ||
| 196 | m = dot_re.match(locale) | ||
| 197 | if m: | ||
| 198 | locale = m.group(1) | ||
| 199 | if not encodings.has_key(locale): | ||
| 200 | encodings[locale] = [] | ||
| 201 | encodings[locale].append(charset) | ||
| 202 | |||
| 203 | def output_locale_source(name, locale, encoding): | ||
| 204 | pkgname = 'locale-base-' + legitimize_package_name(name) | ||
| 205 | |||
| 206 | bb.data.setVar('RDEPENDS_%s' % pkgname, 'localedef glibc-localedata-%s glibc-charmap-%s' % (legitimize_package_name(locale), legitimize_package_name(encoding)), d) | ||
| 207 | rprovides = 'virtual-locale-%s' % legitimize_package_name(name) | ||
| 208 | m = re.match("(.*)_(.*)", name) | ||
| 209 | if m: | ||
| 210 | rprovides += ' virtual-locale-%s' % m.group(1) | ||
| 211 | bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d) | ||
| 212 | bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d) | ||
| 213 | bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d) | ||
| 214 | bb.data.setVar('pkg_postinst_%s' % pkgname, bb.data.getVar('locale_base_postinst', d, 1) % (locale, encoding, locale), d) | ||
| 215 | bb.data.setVar('pkg_postrm_%s' % pkgname, bb.data.getVar('locale_base_postrm', d, 1) % (locale, encoding, locale), d) | ||
| 216 | |||
| 217 | def output_locale_binary(name, locale, encoding): | ||
| 218 | target_arch = bb.data.getVar("TARGET_ARCH", d, 1) | ||
| 219 | qemu = "qemu-%s" % target_arch | ||
| 220 | pkgname = 'locale-base-' + legitimize_package_name(name) | ||
| 221 | m = re.match("(.*)\.(.*)", name) | ||
| 222 | if m: | ||
| 223 | glibc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-","")) | ||
| 224 | else: | ||
| 225 | glibc_name = name | ||
| 226 | bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('glibc-binary-localedata-%s' % glibc_name), d) | ||
| 227 | rprovides = 'virtual-locale-%s' % legitimize_package_name(name) | ||
| 228 | m = re.match("(.*)_(.*)", name) | ||
| 229 | if m: | ||
| 230 | rprovides += ' virtual-locale-%s' % m.group(1) | ||
| 231 | bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d) | ||
| 232 | bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d) | ||
| 233 | bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d) | ||
| 234 | |||
| 235 | treedir = os.path.join(bb.data.getVar("WORKDIR", d, 1), "locale-tree") | ||
| 236 | path = bb.data.getVar("PATH", d, 1) | ||
| 237 | i18npath = os.path.join(treedir, datadir, "i18n") | ||
| 238 | |||
| 239 | localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, name) | ||
| 240 | cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, treedir, localedef_opts) | ||
| 241 | bb.note("generating locale %s (%s)" % (locale, encoding)) | ||
| 242 | if os.system(cmd): | ||
| 243 | raise bb.build.FuncFailed("localedef returned an error (command was %s)." % cmd) | ||
| 244 | |||
| 245 | def output_locale(name, locale, encoding): | ||
| 246 | output_locale_source(name, locale, encoding) | ||
| 247 | |||
| 248 | # Reshuffle names so that UTF-8 is preferred over other encodings | ||
| 249 | non_utf8 = [] | ||
| 250 | for l in encodings.keys(): | ||
| 251 | if len(encodings[l]) == 1: | ||
| 252 | output_locale(l, l, encodings[l][0]) | ||
| 253 | if encodings[l][0] != "UTF-8": | ||
| 254 | non_utf8.append(l) | ||
| 255 | else: | ||
| 256 | if "UTF-8" in encodings[l]: | ||
| 257 | output_locale(l, l, "UTF-8") | ||
| 258 | encodings[l].remove("UTF-8") | ||
| 259 | else: | ||
| 260 | non_utf8.append(l) | ||
| 261 | for e in encodings[l]: | ||
| 262 | output_locale('%s.%s' % (l, e), l, e) | ||
| 263 | |||
| 264 | if non_utf8 != []: | ||
| 265 | bb.note("the following locales are supported only in legacy encodings:") | ||
| 266 | bb.note(" " + " ".join(non_utf8)) | ||
| 267 | } | ||
| 268 | |||
| 269 | # We want to do this indirection so that we can safely 'return' | ||
| 270 | # from the called function even though we're prepending | ||
| 271 | python populate_packages_prepend () { | ||
| 272 | if bb.data.getVar('DEBIAN_NAMES', d, 1): | ||
| 273 | bb.data.setVar('PKG_glibc', 'libc6', d) | ||
| 274 | bb.data.setVar('PKG_glibc-dev', 'libc6-dev', d) | ||
| 275 | bb.build.exec_func('package_do_split_gconvs', d) | ||
| 276 | } | ||
