126497SacheBasic Installation
226497Sache==================
326497Sache
4165670SacheThese are installation instructions for Readline-5.2.
526497Sache
6119610SacheThe simplest way to compile readline is:
726497Sache
8119610Sache  1. `cd' to the directory containing the readline source code and type
9119610Sache     `./configure' to configure readline for your system.  If you're
1026497Sache     using `csh' on an old version of System V, you might need to type
1126497Sache     `sh ./configure' instead to prevent `csh' from trying to execute
1226497Sache     `configure' itself.
1326497Sache
14119610Sache     Running `configure' takes some time.  While running, it prints some
1526497Sache     messages telling which features it is checking for.
1626497Sache
17119610Sache  2. Type `make' to compile readline and build the static readline
18119610Sache     and history libraries.  If supported, the shared readline and history
19119610Sache     libraries will be built also.  See below for instructions on compiling
20119610Sache     the other parts of the distribution.  Typing `make everything' will
21119610Sache     cause the static and shared libraries (if supported) and the example
22119610Sache     programs to be built.
2326497Sache
24119610Sache  3. Type `make install' to install the static readline and history
25119610Sache     libraries, the readline include files, the documentation, and, if
26119610Sache     supported, the shared readline and history libraries.
2726497Sache
28119610Sache  4. You can remove the created libraries and object files from the
29119610Sache     build directory by typing `make clean'.  To also remove the
30119610Sache     files that `configure' created (so you can compile readline for
3126497Sache     a different kind of computer), type `make distclean'.  There is
3226497Sache     also a `make maintainer-clean' target, but that is intended mainly
33119610Sache     for the readline developers, and should be used with care.
3426497Sache
35119610SacheThe `configure' shell script attempts to guess correct values for
36119610Sachevarious system-dependent variables used during compilation.  It
37119610Sacheuses those values to create a `Makefile' in the build directory,
38119610Sacheand Makefiles in the `doc', `shlib', and `examples'
39119610Sachesubdirectories.  It also creates a `config.h' file containing
40119610Sachesystem-dependent definitions.  Finally, it creates a shell script
41119610Sache`config.status' that you can run in the future to recreate the
42119610Sachecurrent configuration, a file `config.cache' that saves the
43119610Sacheresults of its tests to speed up reconfiguring, and a file
44119610Sache`config.log' containing compiler output (useful mainly for
45119610Sachedebugging `configure'). 
46119610Sache
47119610SacheIf you need to do unusual things to compile readline, please try
48119610Sacheto figure out how `configure' could check whether to do them, and
49119610Sachemail diffs or instructions to <bug-readline@gnu.org> so they can
50119610Sachebe considered for the next release.  If at some point
51119610Sache`config.cache' contains results you don't want to keep, you may
52119610Sacheremove or edit it. 
53119610Sache
54119610SacheThe file `configure.in' is used to create `configure' by a
55119610Sacheprogram called `autoconf'.  You only need `configure.in' if you
56119610Sachewant to change it or regenerate `configure' using a newer version
57119610Sacheof `autoconf'.  The readline `configure.in' requires autoconf
58119610Sacheversion 2.50 or newer. 
59119610Sache
6026497SacheCompilers and Options
6126497Sache=====================
6226497Sache
63119610SacheSome systems require unusual options for compilation or linking that
6426497Sachethe `configure' script does not know about.  You can give `configure'
6526497Sacheinitial values for variables by setting them in the environment.  Using
6626497Sachea Bourne-compatible shell, you can do that on the command line like
6726497Sachethis:
68119610Sache
6926497Sache     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
7026497Sache
7126497SacheOr on systems that have the `env' program, you can do it like this:
72119610Sache
7326497Sache     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
7426497Sache
7526497SacheCompiling For Multiple Architectures
7626497Sache====================================
7726497Sache
78119610SacheYou can compile readline for more than one kind of computer at the
7926497Sachesame time, by placing the object files for each architecture in their
8026497Sacheown directory.  To do this, you must use a version of `make' that
8126497Sachesupports the `VPATH' variable, such as GNU `make'.  `cd' to the
8226497Sachedirectory where you want the object files and executables to go and run
8326497Sachethe `configure' script.  `configure' automatically checks for the
8426497Sachesource code in the directory that `configure' is in and in `..'.
8526497Sache
86119610SacheIf you have to use a `make' that does not supports the `VPATH'
87119610Sachevariable, you have to compile readline for one architecture at a
88119610Sachetime in the source code directory.  After you have installed
89119610Sachereadline for one architecture, use `make distclean' before
90119610Sachereconfiguring for another architecture. 
9126497Sache
9226497SacheInstallation Names
9326497Sache==================
9426497Sache
95119610SacheBy default, `make install' will install the readline libraries in
96119610Sache`/usr/local/lib', the include files in
97119610Sache`/usr/local/include/readline', the man pages in `/usr/local/man',
98119610Sacheand the info files in `/usr/local/info'.  You can specify an
99119610Sacheinstallation prefix other than `/usr/local' by giving `configure'
100119610Sachethe option `--prefix=PATH' or by supplying a value for the
101119610SacheDESTDIR variable when running `make install'. 
10226497Sache
103119610SacheYou can specify separate installation prefixes for
104119610Sachearchitecture-specific files and architecture-independent files. 
105119610SacheIf you give `configure' the option `--exec-prefix=PATH', the
106119610Sachereadline Makefiles will use PATH as the prefix for installing the
107119610Sachelibraries.  Documentation and other data files will still use the
108119610Sacheregular prefix. 
10926497Sache
11026497SacheSpecifying the System Type
11126497Sache==========================
11226497Sache
113119610SacheThere may be some features `configure' can not figure out
114119610Sacheautomatically, but need to determine by the type of host readline
115119610Sachewill run on.  Usually `configure' can figure that out, but if it
116119610Sacheprints a message saying it can not guess the host type, give it
117119610Sachethe `--host=TYPE' option.  TYPE can either be a short name for
118119610Sachethe system type, such as `sun4', or a canonical name with three
119119610Sachefields: CPU-COMPANY-SYSTEM (e.g., i386-unknown-freebsd4.2). 
12026497Sache
121119610SacheSee the file `config.sub' for the possible values of each field.
12226497Sache
12326497SacheSharing Defaults
12426497Sache================
12526497Sache
126119610SacheIf you want to set default values for `configure' scripts to share,
12726497Sacheyou can create a site shell script called `config.site' that gives
12826497Sachedefault values for variables like `CC', `cache_file', and `prefix'.
12926497Sache`configure' looks for `PREFIX/share/config.site' if it exists, then
13026497Sache`PREFIX/etc/config.site' if it exists.  Or, you can set the
13126497Sache`CONFIG_SITE' environment variable to the location of the site script.
132119610SacheA warning: the readline `configure' looks for a site script, but not
133119610Sacheall `configure' scripts do.
13426497Sache
13526497SacheOperation Controls
13626497Sache==================
13726497Sache
138119610Sache`configure' recognizes the following options to control how it
13926497Sacheoperates.
14026497Sache
14126497Sache`--cache-file=FILE'
14226497Sache     Use and save the results of the tests in FILE instead of
14326497Sache     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
14426497Sache     debugging `configure'.
14526497Sache
14626497Sache`--help'
14726497Sache     Print a summary of the options to `configure', and exit.
14826497Sache
14926497Sache`--quiet'
15026497Sache`--silent'
15126497Sache`-q'
15226497Sache     Do not print messages saying which checks are being made.
15326497Sache
15426497Sache`--srcdir=DIR'
15526497Sache     Look for the package's source code in directory DIR.  Usually
15626497Sache     `configure' can determine that directory automatically.
15726497Sache
15826497Sache`--version'
15926497Sache     Print the version of Autoconf used to generate the `configure'
16026497Sache     script, and exit.
16126497Sache
16226497Sache`configure' also accepts some other, not widely useful, options.
16326497Sache
164119610SacheOptional Features
165119610Sache=================
166119610Sache
167119610SacheThe readline `configure' recognizes a single `--with-PACKAGE' option:
168119610Sache
169119610Sache`--with-curses'
170119610Sache    This tells readline that it can find the termcap library functions
171119610Sache    (tgetent, et al.) in the curses library, rather than a separate
172119610Sache    termcap library.  Readline uses the termcap functions, but does not
173119610Sache    link with the termcap or curses library itself, allowing applications
174119610Sache    which link with readline the to choose an appropriate library.
175119610Sache    This option tells readline to link the example programs with the
176119610Sache    curses library rather than libtermcap.
177119610Sache
178119610Sache`configure' also recognizes two `--enable-FEATURE' options:
179119610Sache
180119610Sache`--enable-shared'
181119610Sache    Build the shared libraries by default on supported platforms.  The
182119610Sache    default is `yes'.
183119610Sache
184119610Sache`--enable-static'
185119610Sache    Build the static libraries by default.  The default is `yes'.
186119610Sache 
187119610SacheShared Libraries
188119610Sache================
189119610Sache
190119610SacheThere is support for building shared versions of the readline and
191119610Sachehistory libraries.  The configure script creates a Makefile in
192119610Sachethe `shlib' subdirectory, and typing `make shared' will cause
193119610Sacheshared versions of the readline and history libraries to be built
194119610Sacheon supported platforms.
195119610Sache
196119610SacheIf `configure' is given the `--enable-shared' option, it will attempt
197119610Sacheto build the shared libraries by default on supported platforms.
198119610Sache
199119610SacheConfigure calls the script support/shobj-conf to test whether or
200119610Sachenot shared library creation is supported and to generate the values
201119610Sacheof variables that are substituted into shlib/Makefile.  If you
202119610Sachetry to build shared libraries on an unsupported platform, `make'
203119610Sachewill display a message asking you to update support/shobj-conf for
204119610Sacheyour platform.
205119610Sache
206119610SacheIf you need to update support/shobj-conf, you will need to create
207119610Sachea `stanza' for your operating system and compiler.  The script uses
208119610Sachethe value of host_os and ${CC} as determined by configure.  For
209119610Sacheinstance, FreeBSD 4.2 with any version of gcc is identified as
210119610Sache`freebsd4.2-gcc*'.
211119610Sache
212119610SacheIn the stanza for your operating system-compiler pair, you will need to
213119610Sachedefine several variables.  They are:
214119610Sache
215119610SacheSHOBJ_CC	The C compiler used to compile source files into shareable
216119610Sache		object files.  This is normally set to the value of ${CC}
217119610Sache		by configure, and should not need to be changed.
218119610Sache
219119610SacheSHOBJ_CFLAGS	Flags to pass to the C compiler ($SHOBJ_CC) to create
220119610Sache		position-independent code.  If you are using gcc, this
221119610Sache		should probably be set to `-fpic'.
222119610Sache
223119610SacheSHOBJ_LD	The link editor to be used to create the shared library from
224119610Sache		the object files created by $SHOBJ_CC.  If you are using
225119610Sache		gcc, a value of `gcc' will probably work.
226119610Sache
227119610SacheSHOBJ_LDFLAGS	Flags to pass to SHOBJ_LD to enable shared object creation.
228119610Sache		If you are using gcc, `-shared' may be all that is necessary.
229119610Sache		These should be the flags needed for generic shared object
230119610Sache		creation.
231119610Sache
232119610SacheSHLIB_XLDFLAGS	Additional flags to pass to SHOBJ_LD for shared library
233119610Sache		creation.  Many systems use the -R option to the link
234119610Sache		editor to embed a path within the library for run-time
235119610Sache		library searches.  A reasonable value for such systems would
236119610Sache		be `-R$(libdir)'.
237119610Sache
238119610SacheSHLIB_LIBS	Any additional libraries that shared libraries should be
239119610Sache		linked against when they are created.
240119610Sache
241157184SacheSHLIB_LIBPREF	The prefix to use when generating the filename of the shared
242157184Sache		library.  The default is `lib'; Cygwin uses `cyg'.
243157184Sache
244119610SacheSHLIB_LIBSUFF	The suffix to add to `libreadline' and `libhistory' when
245119610Sache		generating the filename of the shared library.  Many systems
246119610Sache		use `so'; HP-UX uses `sl'.
247119610Sache
248119610SacheSHLIB_LIBVERSION The string to append to the filename to indicate the version
249119610Sache		of the shared library.  It should begin with $(SHLIB_LIBSUFF),
250119610Sache		and possibly include version information that allows the
251119610Sache		run-time loader to load the version of the shared library
252119610Sache		appropriate for a particular program.  Systems using shared
253119610Sache		libraries similar to SunOS 4.x use major and minor library
254119610Sache		version numbers; for those systems a value of
255119610Sache		`$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate.
256119610Sache		Systems based on System V Release 4 don't use minor version
257119610Sache		numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
258119610Sache		Other Unix versions use different schemes.
259119610Sache
260157184SacheSHLIB_DLLVERSION The version number for shared libraries that determines API
261157184Sache		compatibility between readline versions and the underlying
262157184Sache		system.  Used only on Cygwin.  Defaults to $SHLIB_MAJOR, but
263157184Sache		can be overridden at configuration time by defining DLLVERSION
264157184Sache		in the environment.
265157184Sache
266157184SacheSHLIB_DOT	The character used to separate the name of the shared library
267157184Sache		from the suffix and version information.  The default is `.';
268157184Sache		systems like Cygwin which don't separate version information
269157184Sache		from the library name should set this to the empty string.
270157184Sache
271119610SacheSHLIB_STATUS	Set this to `supported' when you have defined the other
272119610Sache		necessary variables.  Make uses this to determine whether
273119610Sache		or not shared library creation should be attempted.  If
274119610Sache		shared libraries are not supported, this will be set to
275119610Sache		`unsupported'.
276119610Sache
277119610SacheYou should look at the existing stanzas in support/shobj-conf for ideas.
278119610Sache
279119610SacheOnce you have updated support/shobj-conf, re-run configure and type
280119610Sache`make shared' or `make'.  The shared libraries will be created in the
281119610Sacheshlib subdirectory.
282119610Sache
283119610SacheIf shared libraries are created, `make install' will install them. 
284119610SacheYou may install only the shared libraries by running `make
285119610Sacheinstall-shared' from the top-level build directory.  Running `make
286119610Sacheinstall' in the shlib subdirectory will also work.  If you don't want
287119610Sacheto install any created shared libraries, run `make install-static'. 
288