]> git.ipfire.org Git - thirdparty/bash.git/blob - INSTALL
fix for SIGINT in sourced script
[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-2.04$ ./configure --help
42
43 at the Bash prompt in your Bash source directory.
44
45 If you need to do unusual things to compile Bash, please try to figure
46 out how 'configure' could check whether or not to do them, and mail
47 diffs or instructions to <bash-maintainers@gnu.org> so they can be
48 considered for the next release.
49
50 The file 'configure.ac' is used to create 'configure' by a program
51 called Autoconf. You only need 'configure.ac' if you want to change it
52 or regenerate 'configure' using a newer version of Autoconf. If you do
53 this, make sure you are using Autoconf version 2.50 or newer.
54
55 You can remove the program binaries and object files from the source
56 code directory by typing 'make clean'. To also remove the files that
57 'configure' created (so you can compile Bash for a different kind of
58 computer), type 'make distclean'.
59
60 Next: Compiling For Multiple Architectures, Prev: Basic Installation, Up: Installing Bash
61
62 Compilers and Options
63 =====================
64
65 Some systems require unusual options for compilation or linking that the
66 'configure' script does not know about. You can give 'configure'
67 initial values for variables by setting them in the environment. Using
68 a Bourne-compatible shell, you can do that on the command line like
69 this:
70
71 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
72
73 On systems that have the 'env' program, you can do it like this:
74
75 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
76
77 The configuration process uses GCC to build Bash if it is available.
78
79 Next: Installation Names, Prev: Compilers and Options, Up: Installing Bash
80
81 Compiling For Multiple Architectures
82 ====================================
83
84 You can compile Bash for more than one kind of computer at the same
85 time, by placing the object files for each architecture in their own
86 directory. To do this, you must use a version of 'make' that supports
87 the 'VPATH' variable, such as GNU 'make'. 'cd' to the directory where
88 you want the object files and executables to go and run the 'configure'
89 script from the source directory. You may need to supply the
90 '--srcdir=PATH' argument to tell 'configure' where the source files are.
91 'configure' automatically checks for the source code in the directory
92 that 'configure' is in and in '..'.
93
94 If you have to use a 'make' that does not supports the 'VPATH' variable,
95 you can compile Bash for one architecture at a time in the source code
96 directory. After you have installed Bash for one architecture, use
97 'make distclean' before reconfiguring for another architecture.
98
99 Alternatively, if your system supports symbolic links, you can use the
100 'support/mkclone' script to create a build tree which has symbolic links
101 back to each file in the source directory. Here's an example that
102 creates a build directory in the current directory from a source
103 directory '/usr/gnu/src/bash-2.0':
104
105 bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
106
107 The 'mkclone' script requires Bash, so you must have already built Bash
108 for at least one architecture before you can create build directories
109 for other architectures.
110
111 Next: Specifying the System Type, Prev: Compiling For Multiple Architectures, Up: Installing Bash
112
113 Installation Names
114 ==================
115
116 By default, 'make install' will install into '/usr/local/bin',
117 '/usr/local/man', etc. You can specify an installation prefix other
118 than '/usr/local' by giving 'configure' the option '--prefix=PATH', or
119 by specifying a value for the 'DESTDIR' 'make' variable when running
120 'make install'.
121
122 You can specify separate installation prefixes for architecture-specific
123 files and architecture-independent files. If you give 'configure' the
124 option '--exec-prefix=PATH', 'make install' will use PATH as the prefix
125 for installing programs and libraries. Documentation and other data
126 files will still use the regular prefix.
127
128 Next: Sharing Defaults, Prev: Installation Names, Up: Installing Bash
129
130 Specifying the System Type
131 ==========================
132
133 There may be some features 'configure' can not figure out automatically,
134 but need to determine by the type of host Bash will run on. Usually
135 'configure' can figure that out, but if it prints a message saying it
136 can not guess the host type, give it the '--host=TYPE' option. 'TYPE'
137 can either be a short name for the system type, such as 'sun4', or a
138 canonical name with three fields: 'CPU-COMPANY-SYSTEM' (e.g.,
139 'i386-unknown-freebsd4.2').
140
141 See the file 'support/config.sub' for the possible values of each field.
142
143 Next: Operation Controls, Prev: Specifying the System Type, Up: Installing Bash
144
145 Sharing Defaults
146 ================
147
148 If you want to set default values for 'configure' scripts to share, you
149 can create a site shell script called 'config.site' that gives default
150 values for variables like 'CC', 'cache_file', and 'prefix'. 'configure'
151 looks for 'PREFIX/share/config.site' if it exists, then
152 'PREFIX/etc/config.site' if it exists. Or, you can set the
153 'CONFIG_SITE' environment variable to the location of the site script.
154 A warning: the Bash 'configure' looks for a site script, but not all
155 'configure' scripts do.
156
157 Next: Optional Features, Prev: Sharing Defaults, Up: Installing Bash
158
159 Operation Controls
160 ==================
161
162 'configure' recognizes the following options to control how it operates.
163
164 '--cache-file=FILE'
165 Use and save the results of the tests in FILE instead of
166 './config.cache'. Set FILE to '/dev/null' to disable caching, for
167 debugging 'configure'.
168
169 '--help'
170 Print a summary of the options to 'configure', and exit.
171
172 '--quiet'
173 '--silent'
174 '-q'
175 Do not print messages saying which checks are being made.
176
177 '--srcdir=DIR'
178 Look for the Bash source code in directory DIR. Usually
179 'configure' can determine that directory automatically.
180
181 '--version'
182 Print the version of Autoconf used to generate the 'configure'
183 script, and exit.
184
185 'configure' also accepts some other, not widely used, boilerplate
186 options. 'configure --help' prints the complete list.
187
188 Prev: Operation Controls, Up: Installing Bash
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.sas.com/standards/large_file/x_open.20Mar96.html) if
252 the 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-direxpand-default'
325 Cause the 'direxpand' shell option (*note The Shopt Builtin::) to
326 be enabled by default when the shell starts. It is normally
327 disabled by default.
328
329 '--enable-directory-stack'
330 Include support for a 'csh'-like directory stack and the 'pushd',
331 'popd', and 'dirs' builtins (*note The Directory Stack::).
332
333 '--enable-disabled-builtins'
334 Allow builtin commands to be invoked via 'builtin xxx' even after
335 'xxx' has been disabled using 'enable -n xxx'. See *note Bash
336 Builtins::, for details of the 'builtin' and 'enable' builtin
337 commands.
338
339 '--enable-dparen-arithmetic'
340 Include support for the '((...))' command (*note Conditional
341 Constructs::).
342
343 '--enable-extended-glob'
344 Include support for the extended pattern matching features
345 described above under *note Pattern Matching::.
346
347 '--enable-extended-glob-default'
348 Set the default value of the EXTGLOB shell option described above
349 under *note The Shopt Builtin:: to be enabled.
350
351 '--enable-function-import'
352 Include support for importing function definitions exported by
353 another instance of the shell from the environment. This option is
354 enabled by default.
355
356 '--enable-glob-asciirange-default'
357 Set the default value of the GLOBASCIIRANGES shell option described
358 above under *note The Shopt Builtin:: to be enabled. This controls
359 the behavior of character ranges when used in pattern matching
360 bracket expressions.
361
362 '--enable-help-builtin'
363 Include the 'help' builtin, which displays help on shell builtins
364 and variables (*note Bash Builtins::).
365
366 '--enable-history'
367 Include command history and the 'fc' and 'history' builtin commands
368 (*note Bash History Facilities::).
369
370 '--enable-job-control'
371 This enables the job control features (*note Job Control::), if the
372 operating system supports them.
373
374 '--enable-multibyte'
375 This enables support for multibyte characters if the operating
376 system provides the necessary support.
377
378 '--enable-net-redirections'
379 This enables the special handling of filenames of the form
380 '/dev/tcp/HOST/PORT' and '/dev/udp/HOST/PORT' when used in
381 redirections (*note Redirections::).
382
383 '--enable-process-substitution'
384 This enables process substitution (*note Process Substitution::) if
385 the operating system provides the necessary support.
386
387 '--enable-progcomp'
388 Enable the programmable completion facilities (*note Programmable
389 Completion::). If Readline is not enabled, this option has no
390 effect.
391
392 '--enable-prompt-string-decoding'
393 Turn on the interpretation of a number of backslash-escaped
394 characters in the '$PS1', '$PS2', '$PS3', and '$PS4' prompt
395 strings. See *note Controlling the Prompt::, for a complete list
396 of prompt string escape sequences.
397
398 '--enable-readline'
399 Include support for command-line editing and history with the Bash
400 version of the Readline library (*note Command Line Editing::).
401
402 '--enable-restricted'
403 Include support for a "restricted shell". If this is enabled,
404 Bash, when called as 'rbash', enters a restricted mode. See *note
405 The Restricted Shell::, for a description of restricted mode.
406
407 '--enable-select'
408 Include the 'select' compound command, which allows the generation
409 of simple menus (*note Conditional Constructs::).
410
411 '--enable-separate-helpfiles'
412 Use external files for the documentation displayed by the 'help'
413 builtin instead of storing the text internally.
414
415 '--enable-single-help-strings'
416 Store the text displayed by the 'help' builtin as a single string
417 for each help topic. This aids in translating the text to
418 different languages. You may need to disable this if your compiler
419 cannot handle very long string literals.
420
421 '--enable-strict-posix-default'
422 Make Bash POSIX-conformant by default (*note Bash POSIX Mode::).
423
424 '--enable-usg-echo-default'
425 A synonym for '--enable-xpg-echo-default'.
426
427 '--enable-xpg-echo-default'
428 Make the 'echo' builtin expand backslash-escaped characters by
429 default, without requiring the '-e' option. This sets the default
430 value of the 'xpg_echo' shell option to 'on', which makes the Bash
431 'echo' behave more like the version specified in the Single Unix
432 Specification, version 3. *Note Bash Builtins::, for a description
433 of the escape sequences that 'echo' recognizes.
434
435 The file 'config-top.h' contains C Preprocessor '#define' statements for
436 options which are not settable from 'configure'. Some of these are not
437 meant to be changed; beware of the consequences if you do. Read the
438 comments associated with each definition for more information about its
439 effect.