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