Debian Codegraph @

INSTALL

raw
1 Basic Installation
2 ==================
3
4 These are installation instructions for Readline.
5
6 The simplest way to compile readline is:
7
8 1. `cd' to the directory containing the readline source code and type
9 `./configure' to configure readline for your system. If you're
10 using `csh' on an old version of System V, you might need to type
11 `sh ./configure' instead to prevent `csh' from trying to execute
12 `configure' itself.
13
14 Running `configure' takes some time. While running, it prints some
15 messages telling which features it is checking for.
16
17 If you want to build readline in a directory other than the source
18 directory, just run `configure' using a full pathname, for instance:
19
20 bash /usr/local/src/readline/readline-8.3/configure
21
22 2. Type `make' to compile readline and build the static readline
23 and history libraries. If supported, this will build the shared
24 readline and history libraries also. See below for instructions on
25 compiling the other parts of the distribution. Typing `make everything'
26 will build the static and shared libraries (if supported) and the
27 example programs.
28
29 3. Type `make install' to install the static readline and history
30 libraries, the readline include files, the documentation, and, if
31 supported, the shared readline and history libraries.
32
33 4. You can remove the created libraries and object files from the
34 build directory by typing `make clean'. To also remove the
35 files that `configure' created (so you can compile readline for
36 a different kind of computer), type `make distclean'. There is
37 also a `make maintainer-clean' target, but that is intended mainly
38 for the readline developers, and should be used with care.
39
40 The `configure' shell script attempts to guess correct values for
41 various system-dependent variables used during compilation. It
42 uses those values to create a `Makefile' in the build directory,
43 and Makefiles in the `doc', `shlib', and `examples'
44 subdirectories. It also creates a `config.h' file containing
45 system-dependent definitions. Finally, it creates a shell script
46 `config.status' that you can run in the future to recreate the
47 current configuration, a file `config.cache' that saves the
48 results of its tests to speed up reconfiguring, and a file
49 `config.log' containing compiler output (useful mainly for
50 debugging `configure').
51
52 To find out more about the options and arguments that the `configure'
53 script understands, type
54
55 bash-4.2$ ./configure --help
56
57 at a shell prompt in your readline source directory.
58
59 If you want to build readline in a directory separate from the source
60 directory - to build for multiple architectures, for example - just use
61 the full path to the configure script. The following commands will
62 build readline in a directory under `/usr/local/build' from the source code
63 in `/usr/local/src/readline/readline-8.3':
64
65 mkdir /usr/local/build/readline-8.3
66 cd /usr/local/build/readline-8.3
67 bash /usr/local/src/readline/readline-8.3/configure
68 make
69
70 See `Compiling For Multiple Architectures' below for more information
71 about building in a directory separate from the source.
72
73 If you need to do unusual things to compile readline, please try
74 to figure out how `configure' could check whether to do them, and
75 mail diffs or instructions to <[email protected]> so they can
76 be considered for the next release. If at some point
77 `config.cache' contains results you don't want to keep, you may
78 remove or edit it.
79
80 The file `configure.in' is used to create `configure' by a
81 program called `autoconf'. You only need `configure.in' if you
82 want to change it or regenerate `configure' using a newer version
83 of `autoconf'. The readline `configure.in' requires autoconf
84 version 2.69 or newer.
85
86 Compilers and Options
87 =====================
88
89 Some systems require unusual options for compilation or linking that
90 the `configure' script does not know about. You can give `configure'
91 initial values for variables by setting them in the environment. Using
92 a Bourne-compatible shell, you can do that on the command line like
93 this:
94
95 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
96
97 Or on systems that have the `env' program, you can do it like this:
98
99 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
100
101 Compiling For Multiple Architectures
102 ====================================
103
104 You can compile readline for more than one kind of computer at the
105 same time, by placing the object files for each architecture in their
106 own directory. To do this, you must use a version of `make' that
107 supports the `VPATH' variable, such as GNU `make'. `cd' to the
108 directory where you want the object files and executables to go and run
109 the `configure' script. `configure' automatically checks for the
110 source code in the directory that `configure' is in and in `..'.
111
112 If you have to use a `make' that does not supports the `VPATH'
113 variable, you have to compile readline for one architecture at a
114 time in the source code directory. After you have installed
115 readline for one architecture, use `make distclean' before
116 reconfiguring for another architecture.
117
118 Installation Names
119 ==================
120
121 By default, `make install' will install the readline libraries in
122 `/usr/local/lib', the include files in `/usr/local/include/readline',
123 the man pages in `/usr/local/man', and the info files in `/usr/local/info'.
124 You can specify an installation prefix other than `/usr/local' by
125 giving `configure' the option `--prefix=PATH' or by supplying a value for
126 the DESTDIR variable when running `make install'.
127
128 You can specify separate installation prefixes for
129 architecture-specific files and architecture-independent files.
130 If you give `configure' the option `--exec-prefix=PATH', the
131 readline Makefiles will use PATH as the prefix for installing the
132 libraries. Documentation and other data files will still use the
133 regular prefix.
134
135 Specifying the System Type
136 ==========================
137
138 There may be some features `configure' can not figure out
139 automatically, but need to determine by the type of host readline
140 will run on. Usually `configure' can figure that out, but if it
141 prints a message saying it can not guess the host type, give it
142 the `--host=TYPE' option. TYPE can either be a short name for
143 the system type, such as `sun4', or a canonical name with three
144 fields: CPU-COMPANY-SYSTEM (e.g., i386-unknown-freebsd4.2).
145
146 See the file `config.sub' for the possible values of each field.
147
148 Sharing Defaults
149 ================
150
151 If you want to set default values for `configure' scripts to share,
152 you can create a site shell script called `config.site' that gives
153 default values for variables like `CC', `cache_file', and `prefix'.
154 `configure' looks for `PREFIX/share/config.site' if it exists, then
155 `PREFIX/etc/config.site' if it exists. Or, you can set the
156 `CONFIG_SITE' environment variable to the location of the site script.
157 A warning: the readline `configure' looks for a site script, but not
158 all `configure' scripts do.
159
160 Operation Controls
161 ==================
162
163 `configure' recognizes the following options to control how it
164 operates.
165
166 `--cache-file=FILE'
167 Use and save the results of the tests in FILE instead of
168 `./config.cache'. Set FILE to `/dev/null' to disable caching, for
169 debugging `configure'.
170
171 `--help'
172 Print a summary of the options to `configure', and exit.
173
174 `--quiet'
175 `--silent'
176 `-q'
177 Do not print messages saying which checks are being made.
178
179 `--srcdir=DIR'
180 Look for the package's source code in directory DIR. Usually
181 `configure' can determine that directory automatically.
182
183 `--version'
184 Print the version of Autoconf used to generate the `configure'
185 script, and exit.
186
187 `configure' also accepts some other, not widely useful, options.
188
189 Optional Features
190 =================
191
192 The readline `configure' recognizes two `--with-PACKAGE' options:
193
194 `--with-curses'
195 This tells readline that it can find the termcap library functions
196 (tgetent, et al.) in the curses library, rather than a separate
197 termcap library. Readline uses the termcap functions, but does not
198 usually link with the termcap or curses library itself, allowing
199 applications which link with readline the to choose an appropriate
200 library. This option tells readline to link the example programs with
201 the curses library rather than libtermcap.
202
203 `--with-shared-termcap-library'
204 This tells the readline build process to link the shared version of
205 libreadline against a shared version of the curses or termcap library
206 (see the description of SHLIB_LIBS below under `Shared Libraries').
207 This relieves the application of having to link with curses or termcap
208 itself, but does not allow the application to choose which library to
209 use. This is only effective on systems that build shared libraries (see
210 below; the default for shared libraries is `yes').
211
212 `configure' also recognizes several `--enable-FEATURE' options:
213
214 `--enable-bracketed-paste-default'
215 Enable bracketed paste by default, so the initial value of the
216 `enable-bracketed-paste' Readline variable is `on'. The default
217 is `yes'.
218
219 `--enable-install-examples'
220 Install the readline example programs as part of `make install'.
221
222 `--enable-multibyte'
223 Build with support for multibyte characters enabled on systems with the
224 necessary framework (locale definitions, C library functions, etc.). The
225 default is `yes'.
226
227 `--enable-shared'
228 Build the shared libraries by default on supported platforms. The
229 default is `yes'.
230
231 `--enable-static'
232 Build the static libraries by default. The default is `yes'.
233
234 Shared Libraries
235 ================
236
237 There is support for building shared versions of the readline and
238 history libraries. The configure script creates a Makefile in
239 the `shlib' subdirectory, and typing `make shared' will cause
240 shared versions of the readline and history libraries to be built
241 on supported platforms.
242
243 If `configure' is given the `--enable-shared' option, it will attempt
244 to build the shared libraries by default on supported platforms. This
245 option is enabled by default.
246
247 Configure calls the script support/shobj-conf to test whether or
248 not shared library creation is supported and to generate the values
249 of variables that are substituted into shlib/Makefile. If you
250 try to build shared libraries on an unsupported platform, `make'
251 will display a message asking you to update support/shobj-conf for
252 your platform.
253
254 If you need to update support/shobj-conf, you will need to create
255 a `stanza' for your operating system and compiler. The script uses
256 the value of host_os and ${CC} as determined by configure. For
257 instance, FreeBSD 4.2 with any version of gcc is identified as
258 `freebsd4.2-gcc*'.
259
260 In the stanza for your operating system-compiler pair, you will need to
261 define several variables. They are:
262
263 SHOBJ_CC The C compiler used to compile source files into shareable
264 object files. This is normally set to the value of ${CC}
265 by configure, and should not need to be changed.
266
267 SHOBJ_CFLAGS Flags to pass to the C compiler ($SHOBJ_CC) to create
268 position-independent code. If you are using gcc, this
269 should probably be set to `-fpic'.
270
271 SHOBJ_LD The link editor to be used to create the shared library from
272 the object files created by $SHOBJ_CC. If you are using
273 gcc, a value of `gcc' will probably work.
274
275 SHOBJ_LDFLAGS Flags to pass to SHOBJ_LD to enable shared object creation.
276 If you are using gcc, `-shared' may be all that is necessary.
277 These should be the flags needed for generic shared object
278 creation.
279
280 SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library
281 creation. Many systems use the -R option to the link
282 editor to embed a path within the library for run-time
283 library searches. A reasonable value for such systems would
284 be `-R$(libdir)'.
285
286 SHLIB_LIBS Any additional libraries that shared libraries should be
287 linked against when they are created.
288
289 SHLIB_LIBPREF The prefix to use when generating the filename of the shared
290 library. The default is `lib'; Cygwin uses `cyg'.
291
292 SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when
293 generating the filename of the shared library. Many systems
294 use `so'; HP-UX uses `sl'.
295
296 SHLIB_LIBVERSION The string to append to the filename to indicate the version
297 of the shared library. It should begin with $(SHLIB_LIBSUFF),
298 and possibly include version information that allows the
299 run-time loader to load the version of the shared library
300 appropriate for a particular program. Systems using shared
301 libraries similar to SunOS 4.x use major and minor library
302 version numbers; for those systems a value of
303 `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate.
304 Systems based on System V Release 4 don't use minor version
305 numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
306 Other Unix versions use different schemes.
307
308 SHLIB_DLLVERSION The version number for shared libraries that determines API
309 compatibility between readline versions and the underlying
310 system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but
311 can be overridden at configuration time by defining DLLVERSION
312 in the environment.
313
314 SHLIB_DOT The character used to separate the name of the shared library
315 from the suffix and version information. The default is `.';
316 systems like Cygwin which don't separate version information
317 from the library name should set this to the empty string.
318
319 SHLIB_STATUS Set this to `supported' when you have defined the other
320 necessary variables. Make uses this to determine whether
321 or not shared library creation should be attempted. If
322 shared libraries are not supported, this will be set to
323 `unsupported'.
324
325 You should look at the existing stanzas in support/shobj-conf for ideas.
326
327 Once you have updated support/shobj-conf, re-run configure and type
328 `make shared' or `make'. The shared libraries will be created in the
329 shlib subdirectory.
330
331 If shared libraries are created, `make install' will install them.
332 You may install only the shared libraries by running `make
333 install-shared' from the top-level build directory. Running `make
334 install' in the shlib subdirectory will also work. If you don't want
335 to install any created shared libraries, run `make install-static'.