1 | Basic Installation |
---|
2 | ================== |
---|
3 | |
---|
4 | These are installation instructions for Readline 4.2a. |
---|
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 | 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 | |
---|
33 | The `configure' shell script attempts to guess correct values for |
---|
34 | various system-dependent variables used during compilation. It |
---|
35 | uses those values to create a `Makefile' in the build directory, |
---|
36 | and Makefiles in the `doc', `shlib', and `examples' |
---|
37 | subdirectories. It also creates a `config.h' file containing |
---|
38 | system-dependent definitions. Finally, it creates a shell script |
---|
39 | `config.status' that you can run in the future to recreate the |
---|
40 | current configuration, a file `config.cache' that saves the |
---|
41 | results of its tests to speed up reconfiguring, and a file |
---|
42 | `config.log' containing compiler output (useful mainly for |
---|
43 | debugging `configure'). |
---|
44 | |
---|
45 | If you need to do unusual things to compile readline, please try |
---|
46 | to figure out how `configure' could check whether to do them, and |
---|
47 | mail diffs or instructions to <bug-readline@gnu.org> so they can |
---|
48 | be considered for the next release. If at some point |
---|
49 | `config.cache' contains results you don't want to keep, you may |
---|
50 | remove or edit it. |
---|
51 | |
---|
52 | The file `configure.in' is used to create `configure' by a |
---|
53 | program called `autoconf'. You only need `configure.in' if you |
---|
54 | want to change it or regenerate `configure' using a newer version |
---|
55 | of `autoconf'. |
---|
56 | |
---|
57 | Compilers and Options |
---|
58 | ===================== |
---|
59 | |
---|
60 | Some systems require unusual options for compilation or linking that |
---|
61 | the `configure' script does not know about. You can give `configure' |
---|
62 | initial values for variables by setting them in the environment. Using |
---|
63 | a Bourne-compatible shell, you can do that on the command line like |
---|
64 | this: |
---|
65 | |
---|
66 | CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure |
---|
67 | |
---|
68 | Or 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 | |
---|
72 | Compiling For Multiple Architectures |
---|
73 | ==================================== |
---|
74 | |
---|
75 | You can compile readline for more than one kind of computer at the |
---|
76 | same time, by placing the object files for each architecture in their |
---|
77 | own directory. To do this, you must use a version of `make' that |
---|
78 | supports the `VPATH' variable, such as GNU `make'. `cd' to the |
---|
79 | directory where you want the object files and executables to go and run |
---|
80 | the `configure' script. `configure' automatically checks for the |
---|
81 | source code in the directory that `configure' is in and in `..'. |
---|
82 | |
---|
83 | If you have to use a `make' that does not supports the `VPATH' |
---|
84 | variable, you have to compile readline for one architecture at a |
---|
85 | time in the source code directory. After you have installed |
---|
86 | readline for one architecture, use `make distclean' before |
---|
87 | reconfiguring for another architecture. |
---|
88 | |
---|
89 | Installation Names |
---|
90 | ================== |
---|
91 | |
---|
92 | By 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', |
---|
95 | and the info files in `/usr/local/info'. You can specify an |
---|
96 | installation prefix other than `/usr/local' by giving `configure' |
---|
97 | the option `--prefix=PATH' or by supplying a value for the |
---|
98 | DESTDIR variable when running `make install'. |
---|
99 | |
---|
100 | You can specify separate installation prefixes for |
---|
101 | architecture-specific files and architecture-independent files. |
---|
102 | If you give `configure' the option `--exec-prefix=PATH', the |
---|
103 | readline Makefiles will use PATH as the prefix for installing the |
---|
104 | libraries. Documentation and other data files will still use the |
---|
105 | regular prefix. |
---|
106 | |
---|
107 | Specifying the System Type |
---|
108 | ========================== |
---|
109 | |
---|
110 | There may be some features `configure' can not figure out |
---|
111 | automatically, but need to determine by the type of host readline |
---|
112 | will run on. Usually `configure' can figure that out, but if it |
---|
113 | prints a message saying it can not guess the host type, give it |
---|
114 | the `--host=TYPE' option. TYPE can either be a short name for |
---|
115 | the system type, such as `sun4', or a canonical name with three |
---|
116 | fields: CPU-COMPANY-SYSTEM (e.g., i386-unknown-freebsd4.2). |
---|
117 | |
---|
118 | See the file `config.sub' for the possible values of each field. |
---|
119 | |
---|
120 | Sharing Defaults |
---|
121 | ================ |
---|
122 | |
---|
123 | If you want to set default values for `configure' scripts to share, |
---|
124 | you can create a site shell script called `config.site' that gives |
---|
125 | default 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. |
---|
129 | A warning: the readline `configure' looks for a site script, but not |
---|
130 | all `configure' scripts do. |
---|
131 | |
---|
132 | Operation Controls |
---|
133 | ================== |
---|
134 | |
---|
135 | `configure' recognizes the following options to control how it |
---|
136 | operates. |
---|
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 | |
---|
161 | Optional Features |
---|
162 | ================= |
---|
163 | |
---|
164 | The 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 | |
---|
175 | Shared Libraries |
---|
176 | ================ |
---|
177 | |
---|
178 | There is support for building shared versions of the readline and |
---|
179 | history libraries. The configure script creates a Makefile in |
---|
180 | the `shlib' subdirectory, and typing `make shared' will cause |
---|
181 | shared versions of the readline and history libraries to be built |
---|
182 | on supported platforms. `make everything' will run `make shared' |
---|
183 | after building the static libraries. |
---|
184 | |
---|
185 | Configure calls the script support/shobj-conf to test whether or |
---|
186 | not shared library creation is supported and to generate the values |
---|
187 | of variables that are substituted into shlib/Makefile. If you |
---|
188 | try to build shared libraries on an unsupported platform, `make' |
---|
189 | will display a message asking you to update support/shobj-conf for |
---|
190 | your platform. |
---|
191 | |
---|
192 | If you need to update support/shobj-conf, you will need to create |
---|
193 | a `stanza' for your operating system and compiler. The script uses |
---|
194 | the value of host_os and ${CC} as determined by configure. For |
---|
195 | instance, FreeBSD 4.2 with any version of gcc is identified as |
---|
196 | `freebsd4.2-gcc*'. |
---|
197 | |
---|
198 | In the stanza for your operating system-compiler pair, you will need to |
---|
199 | define several variables. They are: |
---|
200 | |
---|
201 | SHOBJ_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 | |
---|
205 | SHOBJ_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 | |
---|
209 | SHOBJ_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 | |
---|
213 | SHOBJ_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 | |
---|
218 | SHLIB_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 | |
---|
224 | SHLIB_LIBS Any additional libraries that shared libraries should be |
---|
225 | linked against when they are created. |
---|
226 | |
---|
227 | SHLIB_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 | |
---|
231 | SHLIB_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 | |
---|
243 | SHLIB_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 | |
---|
247 | You should look at the existing stanzas in support/shobj-conf for ideas. |
---|
248 | |
---|
249 | Once you have updated support/shobj-conf, re-run configure and type |
---|
250 | `make shared'. The shared libraries will be created in the shlib |
---|
251 | subdirectory. |
---|
252 | |
---|
253 | Since shared libraries are not created on all platforms, `make install' |
---|
254 | will not automatically install the shared libraries. To install them, |
---|
255 | change the current directory to shlib and type `make install'. Running |
---|
256 | `make install-shared' from the top-level build directory will also work. |
---|