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.

(From OE-Core rev: 2c4c78a6a9970533f3352f1067b2263f45098493)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2015-12-22 17:03:16 +13:00 committed by Richard Purdie
parent 498e4834a8
commit fe28c251b1

View File

@ -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)