Traverse the entire autotools tree.

pull/15/head
Jussi Pakkanen 11 years ago
parent 79f6f38a16
commit a1988277bd
  1. 16
      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__':

Loading…
Cancel
Save