diff options
-rw-r--r-- | meta/recipes-support/boost/boost.inc | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/meta/recipes-support/boost/boost.inc b/meta/recipes-support/boost/boost.inc index ad1bc76184..d34ca7cbf1 100644 --- a/meta/recipes-support/boost/boost.inc +++ b/meta/recipes-support/boost/boost.inc | |||
@@ -106,16 +106,24 @@ BJAM_TOOLS = "-sTOOLS=gcc \ | |||
106 | def get_boost_parallel_make(bb, d): | 106 | def get_boost_parallel_make(bb, d): |
107 | pm = d.getVar('PARALLEL_MAKE', True) | 107 | pm = d.getVar('PARALLEL_MAKE', True) |
108 | if pm: | 108 | if pm: |
109 | # people are usually using "-jN" or "-j N", but let it work with something else appended to it | 109 | # look for '-j' and throw other options (e.g. '-l') away |
110 | import re | 110 | # because they might have different meaning in bjam |
111 | pm_prefix = re.search("\D+", pm) | 111 | pm = pm.split() |
112 | pm_val = re.search("\d+", pm) | 112 | while pm: |
113 | if pm_prefix is None or pm_val is None: | 113 | v = None |
114 | bb.error("Unable to analyse format of PARALLEL_MAKE variable: %s" % pm) | 114 | opt = pm.pop(0) |
115 | pm_nval = min(64, int(pm_val.group(0))) | 115 | if opt == '-j': |
116 | return pm_prefix.group(0) + str(pm_nval) + pm[pm_val.end():] | 116 | v = pm.pop(0) |
117 | else: | 117 | elif opt.startswith('-j'): |
118 | return "" | 118 | v = opt[2:].strip() |
119 | else: | ||
120 | v = None | ||
121 | |||
122 | if v: | ||
123 | v = min(64, int(v)) | ||
124 | return '-j' + str(v) | ||
125 | |||
126 | return "" | ||
119 | 127 | ||
120 | BOOST_PARALLEL_MAKE = "${@get_boost_parallel_make(bb, d)}" | 128 | BOOST_PARALLEL_MAKE = "${@get_boost_parallel_make(bb, d)}" |
121 | BJAM_OPTS = '${BOOST_PARALLEL_MAKE} \ | 129 | BJAM_OPTS = '${BOOST_PARALLEL_MAKE} \ |