summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/update-glib-annotations.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/misc/update-glib-annotations.py b/misc/update-glib-annotations.py
new file mode 100755
index 00000000..63d83fa8
--- /dev/null
+++ b/misc/update-glib-annotations.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+if __name__ == '__main__':
+ srcdir = sys.argv[1]
+ sources = []
+ projname = 'glib'
+ subdir = os.path.join(srcdir, projname)
+ headersfile = os.path.join(subdir, projname + '-public-headers.txt')
+ f = open(headersfile)
+ line = f.read()
+ f.close()
+ for headername in line.split(' '):
+ headername = headername.strip()
+ if headername == 'gi18n-lib.h':
+ continue
+ sources.append(os.path.join(subdir, headername))
+ for sourcename in os.listdir(subdir):
+ if sourcename.endswith('.c'):
+ sources.append(os.path.join(subdir, sourcename))
+ os.execv('./g-ir-annotation-tool',
+ ['./g-ir-annotation-tool', '--extract',
+ '-DGLIB_COMPILATION',
+ '-I' + srcdir,
+ '-I' + os.path.join(srcdir, 'glib'),
+ '-I' + os.path.join(srcdir, 'gmodule')] + sources)