summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-06-14 00:21:21 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2014-06-14 00:21:21 +0300
commit029ed965e2c77855bed4fa86398cd8efed7a7269 (patch)
tree9656657f18d447419cf05399001821b409be7d36 /tools
parent0ff7fd40bad04d11b9f06db5c4a3acac3c0bfacd (diff)
downloadmeson-029ed965e2c77855bed4fa86398cd8efed7a7269.tar.gz
Convert some pkg-config declarations.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/autotools2meson.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/autotools2meson.py b/tools/autotools2meson.py
index 6edc3b3d0..a26d6aa4d 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))