]>
Commit | Line | Data |
---|---|---|
ccc6cda3 JA |
1 | Basic Installation |
2 | ================== | |
726f6388 | 3 | |
d166f048 | 4 | These are installation instructions for Bash. |
ccc6cda3 | 5 | |
bb70624e JA |
6 | The 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 | 25 | The 'configure' shell script attempts to guess correct values for |
ccc6cda3 | 26 | various system-dependent variables used during compilation. It uses |
a0c0a00f CR |
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' | |
bb70624e JA |
39 | script understands, type |
40 | ||
41 | bash-2.04$ ./configure --help | |
42 | ||
43 | at the Bash prompt in your Bash source directory. | |
ccc6cda3 | 44 | |
b72432fd | 45 | If you need to do unusual things to compile Bash, please try to figure |
a0c0a00f | 46 | out how 'configure' could check whether or not to do them, and mail |
b72432fd JA |
47 | diffs or instructions to <bash-maintainers@gnu.org> so they can be |
48 | considered for the next release. | |
ccc6cda3 | 49 | |
a0c0a00f CR |
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 | |
f73dda09 | 53 | this, make sure you are using Autoconf version 2.50 or newer. |
ccc6cda3 | 54 | |
ccc6cda3 | 55 | You can remove the program binaries and object files from the source |
a0c0a00f CR |
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 | |
ccc6cda3 JA |
61 | |
62 | Compilers and Options | |
63 | ===================== | |
64 | ||
a0c0a00f CR |
65 | Some systems require unusual options for compilation or linking that the |
66 | 'configure' script does not know about. You can give 'configure' | |
ccc6cda3 JA |
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 | ||
a0c0a00f | 73 | On systems that have the 'env' program, you can do it like this: |
ccc6cda3 JA |
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 | ||
a0c0a00f CR |
79 | Next: Installation Names, Prev: Compilers and Options, Up: Installing Bash |
80 | ||
ccc6cda3 JA |
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 | |
a0c0a00f CR |
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' | |
ccc6cda3 | 89 | script from the source directory. You may need to supply the |
a0c0a00f CR |
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 '..'. | |
ccc6cda3 | 93 | |
a0c0a00f CR |
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. | |
ccc6cda3 JA |
98 | |
99 | Alternatively, if your system supports symbolic links, you can use the | |
a0c0a00f CR |
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': | |
ccc6cda3 JA |
104 | |
105 | bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . | |
106 | ||
a0c0a00f | 107 | The 'mkclone' script requires Bash, so you must have already built Bash |
ccc6cda3 JA |
108 | for at least one architecture before you can create build directories |
109 | for other architectures. | |
110 | ||
a0c0a00f CR |
111 | Next: Specifying the System Type, Prev: Compiling For Multiple Architectures, Up: Installing Bash |
112 | ||
ccc6cda3 JA |
113 | Installation Names |
114 | ================== | |
115 | ||
a0c0a00f CR |
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. | |
ccc6cda3 | 127 | |
a0c0a00f | 128 | Next: Sharing Defaults, Prev: Installation Names, Up: Installing Bash |
ccc6cda3 JA |
129 | |
130 | Specifying the System Type | |
131 | ========================== | |
132 | ||
a0c0a00f CR |
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'). | |
ccc6cda3 | 140 | |
a0c0a00f CR |
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 | |
ccc6cda3 JA |
144 | |
145 | Sharing Defaults | |
146 | ================ | |
147 | ||
a0c0a00f CR |
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 | |
ccc6cda3 JA |
158 | |
159 | Operation Controls | |
160 | ================== | |
161 | ||
a0c0a00f | 162 | 'configure' recognizes the following options to control how it operates. |
ccc6cda3 | 163 | |
a0c0a00f | 164 | '--cache-file=FILE' |
ccc6cda3 | 165 | Use and save the results of the tests in FILE instead of |
a0c0a00f CR |
166 | './config.cache'. Set FILE to '/dev/null' to disable caching, for |
167 | debugging 'configure'. | |
ccc6cda3 | 168 | |
a0c0a00f CR |
169 | '--help' |
170 | Print a summary of the options to 'configure', and exit. | |
ccc6cda3 | 171 | |
a0c0a00f CR |
172 | '--quiet' |
173 | '--silent' | |
174 | '-q' | |
ccc6cda3 JA |
175 | Do not print messages saying which checks are being made. |
176 | ||
a0c0a00f | 177 | '--srcdir=DIR' |
ccc6cda3 | 178 | Look for the Bash source code in directory DIR. Usually |
a0c0a00f | 179 | 'configure' can determine that directory automatically. |
ccc6cda3 | 180 | |
a0c0a00f CR |
181 | '--version' |
182 | Print the version of Autoconf used to generate the 'configure' | |
ccc6cda3 JA |
183 | script, and exit. |
184 | ||
a0c0a00f CR |
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 | |
ccc6cda3 JA |
189 | |
190 | Optional Features | |
191 | ================= | |
192 | ||
a0c0a00f | 193 | The Bash 'configure' has a number of '--enable-FEATURE' options, where |
b72432fd | 194 | FEATURE indicates an optional part of Bash. There are also several |
a0c0a00f CR |
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'. | |
ccc6cda3 | 199 | |
a0c0a00f CR |
200 | Here is a complete list of the '--enable-' and '--with-' options that |
201 | the 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 | 246 | There are several '--enable-' options that alter how Bash is compiled |
cce855bc JA |
247 | and linked, rather than changing run-time features. |
248 | ||
a0c0a00f | 249 | '--enable-largefile' |
f73dda09 JA |
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 | |
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 |
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'. | |
ccc6cda3 | 267 | |
a0c0a00f CR |
268 | All of the following options except for 'disabled-builtins', |
269 | 'direxpand-default', and 'xpg-echo-default' are enabled by default, | |
ac50fbac | 270 | unless 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 | ||
a0c0a00f CR |
324 | '--enable-direxpand-default' |
325 | Cause the 'direxpand' shell option (*note The Shopt Builtin::) to | |
ac50fbac CR |
326 | be enabled by default when the shell starts. It is normally |
327 | disabled by default. | |
328 | ||
a0c0a00f CR |
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::). | |
ccc6cda3 | 332 | |
a0c0a00f CR |
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 | |
d166f048 JA |
337 | commands. |
338 | ||
a0c0a00f CR |
339 | '--enable-dparen-arithmetic' |
340 | Include support for the '((...))' command (*note Conditional | |
28ef6c31 | 341 | Constructs::). |
d166f048 | 342 | |
a0c0a00f | 343 | '--enable-extended-glob' |
cce855bc | 344 | Include support for the extended pattern matching features |
3185942a | 345 | described above under *note Pattern Matching::. |
cce855bc | 346 | |
a0c0a00f | 347 | '--enable-extended-glob-default' |
0001803f CR |
348 | Set the default value of the EXTGLOB shell option described above |
349 | under *note The Shopt Builtin:: to be enabled. | |
350 | ||
a0c0a00f CR |
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' | |
ac50fbac | 357 | Set the default value of the GLOBASCIIRANGES shell option described |
a0c0a00f CR |
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. | |
ac50fbac | 361 | |
a0c0a00f CR |
362 | '--enable-help-builtin' |
363 | Include the 'help' builtin, which displays help on shell builtins | |
28ef6c31 | 364 | and variables (*note Bash Builtins::). |
d166f048 | 365 | |
a0c0a00f CR |
366 | '--enable-history' |
367 | Include command history and the 'fc' and 'history' builtin commands | |
368 | (*note Bash History Facilities::). | |
d166f048 | 369 | |
a0c0a00f CR |
370 | '--enable-job-control' |
371 | This enables the job control features (*note Job Control::), if the | |
372 | operating system supports them. | |
ccc6cda3 | 373 | |
a0c0a00f | 374 | '--enable-multibyte' |
b80f6443 JA |
375 | This enables support for multibyte characters if the operating |
376 | system provides the necessary support. | |
377 | ||
a0c0a00f | 378 | '--enable-net-redirections' |
bb70624e | 379 | This enables the special handling of filenames of the form |
a0c0a00f | 380 | '/dev/tcp/HOST/PORT' and '/dev/udp/HOST/PORT' when used in |
28ef6c31 | 381 | redirections (*note Redirections::). |
bb70624e | 382 | |
a0c0a00f | 383 | '--enable-process-substitution' |
28ef6c31 JA |
384 | This enables process substitution (*note Process Substitution::) if |
385 | the operating system provides the necessary support. | |
ccc6cda3 | 386 | |
a0c0a00f | 387 | '--enable-progcomp' |
95732b49 JA |
388 | Enable the programmable completion facilities (*note Programmable |
389 | Completion::). If Readline is not enabled, this option has no | |
390 | effect. | |
391 | ||
a0c0a00f | 392 | '--enable-prompt-string-decoding' |
ccc6cda3 | 393 | Turn on the interpretation of a number of backslash-escaped |
a0c0a00f | 394 | characters in the '$PS1', '$PS2', '$PS3', and '$PS4' prompt |
ac50fbac CR |
395 | strings. See *note Controlling the Prompt::, for a complete list |
396 | of prompt string escape sequences. | |
ccc6cda3 | 397 | |
a0c0a00f | 398 | '--enable-readline' |
d166f048 | 399 | Include support for command-line editing and history with the Bash |
28ef6c31 | 400 | version of the Readline library (*note Command Line Editing::). |
d166f048 | 401 | |
a0c0a00f | 402 | '--enable-restricted' |
d166f048 | 403 | Include support for a "restricted shell". If this is enabled, |
a0c0a00f | 404 | Bash, when called as 'rbash', enters a restricted mode. See *note |
d166f048 JA |
405 | The Restricted Shell::, for a description of restricted mode. |
406 | ||
a0c0a00f CR |
407 | '--enable-select' |
408 | Include the 'select' compound command, which allows the generation | |
495aee44 | 409 | of simple menus (*note Conditional Constructs::). |
ccc6cda3 | 410 | |
a0c0a00f CR |
411 | '--enable-separate-helpfiles' |
412 | Use external files for the documentation displayed by the 'help' | |
95732b49 JA |
413 | builtin instead of storing the text internally. |
414 | ||
a0c0a00f CR |
415 | '--enable-single-help-strings' |
416 | Store the text displayed by the 'help' builtin as a single string | |
95732b49 | 417 | for each help topic. This aids in translating the text to |
a0c0a00f CR |
418 | different languages. You may need to disable this if your compiler |
419 | cannot handle very long string literals. | |
95732b49 | 420 | |
a0c0a00f | 421 | '--enable-strict-posix-default' |
95732b49 JA |
422 | Make Bash POSIX-conformant by default (*note Bash POSIX Mode::). |
423 | ||
a0c0a00f CR |
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. |