1g-ir-scanner(1) General Commands Manual g-ir-scanner(1)
2
3
4
6 g-ir-scanner - extracting C metadata from sources and headers
7
9 g-ir-scanner [OPTION...] FILES...
10
12 g-ir-scanner is a tool which generates GIR XML files by parsing headers
13 and introspecting GObject based libraries. It is usually invoked
14 during the normal build step for a project and the information is saved
15 to disk and later installed, so that language bindings and other
16 applications can use it. Header files and source files are passed in
17 as arguments on the command line. The suffix determines whether a file
18 be treated as a source file (.c) or a header file (.h). Currently only
19 C based libraries are supported by the scanner.
20
22 --help Show help options
23
24 --quiet
25 If passed, do not print details of normal operation.
26
27 --warn-all
28 Display warnings for public API which is not introspectable.
29
30 --warn-error
31 Make warnings be fatal errors.
32
33 --format=FORMAT
34 This parameters decides which the resulting format will be used.
35 The default value is gir.
36
37 --include=NAME
38 Add the specified introspection dependency to the scanned
39 namespace. NAME is of the form NAMESPACE-VERSION, like Gtk-3.0.
40
41 --include-uninstalled=PATH
42 Add the specified introspection dependency to the scanned
43 namespace. This differs from --include in that it takes a file
44 path, and does not process the pkg-config dependencies (since
45 they may not be installed yet).
46
47 --add-include-path=PATH
48 Add a directory to the path which the scanner uses to find GIR
49 files. Can be used multiple times to specify multiple
50 directories
51
52 -i, --library=LIBRARY
53 Specifies a library that will be introspected. This means that
54 the *_get_type() functions in it will be called for GObject data
55 types. The name of the library should not contain the leading
56 lib prefix nor the ending shared library suffix.
57
58 -L, --library-path=PATH
59 Include this directory when searching for a library. This
60 option can be specified multiple times to include more than one
61 directory to look for libraries in.
62
63 -Idirectory
64 Include this directory in the list of directories to be searched
65 for header files. You need to pass to the scanner all the
66 directories you'd normally pass to the compiler when using the
67 specified source files.
68
69 -n, --namespace=NAME
70 The namespace name. This name should be capitalized, eg the
71 first letter should be upper case. Examples: Gtk, Clutter,
72 WebKit.
73
74 --no-libtool
75 Disable usage of libtool for compiling stub introspection
76 binary. Use this if your build system does not require libtool.
77
78 --libtool
79 Full path to libtool executable. Typically used for Automake
80 systems.
81
82 --nsversion=VERSION
83 The namespace version. For instance 1.0. This is usually the
84 platform version, eg 2.0 for Gtk+, not 2.12.7.
85
86 -p, --program=PROGRAM
87 Specifies a binary that will be introspected. This means that
88 the *_get_type() functions in it will be called for GObject data
89 types. The binary must be modified to take a --introspect-dump=
90 option, and to pass the argument to this function to
91 g_irepository_dump.
92
93 --program-arg=ARG
94 Additional argument to pass to program for introspection.
95
96 --identifier-prefix=PREFIX
97 This option may be specified multiple times. Each one gives a
98 prefix that will be stripped from all C identifiers. If none
99 specified, the namespace will be used. Eg, an identifier prefix
100 of Foo will export the identifier typdef struct _FooBar FooBar;
101 as Foo.Bar.
102
103 --symbol-prefix=PREFIX
104 This option may be specified multiple times. Each one gives a
105 prefix that will be stripped from all C symbols. Eg, an symbol
106 prefix of foo will export the symbol foo_bar_do_something as
107 Foo.Bar.do_something.
108
109 --accept-unprefixed
110 If specified, the scanner will accept identifiers and symbols
111 which do not match the namespace prefix. Try to avoid using
112 this if possible.
113
114 --output=FILENAME
115 Name of the file to output. Normally namespace + format
116 extension. Eg, GLib-2.0.gir.
117
118 --pkg=PACKAGE
119 List of pkg-config packages to get compiler and linker flags
120 from. This option can be specified multiple times to include
121 flags from several pkg-config packages.
122
123 --pkg-export=PACKAGE
124 List of pkg-config packages that are provided by the generated
125 gir. This option can be specified multiple times if the gir
126 provides more packages. If not specified, the packages
127 specified with --pkg= will be used.
128
129 --verbose
130 Be verbose, include some debugging information.
131
132
133 ENVIRONMENT VARIABLES
134 The g-ir-scanner uses the XDG_DATA_DIRS variable to check for
135 dirs, the girs are located in XDG_DATA_DIRS/gir-1.0. It is
136 normally set on a distribution so you shouldn't need to set it
137 yourself.
138
139 The variable GI_SCANNER_DISABLE_CACHE ensures that the scanner
140 will not write cache data to $HOME.
141
142 The variable GI_SCANNER_DEBUG can be used to debug issues in the
143 build-system that involve g-ir-scanner. When it is set to 'save-
144 temps', then g-ir-scanner will not remove temporary files and
145 directories after it terminates.
146
147 The variable GI_HOST_OS can be used to control the OS name on
148 the host that runs the scanner. It has the same semantics as the
149 Python os.name property.
150
152 Report bugs at
153 https://gitlab.gnome.org/GNOME/gobject-introspection/issues.
154
156 http://live.gnome.org/GObjectIntrospection
157
159 Johan Dahlin
160
161
162
163
164 g-ir-scanner(1)