summaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-01-19 00:18:26 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-19 17:24:48 +0000
commitdbe91a3d6aebb09d2618a955d09bcbd8ee2baff2 (patch)
tree173c73fdbd556c921041f52ab3b203214e65b835 /scripts/lib/recipetool
parente7bedb91a7114dda22a97b57de6e98d7794d8a1e (diff)
downloadpoky-dbe91a3d6aebb09d2618a955d09bcbd8ee2baff2.tar.gz
recipetool: create: improve extraction of pkg-config / lib deps
* The regexes for PKG_CHECK_MODULES / AC_CHECK_LIB were a bit too strict and thus we were skipping some macros. * Add support for PKG_CHECK_EXISTS * Avoid duplicates in warning on missing pkg-config dependencies * Ignore dependency on musl (since this may come up if it's the selected C library) (From OE-Core rev: c58669fb0977f7f0cb79f252484d5c5ef0dfb7e4) 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')
-rw-r--r--scripts/lib/recipetool/create_buildsys.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py
index 1674aba28a..7fedb2a917 100644
--- a/scripts/lib/recipetool/create_buildsys.py
+++ b/scripts/lib/recipetool/create_buildsys.py
@@ -157,12 +157,13 @@ class AutotoolsRecipeHandler(RecipeHandler):
157 progclassmap = {'gconftool-2': 'gconf', 157 progclassmap = {'gconftool-2': 'gconf',
158 'pkg-config': 'pkgconfig'} 158 'pkg-config': 'pkgconfig'}
159 159
160 ignoredeps = ['gcc-runtime', 'glibc', 'uclibc', 'tar-native', 'binutils-native'] 160 ignoredeps = ['gcc-runtime', 'glibc', 'uclibc', 'musl', 'tar-native', 'binutils-native']
161 ignorelibs = ['socket'] 161 ignorelibs = ['socket']
162 162
163 pkg_re = re.compile('PKG_CHECK_MODULES\(\[?[a-zA-Z0-9]*\]?, \[?([^,\]]*)[),].*') 163 pkg_re = re.compile('PKG_CHECK_MODULES\(\[?[a-zA-Z0-9_]*\]?, *\[?([^,\]]*)\]?[),].*')
164 lib_re = re.compile('AC_CHECK_LIB\(\[?([a-zA-Z0-9]*)\]?, .*') 164 pkgce_re = re.compile('PKG_CHECK_EXISTS\(\[?([^,\]]*)\]?[),].*')
165 progs_re = re.compile('_PROGS?\(\[?[a-zA-Z0-9]*\]?, \[?([^,\]]*)\]?[),].*') 165 lib_re = re.compile('AC_CHECK_LIB\(\[?([^,\]]*)\]?,.*')
166 progs_re = re.compile('_PROGS?\(\[?[a-zA-Z0-9_]*\]?, \[?([^,\]]*)\]?[),].*')
166 dep_re = re.compile('([^ ><=]+)( [<>=]+ [^ ><=]+)?') 167 dep_re = re.compile('([^ ><=]+)( [<>=]+ [^ ><=]+)?')
167 ac_init_re = re.compile('AC_INIT\(([^,]+), *([^,]+)[,)].*') 168 ac_init_re = re.compile('AC_INIT\(([^,]+), *([^,]+)[,)].*')
168 am_init_re = re.compile('AM_INIT_AUTOMAKE\(([^,]+), *([^,]+)[,)].*') 169 am_init_re = re.compile('AM_INIT_AUTOMAKE\(([^,]+), *([^,]+)[,)].*')
@@ -249,6 +250,13 @@ class AutotoolsRecipeHandler(RecipeHandler):
249 if res: 250 if res:
250 pcdeps.extend([x[0] for x in res]) 251 pcdeps.extend([x[0] for x in res])
251 inherits.append('pkgconfig') 252 inherits.append('pkgconfig')
253 elif keyword == 'PKG_CHECK_EXISTS':
254 res = pkgce_re.search(value)
255 if res:
256 res = dep_re.findall(res.group(1))
257 if res:
258 pcdeps.extend([x[0] for x in res])
259 inherits.append('pkgconfig')
252 elif keyword in ('AM_GNU_GETTEXT', 'AM_GLIB_GNU_GETTEXT', 'GETTEXT_PACKAGE'): 260 elif keyword in ('AM_GNU_GETTEXT', 'AM_GLIB_GNU_GETTEXT', 'GETTEXT_PACKAGE'):
253 inherits.append('gettext') 261 inherits.append('gettext')
254 elif keyword in ('AC_PROG_INTLTOOL', 'IT_PROG_INTLTOOL'): 262 elif keyword in ('AC_PROG_INTLTOOL', 'IT_PROG_INTLTOOL'):
@@ -313,6 +321,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
313 defines[key] = value 321 defines[key] = value
314 322
315 keywords = ['PKG_CHECK_MODULES', 323 keywords = ['PKG_CHECK_MODULES',
324 'PKG_CHECK_EXISTS',
316 'AM_GNU_GETTEXT', 325 'AM_GNU_GETTEXT',
317 'AM_GLIB_GNU_GETTEXT', 326 'AM_GLIB_GNU_GETTEXT',
318 'GETTEXT_PACKAGE', 327 'GETTEXT_PACKAGE',
@@ -375,6 +384,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
375 384
376 recipemap = read_pkgconfig_provides(tinfoil.config_data) 385 recipemap = read_pkgconfig_provides(tinfoil.config_data)
377 unmapped = [] 386 unmapped = []
387 pcdeps = list(set(pcdeps))
378 for pcdep in pcdeps: 388 for pcdep in pcdeps:
379 recipe = recipemap.get(pcdep, None) 389 recipe = recipemap.get(pcdep, None)
380 if recipe: 390 if recipe: