aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/autotools2meson.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/autotools2meson.py b/tools/autotools2meson.py
index 37ec5bc..a71efa6 100755
--- a/tools/autotools2meson.py
+++ b/tools/autotools2meson.py
@@ -26,7 +26,7 @@ class Converter():
while line != '':
line = line.rstrip()
while line.endswith('\\'):
- line = line[:-1] + file.readline.rstrip()
+ line = line[:-1] + file.readline().rstrip()
yield line
line = file.readline()
@@ -37,8 +37,20 @@ class Converter():
ifile = open(os.path.join(subdir, 'Makefile.am'))
except FileNotFoundError:
print('Makefile.am not found in subdir', subdir)
+ ofile = open(os.path.join(subdir, 'meson.build'), 'w')
for line in self.readlines(ifile):
- print(line)
+ items = line.strip().split()
+ if len(items) == 0:
+ ofile.write('\n')
+ continue
+ if items[0] == 'SUBDIRS':
+ for i in items[2:]:
+ if i != '.':
+ ofile.write("subdir('%s')\n" % i)
+ self.convert(os.path.join(subdir, i))
+ else:
+ ofile.write(line)
+ ofile.write('\n')
if __name__ == '__main__':