summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-10-07 13:25:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-10-10 10:00:07 +0100
commit8ea43499885943e1248842e2dfc17060e596be3b (patch)
tree7c1e9a4e25e7580f1329c45ae34a6cf1a2bfe4c4 /meta
parent24c803c91310544853da1a389ec7ddbf891d7528 (diff)
downloadpoky-8ea43499885943e1248842e2dfc17060e596be3b.tar.gz
libc-package.bbclass: Use a makefile for locale gernation to increase parallelization
We can generate the locales in parallel. The easiest way to do this is generate a Makefile and then run this with our usual parallel make options. [YOCTO #1554] (From OE-Core rev: 6ce8d028f2a542eceb270aeb511929953a859d39) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/libc-package.bbclass25
1 files changed, 15 insertions, 10 deletions
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
index 71a577b5c0..6ef2f97254 100644
--- a/meta/classes/libc-package.bbclass
+++ b/meta/classes/libc-package.bbclass
@@ -252,6 +252,8 @@ python package_do_split_gconvs () {
252 rprovides.append(legitimize_package_name('%s-binary-localedata-%s' % (bpn, libc_name))) 252 rprovides.append(legitimize_package_name('%s-binary-localedata-%s' % (bpn, libc_name)))
253 bb.data.setVar('RPROVIDES_%s' % pkgname, " ".join(rprovides), d) 253 bb.data.setVar('RPROVIDES_%s' % pkgname, " ".join(rprovides), d)
254 254
255 commands = {}
256
255 def output_locale_binary(name, pkgname, locale, encoding): 257 def output_locale_binary(name, pkgname, locale, encoding):
256 treedir = base_path_join(bb.data.getVar("WORKDIR", d, 1), "locale-tree") 258 treedir = base_path_join(bb.data.getVar("WORKDIR", d, 1), "locale-tree")
257 ldlibdir = base_path_join(treedir, bb.data.getVar("base_libdir", d, 1)) 259 ldlibdir = base_path_join(treedir, bb.data.getVar("base_libdir", d, 1))
@@ -298,17 +300,9 @@ python package_do_split_gconvs () {
298 -E LD_LIBRARY_PATH=%s %s %s/bin/localedef %s" % \ 300 -E LD_LIBRARY_PATH=%s %s %s/bin/localedef %s" % \
299 (path, i18npath, qemu, treedir, ldlibdir, qemu_options, treedir, localedef_opts) 301 (path, i18npath, qemu, treedir, ldlibdir, qemu_options, treedir, localedef_opts)
300 302
303 commands["%s/%s" % (outputpath, name)] = cmd
304
301 bb.note("generating locale %s (%s)" % (locale, encoding)) 305 bb.note("generating locale %s (%s)" % (locale, encoding))
302 import subprocess
303 process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
304 if process.wait() != 0:
305 bb.note("cmd:")
306 bb.note(cmd)
307 bb.note("stdout:")
308 bb.note(process.stdout.read())
309 bb.note("stderr:")
310 bb.note(process.stderr.read())
311 raise bb.build.FuncFailed("localedef returned an error")
312 306
313 def output_locale(name, locale, encoding): 307 def output_locale(name, locale, encoding):
314 pkgname = bb.data.getVar('MLPREFIX', d) + 'locale-base-' + legitimize_package_name(name) 308 pkgname = bb.data.getVar('MLPREFIX', d) + 'locale-base-' + legitimize_package_name(name)
@@ -353,6 +347,17 @@ python package_do_split_gconvs () {
353 bb.note(" " + " ".join(non_utf8)) 347 bb.note(" " + " ".join(non_utf8))
354 348
355 if use_bin == "compile": 349 if use_bin == "compile":
350 makefile = base_path_join(bb.data.getVar("WORKDIR", d, 1), "locale-tree", "Makefile")
351 m = open(makefile, "w")
352 m.write("all: %s\n\n" % " ".join(commands.keys()))
353 for cmd in commands:
354 m.write(cmd + ":\n")
355 m.write(" " + commands[cmd] + "\n\n")
356 m.close()
357 d.setVar("B", os.path.dirname(makefile))
358 d.setVar("EXTRA_OEMAKE", "${PARALLEL_MAKE}")
359 bb.note("Executing binary locale generation makefile")
360 bb.build.exec_func("oe_runmake", d)
356 bb.note("collecting binary locales from locale tree") 361 bb.note("collecting binary locales from locale tree")
357 bb.build.exec_func("do_collect_bins_from_locale_tree", d) 362 bb.build.exec_func("do_collect_bins_from_locale_tree", d)
358 do_split_packages(d, binary_locales_dir, file_regex='(.*)', \ 363 do_split_packages(d, binary_locales_dir, file_regex='(.*)', \