]> git.ipfire.org Git - thirdparty/bash.git/blob - INSTALL
Imported from ../bash-2.03.tar.gz.
[thirdparty/bash.git] / INSTALL
1 Basic Installation
2 ==================
3
4 These are installation instructions for Bash.
5
6 The `configure' shell script attempts to guess correct values for
7 various system-dependent variables used during compilation. It uses
8 those values to create a `Makefile' in each directory of the package
9 (the top directory, the `builtins' and `doc' directories, and the each
10 directory under `lib'). It also creates a `config.h' file containing
11 system-dependent definitions. Finally, it creates a shell script named
12 `config.status' that you can run in the future to recreate the current
13 configuration, a file `config.cache' that saves the results of its
14 tests to speed up reconfiguring, and a file `config.log' containing
15 compiler output (useful mainly for debugging `configure'). If at some
16 point `config.cache' contains results you don't want to keep, you may
17 remove or edit it.
18
19 If you need to do unusual things to compile Bash, please try to figure
20 out how `configure' could check whether or not to do them, and mail
21 diffs or instructions to <bash-maintainers@gnu.org> so they can be
22 considered for the next release.
23
24 The file `configure.in' is used to create `configure' by a program
25 called Autoconf. You only need `configure.in' if you want to change it
26 or regenerate `configure' using a newer version of Autoconf. If you do
27 this, make sure you are using Autoconf version 2.10 or newer.
28
29 If you need to change `configure.in' or regenerate `configure', you
30 will need to create two files: `_distribution' and `_patchlevel'.
31 `_distribution' should contain the major and minor version numbers of
32 the Bash distribution, for example `2.01'. `_patchlevel' should
33 contain the patch level of the Bash distribution, `0' for example. The
34 script `support/mkconffiles' has been provided to automate the creation
35 of these files.
36
37 The simplest way to compile Bash is:
38
39 1. `cd' to the directory containing the source code and type
40 `./configure' to configure Bash for your system. If you're using
41 `csh' on an old version of System V, you might need to type `sh
42 ./configure' instead to prevent `csh' from trying to execute
43 `configure' itself.
44
45 Running `configure' takes awhile. While running, it prints some
46 messages telling which features it is checking for.
47
48 2. Type `make' to compile Bash and build the `bashbug' bug reporting
49 script.
50
51 3. Optionally, type `make tests' to run the Bash test suite.
52
53 4. Type `make install' to install `bash' and `bashbug'. This will
54 also install the manual pages and Info file.
55
56 You can remove the program binaries and object files from the source
57 code directory by typing `make clean'. To also remove the files that
58 `configure' created (so you can compile Bash for a different kind of
59 computer), type `make distclean'.
60
61 Compilers and Options
62 =====================
63
64 Some systems require unusual options for compilation or linking that
65 the `configure' script does not know about. You can give `configure'
66 initial values for variables by setting them in the environment. Using
67 a Bourne-compatible shell, you can do that on the command line like
68 this:
69
70 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
71
72 On systems that have the `env' program, you can do it like this:
73
74 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
75
76 The configuration process uses GCC to build Bash if it is available.
77
78 Compiling For Multiple Architectures
79 ====================================
80
81 You can compile Bash for more than one kind of computer at the same
82 time, by placing the object files for each architecture in their own
83 directory. To do this, you must use a version of `make' that supports
84 the `VPATH' variable, such as GNU `make'. `cd' to the directory where
85 you want the object files and executables to go and run the `configure'
86 script from the source directory. You may need to supply the
87 `--srcdir=PATH' argument to tell `configure' where the source files
88 are. `configure' automatically checks for the source code in the
89 directory that `configure' is in and in `..'.
90
91 If you have to use a `make' that does not supports the `VPATH'
92 variable, you can compile Bash for one architecture at a time in the
93 source code directory. After you have installed Bash for one
94 architecture, use `make distclean' before reconfiguring for another
95 architecture.
96
97 Alternatively, if your system supports symbolic links, you can use the
98 `support/mkclone' script to create a build tree which has symbolic
99 links back to each file in the source directory. Here's an example
100 that creates a build directory in the current directory from a source
101 directory `/usr/gnu/src/bash-2.0':
102
103 bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
104
105 The `mkclone' script requires Bash, so you must have already built Bash
106 for at least one architecture before you can create build directories
107 for other architectures.
108
109 Installation Names
110 ==================
111
112 By default, `make install' will install into `/usr/local/bin',
113 `/usr/local/man', etc. You can specify an installation prefix other
114 than `/usr/local' by giving `configure' the option `--prefix=PATH'.
115
116 You can specify separate installation prefixes for
117 architecture-specific files and architecture-independent files. If you
118 give `configure' the option `--exec-prefix=PATH', `make install' will
119 use `PATH' as the prefix for installing programs and libraries.
120 Documentation and other data files will still use the regular prefix.
121
122 Specifying the System Type
123 ==========================
124
125 There may be some features `configure' can not figure out
126 automatically, but needs to determine by the type of host Bash will run
127 on. Usually `configure' can figure that out, but if it prints a
128 message saying it can not guess the host type, give it the
129 `--host=TYPE' option. `TYPE' can either be a short name for the system
130 type, such as `sun4', or a canonical name with three fields:
131 `CPU-COMPANY-SYSTEM' (e.g., `sparc-sun-sunos4.1.2').
132
133 See the file `support/config.sub' for the possible values of each field.
134
135 Sharing Defaults
136 ================
137
138 If you want to set default values for `configure' scripts to share, you
139 can create a site shell script called `config.site' that gives default
140 values for variables like `CC', `cache_file', and `prefix'. `configure'
141 looks for `PREFIX/share/config.site' if it exists, then
142 `PREFIX/etc/config.site' if it exists. Or, you can set the
143 `CONFIG_SITE' environment variable to the location of the site script.
144 A warning: the Bash `configure' looks for a site script, but not all
145 `configure' scripts do.
146
147 Operation Controls
148 ==================
149
150 `configure' recognizes the following options to control how it operates.
151
152 `--cache-file=FILE'
153 Use and save the results of the tests in FILE instead of
154 `./config.cache'. Set FILE to `/dev/null' to disable caching, for
155 debugging `configure'.
156
157 `--help'
158 Print a summary of the options to `configure', and exit.
159
160 `--quiet'
161 `--silent'
162 `-q'
163 Do not print messages saying which checks are being made.
164
165 `--srcdir=DIR'
166 Look for the Bash source code in directory DIR. Usually
167 `configure' can determine that directory automatically.
168
169 `--version'
170 Print the version of Autoconf used to generate the `configure'
171 script, and exit.
172
173 `configure' also accepts some other, not widely used, boilerplate
174 options.
175
176 Optional Features
177 =================
178
179 The Bash `configure' has a number of `--enable-FEATURE' options, where
180 FEATURE indicates an optional part of Bash. There are also several
181 `--with-PACKAGE' options, where PACKAGE is something like `gnu-malloc'
182 or `purify'. To turn off the default use of a package, use
183 `--without-PACKAGE'. To configure Bash without a feature that is
184 enabled by default, use `--disable-FEATURE'.
185
186 Here is a complete list of the `--enable-' and `--with-' options that
187 the Bash `configure' recognizes.
188
189 `--with-afs'
190 Define if you are using the Andrew File System from Transarc.
191
192 `--with-curses'
193 Use the curses library instead of the termcap library. This should
194 be supplied if your system has an inadequate or incomplete termcap
195 database.
196
197 `--with-glibc-malloc'
198 Use the GNU libc version of `malloc' in `lib/malloc/gmalloc.c'.
199 This is not the version of `malloc' that appears in glibc version
200 2, but a modified version of the `malloc' from glibc version 1.
201 This is somewhat slower than the default `malloc', but wastes less
202 space on a per-allocation basis, and will return memory to the
203 operating system under some circumstances.
204
205 `--with-gnu-malloc'
206 Use the GNU version of `malloc' in `lib/malloc/malloc.c'. This is
207 not the same `malloc' that appears in GNU libc, but an older
208 version derived from the 4.2 BSD `malloc'. This `malloc' is very
209 fast, but wastes some space on each allocation. This option is
210 enabled by default. The `NOTES' file contains a list of systems
211 for which this should be turned off, and `configure' disables this
212 option automatically for a number of systems.
213
214 `--with-installed-readline'
215 Define this to make bash link with a locally-installed version of
216 Readline rather than the version in lib/readline. This works only
217 with readline 4.0 and later versions.
218
219 `--with-purify'
220 Define this to use the Purify memory allocation checker from Pure
221 Software.
222
223 `--enable-minimal-config'
224 This produces a shell with minimal features, close to the
225 historical Bourne shell.
226
227 There are several `--enable-' options that alter how Bash is compiled
228 and linked, rather than changing run-time features.
229
230 `--enable-profiling'
231 This builds a Bash binary that produces profiling information to be
232 processed by `gprof' each time it is executed.
233
234 `--enable-static-link'
235 This causes Bash to be linked statically, if `gcc' is being used.
236 This could be used to build a version to use as root's shell.
237
238 The `minimal-config' option can be used to disable all of the following
239 options, but it is processed first, so individual options may be
240 enabled using `enable-FEATURE'.
241
242 All of the following options except for `disabled-builtins' and
243 `usg-echo-default' are enabled by default, unless the operating system
244 does not provide the necessary support.
245
246 `--enable-alias'
247 Allow alias expansion and include the `alias' and `unalias'
248 builtins (*note Aliases::.).
249
250 `--enable-array-variables'
251 Include support for one-dimensional array shell variables (*note
252 Arrays::.).
253
254 `--enable-bang-history'
255 Include support for `csh'-like history substitution (*note History
256 Interaction::.).
257
258 `--enable-brace-expansion'
259 Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ).
260 See *Note Brace Expansion::, for a complete description.
261
262 `--enable-command-timing'
263 Include support for recognizing `time' as a reserved word and for
264 displaying timing statistics for the pipeline following `time'.
265 This allows pipelines as well as shell builtins and functions to
266 be timed.
267
268 `--enable-cond-command'
269 Include support for the `[[' conditional command (*note
270 Conditional Constructs::.).
271
272 `--enable-directory-stack'
273 Include support for a `csh'-like directory stack and the `pushd',
274 `popd', and `dirs' builtins (*note The Directory Stack::.).
275
276 `--enable-disabled-builtins'
277 Allow builtin commands to be invoked via `builtin xxx' even after
278 `xxx' has been disabled using `enable -n xxx'. See *Note Bash
279 Builtins::, for details of the `builtin' and `enable' builtin
280 commands.
281
282 `--enable-dparen-arithmetic'
283 Include support for the `((...))' command (*note Conditional
284 Constructs::.).
285
286 `--enable-extended-glob'
287 Include support for the extended pattern matching features
288 described above under *Note Pattern Matching::.
289
290 `--enable-help-builtin'
291 Include the `help' builtin, which displays help on shell builtins
292 and variables.
293
294 `--enable-history'
295 Include command history and the `fc' and `history' builtin
296 commands.
297
298 `--enable-job-control'
299 This enables the job control features (*note Job Control::.), if
300 the operating system supports them.
301
302 `--enable-process-substitution'
303 This enables process substitution (*note Process Substitution::.)
304 if the operating system provides the necessary support.
305
306 `--enable-prompt-string-decoding'
307 Turn on the interpretation of a number of backslash-escaped
308 characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt
309 strings. See *Note Printing a Prompt::, for a complete list of
310 prompt string escape sequences.
311
312 `--enable-readline'
313 Include support for command-line editing and history with the Bash
314 version of the Readline library (*note Command Line Editing::.).
315
316 `--enable-restricted'
317 Include support for a "restricted shell". If this is enabled,
318 Bash, when called as `rbash', enters a restricted mode. See *Note
319 The Restricted Shell::, for a description of restricted mode.
320
321 `--enable-select'
322 Include the `select' builtin, which allows the generation of simple
323 menus (*note Conditional Constructs::.).
324
325 `--enable-usg-echo-default'
326 Make the `echo' builtin expand backslash-escaped characters by
327 default, without requiring the `-e' option. This makes the Bash
328 `echo' behave more like the System V version.
329
330 The file `config.h.top' contains C Preprocessor `#define' statements
331 for options which are not settable from `configure'. Some of these are
332 not meant to be changed; beware of the consequences if you do. Read
333 the comments associated with each definition for more information about
334 its effect.