]> git.ipfire.org Git - thirdparty/bash.git/blame - INSTALL
Bash-4.1 patchlevel 11
[thirdparty/bash.git] / INSTALL
CommitLineData
ccc6cda3
JA
1Basic Installation
2==================
726f6388 3
d166f048 4These are installation instructions for Bash.
ccc6cda3 5
bb70624e
JA
6The simplest way to compile Bash is:
7
8 1. `cd' to the directory containing the source code and type
9 `./configure' to configure Bash for your system. If you're using
10 `csh' on an old version of System V, you might need to type `sh
11 ./configure' instead to prevent `csh' from trying to execute
12 `configure' itself.
13
14 Running `configure' takes some time. While running, it prints
15 messages telling which features it is checking for.
16
17 2. Type `make' to compile Bash and build the `bashbug' bug reporting
18 script.
19
20 3. Optionally, type `make tests' to run the Bash test suite.
21
22 4. Type `make install' to install `bash' and `bashbug'. This will
23 also install the manual pages and Info file.
24
ccc6cda3
JA
25The `configure' shell script attempts to guess correct values for
26various system-dependent variables used during compilation. It uses
27those values to create a `Makefile' in each directory of the package
bb70624e
JA
28(the top directory, the `builtins', `doc', and `support' directories,
29each directory under `lib', and several others). It also creates a
30`config.h' file containing system-dependent definitions. Finally, it
31creates a shell script named `config.status' that you can run in the
32future to recreate the current configuration, a file `config.cache'
33that saves the results of its tests to speed up reconfiguring, and a
34file `config.log' containing compiler output (useful mainly for
35debugging `configure'). If at some point `config.cache' contains
36results you don't want to keep, you may remove or edit it.
37
38To find out more about the options and arguments that the `configure'
39script understands, type
40
41 bash-2.04$ ./configure --help
42
43at the Bash prompt in your Bash source directory.
ccc6cda3 44
b72432fd
JA
45If you need to do unusual things to compile Bash, please try to figure
46out how `configure' could check whether or not to do them, and mail
47diffs or instructions to <bash-maintainers@gnu.org> so they can be
48considered for the next release.
ccc6cda3
JA
49
50The file `configure.in' is used to create `configure' by a program
51called Autoconf. You only need `configure.in' if you want to change it
52or regenerate `configure' using a newer version of Autoconf. If you do
f73dda09 53this, make sure you are using Autoconf version 2.50 or newer.
ccc6cda3 54
ccc6cda3
JA
55You can remove the program binaries and object files from the source
56code directory by typing `make clean'. To also remove the files that
57`configure' created (so you can compile Bash for a different kind of
58computer), type `make distclean'.
59
60Compilers and Options
61=====================
62
63Some systems require unusual options for compilation or linking that
64the `configure' script does not know about. You can give `configure'
65initial values for variables by setting them in the environment. Using
66a Bourne-compatible shell, you can do that on the command line like
67this:
68
69 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
70
71On systems that have the `env' program, you can do it like this:
72
73 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
74
75The configuration process uses GCC to build Bash if it is available.
76
77Compiling For Multiple Architectures
78====================================
79
80You can compile Bash for more than one kind of computer at the same
81time, by placing the object files for each architecture in their own
82directory. To do this, you must use a version of `make' that supports
83the `VPATH' variable, such as GNU `make'. `cd' to the directory where
84you want the object files and executables to go and run the `configure'
85script from the source directory. You may need to supply the
86`--srcdir=PATH' argument to tell `configure' where the source files
87are. `configure' automatically checks for the source code in the
88directory that `configure' is in and in `..'.
89
90If you have to use a `make' that does not supports the `VPATH'
91variable, you can compile Bash for one architecture at a time in the
92source code directory. After you have installed Bash for one
93architecture, use `make distclean' before reconfiguring for another
94architecture.
95
96Alternatively, if your system supports symbolic links, you can use the
97`support/mkclone' script to create a build tree which has symbolic
98links back to each file in the source directory. Here's an example
99that creates a build directory in the current directory from a source
100directory `/usr/gnu/src/bash-2.0':
101
102 bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
103
104The `mkclone' script requires Bash, so you must have already built Bash
105for at least one architecture before you can create build directories
106for other architectures.
107
108Installation Names
109==================
110
111By default, `make install' will install into `/usr/local/bin',
112`/usr/local/man', etc. You can specify an installation prefix other
f73dda09
JA
113than `/usr/local' by giving `configure' the option `--prefix=PATH', or
114by specifying a value for the `DESTDIR' `make' variable when running
115`make install'.
ccc6cda3
JA
116
117You can specify separate installation prefixes for
118architecture-specific files and architecture-independent files. If you
b72432fd 119give `configure' the option `--exec-prefix=PATH', `make install' will
bb70624e 120use PATH as the prefix for installing programs and libraries.
ccc6cda3
JA
121Documentation and other data files will still use the regular prefix.
122
123Specifying the System Type
124==========================
125
126There may be some features `configure' can not figure out
f73dda09 127automatically, but need to determine by the type of host Bash will run
b72432fd
JA
128on. Usually `configure' can figure that out, but if it prints a
129message saying it can not guess the host type, give it the
ccc6cda3
JA
130`--host=TYPE' option. `TYPE' can either be a short name for the system
131type, such as `sun4', or a canonical name with three fields:
f73dda09 132`CPU-COMPANY-SYSTEM' (e.g., `i386-unknown-freebsd4.2').
ccc6cda3
JA
133
134See the file `support/config.sub' for the possible values of each field.
135
136Sharing Defaults
137================
138
139If you want to set default values for `configure' scripts to share, you
140can create a site shell script called `config.site' that gives default
141values for variables like `CC', `cache_file', and `prefix'. `configure'
142looks for `PREFIX/share/config.site' if it exists, then
143`PREFIX/etc/config.site' if it exists. Or, you can set the
144`CONFIG_SITE' environment variable to the location of the site script.
145A warning: the Bash `configure' looks for a site script, but not all
146`configure' scripts do.
147
148Operation Controls
149==================
150
151`configure' recognizes the following options to control how it operates.
152
153`--cache-file=FILE'
154 Use and save the results of the tests in FILE instead of
155 `./config.cache'. Set FILE to `/dev/null' to disable caching, for
156 debugging `configure'.
157
158`--help'
159 Print a summary of the options to `configure', and exit.
160
161`--quiet'
162`--silent'
163`-q'
164 Do not print messages saying which checks are being made.
165
166`--srcdir=DIR'
167 Look for the Bash source code in directory DIR. Usually
168 `configure' can determine that directory automatically.
169
170`--version'
171 Print the version of Autoconf used to generate the `configure'
172 script, and exit.
173
174`configure' also accepts some other, not widely used, boilerplate
bb70624e 175options. `configure --help' prints the complete list.
ccc6cda3
JA
176
177Optional Features
178=================
179
180The Bash `configure' has a number of `--enable-FEATURE' options, where
b72432fd 181FEATURE indicates an optional part of Bash. There are also several
bb70624e 182`--with-PACKAGE' options, where PACKAGE is something like `bash-malloc'
b72432fd
JA
183or `purify'. To turn off the default use of a package, use
184`--without-PACKAGE'. To configure Bash without a feature that is
185enabled by default, use `--disable-FEATURE'.
ccc6cda3
JA
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
bb70624e 193`--with-bash-malloc'
95732b49
JA
194 Use the Bash version of `malloc' in the directory `lib/malloc'.
195 This is not the same `malloc' that appears in GNU libc, but an
196 older version originally derived from the 4.2 BSD `malloc'. This
197 `malloc' is very fast, but wastes some space on each allocation.
198 This option is enabled by default. The `NOTES' file contains a
199 list of systems for which this should be turned off, and
200 `configure' disables this option automatically for a number of
201 systems.
bb70624e 202
d166f048
JA
203`--with-curses'
204 Use the curses library instead of the termcap library. This should
205 be supplied if your system has an inadequate or incomplete termcap
206 database.
ccc6cda3 207
d166f048 208`--with-gnu-malloc'
bb70624e 209 A synonym for `--with-bash-malloc'.
ccc6cda3 210
f73dda09 211`--with-installed-readline[=PREFIX]'
bb70624e
JA
212 Define this to make Bash link with a locally-installed version of
213 Readline rather than the version in `lib/readline'. This works
95732b49 214 only with Readline 5.0 and later versions. If PREFIX is `yes' or
f73dda09
JA
215 not supplied, `configure' uses the values of the make variables
216 `includedir' and `libdir', which are subdirectories of `prefix' by
217 default, to find the installed version of Readline if it is not in
218 the standard system include and library directories. If PREFIX is
219 `no', Bash links with the version in `lib/readline'. If PREFIX is
220 set to any other value, `configure' treats it as a directory
221 pathname and looks for the installed version of Readline in
222 subdirectories of that directory (include files in
223 PREFIX/`include' and the library in PREFIX/`lib').
b72432fd 224
ccc6cda3 225`--with-purify'
bb70624e
JA
226 Define this to use the Purify memory allocation checker from
227 Rational Software.
ccc6cda3
JA
228
229`--enable-minimal-config'
230 This produces a shell with minimal features, close to the
231 historical Bourne shell.
232
cce855bc
JA
233There are several `--enable-' options that alter how Bash is compiled
234and linked, rather than changing run-time features.
235
f73dda09
JA
236`--enable-largefile'
237 Enable support for large files
238 (http://www.sas.com/standards/large_file/x_open.20Mar96.html) if
239 the operating system requires special compiler options to build
7117c2d2
JA
240 programs which can access large files. This is enabled by
241 default, if the operating system provides large file support.
f73dda09 242
cce855bc
JA
243`--enable-profiling'
244 This builds a Bash binary that produces profiling information to be
245 processed by `gprof' each time it is executed.
246
247`--enable-static-link'
248 This causes Bash to be linked statically, if `gcc' is being used.
249 This could be used to build a version to use as root's shell.
250
ccc6cda3
JA
251The `minimal-config' option can be used to disable all of the following
252options, but it is processed first, so individual options may be
253enabled using `enable-FEATURE'.
254
255All of the following options except for `disabled-builtins' and
bb70624e 256`xpg-echo-default' are enabled by default, unless the operating system
ccc6cda3
JA
257does not provide the necessary support.
258
ccc6cda3
JA
259`--enable-alias'
260 Allow alias expansion and include the `alias' and `unalias'
28ef6c31 261 builtins (*note Aliases::).
ccc6cda3 262
bb70624e
JA
263`--enable-arith-for-command'
264 Include support for the alternate form of the `for' command that
265 behaves like the C language `for' statement (*note Looping
28ef6c31 266 Constructs::).
bb70624e 267
d166f048 268`--enable-array-variables'
b72432fd 269 Include support for one-dimensional array shell variables (*note
28ef6c31 270 Arrays::).
ccc6cda3
JA
271
272`--enable-bang-history'
b72432fd 273 Include support for `csh'-like history substitution (*note History
28ef6c31 274 Interaction::).
ccc6cda3 275
d166f048
JA
276`--enable-brace-expansion'
277 Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ).
3185942a
JA
278 See *note Brace Expansion::, for a complete description.
279
280`--enable-casemod-attributes'
281 Include support for case-modifying attributes in the `declare'
282 builtin and assignment statements. Variables with the UPPERCASE
283 attribute, for example, will have their values converted to
284 uppercase upon assignment.
285
286`--enable-casemod-expansion'
287 Include support for case-modifying word expansions.
d166f048
JA
288
289`--enable-command-timing'
290 Include support for recognizing `time' as a reserved word and for
bb70624e 291 displaying timing statistics for the pipeline following `time'
28ef6c31 292 (*note Pipelines::). This allows pipelines as well as shell
bb70624e 293 builtins and functions to be timed.
d166f048 294
cce855bc 295`--enable-cond-command'
b80f6443
JA
296 Include support for the `[[' conditional command. (*note
297 Conditional Constructs::).
298
299`--enable-cond-regexp'
300 Include support for matching POSIX regular expressions using the
301 `=~' binary operator in the `[[' conditional command. (*note
28ef6c31 302 Conditional Constructs::).
cce855bc 303
3185942a
JA
304`--enable-coprocesses'
305 Include support for coprocesses and the `coproc' reserved word
306 (*note Pipelines::).
307
95732b49
JA
308`--enable-debugger'
309 Include support for the bash debugger (distributed separately).
310
ccc6cda3
JA
311`--enable-directory-stack'
312 Include support for a `csh'-like directory stack and the `pushd',
28ef6c31 313 `popd', and `dirs' builtins (*note The Directory Stack::).
ccc6cda3 314
d166f048
JA
315`--enable-disabled-builtins'
316 Allow builtin commands to be invoked via `builtin xxx' even after
3185942a 317 `xxx' has been disabled using `enable -n xxx'. See *note Bash
d166f048
JA
318 Builtins::, for details of the `builtin' and `enable' builtin
319 commands.
320
321`--enable-dparen-arithmetic'
b72432fd 322 Include support for the `((...))' command (*note Conditional
28ef6c31 323 Constructs::).
d166f048 324
cce855bc
JA
325`--enable-extended-glob'
326 Include support for the extended pattern matching features
3185942a 327 described above under *note Pattern Matching::.
cce855bc 328
0001803f
CR
329`--enable-extended-glob-default'
330 Set the default value of the EXTGLOB shell option described above
331 under *note The Shopt Builtin:: to be enabled.
332
d166f048
JA
333`--enable-help-builtin'
334 Include the `help' builtin, which displays help on shell builtins
28ef6c31 335 and variables (*note Bash Builtins::).
d166f048
JA
336
337`--enable-history'
338 Include command history and the `fc' and `history' builtin
28ef6c31 339 commands (*note Bash History Facilities::).
d166f048
JA
340
341`--enable-job-control'
28ef6c31 342 This enables the job control features (*note Job Control::), if
b72432fd 343 the operating system supports them.
ccc6cda3 344
b80f6443
JA
345`--enable-multibyte'
346 This enables support for multibyte characters if the operating
347 system provides the necessary support.
348
bb70624e
JA
349`--enable-net-redirections'
350 This enables the special handling of filenames of the form
351 `/dev/tcp/HOST/PORT' and `/dev/udp/HOST/PORT' when used in
28ef6c31 352 redirections (*note Redirections::).
bb70624e 353
ccc6cda3 354`--enable-process-substitution'
28ef6c31
JA
355 This enables process substitution (*note Process Substitution::) if
356 the operating system provides the necessary support.
ccc6cda3 357
95732b49
JA
358`--enable-progcomp'
359 Enable the programmable completion facilities (*note Programmable
360 Completion::). If Readline is not enabled, this option has no
361 effect.
362
ccc6cda3
JA
363`--enable-prompt-string-decoding'
364 Turn on the interpretation of a number of backslash-escaped
365 characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt
3185942a 366 strings. See *note Printing a Prompt::, for a complete list of
b72432fd 367 prompt string escape sequences.
ccc6cda3 368
d166f048
JA
369`--enable-readline'
370 Include support for command-line editing and history with the Bash
28ef6c31 371 version of the Readline library (*note Command Line Editing::).
d166f048
JA
372
373`--enable-restricted'
374 Include support for a "restricted shell". If this is enabled,
3185942a 375 Bash, when called as `rbash', enters a restricted mode. See *note
d166f048
JA
376 The Restricted Shell::, for a description of restricted mode.
377
ccc6cda3 378`--enable-select'
b72432fd 379 Include the `select' builtin, which allows the generation of simple
28ef6c31 380 menus (*note Conditional Constructs::).
ccc6cda3 381
95732b49
JA
382`--enable-separate-helpfiles'
383 Use external files for the documentation displayed by the `help'
384 builtin instead of storing the text internally.
385
386`--enable-single-help-strings'
387 Store the text displayed by the `help' builtin as a single string
388 for each help topic. This aids in translating the text to
389 different languages. You may need to disable this if your
390 compiler cannot handle very long string literals.
391
392`--enable-strict-posix-default'
393 Make Bash POSIX-conformant by default (*note Bash POSIX Mode::).
394
ccc6cda3 395`--enable-usg-echo-default'
bb70624e
JA
396 A synonym for `--enable-xpg-echo-default'.
397
398`--enable-xpg-echo-default'
ccc6cda3 399 Make the `echo' builtin expand backslash-escaped characters by
bb70624e
JA
400 default, without requiring the `-e' option. This sets the default
401 value of the `xpg_echo' shell option to `on', which makes the Bash
402 `echo' behave more like the version specified in the Single Unix
95732b49 403 Specification, version 3. *Note Bash Builtins::, for a
bb70624e 404 description of the escape sequences that `echo' recognizes.
ccc6cda3 405
bb70624e 406The file `config-top.h' contains C Preprocessor `#define' statements
ccc6cda3
JA
407for options which are not settable from `configure'. Some of these are
408not meant to be changed; beware of the consequences if you do. Read
409the comments associated with each definition for more information about
410its effect.