diff options
Diffstat (limited to 'tools/autotools2meson.py')
-rwxr-xr-x | tools/autotools2meson.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/autotools2meson.py b/tools/autotools2meson.py index 6edc3b3..a26d6aa 100755 --- a/tools/autotools2meson.py +++ b/tools/autotools2meson.py @@ -15,7 +15,7 @@ # limitations under the License. -import sys, os +import sys, os, re class Converter(): def __init__(self, root): @@ -88,6 +88,20 @@ class Converter(): languages.append("'cpp'") elif line.startswith('#'): outlines.append(line + '\n') + elif line.startswith('PKG_CHECK_MODULES'): + rest = line.split('(', 1)[-1].strip() + pkgstanza = rest.split()[1:] + for i in pkgstanza: + i = i.strip() + dep = None + if '=' in i: + continue + if i.startswith('['): + dep = i[1:] + elif re.match('[a-zA-Z]', i): + dep = i + if dep is not None: + outlines.append("%s_dep = dependency('%s')\n" % (dep, dep)) else: outlines.append('# %s\n' % line) ofile.write("project(%s)\n" % ', '.join(["'%s'" % name] + languages)) |