1G-IR-SCANNER(1)                                                G-IR-SCANNER(1)
2
3
4

NAME

6       g-ir-scanner - Extracting C metadata from sources and headers
7

SYNOPSIS

9       g-ir-scanner [OPTION...] FILES...
10

DESCRIPTION

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 during
14       the  normal  build  step  for a project and the information is saved to
15       disk and later installed, so that language bindings and other  applica‐
16       tions  can use it. Header files and source files are passed in as argu‐
17       ments on the command line. The suffix  determines  whether  a  file  be
18       treated  as  a source file (.c) or a header file (.h). Currently only C
19       based libraries are supported by the scanner.
20

OPTIONS

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       --strict
34              Display warnings for strict introspectable API.
35
36       --format=FORMAT
37              This parameters decides which the resulting format will be used.
38              The default value is gir.
39
40       --include=NAME
41              Add  the specified introspection dependency to the scanned name‐
42              space.  NAME is of the form NAMESPACE-VERSION, like Gtk-3.0.
43
44       --include-uninstalled=PATH
45              Add the specified introspection dependency to the scanned  name‐
46              space.   This  differs  from  --include  in that it takes a file
47              path, and does not process the  pkg-config  dependencies  (since
48              they may not be installed yet).
49
50       --add-include-path=PATH
51              Add  a  directory to the path which the scanner uses to find GIR
52              files. Can be used multiple times to specify  multiple  directo‐
53              ries
54
55       -i,--library=LIBRARY
56              Specifies  a  library that will be introspected. This means that
57              the *_get_type() functions in it will be called for GObject data
58              types.  The  name  of the library should not contain the leading
59              lib prefix nor the ending shared library suffix.
60
61       -L,--library-path=PATH
62              Include this directory when searching for a library. This option
63              can  be specified multiple times to include more than one direc‐
64              tory to look for libraries in.
65
66       -Idirectory
67              Include this directory in the list of directories to be searched
68              for header files. You need to pass to the scanner all the direc‐
69              tories you'd normally pass to the compiler when using the speci‐
70              fied source files.
71
72       --c-include=C_INCLUDES
73              Headers  which should be included in C programs. This option can
74              be specified multiple times to include more than one header.
75
76       -n,--namespace=NAME
77              The namespace name. This name  should  be  capitalized,  eg  the
78              first  letter  should be upper case. Examples: Gtk, Clutter, We‐
79              bKit.
80
81       --no-libtool
82              Disable usage of libtool for compiling  stub  introspection  bi‐
83              nary. Use this if your build system does not require libtool.
84
85       --libtool
86              Full  path  to  libtool  executable. Typically used for Automake
87              systems.
88
89       --nsversion=VERSION
90              The namespace version. For instance 1.0.  This  is  usually  the
91              platform version, eg 2.0 for Gtk+, not 2.12.7.
92
93       -p,--program=PROGRAM
94              Specifies  a  binary  that will be introspected. This means that
95              the *_get_type() functions in it will be called for GObject data
96              types.  The binary must be modified to take a --introspect-dump=
97              option, and to pass the argument to this function to  g_ireposi‐
98              tory_dump.
99
100       --program-arg=ARG
101              Additional argument to pass to program for introspection.
102
103       --identifier-prefix=PREFIX
104              This  option  may  be specified multiple times. Each one gives a
105              prefix that will be stripped from all  C  identifiers.  If  none
106              specified,  the namespace will be used. Eg, an identifier prefix
107              of Foo will export the identifier typdef struct _FooBar  FooBar;
108              as Foo.Bar.
109
110       --symbol-prefix=PREFIX
111              This  option  may  be specified multiple times. Each one gives a
112              prefix that will be stripped from all C symbols. Eg,  an  symbol
113              prefix  of  foo  will  export the symbol foo_bar_do_something as
114              Foo.Bar.do_something.
115
116       --accept-unprefixed
117              If specified, the scanner will accept  identifiers  and  symbols
118              which do not match the namespace prefix. Try to avoid using this
119              if possible.
120
121       --output=FILENAME
122              Name of the file to output. Normally namespace +  format  exten‐
123              sion. Eg, GLib-2.0.gir.
124
125       --pkg=PACKAGE
126              List  of  pkg-config  packages  to get compiler and linker flags
127              from. This option can be specified  multiple  times  to  include
128              flags from several pkg-config packages.
129
130       --pkg-export=PACKAGE
131              List  of  pkg-config packages that are provided by the generated
132              gir. This option can be specified multiple times if the gir pro‐
133              vides  more  packages.  If not specified, the packages specified
134              with --pkg= will be used.
135
136       --compiler=COMPILER
137              The C compiler to be used internally by g-ir-scanner when intro‐
138              specting  the  run  time type information, like properties, sig‐
139              nals, ancestors, and implemented interfaces. It has the same se‐
140              mantics as the CC environment variable.
141
142       --verbose
143              Be verbose, include some debugging information.
144

ENVIRONMENT VARIABLES

146       The g-ir-scanner uses the XDG_DATA_DIRS variable to check for dirs, the
147       girs are located in XDG_DATA_DIRS/gir-1.0. It is normally set on a dis‐
148       tribution so you shouldn't need to set it yourself.
149
150       The variable GI_SCANNER_DISABLE_CACHE ensures that the scanner will not
151       write cache data to $HOME.
152
153       The variable GI_SCANNER_DEBUG can  be  used  to  debug  issues  in  the
154       build-system  that  involve g-ir-scanner. When it is set to save-temps,
155       then g-ir-scanner will not remove temporary files and directories after
156       it terminates.
157
158       The  variable GI_HOST_OS can be used to control the OS name on the host
159       that runs the scanner. It has the same semantics as the Python  os.name
160       property.
161
162       The variable GI_CROSS_LAUNCHER can be used to wrap the GType introspec‐
163       tion binary generated by g-ir-scanner before executing it. It is useful
164       when generating introspection data in a cross-compilation environment.
165

BUGS

167       Report                              bugs                             at
168       https://gitlab.gnome.org/GNOME/gobject-introspection/issues
169

HOMEPAGE AND CONTACT

171       https://gi.readthedocs.io/
172

AUTHORS

174       Johan Dahlin
175
176
177
178
179                                                               G-IR-SCANNER(1)
Impressum