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