summaryrefslogtreecommitdiff
path: root/scripts/lib/recipetool
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-09-19 08:08:08 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-19 09:06:52 +0100
commit63234cc45aee91b031657971f36997e1443f80ee (patch)
tree3d81d0f1f637b35e4cffab64c1796025ffa61df7 /scripts/lib/recipetool
parentf7e43f931d7d6019a3b2509b2b2635978fbbae36 (diff)
downloadopenembedded-core-63234cc45aee91b031657971f36997e1443f80ee.tar.gz
openembedded-core-63234cc45aee91b031657971f36997e1443f80ee.tar.bz2
openembedded-core-63234cc45aee91b031657971f36997e1443f80ee.zip
recipetool: create: detect python autoconf macros
If python is required then we need to inherit pythonnative (or python3native) otherwise do_configure will probably fail since it won't be able to find python. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/recipetool')
-rw-r--r--scripts/lib/recipetool/create_buildsys.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py
index 0ad748ef02..067be18c13 100644
--- a/scripts/lib/recipetool/create_buildsys.py
+++ b/scripts/lib/recipetool/create_buildsys.py
@@ -442,6 +442,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
ac_init_re = re.compile('AC_INIT\(\s*([^,]+),\s*([^,]+)[,)].*')
am_init_re = re.compile('AM_INIT_AUTOMAKE\(\s*([^,]+),\s*([^,]+)[,)].*')
define_re = re.compile('\s*(m4_)?define\(\s*([^,]+),\s*([^,]+)\)')
+ version_re = re.compile('([0-9.]+)')
defines = {}
def subst_defines(value):
@@ -488,6 +489,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
for handler in handlers:
if handler.process_macro(srctree, keyword, value, process_value, libdeps, pcdeps, deps, outlines, inherits, values):
return
+ logger.debug('Found keyword %s with value "%s"' % (keyword, value))
if keyword == 'PKG_CHECK_MODULES':
res = pkg_re.search(value)
if res:
@@ -573,6 +575,17 @@ class AutotoolsRecipeHandler(RecipeHandler):
deps.append('swig-native')
elif keyword == 'AX_PROG_XSLTPROC':
deps.append('libxslt-native')
+ elif keyword in ['AC_PYTHON_DEVEL', 'AX_PYTHON_DEVEL', 'AM_PATH_PYTHON']:
+ pythonclass = 'pythonnative'
+ res = version_re.search(value)
+ if res:
+ if res.group(1).startswith('3'):
+ pythonclass = 'python3native'
+ # Avoid replacing python3native with pythonnative
+ if not pythonclass in inherits and not 'python3native' in inherits:
+ if 'pythonnative' in inherits:
+ inherits.remove('pythonnative')
+ inherits.append(pythonclass)
elif keyword == 'AX_WITH_CURSES':
deps.append('ncurses')
elif keyword == 'AX_PATH_BDB':
@@ -639,6 +652,9 @@ class AutotoolsRecipeHandler(RecipeHandler):
'AX_LIB_TAGLIB',
'AX_PKG_SWIG',
'AX_PROG_XSLTPROC',
+ 'AC_PYTHON_DEVEL',
+ 'AX_PYTHON_DEVEL',
+ 'AM_PATH_PYTHON',
'AX_WITH_CURSES',
'AX_PATH_BDB',
'AX_PATH_LIB_PCRE',