]>
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 | ||
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 |
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 | |
bb70624e JA |
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' | |
33 | that saves the results of its tests to speed up reconfiguring, and a | |
34 | file `config.log' containing compiler output (useful mainly for | |
35 | debugging `configure'). If at some point `config.cache' contains | |
36 | results you 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. | |
ccc6cda3 | 44 | |
b72432fd JA |
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. | |
ccc6cda3 JA |
49 | |
50 | The file `configure.in' is used to create `configure' by a program | |
51 | called Autoconf. You only need `configure.in' 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 JA |
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 | Compilers and Options | |
61 | ===================== | |
62 | ||
63 | Some systems require unusual options for compilation or linking that | |
64 | the `configure' script does not know about. You can give `configure' | |
65 | initial values for variables by setting them in the environment. Using | |
66 | a Bourne-compatible shell, you can do that on the command line like | |
67 | this: | |
68 | ||
69 | CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure | |
70 | ||
71 | On systems that have the `env' program, you can do it like this: | |
72 | ||
73 | env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure | |
74 | ||
75 | The configuration process uses GCC to build Bash if it is available. | |
76 | ||
77 | Compiling For Multiple Architectures | |
78 | ==================================== | |
79 | ||
80 | You can compile Bash for more than one kind of computer at the same | |
81 | time, by placing the object files for each architecture in their own | |
82 | directory. To do this, you must use a version of `make' that supports | |
83 | the `VPATH' variable, such as GNU `make'. `cd' to the directory where | |
84 | you want the object files and executables to go and run the `configure' | |
85 | script from the source directory. You may need to supply the | |
86 | `--srcdir=PATH' argument to tell `configure' where the source files | |
87 | are. `configure' automatically checks for the source code in the | |
88 | directory that `configure' is in and in `..'. | |
89 | ||
90 | If you have to use a `make' that does not supports the `VPATH' | |
91 | variable, you can compile Bash for one architecture at a time in the | |
92 | source code directory. After you have installed Bash for one | |
93 | architecture, use `make distclean' before reconfiguring for another | |
94 | architecture. | |
95 | ||
96 | Alternatively, if your system supports symbolic links, you can use the | |
97 | `support/mkclone' script to create a build tree which has symbolic | |
98 | links back to each file in the source directory. Here's an example | |
99 | that creates a build directory in the current directory from a source | |
100 | directory `/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 | ||
104 | The `mkclone' script requires Bash, so you must have already built Bash | |
105 | for at least one architecture before you can create build directories | |
106 | for other architectures. | |
107 | ||
108 | Installation Names | |
109 | ================== | |
110 | ||
111 | By default, `make install' will install into `/usr/local/bin', | |
112 | `/usr/local/man', etc. You can specify an installation prefix other | |
f73dda09 JA |
113 | than `/usr/local' by giving `configure' the option `--prefix=PATH', or |
114 | by specifying a value for the `DESTDIR' `make' variable when running | |
115 | `make install'. | |
ccc6cda3 JA |
116 | |
117 | You can specify separate installation prefixes for | |
118 | architecture-specific files and architecture-independent files. If you | |
b72432fd | 119 | give `configure' the option `--exec-prefix=PATH', `make install' will |
bb70624e | 120 | use PATH as the prefix for installing programs and libraries. |
ccc6cda3 JA |
121 | Documentation and other data files will still use the regular prefix. |
122 | ||
123 | Specifying the System Type | |
124 | ========================== | |
125 | ||
126 | There may be some features `configure' can not figure out | |
f73dda09 | 127 | automatically, but need to determine by the type of host Bash will run |
b72432fd JA |
128 | on. Usually `configure' can figure that out, but if it prints a |
129 | message 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 |
131 | type, such as `sun4', or a canonical name with three fields: | |
f73dda09 | 132 | `CPU-COMPANY-SYSTEM' (e.g., `i386-unknown-freebsd4.2'). |
ccc6cda3 JA |
133 | |
134 | See the file `support/config.sub' for the possible values of each field. | |
135 | ||
136 | Sharing Defaults | |
137 | ================ | |
138 | ||
139 | If you want to set default values for `configure' scripts to share, you | |
140 | can create a site shell script called `config.site' that gives default | |
141 | values for variables like `CC', `cache_file', and `prefix'. `configure' | |
142 | looks 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. | |
145 | A warning: the Bash `configure' looks for a site script, but not all | |
146 | `configure' scripts do. | |
147 | ||
148 | Operation 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 | 175 | options. `configure --help' prints the complete list. |
ccc6cda3 JA |
176 | |
177 | Optional Features | |
178 | ================= | |
179 | ||
180 | The Bash `configure' has a number of `--enable-FEATURE' options, where | |
b72432fd | 181 | FEATURE indicates an optional part of Bash. There are also several |
bb70624e | 182 | `--with-PACKAGE' options, where PACKAGE is something like `bash-malloc' |
b72432fd JA |
183 | or `purify'. To turn off the default use of a package, use |
184 | `--without-PACKAGE'. To configure Bash without a feature that is | |
185 | enabled by default, use `--disable-FEATURE'. | |
ccc6cda3 JA |
186 | |
187 | Here is a complete list of the `--enable-' and `--with-' options that | |
188 | the Bash `configure' recognizes. | |
189 | ||
d166f048 JA |
190 | `--with-afs' |
191 | Define if you are using the Andrew File System from Transarc. | |
192 | ||
bb70624e JA |
193 | `--with-bash-malloc' |
194 | Use the Bash version of `malloc' in `lib/malloc/malloc.c'. This | |
195 | is not the same `malloc' that appears in GNU libc, but an older | |
196 | version derived from the 4.2 BSD `malloc'. This `malloc' is very | |
197 | fast, but wastes some space on each allocation. This option is | |
198 | enabled by default. The `NOTES' file contains a list of systems | |
199 | for which this should be turned off, and `configure' disables this | |
200 | option automatically for a number of systems. | |
201 | ||
d166f048 JA |
202 | `--with-curses' |
203 | Use the curses library instead of the termcap library. This should | |
204 | be supplied if your system has an inadequate or incomplete termcap | |
205 | database. | |
ccc6cda3 | 206 | |
d166f048 | 207 | `--with-gnu-malloc' |
bb70624e | 208 | A synonym for `--with-bash-malloc'. |
ccc6cda3 | 209 | |
f73dda09 | 210 | `--with-installed-readline[=PREFIX]' |
bb70624e JA |
211 | Define this to make Bash link with a locally-installed version of |
212 | Readline rather than the version in `lib/readline'. This works | |
7117c2d2 | 213 | only with Readline 4.3 and later versions. If PREFIX is `yes' or |
f73dda09 JA |
214 | not supplied, `configure' uses the values of the make variables |
215 | `includedir' and `libdir', which are subdirectories of `prefix' by | |
216 | default, to find the installed version of Readline if it is not in | |
217 | the standard system include and library directories. If PREFIX is | |
218 | `no', Bash links with the version in `lib/readline'. If PREFIX is | |
219 | set to any other value, `configure' treats it as a directory | |
220 | pathname and looks for the installed version of Readline in | |
221 | subdirectories of that directory (include files in | |
222 | PREFIX/`include' and the library in PREFIX/`lib'). | |
b72432fd | 223 | |
ccc6cda3 | 224 | `--with-purify' |
bb70624e JA |
225 | Define this to use the Purify memory allocation checker from |
226 | Rational Software. | |
ccc6cda3 JA |
227 | |
228 | `--enable-minimal-config' | |
229 | This produces a shell with minimal features, close to the | |
230 | historical Bourne shell. | |
231 | ||
cce855bc JA |
232 | There are several `--enable-' options that alter how Bash is compiled |
233 | and linked, rather than changing run-time features. | |
234 | ||
f73dda09 JA |
235 | `--enable-largefile' |
236 | Enable support for large files | |
237 | (http://www.sas.com/standards/large_file/x_open.20Mar96.html) if | |
238 | the operating system requires special compiler options to build | |
7117c2d2 JA |
239 | programs which can access large files. This is enabled by |
240 | default, if the operating system provides large file support. | |
f73dda09 | 241 | |
cce855bc JA |
242 | `--enable-profiling' |
243 | This builds a Bash binary that produces profiling information to be | |
244 | processed by `gprof' each time it is executed. | |
245 | ||
246 | `--enable-static-link' | |
247 | This causes Bash to be linked statically, if `gcc' is being used. | |
248 | This could be used to build a version to use as root's shell. | |
249 | ||
ccc6cda3 JA |
250 | The `minimal-config' option can be used to disable all of the following |
251 | options, but it is processed first, so individual options may be | |
252 | enabled using `enable-FEATURE'. | |
253 | ||
254 | All of the following options except for `disabled-builtins' and | |
bb70624e | 255 | `xpg-echo-default' are enabled by default, unless the operating system |
ccc6cda3 JA |
256 | does not provide the necessary support. |
257 | ||
ccc6cda3 JA |
258 | `--enable-alias' |
259 | Allow alias expansion and include the `alias' and `unalias' | |
28ef6c31 | 260 | builtins (*note Aliases::). |
ccc6cda3 | 261 | |
bb70624e JA |
262 | `--enable-arith-for-command' |
263 | Include support for the alternate form of the `for' command that | |
264 | behaves like the C language `for' statement (*note Looping | |
28ef6c31 | 265 | Constructs::). |
bb70624e | 266 | |
d166f048 | 267 | `--enable-array-variables' |
b72432fd | 268 | Include support for one-dimensional array shell variables (*note |
28ef6c31 | 269 | Arrays::). |
ccc6cda3 JA |
270 | |
271 | `--enable-bang-history' | |
b72432fd | 272 | Include support for `csh'-like history substitution (*note History |
28ef6c31 | 273 | Interaction::). |
ccc6cda3 | 274 | |
d166f048 JA |
275 | `--enable-brace-expansion' |
276 | Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ). | |
b72432fd | 277 | See *Note Brace Expansion::, for a complete description. |
d166f048 JA |
278 | |
279 | `--enable-command-timing' | |
280 | Include support for recognizing `time' as a reserved word and for | |
bb70624e | 281 | displaying timing statistics for the pipeline following `time' |
28ef6c31 | 282 | (*note Pipelines::). This allows pipelines as well as shell |
bb70624e | 283 | builtins and functions to be timed. |
d166f048 | 284 | |
cce855bc | 285 | `--enable-cond-command' |
b72432fd | 286 | Include support for the `[[' conditional command (*note |
28ef6c31 | 287 | Conditional Constructs::). |
cce855bc | 288 | |
ccc6cda3 JA |
289 | `--enable-directory-stack' |
290 | Include support for a `csh'-like directory stack and the `pushd', | |
28ef6c31 | 291 | `popd', and `dirs' builtins (*note The Directory Stack::). |
ccc6cda3 | 292 | |
d166f048 JA |
293 | `--enable-disabled-builtins' |
294 | Allow builtin commands to be invoked via `builtin xxx' even after | |
295 | `xxx' has been disabled using `enable -n xxx'. See *Note Bash | |
296 | Builtins::, for details of the `builtin' and `enable' builtin | |
297 | commands. | |
298 | ||
299 | `--enable-dparen-arithmetic' | |
b72432fd | 300 | Include support for the `((...))' command (*note Conditional |
28ef6c31 | 301 | Constructs::). |
d166f048 | 302 | |
cce855bc JA |
303 | `--enable-extended-glob' |
304 | Include support for the extended pattern matching features | |
305 | described above under *Note Pattern Matching::. | |
306 | ||
d166f048 JA |
307 | `--enable-help-builtin' |
308 | Include the `help' builtin, which displays help on shell builtins | |
28ef6c31 | 309 | and variables (*note Bash Builtins::). |
d166f048 JA |
310 | |
311 | `--enable-history' | |
312 | Include command history and the `fc' and `history' builtin | |
28ef6c31 | 313 | commands (*note Bash History Facilities::). |
d166f048 JA |
314 | |
315 | `--enable-job-control' | |
28ef6c31 | 316 | This enables the job control features (*note Job Control::), if |
b72432fd | 317 | the operating system supports them. |
ccc6cda3 | 318 | |
bb70624e JA |
319 | `--enable-net-redirections' |
320 | This enables the special handling of filenames of the form | |
321 | `/dev/tcp/HOST/PORT' and `/dev/udp/HOST/PORT' when used in | |
28ef6c31 | 322 | redirections (*note Redirections::). |
bb70624e | 323 | |
ccc6cda3 | 324 | `--enable-process-substitution' |
28ef6c31 JA |
325 | This enables process substitution (*note Process Substitution::) if |
326 | the operating system provides the necessary support. | |
ccc6cda3 JA |
327 | |
328 | `--enable-prompt-string-decoding' | |
329 | Turn on the interpretation of a number of backslash-escaped | |
330 | characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt | |
b72432fd JA |
331 | strings. See *Note Printing a Prompt::, for a complete list of |
332 | prompt string escape sequences. | |
ccc6cda3 | 333 | |
bb70624e JA |
334 | `--enable-progcomp' |
335 | Enable the programmable completion facilities (*note Programmable | |
28ef6c31 | 336 | Completion::). If Readline is not enabled, this option has no |
bb70624e JA |
337 | effect. |
338 | ||
d166f048 JA |
339 | `--enable-readline' |
340 | Include support for command-line editing and history with the Bash | |
28ef6c31 | 341 | version of the Readline library (*note Command Line Editing::). |
d166f048 JA |
342 | |
343 | `--enable-restricted' | |
344 | Include support for a "restricted shell". If this is enabled, | |
345 | Bash, when called as `rbash', enters a restricted mode. See *Note | |
346 | The Restricted Shell::, for a description of restricted mode. | |
347 | ||
ccc6cda3 | 348 | `--enable-select' |
b72432fd | 349 | Include the `select' builtin, which allows the generation of simple |
28ef6c31 | 350 | menus (*note Conditional Constructs::). |
ccc6cda3 | 351 | |
ccc6cda3 | 352 | `--enable-usg-echo-default' |
bb70624e JA |
353 | A synonym for `--enable-xpg-echo-default'. |
354 | ||
355 | `--enable-xpg-echo-default' | |
ccc6cda3 | 356 | Make the `echo' builtin expand backslash-escaped characters by |
bb70624e JA |
357 | default, without requiring the `-e' option. This sets the default |
358 | value of the `xpg_echo' shell option to `on', which makes the Bash | |
359 | `echo' behave more like the version specified in the Single Unix | |
360 | Specification, version 2. *Note Bash Builtins::, for a | |
361 | description of the escape sequences that `echo' recognizes. | |
ccc6cda3 | 362 | |
bb70624e | 363 | The file `config-top.h' contains C Preprocessor `#define' statements |
ccc6cda3 JA |
364 | for options which are not settable from `configure'. Some of these are |
365 | not meant to be changed; beware of the consequences if you do. Read | |
366 | the comments associated with each definition for more information about | |
367 | its effect. |