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