aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-12-22 17:03:16 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-22 16:44:04 +0000
commit2c4c78a6a9970533f3352f1067b2263f45098493 (patch)
tree5bbbff592da23f8850579d854ddcd11be40207cf /scripts
parent08ca966dd48db881d8bfb7d7fa0aba49f1f7cffe (diff)
downloadopenembedded-core-contrib-2c4c78a6a9970533f3352f1067b2263f45098493.tar.gz
recipetool: create: improve autotools support
* tar and binutils we can assume are there * libsocket is only relevant on BSD systems, so we can ignore it. * Detect more things implying gettext/intltool is needed * Detect glib-2.0 requirement. 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.py38
1 files changed, 27 insertions, 11 deletions
diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py
index 0aff59e229..1674aba28a 100644
--- a/scripts/lib/recipetool/create_buildsys.py
+++ b/scripts/lib/recipetool/create_buildsys.py
@@ -127,6 +127,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
extravalues['PN'] = pn
if autoconf:
+ lines_before.append('')
lines_before.append('# NOTE: if this software is not capable of being built in a separate build directory')
lines_before.append('# from the source, you should replace autotools with autotools-brokensep in the')
lines_before.append('# inherit line')
@@ -150,11 +151,14 @@ class AutotoolsRecipeHandler(RecipeHandler):
# FIXME this mapping is very thin
progmap = {'flex': 'flex-native',
'bison': 'bison-native',
- 'm4': 'm4-native'}
+ 'm4': 'm4-native',
+ 'tar': 'tar-native',
+ 'ar': 'binutils-native'}
progclassmap = {'gconftool-2': 'gconf',
'pkg-config': 'pkgconfig'}
- ignoredeps = ['gcc-runtime', 'glibc', 'uclibc']
+ ignoredeps = ['gcc-runtime', 'glibc', 'uclibc', 'tar-native', 'binutils-native']
+ ignorelibs = ['socket']
pkg_re = re.compile('PKG_CHECK_MODULES\(\[?[a-zA-Z0-9]*\]?, \[?([^,\]]*)[),].*')
lib_re = re.compile('AC_CHECK_LIB\(\[?([a-zA-Z0-9]*)\]?, .*')
@@ -245,8 +249,12 @@ class AutotoolsRecipeHandler(RecipeHandler):
if res:
pcdeps.extend([x[0] for x in res])
inherits.append('pkgconfig')
- elif keyword == 'AM_GNU_GETTEXT':
+ elif keyword in ('AM_GNU_GETTEXT', 'AM_GLIB_GNU_GETTEXT', 'GETTEXT_PACKAGE'):
inherits.append('gettext')
+ elif keyword in ('AC_PROG_INTLTOOL', 'IT_PROG_INTLTOOL'):
+ deps.append('intltool-native')
+ elif keyword == 'AM_PATH_GLIB_2_0':
+ deps.append('glib-2.0')
elif keyword == 'AC_CHECK_PROG' or keyword == 'AC_PATH_PROG':
res = progs_re.search(value)
if res:
@@ -266,13 +274,16 @@ class AutotoolsRecipeHandler(RecipeHandler):
res = lib_re.search(value)
if res:
lib = res.group(1)
- libdep = recipelibmap.get(lib, None)
- if libdep:
- deps.append(libdep)
+ if lib in ignorelibs:
+ logger.debug('Ignoring library dependency %s' % lib)
else:
- if libdep is None:
- if not lib.startswith('$'):
- unmappedlibs.append(lib)
+ libdep = recipelibmap.get(lib, None)
+ if libdep:
+ deps.append(libdep)
+ else:
+ if libdep is None:
+ if not lib.startswith('$'):
+ unmappedlibs.append(lib)
elif keyword == 'AC_PATH_X':
deps.append('libx11')
elif keyword == 'AC_INIT':
@@ -303,6 +314,11 @@ class AutotoolsRecipeHandler(RecipeHandler):
keywords = ['PKG_CHECK_MODULES',
'AM_GNU_GETTEXT',
+ 'AM_GLIB_GNU_GETTEXT',
+ 'GETTEXT_PACKAGE',
+ 'AC_PROG_INTLTOOL',
+ 'IT_PROG_INTLTOOL',
+ 'AM_PATH_GLIB_2_0',
'AC_CHECK_PROG',
'AC_PATH_PROG',
'AC_CHECK_LIB',
@@ -351,10 +367,10 @@ class AutotoolsRecipeHandler(RecipeHandler):
extravalues[k] = v.strip('"\'').rstrip('()')
if unmapped:
- outlines.append('# NOTE: the following prog dependencies are unknown, ignoring: %s' % ' '.join(unmapped))
+ outlines.append('# NOTE: the following prog dependencies are unknown, ignoring: %s' % ' '.join(list(set(unmapped))))
if unmappedlibs:
- outlines.append('# NOTE: the following library dependencies are unknown, ignoring: %s' % ' '.join(unmappedlibs))
+ outlines.append('# NOTE: the following library dependencies are unknown, ignoring: %s' % ' '.join(list(set(unmappedlibs))))
outlines.append('# (this is based on recipes that have previously been built and packaged)')
recipemap = read_pkgconfig_provides(tinfoil.config_data)