diff options
| author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-03-09 17:48:49 +1300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-09 17:00:29 +0000 |
| commit | 2b6a35212dca1c6f6e85ac7be18f1ac70c7a8bd6 (patch) | |
| tree | c8293b80c5236ff2a211d6f40526a01a28969346 /scripts/lib/recipetool/create_buildsys.py | |
| parent | 1607fac5210437dd13a96017dc65c5f2f46dbf65 (diff) | |
| download | poky-2b6a35212dca1c6f6e85ac7be18f1ac70c7a8bd6.tar.gz | |
recipetool: create: improve mapping for autotools program macros
Make the following improvements to mapping items specified in
AC_CHECK_PROG, AC_PATH_PROG and AX_WITH_PROG to recipes/classes:
* Produce a map of native recipe -> binary for all binaries currently in
STAGING_BINDIR_NATIVE and use this when mapping items
* Add some more entries to the class map
* Ignore autotools binaries since they are covered by the inherit of
autotools
* Ignore coreutils-native since that would almost always be a bogus
dependency
(From OE-Core rev: 5614c5ae6a004d4367eccc34dd3cc7ee61fb7e57)
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/create_buildsys.py')
| -rw-r--r-- | scripts/lib/recipetool/create_buildsys.py | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py index 909743b384..f84ec3dc6c 100644 --- a/scripts/lib/recipetool/create_buildsys.py +++ b/scripts/lib/recipetool/create_buildsys.py | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | # Recipe creation tool - create command build system handlers | 1 | # Recipe creation tool - create command build system handlers |
| 2 | # | 2 | # |
| 3 | # Copyright (C) 2014 Intel Corporation | 3 | # Copyright (C) 2014-2016 Intel Corporation |
| 4 | # | 4 | # |
| 5 | # This program is free software; you can redistribute it and/or modify | 5 | # This program is free software; you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License version 2 as | 6 | # it under the terms of the GNU General Public License version 2 as |
| @@ -404,14 +404,34 @@ class AutotoolsRecipeHandler(RecipeHandler): | |||
| 404 | values = {} | 404 | values = {} |
| 405 | inherits = [] | 405 | inherits = [] |
| 406 | 406 | ||
| 407 | # FIXME this mapping is very thin | 407 | # Hardcoded map, we also use a dynamic one based on what's in the sysroot |
| 408 | progmap = {'flex': 'flex-native', | 408 | progmap = {'flex': 'flex-native', |
| 409 | 'bison': 'bison-native', | 409 | 'bison': 'bison-native', |
| 410 | 'm4': 'm4-native', | 410 | 'm4': 'm4-native', |
| 411 | 'tar': 'tar-native', | 411 | 'tar': 'tar-native', |
| 412 | 'ar': 'binutils-native'} | 412 | 'ar': 'binutils-native', |
| 413 | 'ranlib': 'binutils-native', | ||
| 414 | 'ld': 'binutils-native', | ||
| 415 | 'strip': 'binutils-native', | ||
| 416 | 'libtool': '', | ||
| 417 | 'autoconf': '', | ||
| 418 | 'autoheader': '', | ||
| 419 | 'automake': '', | ||
| 420 | 'uname': '', | ||
| 421 | 'rm': '', | ||
| 422 | 'cp': '', | ||
| 423 | 'mv': '', | ||
| 424 | 'find': '', | ||
| 425 | 'awk': '', | ||
| 426 | 'sed': '', | ||
| 427 | } | ||
| 413 | progclassmap = {'gconftool-2': 'gconf', | 428 | progclassmap = {'gconftool-2': 'gconf', |
| 414 | 'pkg-config': 'pkgconfig'} | 429 | 'pkg-config': 'pkgconfig', |
| 430 | 'python': 'pythonnative', | ||
| 431 | 'python3': 'python3native', | ||
| 432 | 'perl': 'perlnative', | ||
| 433 | 'makeinfo': 'texinfo', | ||
| 434 | } | ||
| 415 | 435 | ||
| 416 | pkg_re = re.compile('PKG_CHECK_MODULES\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') | 436 | pkg_re = re.compile('PKG_CHECK_MODULES\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') |
| 417 | pkgce_re = re.compile('PKG_CHECK_EXISTS\(\s*\[?([^,\]]*)\]?[),].*') | 437 | pkgce_re = re.compile('PKG_CHECK_EXISTS\(\s*\[?([^,\]]*)\]?[),].*') |
| @@ -462,6 +482,8 @@ class AutotoolsRecipeHandler(RecipeHandler): | |||
| 462 | deps = [] | 482 | deps = [] |
| 463 | unmapped = [] | 483 | unmapped = [] |
| 464 | 484 | ||
| 485 | RecipeHandler.load_binmap(tinfoil.config_data) | ||
| 486 | |||
| 465 | def process_macro(keyword, value): | 487 | def process_macro(keyword, value): |
| 466 | for handler in handlers: | 488 | for handler in handlers: |
| 467 | if handler.process_macro(srctree, keyword, value, process_value, libdeps, pcdeps, deps, outlines, inherits, values): | 489 | if handler.process_macro(srctree, keyword, value, process_value, libdeps, pcdeps, deps, outlines, inherits, values): |
| @@ -498,10 +520,12 @@ class AutotoolsRecipeHandler(RecipeHandler): | |||
| 498 | if progclass: | 520 | if progclass: |
| 499 | inherits.append(progclass) | 521 | inherits.append(progclass) |
| 500 | else: | 522 | else: |
| 501 | progdep = progmap.get(prog, None) | 523 | progdep = RecipeHandler.recipebinmap.get(prog, None) |
| 524 | if not progdep: | ||
| 525 | progdep = progmap.get(prog, None) | ||
| 502 | if progdep: | 526 | if progdep: |
| 503 | deps.append(progdep) | 527 | deps.append(progdep) |
| 504 | else: | 528 | elif progdep is None: |
| 505 | if not prog.startswith('$'): | 529 | if not prog.startswith('$'): |
| 506 | unmapped.append(prog) | 530 | unmapped.append(prog) |
| 507 | elif keyword == 'AC_CHECK_LIB': | 531 | elif keyword == 'AC_CHECK_LIB': |
