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