source: trunk/third/readline/INSTALL @ 17010

Revision 17010, 10.7 KB checked in by ghudson, 23 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r17009, which included commits to RCS files with non-trunk default branches.
Line 
1Basic Installation
2==================
3
4These are installation instructions for Readline 4.2a.
5
6The 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  2. Type `make' to compile readline and build the static libreadline
18     and libhistory libraries.  See below for instructions on compiling
19     the other parts of the distribution.  Typing `make everything' will
20     cause the static and shared libraries (if supported) and the example
21     programs to be built.
22
23  3. Type `make install' to install the static libreadline and libhistory
24     libraries, the readline include files, and the documentation.
25
26  4. You can remove the created libraries and object files from the
27     build directory by typing `make clean'.  To also remove the
28     files that `configure' created (so you can compile readline for
29     a different kind of computer), type `make distclean'.  There is
30     also a `make maintainer-clean' target, but that is intended mainly
31     for the readline developers, and should be used with care.
32
33The `configure' shell script attempts to guess correct values for
34various system-dependent variables used during compilation.  It
35uses those values to create a `Makefile' in the build directory,
36and Makefiles in the `doc', `shlib', and `examples'
37subdirectories.  It also creates a `config.h' file containing
38system-dependent definitions.  Finally, it creates a shell script
39`config.status' that you can run in the future to recreate the
40current configuration, a file `config.cache' that saves the
41results of its tests to speed up reconfiguring, and a file
42`config.log' containing compiler output (useful mainly for
43debugging `configure').
44
45If you need to do unusual things to compile readline, please try
46to figure out how `configure' could check whether to do them, and
47mail diffs or instructions to <bug-readline@gnu.org> so they can
48be considered for the next release.  If at some point
49`config.cache' contains results you don't want to keep, you may
50remove or edit it.
51
52The file `configure.in' is used to create `configure' by a
53program called `autoconf'.  You only need `configure.in' if you
54want to change it or regenerate `configure' using a newer version
55of `autoconf'.
56
57Compilers and Options
58=====================
59
60Some systems require unusual options for compilation or linking that
61the `configure' script does not know about.  You can give `configure'
62initial values for variables by setting them in the environment.  Using
63a Bourne-compatible shell, you can do that on the command line like
64this:
65
66     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
67
68Or on systems that have the `env' program, you can do it like this:
69
70     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
71
72Compiling For Multiple Architectures
73====================================
74
75You can compile readline for more than one kind of computer at the
76same time, by placing the object files for each architecture in their
77own directory.  To do this, you must use a version of `make' that
78supports the `VPATH' variable, such as GNU `make'.  `cd' to the
79directory where you want the object files and executables to go and run
80the `configure' script.  `configure' automatically checks for the
81source code in the directory that `configure' is in and in `..'.
82
83If you have to use a `make' that does not supports the `VPATH'
84variable, you have to compile readline for one architecture at a
85time in the source code directory.  After you have installed
86readline for one architecture, use `make distclean' before
87reconfiguring for another architecture.
88
89Installation Names
90==================
91
92By default, `make install' will install the readline libraries in
93`/usr/local/lib', the include files in
94`/usr/local/include/readline', the man pages in `/usr/local/man',
95and the info files in `/usr/local/info'.  You can specify an
96installation prefix other than `/usr/local' by giving `configure'
97the option `--prefix=PATH' or by supplying a value for the
98DESTDIR variable when running `make install'.
99
100You can specify separate installation prefixes for
101architecture-specific files and architecture-independent files.
102If you give `configure' the option `--exec-prefix=PATH', the
103readline Makefiles will use PATH as the prefix for installing the
104libraries.  Documentation and other data files will still use the
105regular prefix.
106
107Specifying the System Type
108==========================
109
110There may be some features `configure' can not figure out
111automatically, but need to determine by the type of host readline
112will run on.  Usually `configure' can figure that out, but if it
113prints a message saying it can not guess the host type, give it
114the `--host=TYPE' option.  TYPE can either be a short name for
115the system type, such as `sun4', or a canonical name with three
116fields: CPU-COMPANY-SYSTEM (e.g., i386-unknown-freebsd4.2).
117
118See the file `config.sub' for the possible values of each field.
119
120Sharing Defaults
121================
122
123If you want to set default values for `configure' scripts to share,
124you can create a site shell script called `config.site' that gives
125default values for variables like `CC', `cache_file', and `prefix'.
126`configure' looks for `PREFIX/share/config.site' if it exists, then
127`PREFIX/etc/config.site' if it exists.  Or, you can set the
128`CONFIG_SITE' environment variable to the location of the site script.
129A warning: the readline `configure' looks for a site script, but not
130all `configure' scripts do.
131
132Operation Controls
133==================
134
135`configure' recognizes the following options to control how it
136operates.
137
138`--cache-file=FILE'
139     Use and save the results of the tests in FILE instead of
140     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
141     debugging `configure'.
142
143`--help'
144     Print a summary of the options to `configure', and exit.
145
146`--quiet'
147`--silent'
148`-q'
149     Do not print messages saying which checks are being made.
150
151`--srcdir=DIR'
152     Look for the package's source code in directory DIR.  Usually
153     `configure' can determine that directory automatically.
154
155`--version'
156     Print the version of Autoconf used to generate the `configure'
157     script, and exit.
158
159`configure' also accepts some other, not widely useful, options.
160
161Optional Features
162=================
163
164The readline `configure' takes a single `--with-PACKAGE' option:
165
166`--with-curses'
167    This tells readline that it can find the termcap library functions
168    (tgetent, et al.) in the curses library, rather than a separate
169    termcap library.  Readline uses the termcap functions, but does not
170    link with the termcap or curses library itself, allowing applications
171    which link with readline the to choose an appropriate library.
172    This option tells readline to link the example programs with the
173    curses library rather than libtermcap.
174 
175Shared Libraries
176================
177
178There is support for building shared versions of the readline and
179history libraries.  The configure script creates a Makefile in
180the `shlib' subdirectory, and typing `make shared' will cause
181shared versions of the readline and history libraries to be built
182on supported platforms.  `make everything' will run `make shared'
183after building the static libraries.
184
185Configure calls the script support/shobj-conf to test whether or
186not shared library creation is supported and to generate the values
187of variables that are substituted into shlib/Makefile.  If you
188try to build shared libraries on an unsupported platform, `make'
189will display a message asking you to update support/shobj-conf for
190your platform.
191
192If you need to update support/shobj-conf, you will need to create
193a `stanza' for your operating system and compiler.  The script uses
194the value of host_os and ${CC} as determined by configure.  For
195instance, FreeBSD 4.2 with any version of gcc is identified as
196`freebsd4.2-gcc*'.
197
198In the stanza for your operating system-compiler pair, you will need to
199define several variables.  They are:
200
201SHOBJ_CC        The C compiler used to compile source files into shareable
202                object files.  This is normally set to the value of ${CC}
203                by configure, and should not need to be changed.
204
205SHOBJ_CFLAGS    Flags to pass to the C compiler ($SHOBJ_CC) to create
206                position-independent code.  If you are using gcc, this
207                should probably be set to `-fpic'.
208
209SHOBJ_LD        The link editor to be used to create the shared library from
210                the object files created by $SHOBJ_CC.  If you are using
211                gcc, a value of `gcc' will probably work.
212
213SHOBJ_LDFLAGS   Flags to pass to SHOBJ_LD to enable shared object creation.
214                If you are using gcc, `-shared' may be all that is necessary.
215                These should be the flags needed for generic shared object
216                creation.
217
218SHLIB_XLDFLAGS  Additional flags to pass to SHOBJ_LD for shared library
219                creation.  Many systems use the -R option to the link
220                editor to embed a path within the library for run-time
221                library searches.  A reasonable value for such systems would
222                be `-R$(libdir)'.
223
224SHLIB_LIBS      Any additional libraries that shared libraries should be
225                linked against when they are created.
226
227SHLIB_LIBSUFF   The suffix to add to `libreadline' and `libhistory' when
228                generating the filename of the shared library.  Many systems
229                use `so'; HP-UX uses `sl'.
230
231SHLIB_LIBVERSION The string to append to the filename to indicate the version
232                of the shared library.  It should begin with $(SHLIB_LIBSUFF),
233                and possibly include version information that allows the
234                run-time loader to load the version of the shared library
235                appropriate for a particular program.  Systems using shared
236                libraries similar to SunOS 4.x use major and minor library
237                version numbers; for those systems a value of
238                `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate.
239                Systems based on System V Release 4 don't use minor version
240                numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
241                Other Unix versions use different schemes.
242
243SHLIB_STATUS    Set this to `supported' when you have defined the other
244                necessary variables.  Make uses this to determine whether
245                or not shared library creation should be attempted.
246
247You should look at the existing stanzas in support/shobj-conf for ideas.
248
249Once you have updated support/shobj-conf, re-run configure and type
250`make shared'.  The shared libraries will be created in the shlib
251subdirectory.
252
253Since shared libraries are not created on all platforms, `make install'
254will not automatically install the shared libraries.  To install them,
255change the current directory to shlib and type `make install'.  Running
256`make install-shared' from the top-level build directory will also work.
Note: See TracBrowser for help on using the repository browser.