summaryrefslogtreecommitdiffstats
path: root/scripts
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-20 15:11:07 +0100
commit1370edb4490ea9041f9264ed104da4a82e340c3f (patch)
tree0f92f4adcf2462a489e0ff618a8a6be3e3786f8e /scripts
parent541c54e3012e39b4c9a9997b3224434d444d9de2 (diff)
downloadpoky-1370edb4490ea9041f9264ed104da4a82e340c3f.tar.gz
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. (From OE-Core rev: 63234cc45aee91b031657971f36997e1443f80ee) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-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):
442 ac_init_re = re.compile('AC_INIT\(\s*([^,]+),\s*([^,]+)[,)].*') 442 ac_init_re = re.compile('AC_INIT\(\s*([^,]+),\s*([^,]+)[,)].*')
443 am_init_re = re.compile('AM_INIT_AUTOMAKE\(\s*([^,]+),\s*([^,]+)[,)].*') 443 am_init_re = re.compile('AM_INIT_AUTOMAKE\(\s*([^,]+),\s*([^,]+)[,)].*')
444 define_re = re.compile('\s*(m4_)?define\(\s*([^,]+),\s*([^,]+)\)') 444 define_re = re.compile('\s*(m4_)?define\(\s*([^,]+),\s*([^,]+)\)')
445 version_re = re.compile('([0-9.]+)')
445 446
446 defines = {} 447 defines = {}
447 def subst_defines(value): 448 def subst_defines(value):
@@ -488,6 +489,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
488 for handler in handlers: 489 for handler in handlers:
489 if handler.process_macro(srctree, keyword, value, process_value, libdeps, pcdeps, deps, outlines, inherits, values): 490 if handler.process_macro(srctree, keyword, value, process_value, libdeps, pcdeps, deps, outlines, inherits, values):
490 return 491 return
492 logger.debug('Found keyword %s with value "%s"' % (keyword, value))
491 if keyword == 'PKG_CHECK_MODULES': 493 if keyword == 'PKG_CHECK_MODULES':
492 res = pkg_re.search(value) 494 res = pkg_re.search(value)
493 if res: 495 if res:
@@ -573,6 +575,17 @@ class AutotoolsRecipeHandler(RecipeHandler):
573 deps.append('swig-native') 575 deps.append('swig-native')
574 elif keyword == 'AX_PROG_XSLTPROC': 576 elif keyword == 'AX_PROG_XSLTPROC':
575 deps.append('libxslt-native') 577 deps.append('libxslt-native')
578 elif keyword in ['AC_PYTHON_DEVEL', 'AX_PYTHON_DEVEL', 'AM_PATH_PYTHON']:
579 pythonclass = 'pythonnative'
580 res = version_re.search(value)
581 if res:
582 if res.group(1).startswith('3'):
583 pythonclass = 'python3native'
584 # Avoid replacing python3native with pythonnative
585 if not pythonclass in inherits and not 'python3native' in inherits:
586 if 'pythonnative' in inherits:
587 inherits.remove('pythonnative')
588 inherits.append(pythonclass)
576 elif keyword == 'AX_WITH_CURSES': 589 elif keyword == 'AX_WITH_CURSES':
577 deps.append('ncurses') 590 deps.append('ncurses')
578 elif keyword == 'AX_PATH_BDB': 591 elif keyword == 'AX_PATH_BDB':
@@ -639,6 +652,9 @@ class AutotoolsRecipeHandler(RecipeHandler):
639 'AX_LIB_TAGLIB', 652 'AX_LIB_TAGLIB',
640 'AX_PKG_SWIG', 653 'AX_PKG_SWIG',
641 'AX_PROG_XSLTPROC', 654 'AX_PROG_XSLTPROC',
655 'AC_PYTHON_DEVEL',
656 'AX_PYTHON_DEVEL',
657 'AM_PATH_PYTHON',
642 'AX_WITH_CURSES', 658 'AX_WITH_CURSES',
643 'AX_PATH_BDB', 659 'AX_PATH_BDB',
644 'AX_PATH_LIB_PCRE', 660 'AX_PATH_LIB_PCRE',