]> git.ipfire.org Git - thirdparty/bash.git/blob - INSTALL
Imported from ../bash-2.0.tar.gz.
[thirdparty/bash.git] / INSTALL
1 Basic Installation
2 ==================
3
4 These are generic 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 the package, please try to
20 figure out how `configure' could check whether or not to do them, and
21 mail diffs or instructions to `bash-maintainers@prep.ai.mit.edu' so
22 they can be 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.9 or newer.
28
29 The 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
48 You can remove the program binaries and object files from the source
49 code directory by typing `make clean'. To also remove the files that
50 `configure' created (so you can compile Bash for a different kind of
51 computer), type `make distclean'.
52
53 Compilers and Options
54 =====================
55
56 Some systems require unusual options for compilation or linking that
57 the `configure' script does not know about. You can give `configure'
58 initial values for variables by setting them in the environment. Using
59 a Bourne-compatible shell, you can do that on the command line like
60 this:
61
62 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
63
64 On systems that have the `env' program, you can do it like this:
65
66 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
67
68 The configuration process uses GCC to build Bash if it is available.
69
70 Compiling For Multiple Architectures
71 ====================================
72
73 You can compile Bash for more than one kind of computer at the same
74 time, by placing the object files for each architecture in their own
75 directory. To do this, you must use a version of `make' that supports
76 the `VPATH' variable, such as GNU `make'. `cd' to the directory where
77 you want the object files and executables to go and run the `configure'
78 script from the source directory. You may need to supply the
79 `--srcdir=PATH' argument to tell `configure' where the source files
80 are. `configure' automatically checks for the source code in the
81 directory that `configure' is in and in `..'.
82
83 If you have to use a `make' that does not supports the `VPATH'
84 variable, you can compile Bash for one architecture at a time in the
85 source code directory. After you have installed Bash for one
86 architecture, use `make distclean' before reconfiguring for another
87 architecture.
88
89 Alternatively, if your system supports symbolic links, you can use the
90 `support/mkclone' script to create a build tree which has symbolic
91 links back to each file in the source directory. Here's an example
92 that creates a build directory in the current directory from a source
93 directory `/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
97 The `mkclone' script requires Bash, so you must have already built Bash
98 for at least one architecture before you can create build directories
99 for other architectures.
100
101 Installation Names
102 ==================
103
104 By default, `make install' will install into `/usr/local/bin',
105 `/usr/local/man', etc. You can specify an installation prefix other
106 than `/usr/local' by giving `configure' the option `--prefix=PATH'.
107
108 You can specify separate installation prefixes for
109 architecture-specific files and architecture-independent files. If you
110 give `configure' the option `--exec-prefix=PATH', the package will use
111 `PATH' as the prefix for installing programs and libraries.
112 Documentation and other data files will still use the regular prefix.
113
114 Specifying the System Type
115 ==========================
116
117 There may be some features `configure' can not figure out
118 automatically, but needs to determine by the type of host the package
119 will run on. Usually `configure' can figure that out, but if it prints
120 a 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
122 type, such as `sun4', or a canonical name with three fields:
123 `CPU-COMPANY-SYSTEM' (e.g., `sparc-sun-sunos4.1.2').
124
125 See the file `support/config.sub' for the possible values of each field.
126
127 Sharing Defaults
128 ================
129
130 If you want to set default values for `configure' scripts to share, you
131 can create a site shell script called `config.site' that gives default
132 values for variables like `CC', `cache_file', and `prefix'. `configure'
133 looks 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.
136 A warning: the Bash `configure' looks for a site script, but not all
137 `configure' scripts do.
138
139 Operation 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
166 options.
167
168 Optional Features
169 =================
170
171 The Bash `configure' has a number of `--enable-FEATURE' options, where
172 FEATURE indicates an optional part of the package. There are also
173 several `--with-PACKAGE' options, where PACKAGE is something like
174 `gnu-malloc' or `purify' (for the Purify memory allocation checker). To
175 turn off the default use of a package, use `--without-PACKAGE'. To
176 configure Bash without a feature that is enabled by default, use
177 `--disable-FEATURE'.
178
179 Here is a complete list of the `--enable-' and `--with-' options that
180 the 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
206 The `minimal-config' option can be used to disable all of the following
207 options, but it is processed first, so individual options may be
208 enabled using `enable-FEATURE'.
209
210 All of the following options except for `disabled-builtins' and
211 `usg-echo-default' are enabled by default, unless the operating system
212 does 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
284 The file `config.h.top' contains C Preprocessor `#define' statements
285 for options which are not settable from `configure'. Some of these are
286 not meant to be changed; beware of the consequences if you do. Read
287 the comments associated with each definition for more information about
288 its effect.