blob: 1ea51752b93cd30f8369f7d88aa4d43986aa5e50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
'\" t
.\" Title: glib-compile-resources
.\" Author: Alexander Larsson
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" Date: 08/05/2014
.\" Manual: User Commands
.\" Source: GIO
.\" Language: English
.\"
.TH "GLIB\-COMPILE\-RESOU" "1" "" "GIO" "User Commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
glib-compile-resources \- GLib resource compiler
.SH "SYNOPSIS"
.HP \w'\fBglib\-compile\-resources\fR\ 'u
\fBglib\-compile\-resources\fR [OPTION...] {FILE}
.SH "DESCRIPTION"
.PP
\fBglib\-compile\-resources\fR
reads the resource description from
\fIFILE\fR
and the files that it references and creates a binary resource bundle that is suitable for use with the
\fBGResource\fR
API\&. The resulting bundle is then written out as\-is, or as C source for linking into an application\&.
.PP
The XML resource files normally have the filename extension
\&.gresource\&.xml\&. For a detailed description of the XML file format, see the
\fBGResource\fR
documentation\&.
.SH "OPTIONS"
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print help and exit
.RE
.PP
\fB\-\-target=\fR\fB\fITARGET\fR\fR
.RS 4
Store the compiled resources in the file
\fITARGET\fR\&. If not specified a filename based on the
\fIFILE\fR
basename is used\&.
.RE
.PP
\fB\-\-sourcedir=\fR\fB\fIDIRECTORY\fR\fR
.RS 4
The files referenced in
\fIFILE\fR
are loaded from this directory\&. If not specified, the current directory is used\&.
.RE
.PP
\fB\-\-generate\fR
.RS 4
Write the output file in the format selected for by its filename extension:
.PP
\&.c
.RS 4
C source
.RE
.PP
\&.h
.RS 4
C header
.RE
.PP
\&.gresource
.RS 4
resource bundle
.RE
.sp
.RE
.PP
\fB\-\-generate\-source\fR
.RS 4
Instead of a writing the resource bundle in binary form create a C source file that contains the resource bundle\&. This can then be compiled into an application for easy access\&.
.RE
.PP
\fB\-\-generate\-header\fR
.RS 4
Generate a header file for use with C code generated by
\fB\-\-generate\-source\fR\&.
.RE
.PP
\fB\-\-generate\-dependencies\fR
.RS 4
Prints the list of files that the resource bundle references to standard output\&. This can be used to track dependencies in the build system\&. For example, the following make rule would mark
\fItest\&.gresource\fR
as depending on all the files that
\fItest\&.gresource\&.xml\fR
includes, so that is is automatically rebuilt if any of them change:
.sp
.if n \{\
.RS 4
.\}
.nf
test\&.gresource: test\&.gresource\&.xml $(shell $(GLIB_COMPILE_RESOURCES) \-\-generate\-dependencies test\&.gresource\&.xml)
.fi
.if n \{\
.RE
.\}
.sp
Note that this may or may not be portable to non\-GNU
\fBmake\fR\&.
.RE
.PP
\fB\-\-c\-name\fR
.RS 4
Specify the prefix used for the C identifiers in the code generated by
\fB\-\-generate\-source\fR
and
\fB\-\-generate\-header\fR\&.
.RE
.PP
\fB\-\-manual\-register\fR
.RS 4
By default code generated by
\fB\-\-generate\-source\fR
uses automatic initialization of the resource\&. This works on most systems by using the compiler support for constructors\&. However, some (uncommon) compilers may not support this, you can then specify
\fB\-\-manual\-register\fR, which will generate custom register and unregister functions that your code can manually call at initialization and uninitialization time\&.
.RE
.PP
\fB\-\-internal\fR
.RS 4
By default code generated by
\fB\-\-generate\-source\fR
declares all initialization functions as
\fBextern\fR\&. So they are exported unless this is prevented by a link script or other means\&. Since libraries usually want to use the functions only internally it can be more useful to declare them as
G_GNUC_INTERNAL
which is what
\fB\-\-internal\fR
does\&.
.RE
.SH "ENVIRONMENT"
.PP
\fBXMLLINT\fR
.RS 4
The full path to the xmllint executable\&. This is used to preprocess resources with the
xml\-stripblanks
preprocessing option\&. If this environment variable is not set, xmllint is searched in the
\fBPATH\fR\&.
.RE
.PP
\fBGDK_PIXBUF_PIXDATA\fR
.RS 4
The full path to the gdk\-pixbuf\-pixdata executable\&. This is used to preprocess resources with the
to\-pixdata
preprocessing option\&. If this environment variable is not set, gdk\-pixbuf\-pixdata is searched in the
\fBPATH\fR\&.
.RE
|