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