Bug 574351 - Add --pkg-export option GOBJECT_INTROSPECTION_0_6_4
authorColin Walters <walters@verbum.org>
Mon, 24 Aug 2009 19:48:01 +0000 (15:48 -0400)
committerColin Walters <walters@verbum.org>
Mon, 24 Aug 2009 19:48:01 +0000 (15:48 -0400)
We need to differentiate between --pkg options we use to parse
ourself, and --pkg-export which are needed for library consumers.

When introspecting a library we won't necessarily have the
pkg-config file built, so add a --pkg-export line so library
authors can explicitly make the .gir -> pkg-config association.

gir/Makefile.am
giscanner/scannermain.py

index d136316..c37e030 100644 (file)
@@ -161,8 +161,8 @@ GIRepository-2.0.gir: GObject-2.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) $(GIREPOSIT
                --include=GObject-2.0 \
            --library=girepository-1.0 \
            -I$(srcdir)/girepository \
-               --pkg glib-2.0 \
                --pkg gobject-2.0 \
+               --pkg-export gobject-introspection-1.0 \
            $(GIREPOSITORY_FILES)
 BUILT_GIRSOURCES += GIRepository-2.0.gir
 
index d70eed4..9623b9f 100644 (file)
@@ -81,6 +81,9 @@ def _get_option_parser():
     parser.add_option("", "--pkg",
                       action="append", dest="packages", default=[],
                       help="pkg-config packages to get cflags from")
+    parser.add_option("", "--pkg-export",
+                      action="append", dest="packages_export", default=[],
+                      help="Associated pkg-config packages for this library")
     parser.add_option("-v", "--verbose",
                       action="store_true", dest="verbose",
                       help="be verbose")
@@ -319,8 +322,12 @@ def scanner_main(args):
         raise SystemExit("ERROR in annotation: %s" % (str(e), ))
 
     # Write out AST
+    if options.packages_export:
+        exported_packages = options.packages_export
+    else:
+        exported_packages = options.packages
     writer = Writer(namespace, shlibs, transformer.get_includes(),
-                    options.packages, options.c_includes,
+                    exported_packages, options.c_includes,
                     transformer.get_strip_prefix())
     data = writer.get_xml()
     if options.output: