]>
Commit | Line | Data |
---|---|---|
ccc6cda3 JA |
1 | Basic Installation |
2 | ================== | |
726f6388 | 3 | |
d166f048 | 4 | These are installation instructions for Bash. |
ccc6cda3 JA |
5 | |
6 | The `configure' shell script attempts to guess correct values for | |
7 | various system-dependent variables used during compilation. It uses | |
8 | those values to create a `Makefile' in each directory of the package | |
9 | (the top directory, the `builtins' and `doc' directories, and the each | |
10 | directory under `lib'). It also creates a `config.h' file containing | |
11 | system-dependent definitions. Finally, it creates a shell script named | |
12 | `config.status' that you can run in the future to recreate the current | |
13 | configuration, a file `config.cache' that saves the results of its | |
14 | tests to speed up reconfiguring, and a file `config.log' containing | |
15 | compiler output (useful mainly for debugging `configure'). If at some | |
16 | point `config.cache' contains results you don't want to keep, you may | |
17 | remove or edit it. | |
18 | ||
19 | If you need to do unusual things to compile the package, please try to | |
20 | figure out how `configure' could check whether or not to do them, and | |
21 | mail diffs or instructions to `bash-maintainers@prep.ai.mit.edu' so | |
22 | they can be considered for the next release. | |
23 | ||
24 | The file `configure.in' is used to create `configure' by a program | |
25 | called Autoconf. You only need `configure.in' if you want to change it | |
26 | or regenerate `configure' using a newer version of Autoconf. If you do | |
d166f048 JA |
27 | this, make sure you are using Autoconf version 2.10 or newer. |
28 | ||
29 | If you need to change `configure.in' or regenerate `configure', you | |
30 | will need to create two files: `_distribution' and `_patchlevel'. | |
31 | `_distribution' should contain the major and minor version numbers of | |
bc4cd23c JA |
32 | the Bash distribution, for example `2.02'. `_patchlevel' should |
33 | contain the patch level of the Bash distribution, `1' for example. The | |
d166f048 JA |
34 | script `support/mkconffiles' has been provided to automate the creation |
35 | of these files. | |
ccc6cda3 JA |
36 | |
37 | The simplest way to compile Bash is: | |
38 | ||
39 | 1. `cd' to the directory containing the source code and type | |
40 | `./configure' to configure Bash for your system. If you're using | |
41 | `csh' on an old version of System V, you might need to type `sh | |
42 | ./configure' instead to prevent `csh' from trying to execute | |
43 | `configure' itself. | |
44 | ||
45 | Running `configure' takes awhile. While running, it prints some | |
46 | messages telling which features it is checking for. | |
47 | ||
48 | 2. Type `make' to compile Bash and build the `bashbug' bug reporting | |
49 | script. | |
50 | ||
51 | 3. Optionally, type `make tests' to run the Bash test suite. | |
52 | ||
53 | 4. Type `make install' to install `bash' and `bashbug'. This will | |
54 | also install the manual pages and Info file. | |
55 | ||
56 | You can remove the program binaries and object files from the source | |
57 | code directory by typing `make clean'. To also remove the files that | |
58 | `configure' created (so you can compile Bash for a different kind of | |
59 | computer), type `make distclean'. | |
60 | ||
61 | Compilers and Options | |
62 | ===================== | |
63 | ||
64 | Some systems require unusual options for compilation or linking that | |
65 | the `configure' script does not know about. You can give `configure' | |
66 | initial values for variables by setting them in the environment. Using | |
67 | a Bourne-compatible shell, you can do that on the command line like | |
68 | this: | |
69 | ||
70 | CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure | |
71 | ||
72 | On systems that have the `env' program, you can do it like this: | |
73 | ||
74 | env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure | |
75 | ||
76 | The configuration process uses GCC to build Bash if it is available. | |
77 | ||
78 | Compiling For Multiple Architectures | |
79 | ==================================== | |
80 | ||
81 | You can compile Bash for more than one kind of computer at the same | |
82 | time, by placing the object files for each architecture in their own | |
83 | directory. To do this, you must use a version of `make' that supports | |
84 | the `VPATH' variable, such as GNU `make'. `cd' to the directory where | |
85 | you want the object files and executables to go and run the `configure' | |
86 | script from the source directory. You may need to supply the | |
87 | `--srcdir=PATH' argument to tell `configure' where the source files | |
88 | are. `configure' automatically checks for the source code in the | |
89 | directory that `configure' is in and in `..'. | |
90 | ||
91 | If you have to use a `make' that does not supports the `VPATH' | |
92 | variable, you can compile Bash for one architecture at a time in the | |
93 | source code directory. After you have installed Bash for one | |
94 | architecture, use `make distclean' before reconfiguring for another | |
95 | architecture. | |
96 | ||
97 | Alternatively, if your system supports symbolic links, you can use the | |
98 | `support/mkclone' script to create a build tree which has symbolic | |
99 | links back to each file in the source directory. Here's an example | |
100 | that creates a build directory in the current directory from a source | |
101 | directory `/usr/gnu/src/bash-2.0': | |
102 | ||
103 | bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . | |
104 | ||
105 | The `mkclone' script requires Bash, so you must have already built Bash | |
106 | for at least one architecture before you can create build directories | |
107 | for other architectures. | |
108 | ||
109 | Installation Names | |
110 | ================== | |
111 | ||
112 | By default, `make install' will install into `/usr/local/bin', | |
113 | `/usr/local/man', etc. You can specify an installation prefix other | |
114 | than `/usr/local' by giving `configure' the option `--prefix=PATH'. | |
115 | ||
116 | You can specify separate installation prefixes for | |
117 | architecture-specific files and architecture-independent files. If you | |
118 | give `configure' the option `--exec-prefix=PATH', the package will use | |
119 | `PATH' as the prefix for installing programs and libraries. | |
120 | Documentation and other data files will still use the regular prefix. | |
121 | ||
122 | Specifying the System Type | |
123 | ========================== | |
124 | ||
125 | There may be some features `configure' can not figure out | |
126 | automatically, but needs to determine by the type of host the package | |
127 | will run on. Usually `configure' can figure that out, but if it prints | |
128 | a message saying it can not guess the host type, give it the | |
129 | `--host=TYPE' option. `TYPE' can either be a short name for the system | |
130 | type, such as `sun4', or a canonical name with three fields: | |
131 | `CPU-COMPANY-SYSTEM' (e.g., `sparc-sun-sunos4.1.2'). | |
132 | ||
133 | See the file `support/config.sub' for the possible values of each field. | |
134 | ||
135 | Sharing Defaults | |
136 | ================ | |
137 | ||
138 | If you want to set default values for `configure' scripts to share, you | |
139 | can create a site shell script called `config.site' that gives default | |
140 | values for variables like `CC', `cache_file', and `prefix'. `configure' | |
141 | looks for `PREFIX/share/config.site' if it exists, then | |
142 | `PREFIX/etc/config.site' if it exists. Or, you can set the | |
143 | `CONFIG_SITE' environment variable to the location of the site script. | |
144 | A warning: the Bash `configure' looks for a site script, but not all | |
145 | `configure' scripts do. | |
146 | ||
147 | Operation Controls | |
148 | ================== | |
149 | ||
150 | `configure' recognizes the following options to control how it operates. | |
151 | ||
152 | `--cache-file=FILE' | |
153 | Use and save the results of the tests in FILE instead of | |
154 | `./config.cache'. Set FILE to `/dev/null' to disable caching, for | |
155 | debugging `configure'. | |
156 | ||
157 | `--help' | |
158 | Print a summary of the options to `configure', and exit. | |
159 | ||
160 | `--quiet' | |
161 | `--silent' | |
162 | `-q' | |
163 | Do not print messages saying which checks are being made. | |
164 | ||
165 | `--srcdir=DIR' | |
166 | Look for the Bash source code in directory DIR. Usually | |
167 | `configure' can determine that directory automatically. | |
168 | ||
169 | `--version' | |
170 | Print the version of Autoconf used to generate the `configure' | |
171 | script, and exit. | |
172 | ||
173 | `configure' also accepts some other, not widely used, boilerplate | |
174 | options. | |
175 | ||
176 | Optional Features | |
177 | ================= | |
178 | ||
179 | The Bash `configure' has a number of `--enable-FEATURE' options, where | |
180 | FEATURE indicates an optional part of the package. There are also | |
181 | several `--with-PACKAGE' options, where PACKAGE is something like | |
182 | `gnu-malloc' or `purify' (for the Purify memory allocation checker). To | |
183 | turn off the default use of a package, use `--without-PACKAGE'. To | |
184 | configure Bash without a feature that is enabled by default, use | |
185 | `--disable-FEATURE'. | |
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 | ||
193 | `--with-curses' | |
194 | Use the curses library instead of the termcap library. This should | |
195 | be supplied if your system has an inadequate or incomplete termcap | |
196 | database. | |
ccc6cda3 JA |
197 | |
198 | `--with-glibc-malloc' | |
199 | Use the GNU libc version of `malloc' in `lib/malloc/gmalloc.c'. | |
cce855bc JA |
200 | This is not the version of `malloc' that appears in glibc version |
201 | 2, but a modified version of the `malloc' from glibc version 1. | |
202 | This is somewhat slower than the default `malloc', but wastes less | |
203 | space on a per-allocation basis, and will return memory to the | |
204 | operating system under some circumstances. | |
ccc6cda3 | 205 | |
d166f048 JA |
206 | `--with-gnu-malloc' |
207 | Use the GNU version of `malloc' in `lib/malloc/malloc.c'. This is | |
208 | not the same `malloc' that appears in GNU libc, but an older | |
209 | version derived from the 4.2 BSD `malloc'. This `malloc' is very | |
cce855bc JA |
210 | fast, but wastes some space on each allocation. This option is |
211 | enabled by default. The `NOTES' file contains a list of systems | |
212 | for which this should be turned off, and `configure' disables this | |
213 | option automatically for a number of systems. | |
ccc6cda3 JA |
214 | |
215 | `--with-purify' | |
216 | Define this to use the Purify memory allocation checker from Pure | |
217 | Software. | |
218 | ||
219 | `--enable-minimal-config' | |
220 | This produces a shell with minimal features, close to the | |
221 | historical Bourne shell. | |
222 | ||
cce855bc JA |
223 | There are several `--enable-' options that alter how Bash is compiled |
224 | and linked, rather than changing run-time features. | |
225 | ||
226 | `--enable-profiling' | |
227 | This builds a Bash binary that produces profiling information to be | |
228 | processed by `gprof' each time it is executed. | |
229 | ||
230 | `--enable-static-link' | |
231 | This causes Bash to be linked statically, if `gcc' is being used. | |
232 | This could be used to build a version to use as root's shell. | |
233 | ||
ccc6cda3 JA |
234 | The `minimal-config' option can be used to disable all of the following |
235 | options, but it is processed first, so individual options may be | |
236 | enabled using `enable-FEATURE'. | |
237 | ||
238 | All of the following options except for `disabled-builtins' and | |
239 | `usg-echo-default' are enabled by default, unless the operating system | |
240 | does not provide the necessary support. | |
241 | ||
ccc6cda3 JA |
242 | `--enable-alias' |
243 | Allow alias expansion and include the `alias' and `unalias' | |
244 | builtins. | |
245 | ||
d166f048 JA |
246 | `--enable-array-variables' |
247 | Include support for one-dimensional array shell variables. | |
ccc6cda3 JA |
248 | |
249 | `--enable-bang-history' | |
250 | Include support for `csh'-like history substitution. | |
251 | ||
d166f048 JA |
252 | `--enable-brace-expansion' |
253 | Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ). | |
254 | ||
255 | `--enable-command-timing' | |
256 | Include support for recognizing `time' as a reserved word and for | |
257 | displaying timing statistics for the pipeline following `time'. | |
258 | This allows pipelines as well as shell builtins and functions to | |
259 | be timed. | |
260 | ||
cce855bc JA |
261 | `--enable-cond-command' |
262 | Include support for the `[[' conditional command. | |
263 | ||
ccc6cda3 JA |
264 | `--enable-directory-stack' |
265 | Include support for a `csh'-like directory stack and the `pushd', | |
266 | `popd', and `dirs' builtins. | |
267 | ||
d166f048 JA |
268 | `--enable-disabled-builtins' |
269 | Allow builtin commands to be invoked via `builtin xxx' even after | |
270 | `xxx' has been disabled using `enable -n xxx'. See *Note Bash | |
271 | Builtins::, for details of the `builtin' and `enable' builtin | |
272 | commands. | |
273 | ||
274 | `--enable-dparen-arithmetic' | |
275 | Include support for the `ksh' `((...))' command. | |
276 | ||
cce855bc JA |
277 | `--enable-extended-glob' |
278 | Include support for the extended pattern matching features | |
279 | described above under *Note Pattern Matching::. | |
280 | ||
d166f048 JA |
281 | `--enable-help-builtin' |
282 | Include the `help' builtin, which displays help on shell builtins | |
283 | and variables. | |
284 | ||
285 | `--enable-history' | |
286 | Include command history and the `fc' and `history' builtin | |
287 | commands. | |
288 | ||
289 | `--enable-job-control' | |
290 | This enables job control features, if the OS supports them. | |
ccc6cda3 JA |
291 | |
292 | `--enable-process-substitution' | |
293 | This enables process substitution (*note Process Substitution::.) | |
294 | if the OS provides the necessary support. | |
295 | ||
296 | `--enable-prompt-string-decoding' | |
297 | Turn on the interpretation of a number of backslash-escaped | |
298 | characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt | |
299 | strings. | |
300 | ||
d166f048 JA |
301 | `--enable-readline' |
302 | Include support for command-line editing and history with the Bash | |
303 | version of the Readline library. | |
304 | ||
305 | `--enable-restricted' | |
306 | Include support for a "restricted shell". If this is enabled, | |
307 | Bash, when called as `rbash', enters a restricted mode. See *Note | |
308 | The Restricted Shell::, for a description of restricted mode. | |
309 | ||
ccc6cda3 JA |
310 | `--enable-select' |
311 | Include the `ksh' `select' builtin, which allows the generation of | |
312 | simple menus. | |
313 | ||
ccc6cda3 JA |
314 | `--enable-usg-echo-default' |
315 | Make the `echo' builtin expand backslash-escaped characters by | |
316 | default, without requiring the `-e' option. This makes the Bash | |
317 | `echo' behave more like the System V version. | |
318 | ||
319 | The file `config.h.top' contains C Preprocessor `#define' statements | |
320 | for options which are not settable from `configure'. Some of these are | |
321 | not meant to be changed; beware of the consequences if you do. Read | |
322 | the comments associated with each definition for more information about | |
323 | its effect. |