jpayne@68: Basic Installation jpayne@68: ================== jpayne@68: jpayne@68: These are installation instructions for Readline-8.2. jpayne@68: jpayne@68: The simplest way to compile readline is: jpayne@68: jpayne@68: 1. `cd' to the directory containing the readline source code and type jpayne@68: `./configure' to configure readline for your system. If you're jpayne@68: using `csh' on an old version of System V, you might need to type jpayne@68: `sh ./configure' instead to prevent `csh' from trying to execute jpayne@68: `configure' itself. jpayne@68: jpayne@68: Running `configure' takes some time. While running, it prints some jpayne@68: messages telling which features it is checking for. jpayne@68: jpayne@68: 2. Type `make' to compile readline and build the static readline jpayne@68: and history libraries. If supported, the shared readline and history jpayne@68: libraries will be built also. See below for instructions on compiling jpayne@68: the other parts of the distribution. Typing `make everything' will jpayne@68: cause the static and shared libraries (if supported) and the example jpayne@68: programs to be built. jpayne@68: jpayne@68: 3. Type `make install' to install the static readline and history jpayne@68: libraries, the readline include files, the documentation, and, if jpayne@68: supported, the shared readline and history libraries. jpayne@68: jpayne@68: 4. You can remove the created libraries and object files from the jpayne@68: build directory by typing `make clean'. To also remove the jpayne@68: files that `configure' created (so you can compile readline for jpayne@68: a different kind of computer), type `make distclean'. There is jpayne@68: also a `make maintainer-clean' target, but that is intended mainly jpayne@68: for the readline developers, and should be used with care. jpayne@68: jpayne@68: The `configure' shell script attempts to guess correct values for jpayne@68: various system-dependent variables used during compilation. It jpayne@68: uses those values to create a `Makefile' in the build directory, jpayne@68: and Makefiles in the `doc', `shlib', and `examples' jpayne@68: subdirectories. It also creates a `config.h' file containing jpayne@68: system-dependent definitions. Finally, it creates a shell script jpayne@68: `config.status' that you can run in the future to recreate the jpayne@68: current configuration, a file `config.cache' that saves the jpayne@68: results of its tests to speed up reconfiguring, and a file jpayne@68: `config.log' containing compiler output (useful mainly for jpayne@68: debugging `configure'). jpayne@68: jpayne@68: If you need to do unusual things to compile readline, please try jpayne@68: to figure out how `configure' could check whether to do them, and jpayne@68: mail diffs or instructions to so they can jpayne@68: be considered for the next release. If at some point jpayne@68: `config.cache' contains results you don't want to keep, you may jpayne@68: remove or edit it. jpayne@68: jpayne@68: The file `configure.in' is used to create `configure' by a jpayne@68: program called `autoconf'. You only need `configure.in' if you jpayne@68: want to change it or regenerate `configure' using a newer version jpayne@68: of `autoconf'. The readline `configure.in' requires autoconf jpayne@68: version 2.69 or newer. jpayne@68: jpayne@68: Compilers and Options jpayne@68: ===================== jpayne@68: jpayne@68: Some systems require unusual options for compilation or linking that jpayne@68: the `configure' script does not know about. You can give `configure' jpayne@68: initial values for variables by setting them in the environment. Using jpayne@68: a Bourne-compatible shell, you can do that on the command line like jpayne@68: this: jpayne@68: jpayne@68: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure jpayne@68: jpayne@68: Or on systems that have the `env' program, you can do it like this: jpayne@68: jpayne@68: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure jpayne@68: jpayne@68: Compiling For Multiple Architectures jpayne@68: ==================================== jpayne@68: jpayne@68: You can compile readline for more than one kind of computer at the jpayne@68: same time, by placing the object files for each architecture in their jpayne@68: own directory. To do this, you must use a version of `make' that jpayne@68: supports the `VPATH' variable, such as GNU `make'. `cd' to the jpayne@68: directory where you want the object files and executables to go and run jpayne@68: the `configure' script. `configure' automatically checks for the jpayne@68: source code in the directory that `configure' is in and in `..'. jpayne@68: jpayne@68: If you have to use a `make' that does not supports the `VPATH' jpayne@68: variable, you have to compile readline for one architecture at a jpayne@68: time in the source code directory. After you have installed jpayne@68: readline for one architecture, use `make distclean' before jpayne@68: reconfiguring for another architecture. jpayne@68: jpayne@68: Installation Names jpayne@68: ================== jpayne@68: jpayne@68: By default, `make install' will install the readline libraries in jpayne@68: `/usr/local/lib', the include files in jpayne@68: `/usr/local/include/readline', the man pages in `/usr/local/man', jpayne@68: and the info files in `/usr/local/info'. You can specify an jpayne@68: installation prefix other than `/usr/local' by giving `configure' jpayne@68: the option `--prefix=PATH' or by supplying a value for the jpayne@68: DESTDIR variable when running `make install'. jpayne@68: jpayne@68: You can specify separate installation prefixes for jpayne@68: architecture-specific files and architecture-independent files. jpayne@68: If you give `configure' the option `--exec-prefix=PATH', the jpayne@68: readline Makefiles will use PATH as the prefix for installing the jpayne@68: libraries. Documentation and other data files will still use the jpayne@68: regular prefix. jpayne@68: jpayne@68: Specifying the System Type jpayne@68: ========================== jpayne@68: jpayne@68: There may be some features `configure' can not figure out jpayne@68: automatically, but need to determine by the type of host readline jpayne@68: will run on. Usually `configure' can figure that out, but if it jpayne@68: prints a message saying it can not guess the host type, give it jpayne@68: the `--host=TYPE' option. TYPE can either be a short name for jpayne@68: the system type, such as `sun4', or a canonical name with three jpayne@68: fields: CPU-COMPANY-SYSTEM (e.g., i386-unknown-freebsd4.2). jpayne@68: jpayne@68: See the file `config.sub' for the possible values of each field. jpayne@68: jpayne@68: Sharing Defaults jpayne@68: ================ jpayne@68: jpayne@68: If you want to set default values for `configure' scripts to share, jpayne@68: you can create a site shell script called `config.site' that gives jpayne@68: default values for variables like `CC', `cache_file', and `prefix'. jpayne@68: `configure' looks for `PREFIX/share/config.site' if it exists, then jpayne@68: `PREFIX/etc/config.site' if it exists. Or, you can set the jpayne@68: `CONFIG_SITE' environment variable to the location of the site script. jpayne@68: A warning: the readline `configure' looks for a site script, but not jpayne@68: all `configure' scripts do. jpayne@68: jpayne@68: Operation Controls jpayne@68: ================== jpayne@68: jpayne@68: `configure' recognizes the following options to control how it jpayne@68: operates. jpayne@68: jpayne@68: `--cache-file=FILE' jpayne@68: Use and save the results of the tests in FILE instead of jpayne@68: `./config.cache'. Set FILE to `/dev/null' to disable caching, for jpayne@68: debugging `configure'. jpayne@68: jpayne@68: `--help' jpayne@68: Print a summary of the options to `configure', and exit. jpayne@68: jpayne@68: `--quiet' jpayne@68: `--silent' jpayne@68: `-q' jpayne@68: Do not print messages saying which checks are being made. jpayne@68: jpayne@68: `--srcdir=DIR' jpayne@68: Look for the package's source code in directory DIR. Usually jpayne@68: `configure' can determine that directory automatically. jpayne@68: jpayne@68: `--version' jpayne@68: Print the version of Autoconf used to generate the `configure' jpayne@68: script, and exit. jpayne@68: jpayne@68: `configure' also accepts some other, not widely useful, options. jpayne@68: jpayne@68: Optional Features jpayne@68: ================= jpayne@68: jpayne@68: The readline `configure' recognizes two `--with-PACKAGE' options: jpayne@68: jpayne@68: `--with-curses' jpayne@68: This tells readline that it can find the termcap library functions jpayne@68: (tgetent, et al.) in the curses library, rather than a separate jpayne@68: termcap library. Readline uses the termcap functions, but does not jpayne@68: usually link with the termcap or curses library itself, allowing jpayne@68: applications which link with readline the to choose an appropriate jpayne@68: library. This option tells readline to link the example programs with jpayne@68: the curses library rather than libtermcap. jpayne@68: jpayne@68: `--with-shared-termcap-library' jpayne@68: This tells the readline build process to link the shared version of jpayne@68: libreadline against a shared version of the curses or termcap library jpayne@68: (see the description of SHLIB_LIBS below under `Shared Libraries'). jpayne@68: This relieves the application of having to link with curses or termcap jpayne@68: itself, but does not allow the application to choose which library to jpayne@68: use. This is only effective on systems that build shared libraries (see jpayne@68: below; the default for shared libraries is `yes'). jpayne@68: jpayne@68: `configure' also recognizes several `--enable-FEATURE' options: jpayne@68: jpayne@68: `--enable-bracketed-paste-default' jpayne@68: Enable bracketed paste by default, so the initial value of the jpayne@68: `enable-bracketed-paste' Readline variable is `on'. The default jpayne@68: is `yes'. jpayne@68: jpayne@68: `--enable-install-examples' jpayne@68: Install the readline example programs as part of `make install'. jpayne@68: jpayne@68: `--enable-multibyte' jpayne@68: Build with support for multibyte characters enabled on systems with the jpayne@68: necessary framework (locale definitions, C library functions, etc.). The jpayne@68: default is `yes'. jpayne@68: jpayne@68: `--enable-shared' jpayne@68: Build the shared libraries by default on supported platforms. The jpayne@68: default is `yes'. jpayne@68: jpayne@68: `--enable-static' jpayne@68: Build the static libraries by default. The default is `yes'. jpayne@68: jpayne@68: Shared Libraries jpayne@68: ================ jpayne@68: jpayne@68: There is support for building shared versions of the readline and jpayne@68: history libraries. The configure script creates a Makefile in jpayne@68: the `shlib' subdirectory, and typing `make shared' will cause jpayne@68: shared versions of the readline and history libraries to be built jpayne@68: on supported platforms. jpayne@68: jpayne@68: If `configure' is given the `--enable-shared' option, it will attempt jpayne@68: to build the shared libraries by default on supported platforms. This jpayne@68: option is enabled by default. jpayne@68: jpayne@68: Configure calls the script support/shobj-conf to test whether or jpayne@68: not shared library creation is supported and to generate the values jpayne@68: of variables that are substituted into shlib/Makefile. If you jpayne@68: try to build shared libraries on an unsupported platform, `make' jpayne@68: will display a message asking you to update support/shobj-conf for jpayne@68: your platform. jpayne@68: jpayne@68: If you need to update support/shobj-conf, you will need to create jpayne@68: a `stanza' for your operating system and compiler. The script uses jpayne@68: the value of host_os and ${CC} as determined by configure. For jpayne@68: instance, FreeBSD 4.2 with any version of gcc is identified as jpayne@68: `freebsd4.2-gcc*'. jpayne@68: jpayne@68: In the stanza for your operating system-compiler pair, you will need to jpayne@68: define several variables. They are: jpayne@68: jpayne@68: SHOBJ_CC The C compiler used to compile source files into shareable jpayne@68: object files. This is normally set to the value of ${CC} jpayne@68: by configure, and should not need to be changed. jpayne@68: jpayne@68: SHOBJ_CFLAGS Flags to pass to the C compiler ($SHOBJ_CC) to create jpayne@68: position-independent code. If you are using gcc, this jpayne@68: should probably be set to `-fpic'. jpayne@68: jpayne@68: SHOBJ_LD The link editor to be used to create the shared library from jpayne@68: the object files created by $SHOBJ_CC. If you are using jpayne@68: gcc, a value of `gcc' will probably work. jpayne@68: jpayne@68: SHOBJ_LDFLAGS Flags to pass to SHOBJ_LD to enable shared object creation. jpayne@68: If you are using gcc, `-shared' may be all that is necessary. jpayne@68: These should be the flags needed for generic shared object jpayne@68: creation. jpayne@68: jpayne@68: SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library jpayne@68: creation. Many systems use the -R option to the link jpayne@68: editor to embed a path within the library for run-time jpayne@68: library searches. A reasonable value for such systems would jpayne@68: be `-R$(libdir)'. jpayne@68: jpayne@68: SHLIB_LIBS Any additional libraries that shared libraries should be jpayne@68: linked against when they are created. jpayne@68: jpayne@68: SHLIB_LIBPREF The prefix to use when generating the filename of the shared jpayne@68: library. The default is `lib'; Cygwin uses `cyg'. jpayne@68: jpayne@68: SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when jpayne@68: generating the filename of the shared library. Many systems jpayne@68: use `so'; HP-UX uses `sl'. jpayne@68: jpayne@68: SHLIB_LIBVERSION The string to append to the filename to indicate the version jpayne@68: of the shared library. It should begin with $(SHLIB_LIBSUFF), jpayne@68: and possibly include version information that allows the jpayne@68: run-time loader to load the version of the shared library jpayne@68: appropriate for a particular program. Systems using shared jpayne@68: libraries similar to SunOS 4.x use major and minor library jpayne@68: version numbers; for those systems a value of jpayne@68: `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate. jpayne@68: Systems based on System V Release 4 don't use minor version jpayne@68: numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems. jpayne@68: Other Unix versions use different schemes. jpayne@68: jpayne@68: SHLIB_DLLVERSION The version number for shared libraries that determines API jpayne@68: compatibility between readline versions and the underlying jpayne@68: system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but jpayne@68: can be overridden at configuration time by defining DLLVERSION jpayne@68: in the environment. jpayne@68: jpayne@68: SHLIB_DOT The character used to separate the name of the shared library jpayne@68: from the suffix and version information. The default is `.'; jpayne@68: systems like Cygwin which don't separate version information jpayne@68: from the library name should set this to the empty string. jpayne@68: jpayne@68: SHLIB_STATUS Set this to `supported' when you have defined the other jpayne@68: necessary variables. Make uses this to determine whether jpayne@68: or not shared library creation should be attempted. If jpayne@68: shared libraries are not supported, this will be set to jpayne@68: `unsupported'. jpayne@68: jpayne@68: You should look at the existing stanzas in support/shobj-conf for ideas. jpayne@68: jpayne@68: Once you have updated support/shobj-conf, re-run configure and type jpayne@68: `make shared' or `make'. The shared libraries will be created in the jpayne@68: shlib subdirectory. jpayne@68: jpayne@68: If shared libraries are created, `make install' will install them. jpayne@68: You may install only the shared libraries by running `make jpayne@68: install-shared' from the top-level build directory. Running `make jpayne@68: install' in the shlib subdirectory will also work. If you don't want jpayne@68: to install any created shared libraries, run `make install-static'.