summaryrefslogtreecommitdiffstats
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-28 09:25:14 +0000
commitfe28c251b160dba184e92584e5d6f7b7e6644623 (patch)
treeee9148845a9e813c27586d13e5284013969b760b
parent498e4834a806918e41dfe5967f7b58629cf0208f (diff)
downloadpoky-fe28c251b160dba184e92584e5d6f7b7e6644623.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. (From OE-Core rev: 2c4c78a6a9970533f3352f1067b2263f45098493) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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):
127 extravalues['PN'] = pn 127 extravalues['PN'] = pn
128 128
129 if autoconf: 129 if autoconf:
130 lines_before.append('')
130 lines_before.append('# NOTE: if this software is not capable of being built in a separate build directory') 131 lines_before.append('# NOTE: if this software is not capable of being built in a separate build directory')
131 lines_before.append('# from the source, you should replace autotools with autotools-brokensep in the') 132 lines_before.append('# from the source, you should replace autotools with autotools-brokensep in the')
132 lines_before.append('# inherit line') 133 lines_before.append('# inherit line')
@@ -150,11 +151,14 @@ class AutotoolsRecipeHandler(RecipeHandler):
150 # FIXME this mapping is very thin 151 # FIXME this mapping is very thin
151 progmap = {'flex': 'flex-native', 152 progmap = {'flex': 'flex-native',
152 'bison': 'bison-native', 153 'bison': 'bison-native',
153 'm4': 'm4-native'} 154 'm4': 'm4-native',
155 'tar': 'tar-native',
156 'ar': 'binutils-native'}
154 progclassmap = {'gconftool-2': 'gconf', 157 progclassmap = {'gconftool-2': 'gconf',
155 'pkg-config': 'pkgconfig'} 158 'pkg-config': 'pkgconfig'}
156 159
157 ignoredeps = ['gcc-runtime', 'glibc', 'uclibc'] 160 ignoredeps = ['gcc-runtime', 'glibc', 'uclibc', 'tar-native', 'binutils-native']
161 ignorelibs = ['socket']
158 162
159 pkg_re = re.compile('PKG_CHECK_MODULES\(\[?[a-zA-Z0-9]*\]?, \[?([^,\]]*)[),].*') 163 pkg_re = re.compile('PKG_CHECK_MODULES\(\[?[a-zA-Z0-9]*\]?, \[?([^,\]]*)[),].*')
160 lib_re = re.compile('AC_CHECK_LIB\(\[?([a-zA-Z0-9]*)\]?, .*') 164 lib_re = re.compile('AC_CHECK_LIB\(\[?([a-zA-Z0-9]*)\]?, .*')
@@ -245,8 +249,12 @@ class AutotoolsRecipeHandler(RecipeHandler):
245 if res: 249 if res:
246 pcdeps.extend([x[0] for x in res]) 250 pcdeps.extend([x[0] for x in res])
247 inherits.append('pkgconfig') 251 inherits.append('pkgconfig')
248 elif keyword == 'AM_GNU_GETTEXT': 252 elif keyword in ('AM_GNU_GETTEXT', 'AM_GLIB_GNU_GETTEXT', 'GETTEXT_PACKAGE'):
249 inherits.append('gettext') 253 inherits.append('gettext')
254 elif keyword in ('AC_PROG_INTLTOOL', 'IT_PROG_INTLTOOL'):
255 deps.append('intltool-native')
256 elif keyword == 'AM_PATH_GLIB_2_0':
257 deps.append('glib-2.0')
250 elif keyword == 'AC_CHECK_PROG' or keyword == 'AC_PATH_PROG': 258 elif keyword == 'AC_CHECK_PROG' or keyword == 'AC_PATH_PROG':
251 res = progs_re.search(value) 259 res = progs_re.search(value)
252 if res: 260 if res:
@@ -266,13 +274,16 @@ class AutotoolsRecipeHandler(RecipeHandler):
266 res = lib_re.search(value) 274 res = lib_re.search(value)
267 if res: 275 if res:
268 lib = res.group(1) 276 lib = res.group(1)
269 libdep = recipelibmap.get(lib, None) 277 if lib in ignorelibs:
270 if libdep: 278 logger.debug('Ignoring library dependency %s' % lib)
271 deps.append(libdep)
272 else: 279 else:
273 if libdep is None: 280 libdep = recipelibmap.get(lib, None)
274 if not lib.startswith('$'): 281 if libdep:
275 unmappedlibs.append(lib) 282 deps.append(libdep)
283 else:
284 if libdep is None:
285 if not lib.startswith('$'):
286 unmappedlibs.append(lib)
276 elif keyword == 'AC_PATH_X': 287 elif keyword == 'AC_PATH_X':
277 deps.append('libx11') 288 deps.append('libx11')
278 elif keyword == 'AC_INIT': 289 elif keyword == 'AC_INIT':
@@ -303,6 +314,11 @@ class AutotoolsRecipeHandler(RecipeHandler):
303 314
304 keywords = ['PKG_CHECK_MODULES', 315 keywords = ['PKG_CHECK_MODULES',
305 'AM_GNU_GETTEXT', 316 'AM_GNU_GETTEXT',
317 'AM_GLIB_GNU_GETTEXT',
318 'GETTEXT_PACKAGE',
319 'AC_PROG_INTLTOOL',
320 'IT_PROG_INTLTOOL',
321 'AM_PATH_GLIB_2_0',
306 'AC_CHECK_PROG', 322 'AC_CHECK_PROG',
307 'AC_PATH_PROG', 323 'AC_PATH_PROG',
308 'AC_CHECK_LIB', 324 'AC_CHECK_LIB',
@@ -351,10 +367,10 @@ class AutotoolsRecipeHandler(RecipeHandler):
351 extravalues[k] = v.strip('"\'').rstrip('()') 367 extravalues[k] = v.strip('"\'').rstrip('()')
352 368
353 if unmapped: 369 if unmapped:
354 outlines.append('# NOTE: the following prog dependencies are unknown, ignoring: %s' % ' '.join(unmapped)) 370 outlines.append('# NOTE: the following prog dependencies are unknown, ignoring: %s' % ' '.join(list(set(unmapped))))
355 371
356 if unmappedlibs: 372 if unmappedlibs:
357 outlines.append('# NOTE: the following library dependencies are unknown, ignoring: %s' % ' '.join(unmappedlibs)) 373 outlines.append('# NOTE: the following library dependencies are unknown, ignoring: %s' % ' '.join(list(set(unmappedlibs))))
358 outlines.append('# (this is based on recipes that have previously been built and packaged)') 374 outlines.append('# (this is based on recipes that have previously been built and packaged)')
359 375
360 recipemap = read_pkgconfig_provides(tinfoil.config_data) 376 recipemap = read_pkgconfig_provides(tinfoil.config_data)