aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-06-13 23:38:22 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2014-06-13 23:38:22 +0300
commit98895a6c9122605d847394ff15d8aa2f11650ffc (patch)
tree43c289d765f5a5fdbb088e348eed9bcc83fd1501 /tools
parenta1988277bda68d3ff878b45bc561eb52e679afce (diff)
downloadmeson-98895a6c9122605d847394ff15d8aa2f11650ffc.zip
meson-98895a6c9122605d847394ff15d8aa2f11650ffc.tar.gz
meson-98895a6c9122605d847394ff15d8aa2f11650ffc.tar.bz2
Simple target converter.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/autotools2meson.py22
1 files 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: