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