]> git.ipfire.org Git - thirdparty/bash.git/blame - INSTALL
Imported from ../bash-2.0.tar.gz.
[thirdparty/bash.git] / INSTALL
CommitLineData
ccc6cda3
JA
1Basic Installation
2==================
726f6388 3
ccc6cda3
JA
4These are generic installation instructions for Bash.
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
27this, make sure you are using Autoconf version 2.9 or newer.
28
29The simplest way to compile Bash is:
30
31 1. `cd' to the directory containing the source code and type
32 `./configure' to configure Bash for your system. If you're using
33 `csh' on an old version of System V, you might need to type `sh
34 ./configure' instead to prevent `csh' from trying to execute
35 `configure' itself.
36
37 Running `configure' takes awhile. While running, it prints some
38 messages telling which features it is checking for.
39
40 2. Type `make' to compile Bash and build the `bashbug' bug reporting
41 script.
42
43 3. Optionally, type `make tests' to run the Bash test suite.
44
45 4. Type `make install' to install `bash' and `bashbug'. This will
46 also install the manual pages and Info file.
47
48You can remove the program binaries and object files from the source
49code directory by typing `make clean'. To also remove the files that
50`configure' created (so you can compile Bash for a different kind of
51computer), type `make distclean'.
52
53Compilers and Options
54=====================
55
56Some systems require unusual options for compilation or linking that
57the `configure' script does not know about. You can give `configure'
58initial values for variables by setting them in the environment. Using
59a Bourne-compatible shell, you can do that on the command line like
60this:
61
62 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
63
64On systems that have the `env' program, you can do it like this:
65
66 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
67
68The configuration process uses GCC to build Bash if it is available.
69
70Compiling For Multiple Architectures
71====================================
72
73You can compile Bash for more than one kind of computer at the same
74time, by placing the object files for each architecture in their own
75directory. To do this, you must use a version of `make' that supports
76the `VPATH' variable, such as GNU `make'. `cd' to the directory where
77you want the object files and executables to go and run the `configure'
78script from the source directory. You may need to supply the
79`--srcdir=PATH' argument to tell `configure' where the source files
80are. `configure' automatically checks for the source code in the
81directory that `configure' is in and in `..'.
82
83If you have to use a `make' that does not supports the `VPATH'
84variable, you can compile Bash for one architecture at a time in the
85source code directory. After you have installed Bash for one
86architecture, use `make distclean' before reconfiguring for another
87architecture.
88
89Alternatively, if your system supports symbolic links, you can use the
90`support/mkclone' script to create a build tree which has symbolic
91links back to each file in the source directory. Here's an example
92that creates a build directory in the current directory from a source
93directory `/usr/gnu/src/bash-2.0':
94
95 bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
96
97The `mkclone' script requires Bash, so you must have already built Bash
98for at least one architecture before you can create build directories
99for other architectures.
100
101Installation Names
102==================
103
104By default, `make install' will install into `/usr/local/bin',
105`/usr/local/man', etc. You can specify an installation prefix other
106than `/usr/local' by giving `configure' the option `--prefix=PATH'.
107
108You can specify separate installation prefixes for
109architecture-specific files and architecture-independent files. If you
110give `configure' the option `--exec-prefix=PATH', the package will use
111`PATH' as the prefix for installing programs and libraries.
112Documentation and other data files will still use the regular prefix.
113
114Specifying the System Type
115==========================
116
117There may be some features `configure' can not figure out
118automatically, but needs to determine by the type of host the package
119will run on. Usually `configure' can figure that out, but if it prints
120a message saying it can not guess the host type, give it the
121`--host=TYPE' option. `TYPE' can either be a short name for the system
122type, such as `sun4', or a canonical name with three fields:
123`CPU-COMPANY-SYSTEM' (e.g., `sparc-sun-sunos4.1.2').
124
125See the file `support/config.sub' for the possible values of each field.
126
127Sharing Defaults
128================
129
130If you want to set default values for `configure' scripts to share, you
131can create a site shell script called `config.site' that gives default
132values for variables like `CC', `cache_file', and `prefix'. `configure'
133looks for `PREFIX/share/config.site' if it exists, then
134`PREFIX/etc/config.site' if it exists. Or, you can set the
135`CONFIG_SITE' environment variable to the location of the site script.
136A warning: the Bash `configure' looks for a site script, but not all
137`configure' scripts do.
138
139Operation Controls
140==================
141
142`configure' recognizes the following options to control how it operates.
143
144`--cache-file=FILE'
145 Use and save the results of the tests in FILE instead of
146 `./config.cache'. Set FILE to `/dev/null' to disable caching, for
147 debugging `configure'.
148
149`--help'
150 Print a summary of the options to `configure', and exit.
151
152`--quiet'
153`--silent'
154`-q'
155 Do not print messages saying which checks are being made.
156
157`--srcdir=DIR'
158 Look for the Bash source code in directory DIR. Usually
159 `configure' can determine that directory automatically.
160
161`--version'
162 Print the version of Autoconf used to generate the `configure'
163 script, and exit.
164
165`configure' also accepts some other, not widely used, boilerplate
166options.
167
168Optional Features
169=================
170
171The Bash `configure' has a number of `--enable-FEATURE' options, where
172FEATURE indicates an optional part of the package. There are also
173several `--with-PACKAGE' options, where PACKAGE is something like
174`gnu-malloc' or `purify' (for the Purify memory allocation checker). To
175turn off the default use of a package, use `--without-PACKAGE'. To
176configure Bash without a feature that is enabled by default, use
177`--disable-FEATURE'.
178
179Here is a complete list of the `--enable-' and `--with-' options that
180the Bash `configure' recognizes.
181
182`--with-gnu-malloc'
183 Use the GNU version of `malloc' in `lib/malloc/malloc.c'. This is
184 not the same `malloc' that appears in GNU libc, but an older
185 version derived from the 4.2 BSD `malloc'. This `malloc' is very
186 fast, but wastes a lot of space. This option is enabled by
187 default. The `NOTES' file contains a list of systems for which
188 this should be turned off.
189
190`--with-glibc-malloc'
191 Use the GNU libc version of `malloc' in `lib/malloc/gmalloc.c'.
192 This is somewhat slower than the default `malloc', but wastes
193 considerably less space.
194
195`--with-afs'
196 Define if you are using the Andrew File System from Transarc.
197
198`--with-purify'
199 Define this to use the Purify memory allocation checker from Pure
200 Software.
201
202`--enable-minimal-config'
203 This produces a shell with minimal features, close to the
204 historical Bourne shell.
205
206The `minimal-config' option can be used to disable all of the following
207options, but it is processed first, so individual options may be
208enabled using `enable-FEATURE'.
209
210All of the following options except for `disabled-builtins' and
211`usg-echo-default' are enabled by default, unless the operating system
212does not provide the necessary support.
213
214`--enable-job-control'
215 This enables job control features, if the OS supports them.
216
217`--enable-alias'
218 Allow alias expansion and include the `alias' and `unalias'
219 builtins.
220
221`--enable-readline'
222 Include support for command-line editing and history with the Bash
223 version of the Readline library.
224
225`--enable-history'
226 Include command history and the `fc' and `history' builtin
227 commands.
228
229`--enable-bang-history'
230 Include support for `csh'-like history substitution.
231
232`--enable-directory-stack'
233 Include support for a `csh'-like directory stack and the `pushd',
234 `popd', and `dirs' builtins.
235
236`--enable-restricted'
237 Include support for a "restricted shell". If this is enabled,
238 Bash, when called as `rbash', enters a restricted mode. See *Note
239 The Restricted Shell::, for a description of restricted mode.
240
241`--enable-process-substitution'
242 This enables process substitution (*note Process Substitution::.)
243 if the OS provides the necessary support.
244
245`--enable-prompt-string-decoding'
246 Turn on the interpretation of a number of backslash-escaped
247 characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt
248 strings.
249
250`--enable-select'
251 Include the `ksh' `select' builtin, which allows the generation of
252 simple menus.
253
254`--enable-help-builtin'
255 Include the `help' builtin, which displays help on shell builtins
256 and variables.
257
258`--enable-array-variables'
259 Include support for one-dimensional array shell variables.
260
261`--enable-dparen-arithmetic'
262 Include support for the `ksh' `((...))' command.
263
264`--enable-brace-expansion'
265 Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ).
266
267`--enable-disabled-builtins'
268 Allow builtin commands to be invoked via `builtin xxx' even after
269 `xxx' has been disabled using `enable -n xxx'. See *Note Bash
270 Builtins::, for details of the `builtin' and `enable' builtin
271 commands.
272
273`--enable-command-timing'
274 Include support for recognizing `time' as a reserved word and for
275 displaying timing statistics for the pipeline following `time'.
276 This allows pipelines as well as shell builtins and functions to
277 be timed.
278
279`--enable-usg-echo-default'
280 Make the `echo' builtin expand backslash-escaped characters by
281 default, without requiring the `-e' option. This makes the Bash
282 `echo' behave more like the System V version.
283
284The file `config.h.top' contains C Preprocessor `#define' statements
285for options which are not settable from `configure'. Some of these are
286not meant to be changed; beware of the consequences if you do. Read
287the comments associated with each definition for more information about
288its effect.