summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2011-06-07 18:04:37 -0400
committerColin Walters <walters@verbum.org>2011-06-07 18:04:37 -0400
commitc8c23d2db2ec6594b5c43bd01cc78db396c709f3 (patch)
tree0e656d6323796a0e1e0ca729e4451ae72222dd64 /misc
parentdc5f8f07209947b74ad1d9d781d73a5ca1c33c0b (diff)
downloadgobject-introspection-c8c23d2db2ec6594b5c43bd01cc78db396c709f3.tar.gz
update-glib-annotations.py: new script
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)