Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] multiprocessing.eclass: doing parallel work in bash
Date: Fri, 01 Jun 2012 22:51:46
Message-Id: 201206011850.24313.vapier@gentoo.org
In Reply to: [gentoo-dev] multiprocessing.eclass: doing parallel work in bash by Mike Frysinger
1 example conversion of eatureconf
2 -mike
3
4 --- autotools.eclass
5 +++ autotools.eclass
6 @@ -16,7 +16,7 @@
7 if [[ ${___ECLASS_ONCE_AUTOTOOLS} != "recur -_+^+_- spank" ]] ; then
8 ___ECLASS_ONCE_AUTOTOOLS="recur -_+^+_- spank"
9
10 -inherit libtool
11 +inherit libtool multiprocessing
12
13 # @ECLASS-VARIABLE: WANT_AUTOCONF
14 # @DESCRIPTION:
15 @@ -144,14 +144,24 @@ unset _automake_atom _autoconf_atom
16 # Should do a full autoreconf - normally what most people will be interested in.
17 # Also should handle additional directories specified by AC_CONFIG_SUBDIRS.
18 eautoreconf() {
19 - local x g
20 + local x g multitop
21
22 - if [[ -z ${AT_NO_RECURSIVE} ]]; then
23 + if [[ -z ${AT_TOPLEVEL_EAUTORECONF} ]] ; then
24 + AT_TOPLEVEL_EAUTORECONF="yes"
25 + multitop="yes"
26 + multijob_init
27 + fi
28 +
29 + if [[ -z ${AT_NO_RECURSIVE} ]] ; then
30 # Take care of subdirs
31 for x in $(autotools_check_macro_val AC_CONFIG_SUBDIRS) ; do
32 if [[ -d ${x} ]] ; then
33 pushd "${x}" >/dev/null
34 + (
35 + multijob_child_init
36 AT_NOELIBTOOLIZE="yes" eautoreconf
37 + ) &
38 + multijob_post_fork || die
39 popd >/dev/null
40 fi
41 done
42 @@ -196,11 +206,16 @@ eautoreconf() {
43 eautoheader
44 [[ ${AT_NOEAUTOMAKE} != "yes" ]] && FROM_EAUTORECONF="yes" eautomake ${AM_OPTS}
45
46 - [[ ${AT_NOELIBTOOLIZE} == "yes" ]] && return 0
47 + if [[ ${AT_NOELIBTOOLIZE} != "yes" ]] ; then
48 + # Call it here to prevent failures due to elibtoolize called _before_
49 + # eautoreconf. We set $S because elibtoolize runs on that #265319
50 + S=${PWD} elibtoolize --force
51 + fi
52
53 - # Call it here to prevent failures due to elibtoolize called _before_
54 - # eautoreconf. We set $S because elibtoolize runs on that #265319
55 - S=${PWD} elibtoolize --force
56 + if [[ -n ${multitop} ]] ; then
57 + unset AT_TOPLEVEL_EAUTORECONF
58 + multijob_finish || die
59 + fi
60
61 return 0
62 }

Attachments

File name MIME type
signature.asc application/pgp-signature