Gentoo Archives: gentoo-devhelp

From: Nathan Phillip Brink <binki@g.o>
To: gentoo-devhelp@l.g.o
Subject: Re: [gentoo-devhelp] How do I get just the "-j" part from MAKEOPTS?
Date: Tue, 27 Mar 2012 05:38:15
Message-Id: 20120327053756.GR17321@ohnopublishing.net
In Reply to: [gentoo-devhelp] How do I get just the "-j" part from MAKEOPTS? by Nikos Chantziaras
1 On Tue, Mar 27, 2012 at 05:43:43AM +0300, Nikos Chantziaras wrote:
2 > I have an ebuild that uses jam as its build system. jam supports
3 > parallel builds with -jN. However, other make options are not
4 > recognized. So in the ebuild, I can't just pass ${MAKEOPTS}.
5 >
6 > Is there a way to filter out just the "-jN" part of MAKEOPTS and pass it on?
7
8 It looks like some eclasses just resort to sed for that:
9
10 ohnobinki@ohnopublishing ~/portage $ grep -Re 'MAKEOPTS.*-j' /usr/portage/eclass
11 /usr/portage/eclass/toolchain.eclass: export MAKEOPTS="${MAKEOPTS} -j1"
12 /usr/portage/eclass/waf-utils.eclass: local jobs=$(echo -j1 ${MAKEOPTS} | sed -r "s/.*(-j\s*|--jobs=)([0-9]+).*/--jobs=\2/" )
13 /usr/portage/eclass/perl-module.eclass: export HARNESS_OPTIONS=j$(echo -j1 ${MAKEOPTS} | sed -r "s/.*(-j\s*|--jobs=)([0-9]+).*/\2/" )
14
15 So if you did something dirty like that, it would be enough to make
16 people happy ;-).
17
18 --
19 binki
20
21 Look out for missing or extraneous apostrophes!

Replies

Subject Author
[gentoo-devhelp] Re: How do I get just the "-j" part from MAKEOPTS? Nikos Chantziaras <realnc@×××××.com>