From 98895a6c9122605d847394ff15d8aa2f11650ffc Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Fri, 13 Jun 2014 23:38:22 +0300 Subject: Simple target converter. --- tools/autotools2meson.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/autotools2meson.py b/tools/autotools2meson.py index a71efa6..27f3571 100755 --- a/tools/autotools2meson.py +++ b/tools/autotools2meson.py @@ -48,10 +48,28 @@ class Converter(): if i != '.': ofile.write("subdir('%s')\n" % i) self.convert(os.path.join(subdir, i)) + elif items[0].endswith('_SOURCES'): + self.convert_target(ofile, items) else: - ofile.write(line) - ofile.write('\n') + ofile.write("# %s\n" % line) + def convert_target(self, ofile, items): + if items[0].endswith('la_SOURCES'): + func = 'shared_library' + tname = "'%s'" % items[0][:-11] + else: + func = 'executable' + tname = "'%s'" % items[0][:-8] + sources = [tname] + for s in items[2:]: + if s.startswith('$('): + s = s[2:-1] + elif s.startswith('$'): + s = s[1:] + else: + s = "'%s'" % s + sources.append(s) + ofile.write('%s(%s)\n' % (func, ',\n'.join(sources))) if __name__ == '__main__': if len(sys.argv) != 2: -- cgit v1.1