Tizen 2.1 base
[platform/upstream/glib2.0.git] / docs / reference / gio / html / glib-compile-resources.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>glib-compile-resources</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="tools.html" title="GIO Tools">
9 <link rel="prev" href="glib-compile-schemas.html" title="glib-compile-schemas">
10 <link rel="next" href="gdbus.html" title="gdbus">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
16 <td><a accesskey="p" href="glib-compile-schemas.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
17 <td><a accesskey="u" href="tools.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
18 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
19 <th width="100%" align="center">GIO Reference Manual</th>
20 <td><a accesskey="n" href="gdbus.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
21 </tr></table>
22 <div lang="en" class="refentry">
23 <a name="glib-compile-resources"></a><div class="titlepage"></div>
24 <div class="refnamediv"><table width="100%"><tr>
25 <td valign="top">
26 <h2><span class="refentrytitle">glib-compile-resources</span></h2>
27 <p>glib-compile-resources — GLib resource compiler</p>
28 </td>
29 <td valign="top" align="right"></td>
30 </tr></table></div>
31 <div class="refsynopsisdiv">
32 <h2>Synopsis</h2>
33 <div class="cmdsynopsis"><p><code class="command">glib-compile-resources</code>  [option...] {file}</p></div>
34 </div>
35 <div class="refsect1">
36 <a name="id535605"></a><h2>Description</h2>
37 <p><span class="command"><strong>glib-compile-resources</strong></span> reads the resource description from
38 <em class="replaceable"><code>file</code></em> and the files that it references
39 and creates a binary resource bundle that is suitable for use with the
40 <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> API.
41 The resulting bundle is then written out as-is, or as C source for linking into
42 an application.
43 </p>
44 <p>
45 The XML resource files normally have the filename extension <code class="filename">.gresource.xml</code>.
46 For a detailed description of the XML file format, see the
47 <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> documentation.
48 </p>
49 <div class="refsect2">
50 <a name="id576825"></a><h3>Options</h3>
51 <div class="variablelist"><table border="0">
52 <col align="left" valign="top">
53 <tbody>
54 <tr>
55 <td><p><span class="term"><code class="option">-h</code>, <code class="option">--help</code></span></p></td>
56 <td><p>
57 Print help and exit
58 </p></td>
59 </tr>
60 <tr>
61 <td><p><span class="term"><code class="option">--target=<em class="replaceable"><code>TARGETFILE</code></em></code></span></p></td>
62 <td><p>
63 Store the compiled resources in <em class="replaceable"><code>TARGETFILE</code></em>. If not specified a filename based
64 on the <em class="replaceable"><code>file</code></em> basename is used.
65 </p></td>
66 </tr>
67 <tr>
68 <td><p><span class="term"><code class="option">--sourcedir</code></span></p></td>
69 <td><p>
70 The files references in <em class="replaceable"><code>file</code></em> are loaded from this directory. If
71 not specified the current directory is used.
72 </p></td>
73 </tr>
74 <tr>
75 <td><p><span class="term"><code class="option">--generate</code></span></p></td>
76 <td>
77 <p>
78 Write the output file in the format selected for by its filename extension:
79 </p>
80 <div class="variablelist"><table border="0">
81 <col align="left" valign="top">
82 <tbody>
83 <tr>
84 <td><p><span class="term"><code class="literal">.c</code></span></p></td>
85 <td><p>C source</p></td>
86 </tr>
87 <tr>
88 <td><p><span class="term"><code class="literal">.h</code></span></p></td>
89 <td><p>C header</p></td>
90 </tr>
91 <tr>
92 <td><p><span class="term"><code class="literal">.gresource</code></span></p></td>
93 <td><p>resource bundle</p></td>
94 </tr>
95 </tbody>
96 </table></div>
97 <p>
98 </p>
99 </td>
100 </tr>
101 <tr>
102 <td><p><span class="term"><code class="option">--generate-source</code></span></p></td>
103 <td><p>
104 Instead of a writing the resource bundle in binary form create a C source file that contains the
105 resource bundle. This can then be compiled into an application for easy access.
106 </p></td>
107 </tr>
108 <tr>
109 <td><p><span class="term"><code class="option">--generate-header</code></span></p></td>
110 <td><p>
111 Generate a header file for use with C code generated by <code class="option">--generate-source</code>.
112 </p></td>
113 </tr>
114 <tr>
115 <td><p><span class="term"><code class="option">--generate-dependencies</code></span></p></td>
116 <td>
117 <p>
118 Prints the list of files that the resource bundle references to standard output.
119 This can be used to track dependencies in the build system. For example, the following
120 make rule would mark <em class="replaceable"><code>test.gresource</code></em> as depending on all the
121 files that <em class="replaceable"><code>test.gresource.xml</code></em> includes, so that is is automatically
122 rebuilt if any of them change:
123 </p>
124 <pre class="programlisting">
125 test.gresource: test.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies test.gresource.xml)
126 </pre>
127 <p>
128 Note that this may or may not be portable to non-GNU <span class="command"><strong>make</strong></span>.
129 </p>
130 </td>
131 </tr>
132 <tr>
133 <td><p><span class="term"><code class="option">--c-name</code></span></p></td>
134 <td><p>
135 Specify the prefix used for the C identifiers in the code generated by
136 <code class="option">--generate-source</code> and <code class="option">--generate-headers</code>.
137 </p></td>
138 </tr>
139 <tr>
140 <td><p><span class="term"><code class="option">--manual-register</code></span></p></td>
141 <td><p>
142 By default code generated by <code class="option">--generate-source</code> uses automatic initialization
143 of the resource. This works on most systems by using the compiler support for constructors.
144 However, some (uncommon) compilers may not support this, you can then specify <code class="option">--manual-register</code>,
145 which will generate custom register and unregister functions that your code can manually call
146 at initialization and uninitialization time.
147 </p></td>
148 </tr>
149 </tbody>
150 </table></div>
151 </div>
152 <hr>
153 <div class="refsect2">
154 <a name="id736756"></a><h3>Environment Variables</h3>
155 <div class="variablelist"><table border="0">
156 <col align="left" valign="top">
157 <tbody>
158 <tr>
159 <td><p><span class="term"><code class="envar">XMLLINT</code></span></p></td>
160 <td><p>
161 The full path to the xmllint executable. This is used to preprocess resources with the
162 <code class="literal">xml-stripblanks</code> preprocessing option. If this environment variable is not
163 set, xmllint is searched in the <code class="envar">PATH</code>.
164 </p></td>
165 </tr>
166 <tr>
167 <td><p><span class="term"><code class="envar">GDK_PIXBUF_PIXDATA</code></span></p></td>
168 <td><p>
169 The full path to the gdk-pixbuf-pixdata executable. This is used to preprocess resources with the
170 <code class="literal">to-pixdata</code> preprocessing option. If this environment variable is not
171 set, gdk-pixbuf-pixdata is searched in the <code class="envar">PATH</code>.
172 </p></td>
173 </tr>
174 </tbody>
175 </table></div>
176 </div>
177 </div>
178 <div class="refsect1">
179 <a name="id681101"></a><h2>See also</h2>
180 </div>
181 </div>
182 <div class="footer">
183 <hr>
184           Generated by GTK-Doc V1.18</div>
185 </body>
186 </html>