]> git.ipfire.org Git - thirdparty/bash.git/blame - INSTALL
Imported from ../bash-2.01.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
32the Bash distribution, for example `2.01'. `_patchlevel' should
33contain the patch level of the Bash distribution, `0' for example. The
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'.
200 This is somewhat slower than the default `malloc', but wastes
201 considerably less space.
202
d166f048
JA
203`--with-gnu-malloc'
204 Use the GNU version of `malloc' in `lib/malloc/malloc.c'. This is
205 not the same `malloc' that appears in GNU libc, but an older
206 version derived from the 4.2 BSD `malloc'. This `malloc' is very
207 fast, but wastes a lot of space. This option is enabled by
208 default. The `NOTES' file contains a list of systems for which
209 this should be turned off, and `configure' disables this option
210 automatically for a number of systems.
ccc6cda3
JA
211
212`--with-purify'
213 Define this to use the Purify memory allocation checker from Pure
214 Software.
215
216`--enable-minimal-config'
217 This produces a shell with minimal features, close to the
218 historical Bourne shell.
219
220The `minimal-config' option can be used to disable all of the following
221options, but it is processed first, so individual options may be
222enabled using `enable-FEATURE'.
223
224All of the following options except for `disabled-builtins' and
225`usg-echo-default' are enabled by default, unless the operating system
226does not provide the necessary support.
227
ccc6cda3
JA
228`--enable-alias'
229 Allow alias expansion and include the `alias' and `unalias'
230 builtins.
231
d166f048
JA
232`--enable-array-variables'
233 Include support for one-dimensional array shell variables.
ccc6cda3
JA
234
235`--enable-bang-history'
236 Include support for `csh'-like history substitution.
237
d166f048
JA
238`--enable-brace-expansion'
239 Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ).
240
241`--enable-command-timing'
242 Include support for recognizing `time' as a reserved word and for
243 displaying timing statistics for the pipeline following `time'.
244 This allows pipelines as well as shell builtins and functions to
245 be timed.
246
ccc6cda3
JA
247`--enable-directory-stack'
248 Include support for a `csh'-like directory stack and the `pushd',
249 `popd', and `dirs' builtins.
250
d166f048
JA
251`--enable-disabled-builtins'
252 Allow builtin commands to be invoked via `builtin xxx' even after
253 `xxx' has been disabled using `enable -n xxx'. See *Note Bash
254 Builtins::, for details of the `builtin' and `enable' builtin
255 commands.
256
257`--enable-dparen-arithmetic'
258 Include support for the `ksh' `((...))' command.
259
260`--enable-help-builtin'
261 Include the `help' builtin, which displays help on shell builtins
262 and variables.
263
264`--enable-history'
265 Include command history and the `fc' and `history' builtin
266 commands.
267
268`--enable-job-control'
269 This enables job control features, if the OS supports them.
ccc6cda3
JA
270
271`--enable-process-substitution'
272 This enables process substitution (*note Process Substitution::.)
273 if the OS provides the necessary support.
274
275`--enable-prompt-string-decoding'
276 Turn on the interpretation of a number of backslash-escaped
277 characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt
278 strings.
279
d166f048
JA
280`--enable-readline'
281 Include support for command-line editing and history with the Bash
282 version of the Readline library.
283
284`--enable-restricted'
285 Include support for a "restricted shell". If this is enabled,
286 Bash, when called as `rbash', enters a restricted mode. See *Note
287 The Restricted Shell::, for a description of restricted mode.
288
ccc6cda3
JA
289`--enable-select'
290 Include the `ksh' `select' builtin, which allows the generation of
291 simple menus.
292
ccc6cda3
JA
293`--enable-usg-echo-default'
294 Make the `echo' builtin expand backslash-escaped characters by
295 default, without requiring the `-e' option. This makes the Bash
296 `echo' behave more like the System V version.
297
298The file `config.h.top' contains C Preprocessor `#define' statements
299for options which are not settable from `configure'. Some of these are
300not meant to be changed; beware of the consequences if you do. Read
301the comments associated with each definition for more information about
302its effect.