]> git.proxmox.com Git - grub2.git/blame - INSTALL
Mark miscompile error for translation.
[grub2.git] / INSTALL
CommitLineData
6a161fa9 1-*- Text -*-
2
4b13b216 3This is the GRUB. Welcome.
6a161fa9 4
4b13b216 5This file contains instructions for compiling and installing the GRUB.
6a161fa9 6
7The Requirements
8================
9
4b13b216 10GRUB depends on some software packages installed into your system. If
6a161fa9 11you don't have any of them, please obtain and install them before
4b13b216 12configuring the GRUB.
6a161fa9 13
e30d87ad 14* GCC 4.1.3 or later
9fdc64a9
VS
15 Note: older versions may work but support is limited
16 Note: clang 3.2 or later works for i386 and x86_64 targets but results in
17 much bigger binaries.
14a94bba 18 earlier versions not tested
2312f06c 19 Note: clang 3.2 or later works for arm
14a94bba 20 earlier versions not tested
ebd28933
VS
21 Note: clang 3.3 or later works for arm64
22 earlier versions have no arm64 support
8109c5d4 23 Note: clang 3.3 or later works for mips(el)
14a94bba
VS
24 earlier versions fail to generate .reginfo and hence gprel relocations
25 fail.
b73b70eb
VS
26 Note: clang 3.2 or later works for powerpc
27 earlier versions not tested
7b04fe6c
VS
28 Note: clang has no support for generating 64-bit sparc code and hence you
29 can't compile GRUB for sparc64 with clang
30 Note: clang has no support for ia64 and hence you can't compile GRUB
31 for ia64 with clang
6a161fa9 32* GNU Make
160034b2 33* GNU Bison 2.3 or later
fc8345da 34* GNU gettext 0.17 or later
6a161fa9 35* GNU binutils 2.9.1.0.23 or later
7d8c0213 36* Flex 2.5.35 or later
6a161fa9 37* Other standard GNU/Unix tools
86e5b1db 38
795b593a
CW
39On GNU/Linux, you also need:
40
efa1bee7 41* libdevmapper 1.02.34 or later (recommended)
795b593a 42
db99fbe8 43For optional grub-emu features, you need:
795b593a 44
795b593a 45* SDL (recommended)
db99fbe8
VS
46* libpciaccess (optional)
47* libusb (optional)
795b593a
CW
48
49To build GRUB's graphical terminal (gfxterm), you need:
50
51* FreeType 2 or later
52* GNU Unifont
53
86e5b1db 54If you use a development snapshot or want to hack on GRUB you may
55need the following.
56
aa437b58 57* Python 2.6 or later
f022876b 58* Autoconf 2.60 or later
37fb845b 59* Automake 1.10.1 or later
6a161fa9 60
fc8345da
JU
61Prerequisites for make-check:
62
63* qemu, specifically the binary 'qemu-system-i386'
8ca86b3a 64* xorriso 1.2.9 or later, for grub-mkrescue and grub-shell
fc8345da 65
4b13b216 66Configuring the GRUB
6a161fa9 67====================
68
69The `configure' shell script attempts to guess correct values for
70various system-dependent variables used during compilation. It uses
71those values to create a `Makefile' in each directory of the package.
72It may also create one or more `.h' files containing system-dependent
73definitions. Finally, it creates a shell script `config.status' that
74you can run in the future to recreate the current configuration, a
75file `config.cache' that saves the results of its tests to speed up
76reconfiguring, and a file `config.log' containing compiler output
77(useful mainly for debugging `configure').
78
79If you need to do unusual things to compile the package, please try to
80figure out how `configure' could check whether to do them, and mail
81diffs or instructions to the address given in the `README' so they can
82be considered for the next release. If at some point `config.cache'
83contains results you don't want to keep, you may remove or edit it.
84
85The file `configure.ac' is used to create `configure' by a program
86called `autoconf'. You only need `configure.in' if you want to change
87it or regenerate `configure' using a newer version of `autoconf'.
88
89
4b13b216 90Building the GRUB
6a161fa9 91=================
92
93The simplest way to compile this package is:
94
9f73ebd4
VS
95 1. `cd' to the directory containing the package's source code.
96
97 2. Skip this and following step if you use release tarball and proceed to
98 step 4. If you want translations type `./linguas.sh'.
99
100 3. Type `./autogen.sh'.
101
102 4. Type `./configure' to configure the package for your system.
86e5b1db 103 If you're using `csh' on an old version of System V, you might
104 need to type `sh ./configure' instead to prevent `csh' from trying
105 to execute `configure' itself.
6a161fa9 106
107 Running `configure' takes awhile. While running, it prints some
108 messages telling which features it is checking for.
109
9f73ebd4 110 6. Type `make' to compile the package.
6a161fa9 111
9f73ebd4 112 7. Optionally, type `make check' to run any self-tests that come with
6a161fa9 113 the package.
114
9f73ebd4 115 8. Type `make install' to install the programs and any data files and
6a161fa9 116 documentation.
117
9f73ebd4 118 9. You can remove the program binaries and object files from the
6a161fa9 119 source code directory by typing `make clean'. To also remove the
120 files that `configure' created (so you can compile the package for
121 a different kind of computer), type `make distclean'. There is
122 also a `make maintainer-clean' target, but that is intended mainly
123 for the package's developers. If you use it, you may have to get
124 all sorts of other programs in order to regenerate files that came
125 with the distribution.
126
fc97214f
VS
127Cross-compiling the GRUB
128========================
129
130GRUB defines 3 platforms:
131
132 - "Build" is the one which build systems runs on.
133 - "Host" is where you execute GRUB utils.
134 - "Target" is where GRUB itself runs.
135
136For grub-emu host and target must be the same but may differ from build.
137
138If build and host are different make check isn't available.
139
7f68269a
VS
140If build and host are different man pages are not generated.
141
fc97214f
VS
142As an example imagine you have a build system running on FreeBSD on sparc
143which prepares packages for developpers running amd64 GNU/Linux laptop and
144they need to make images for ARM board running U-boot. In this case:
145
146build=sparc64-freebsd
147host=amd64-linux-gnu
148target=arm-uboot
149
150For this example the configure line might look like (more details below)
151(some options are optional and included here for completeness but some rarely
152used options are omited):
153
154./configure BUILD_CC=gcc BUILD_FREETYPE=freetype-config --host=amd64-linux-gnu
155CC=amd64-linux-gnu-gcc CFLAGS="-g -O2" FREETYPE=amd64-linux-gnu-freetype-config
156--target=arm --with-platform=uboot TARGET_CC=arm-elf-gcc
157TARGET_CFLAGS="-Os -march=armv6" TARGET_CCASFLAGS="-march=armv6"
158TARGET_OBJCOPY="arm-elf-objcopy" TARGET_STRIP="arm-elf-strip"
0e8daad0 159TARGET_NM=arm-elf-nm TARGET_RANLIB=arm-elf-ranlib LEX=gflex
fc97214f
VS
160
161You need to use following options to specify tools and platforms. For minimum
162version look at prerequisites. All tools not mentioned in this section under
163corresponding platform are not needed for the platform in question.
164
165 - For build
166 1. BUILD_CC= to gcc able to compile for build. This is used, for
167 example, to compile build-gentrigtables which is then run to
168 generate sin and cos tables.
169 2. BUILD_CFLAGS= for C options for build.
170 3. BUILD_CPPFLAGS= for C preprocessor options for build.
171 4. BUILD_FREETYPE= for freetype-config for build (optional).
172
173 - For host
174 1. --host= to autoconf name of host.
175 2. CC= for gcc able to compile for host
176 3. CFLAGS= for C options for host.
177 4. CPPFLAGS= for C preprocessor options for host.
178 5. LDFLAGS= for linker options for host.
179 6. FREETYPE= for freetype-config for host (optional).
180 7. Libdevmapper if any must be in standard linker folders (-ldevmapper) (optional).
181 8. Libfuse if any must be in standard linker folders (-lfuse) (optional).
182 9. Libzfs if any must be in standard linker folders (-lzfs) (optional).
183 10. Liblzma if any must be in standard linker folders (-llzma) (optional).
184
185 - For target
186 1. --target= to autoconf cpu name of target.
187 2. --with-platform to choose firmware.
188 3. TARGET_CC= for gcc able to compile for target
189 4. TARGET_CFLAGS= for C options for target.
190 5. TARGET_CPPFLAGS= for C preprocessor options for target.
191 6. TARGET_CCASFLAGS= for assembler options for target.
192 7. TARGET_LDFLAGS= for linker options for target.
193 8. TARGET_OBJCOPY= for objcopy for target.
194 9. TARGET_STRIP= for strip for target.
195 10. TARGET_NM= for nm for target.
0e8daad0 196 11. TARGET_RANLIB= for ranlib for target.
fc97214f
VS
197
198 - Additionally for emu, for host and target.
199 1. SDL is looked for in stadard linker directories (-lSDL) (optional)
200 2. libpciaccess is looked for in stadard linker directories (-lpciaccess) (optional)
201 3. libusb is looked for in stadard linker directories (-lusb) (optional)
202
203 - Platform-agnostic tools and data.
204 1. make is the tool you execute after ./configure.
205 2. Bison is specified in YACC= variable
206 3. Flex is specified in LEX= variable
207 4. GNU unifont and Djvu sans are looked for in standard directories.
6a161fa9 208
209Compiling For Multiple Architectures
210====================================
211
212You can compile the package for more than one kind of computer at the
213same time, by placing the object files for each architecture in their
214own directory. `cd' to the directory where you want the object files
215and executables to go and run the `configure' script. `configure'
216automatically checks for the source code in the directory that
217`configure' is in and in `..'.
218
219
220Installation Names
221==================
222
223By default, `make install' will install the package's files in
224`/usr/local/bin', `/usr/local/man', etc. You can specify an
225installation prefix by giving `configure' the option `--prefix=PATH'.
226
227You can specify separate installation prefixes for
228architecture-specific files and architecture-independent files. If
229you give `configure' the option `--exec-prefix=PATH', the package will
230use PATH as the prefix for installing programs and libraries.
231Documentation and other data files will still use the regular prefix.
232
233In addition, if you use an unusual directory layout you can give
234options like `--bindir=PATH' to specify different values for
235particular kinds of files. Run `configure --help' for a list of the
236directories you can set and what kinds of files go in them.
237
238If the package supports it, you can cause programs to be installed
239with an extra prefix or suffix on their names by giving `configure'
240the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
241
4b13b216 242Please note, however, that the GRUB knows where it is located in the
6a161fa9 243filesystem. If you have installed it in an unusual location, the
244system might not work properly, or at all. The chief utility of these
4b13b216 245options for the GRUB is to allow you to "install" in some alternate
6a161fa9 246location, and then copy these to the actual root filesystem later.
247
248
249Sharing Defaults
250================
251
252If you want to set default values for `configure' scripts to share,
253you can create a site shell script called `config.site' that gives
254default values for variables like `CC', `cache_file', and `prefix'.
255`configure' looks for `PREFIX/share/config.site' if it exists, then
256`PREFIX/etc/config.site' if it exists. Or, you can set the
257`CONFIG_SITE' environment variable to the location of the site script.
258A warning: not all `configure' scripts look for a site script.
259
260
261Operation Controls
262==================
263
264 `configure' recognizes the following options to control how it
265operates.
266
267`--cache-file=FILE'
268 Use and save the results of the tests in FILE instead of
269 `./config.cache'. Set FILE to `/dev/null' to disable caching, for
270 debugging `configure'.
271
272`--help'
273 Print a summary of the options to `configure', and exit.
274
275`--quiet'
276`--silent'
277`-q'
278 Do not print messages saying which checks are being made.
279
280`--srcdir=DIR'
281 Look for the package's source code in directory DIR. Usually
282 `configure' can determine that directory automatically.
283
284`--version'
285 Print the version of Autoconf used to generate the `configure'
286 script, and exit.