INSTALL 12 KB

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