From 5614c5ae6a004d4367eccc34dd3cc7ee61fb7e57 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Wed, 9 Mar 2016 17:48:49 +1300 Subject: 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 Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- scripts/lib/recipetool/create_buildsys.py | 36 +++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'scripts/lib/recipetool/create_buildsys.py') 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 @@ # Recipe creation tool - create command build system handlers # -# Copyright (C) 2014 Intel Corporation +# Copyright (C) 2014-2016 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -404,14 +404,34 @@ class AutotoolsRecipeHandler(RecipeHandler): values = {} inherits = [] - # FIXME this mapping is very thin + # Hardcoded map, we also use a dynamic one based on what's in the sysroot progmap = {'flex': 'flex-native', 'bison': 'bison-native', 'm4': 'm4-native', 'tar': 'tar-native', - 'ar': 'binutils-native'} + 'ar': 'binutils-native', + 'ranlib': 'binutils-native', + 'ld': 'binutils-native', + 'strip': 'binutils-native', + 'libtool': '', + 'autoconf': '', + 'autoheader': '', + 'automake': '', + 'uname': '', + 'rm': '', + 'cp': '', + 'mv': '', + 'find': '', + 'awk': '', + 'sed': '', + } progclassmap = {'gconftool-2': 'gconf', - 'pkg-config': 'pkgconfig'} + 'pkg-config': 'pkgconfig', + 'python': 'pythonnative', + 'python3': 'python3native', + 'perl': 'perlnative', + 'makeinfo': 'texinfo', + } pkg_re = re.compile('PKG_CHECK_MODULES\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') pkgce_re = re.compile('PKG_CHECK_EXISTS\(\s*\[?([^,\]]*)\]?[),].*') @@ -462,6 +482,8 @@ class AutotoolsRecipeHandler(RecipeHandler): deps = [] unmapped = [] + RecipeHandler.load_binmap(tinfoil.config_data) + def process_macro(keyword, value): for handler in handlers: if handler.process_macro(srctree, keyword, value, process_value, libdeps, pcdeps, deps, outlines, inherits, values): @@ -498,10 +520,12 @@ class AutotoolsRecipeHandler(RecipeHandler): if progclass: inherits.append(progclass) else: - progdep = progmap.get(prog, None) + progdep = RecipeHandler.recipebinmap.get(prog, None) + if not progdep: + progdep = progmap.get(prog, None) if progdep: deps.append(progdep) - else: + elif progdep is None: if not prog.startswith('$'): unmapped.append(prog) elif keyword == 'AC_CHECK_LIB': -- cgit 1.2.3-korg