summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2009-02-16 16:52:52 -0500
committerOwen W. Taylor <otaylor@fishsoup.net>2009-02-19 12:05:10 -0500
commitec3bcb29fb938ac3d0ea70c1b739a76970613403 (patch)
treeca9b66c1652fc85fd7421097a9886a285f6ba247 /tools
parent8b1299bec2c976420bc987daf25ad74d9b615d55 (diff)
downloadgobject-introspection-ec3bcb29fb938ac3d0ea70c1b739a76970613403.tar.gz
Bug 572075 - Make the scanner work with static and convenience libraries
We need to reference the get_type() functions we are going to dlsym or otherwise the linker may not include them in the introspection binary. giscanner/dumper.py: Accept a list of _get_type() functions and write an array referencing them into the introspection binary. giscanner/glibtransformer.py: Break parsing into too stages - the stage where we compute the _get_type() functions and the stage where we invoke the introspection binary. tools/g-ir-scanner: Pass _get_type() functions from the scanner when creating the introspection binary. http://bugzilla.gnome.org/show_bug.cgi?id=572075
Diffstat (limited to 'tools')
-rwxr-xr-xtools/g-ir-scanner16
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/g-ir-scanner b/tools/g-ir-scanner
index 0cf54cec..f53f7fc3 100755
--- a/tools/g-ir-scanner
+++ b/tools/g-ir-scanner
@@ -316,17 +316,23 @@ def main(args):
# Transform the C symbols into AST nodes
transformer.set_source_ast(ss)
+ # Transform the C AST nodes into higher level
+ # GLib/GObject nodes
+ glibtransformer = GLibTransformer(transformer,
+ noclosure=options.noclosure)
+
+ # Do enough parsing that we have the get_type() functions to reference
+ # when creating the introspection binary
+ glibtransformer.init_parse()
+
if options.program:
args=[options.program]
args.extend(options.program_args)
binary = IntrospectionBinary(args)
else:
- binary = compile_introspection_binary(options)
+ binary = compile_introspection_binary(options,
+ glibtransformer.get_get_type_functions())
- # Transform the C AST nodes into higher level
- # GLib/GObject nodes
- glibtransformer = GLibTransformer(transformer,
- noclosure=options.noclosure)
glibtransformer.set_introspection_binary(binary)
namespace = glibtransformer.parse()