8df72165e26d46cbc81d22d3c81de007adfe6e3a
[platform/upstream/bash.git] / INSTALL
1 Basic Installation
2 ==================
3
4 These are installation instructions for Bash.
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
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
32 the Bash distribution, for example `2.01'.  `_patchlevel' should
33 contain the patch level of the Bash distribution, `0' for example.  The
34 script `support/mkconffiles' has been provided to automate the creation
35 of these files.
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
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.
197
198 `--with-glibc-malloc'
199      Use the GNU libc version of `malloc' in `lib/malloc/gmalloc.c'.
200      This is somewhat slower than the default `malloc', but wastes
201      considerably less space.
202
203 `--with-gnu-malloc'
204      Use the GNU version of `malloc' in `lib/malloc/malloc.c'.  This is
205      not the same `malloc' that appears in GNU libc, but an older
206      version derived from the 4.2 BSD `malloc'.  This `malloc' is very
207      fast, but wastes a lot of space.  This option is enabled by
208      default.  The `NOTES' file contains a list of systems for which
209      this should be turned off, and `configure' disables this option
210      automatically for a number of systems.
211
212 `--with-purify'
213      Define this to use the Purify memory allocation checker from Pure
214      Software.
215
216 `--enable-minimal-config'
217      This produces a shell with minimal features, close to the
218      historical Bourne shell.
219
220 The `minimal-config' option can be used to disable all of the following
221 options, but it is processed first, so individual options may be
222 enabled using `enable-FEATURE'.
223
224 All of the following options except for `disabled-builtins' and
225 `usg-echo-default' are enabled by default, unless the operating system
226 does not provide the necessary support.
227
228 `--enable-alias'
229      Allow alias expansion and include the `alias' and `unalias'
230      builtins.
231
232 `--enable-array-variables'
233      Include support for one-dimensional array shell variables.
234
235 `--enable-bang-history'
236      Include support for `csh'-like history substitution.
237
238 `--enable-brace-expansion'
239      Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ).
240
241 `--enable-command-timing'
242      Include support for recognizing `time' as a reserved word and for
243      displaying timing statistics for the pipeline following `time'.
244      This allows pipelines as well as shell builtins and functions to
245      be timed.
246
247 `--enable-directory-stack'
248      Include support for a `csh'-like directory stack and the `pushd',
249      `popd', and `dirs' builtins.
250
251 `--enable-disabled-builtins'
252      Allow builtin commands to be invoked via `builtin xxx' even after
253      `xxx' has been disabled using `enable -n xxx'.  See *Note Bash
254      Builtins::, for details of the `builtin' and `enable' builtin
255      commands.
256
257 `--enable-dparen-arithmetic'
258      Include support for the `ksh' `((...))' command.
259
260 `--enable-help-builtin'
261      Include the `help' builtin, which displays help on shell builtins
262      and variables.
263
264 `--enable-history'
265      Include command history and the `fc' and `history' builtin
266      commands.
267
268 `--enable-job-control'
269      This enables job control features, if the OS supports them.
270
271 `--enable-process-substitution'
272      This enables process substitution (*note Process Substitution::.)
273      if the OS provides the necessary support.
274
275 `--enable-prompt-string-decoding'
276      Turn on the interpretation of a number of backslash-escaped
277      characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt
278      strings.
279
280 `--enable-readline'
281      Include support for command-line editing and history with the Bash
282      version of the Readline library.
283
284 `--enable-restricted'
285      Include support for a "restricted shell".  If this is enabled,
286      Bash, when called as `rbash', enters a restricted mode.  See *Note
287      The Restricted Shell::, for a description of restricted mode.
288
289 `--enable-select'
290      Include the `ksh' `select' builtin, which allows the generation of
291      simple menus.
292
293 `--enable-usg-echo-default'
294      Make the `echo' builtin expand backslash-escaped characters by
295      default, without requiring the `-e' option.  This makes the Bash
296      `echo' behave more like the System V version.
297
298 The file `config.h.top' contains C Preprocessor `#define' statements
299 for options which are not settable from `configure'.  Some of these are
300 not meant to be changed; beware of the consequences if you do.  Read
301 the comments associated with each definition for more information about
302 its effect.