Skip to content
Newer
Older
100644 389 lines (313 sloc) 17.6 KB
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
1 ++++++++++++++
2 INSTALLING ZSH
3 ++++++++++++++
4
5 This file is divided into two parts: making and installing the shell, and
6 a description of various additional configuration options. You should
7 have a look at the items in the second part before following the
8 instructions in the first.
9
10 =====================
11 MAKING AND INSTALLING
12 =====================
c175751 Initial revision
Tanaka Akira authored
13
14 Check MACHINES File
15 -------------------
16
17 Check the file MACHINES in the subdirectory Etc to see the architectures
18 that zsh is known to compile on, as well as any special instructions
19 for your particular architecture. Most architectures will not require any
20 special instructions.
21
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
22 Pre-configuration
23 -----------------
24
25 If you are using a normal source release, skip this section.
26
27 If the `configure' script does not already exist -- e.g., if you've got
28 a snapshot of the bare sources just checked out from a CVS repository
29 -- some things need to be built before the configuration can proceed.
30 Run the script `./Util/preconfig' to do this.
31
c175751 Initial revision
Tanaka Akira authored
32 Configuring Zsh
33 ---------------
34
35 To configure zsh, from the top level directory, do the command:
36 ./configure
37
38 Configure accepts several options (explained below). To display
39 currently available options, do the command:
40 ./configure --help
41
42 Most of the interesting configuration options can be added after running
43 configure by editing the user configuration section of config.h and the
44 top level Makefile.
45
46 Dynamic loading
47 ---------------
48
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
49 Zsh-3.1 has support for dynamically loadable modules. This is now enabled
50 by default; to disable it, run configure with the --disable-dynamic option.
51 Note that dynamic loading does not work on all systems. On these systems
52 this option will have no effect. When dynamic loading is enabled, major
53 parts of zsh (including the Zsh Line Editor) are compiled into modules and
54 not included into the main zsh binary. Zsh autoloads these modules when
55 they are required. This means that you have to execute make
56 install.modules before you try the newly compiled zsh executable, and hence
57 also the install paths must be correct. The installation path for modules
58 is EPREFIX/lib/zsh/<zsh-version-number>, where EPREFIX defaults to PREFIX
59 unless given explicitly, and PREFIX defaults to /usr/local. See the end of
60 this file for options to configure to change these.
61
62 Adding and removing modules
63 ---------------------------
c175751 Initial revision
Tanaka Akira authored
64
65 The zsh distribution contains several modules, in the Src/Builtins,
66 Src/Modules and Src/Zle directories. If you have any additional zsh
67 modules that you wish to compile for this version of zsh, create another
68 subdirectory of the Src directory and put them there. You can create
49a1ad7 13194: change in module configuration system
Peter Stephenson authored
69 as many extra subdirectories as you need, but currently configure will only
70 search in immediate subdirectories of Src. The subdirectories must be
71 actual directories; symbolic links will not work. You will then need to
72 rerun configure; the easiest way is to run `config.status --recheck' from
73 the top-level build directory which retains the existing configuration as
74 much as possible.
75
76 The key to the module system is the file config.modules, created in the
77 configuration process. Each module has a line in the file. It may be
78 edited to change the following values for each module; be careful to retain
79 the (strict) format for the file:
80 link - `dynamic', if the module is to be dynamically linked -- meaningless
81 if this is not available on your system.
82 `static' if the module is to be linked directly into the executable.
83 `no' if the module is not to be linked at all. In this case it will
84 not even be compiled.
85 load - `yes' if the module is to be visible to the user. This will make
86 builtins, parameters etc. visible to the user without any need
87 to use the zmodload builtin.
88 `no' if an explicit zmodload command is to be required to load the
89 utilities in the module. Note that this applies both to
90 statically and dynamically linked modules.
91 auto - `yes' if the entry is to be regenerated whenever configure is run.
92 `no' if you wish to retain your hand-edited version.
93 Do not edit the entry for the pseudo-module zsh/main, which is the main
94 shell. After you have edited this file, run `make prep' in the Src
95 subdirectory.
c175751 Initial revision
Tanaka Akira authored
96
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
97 By default the complete, compctl, zle, computil, complist, sched, parameter,
98 zleparameter and rlimits modules are compiled into non-dynamic zsh and no
99 modules are compiled into the main binary if dynamic loading is available.
100
101 Note that the modules depending on zle or complete (e.g.: complist and
102 deltochar) cannot be loaded dynamically on systems which do not allow symbols
103 in one dynamically loaded library to be visible from another; this is true,
104 for example, of version 4 of SunOS. The most convenient workaround is to
49a1ad7 13194: change in module configuration system
Peter Stephenson authored
105 compile zle and complete into the base executable by setting their `link'
106 entries in config.modules to `static' as described above.
c175751 Initial revision
Tanaka Akira authored
107
108 Compiler Options or Using a Different Compiler
109 ----------------------------------------------
110
111 By default, configure will use the "gcc" compiler if found. You can use a
112 different compiler, or add unusual options for compiling or linking that
113 the "configure" script does not know about, by either editing the user
114 configuration section of the top level Makefile (after running configure)
115 or giving "configure" initial values for these variables by setting them
116 in the environment. Using a Bourne-compatible shell (such as sh,ksh,zsh),
117
118 you can do that on the command line like this:
119 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
120
121 Or on systems that have the "env" program, you can do it like this:
122 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
123
7102a46 12598: configure takes --enable-cflags=... etc. arguments
Peter Stephenson authored
124 The flags CFLAGS, CPPFLAGS, LDFLAGS and LIBS can also be set as flags to
125 configure, where the name appears in lower case:
126 configure --enable-cflags=-O2 --enable-libs=-lposix
127
128 The advantage of this form is that `config.status --recheck' will remember
129 the flags you originally specified. You can still override the flags when
130 running `make' (although these will not be passed down via `config.status
131 --recheck').
132
c175751 Initial revision
Tanaka Akira authored
133 Check Generated Files
134 ---------------------
135
136 Configure will probe your system and create a "config.h" header file.
137 You should check the user configuration section at the beginning of
138 this include file. You should also examine the values (determined by
139 configure) of HOSTTYPE, OSTYPE, MACHTYPE, and VENDOR to make sure they
140 are correct. The value of these #defines's is used only to initialize
141 the corresponding default shell parameters. Since these shell parameters
142 are only for informational purposes, you can change them to whatever
143 you feel is appropriate.
144
145 Also configure will create a Makefile in the top level directory as well
146 as in the various subdirectories. You should check the user configuration
147 section of the top level Makefile.
148
149 Compiling Zsh
150 -------------
151
152 After configuring, to build zsh, do the command:
153 make
154
155 Installing Zsh
156 --------------
157
158 If no make/compilation errors occur, then to install the zsh binary, do
159 the command:
160 make install.bin
161
162 Any previous copy of zsh will be renamed "zsh.old"
163
164 To install the dynamically-loadable modules, do the command:
165 make install.modules
166
167 To install the zsh man page, do the command:
168 make install.man
169
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
170 To install all the shell functions which come with the distribution, do the
171 command:
172 make install.fns
c175751 Initial revision
Tanaka Akira authored
173
174 Or alternatively, you can install all the above with the command:
175 make install
176
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
177 To install the zsh info files (this must be done separately), do the
178 command:
179 make install.info
180
181 If the programme install-info is available, "make install.info" will
182 insert an entry in the file "dir" in the same directory as the info
183 files. Otherwise you will have to edit the topmost node of the info
184 tree "dir" manually in order to have the zsh info files available to
185 your info reader.
c175751 Initial revision
Tanaka Akira authored
186
187 Building Zsh On Additional Architectures
188 ----------------------------------------
189
190 To build zsh on additional architectures, you can do a "make distclean".
191 This should restore the zsh source distribution back to its original
192 state. You can then configure zsh as above on other architectures in
193 which you wish to build zsh. Or alternatively, you can use a different
194 build directory for each architecture.
195
196 Using A Different Build Directory
197 ---------------------------------
198
199 You can compile the zsh in a different directory from the one containing
200 the source code. Doing so allows you to compile it on more than one
201 architecture at the same time. To do this, you must use a version of
202 "make" that supports the "VPATH" variable, such as GNU "make". "cd" to
203 the directory where you want the object files and executables to go and
204 run the "configure" script. "configure" automatically checks for the
205 source code in the directory that "configure" is in. For example,
206
207 cd /usr/local/SunOS/zsh
208 /usr/local/src/zsh-3.0/configure
209 make
210
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
211
212 =====================
213 CONFIGURATION OPTIONS
214 =====================
215
c175751 Initial revision
Tanaka Akira authored
216 Memory Routines
217 ---------------
218
219 Included in this release are alternate malloc and associated functions
220 which reduce memory usage on some systems. To use these, add the option
221 --enable-zsh-mem
222 when invoking "configure".
223
224 You should check Etc/MACHINES to see if there are specific recommendations
225 about using the zsh malloc routines on your particular architecture.
226
227 Debugging Routines
228 ------------------
229
230 You can turn on various debugging options when invoking "configure".
231
232 To turn on some extra checking in the memory management routines, you
233 can use the following options when invoking "configure".
234 --enable-zsh-mem-warning # turn on warnings of memory allocation errors
235 --enable-zsh-secure-free # turn on memory checking of free()
236
237 If you are using zsh's memory allocation routines (--enable-zsh-mem), you
238 can turn on debugging of this code. This enables the builtin "mem".
239 --enable-zsh-mem-debug # debug zsh's memory allocators
240
241 You can turn on some debugging information of zsh's internal hash tables.
242 This enables the builtin "hashinfo".
243 --enable-zsh-hash-debug # turn on debugging of internal hash tables
244
245 To add some sanity checks and generate debugging information for debuggers
246 you can use the following option. This also disables optimization.
247 --enable-zsh-debug # use it if you want to debug zsh
248
249 Startup/shutdown files
250 ----------------------
251
252 Zsh has several startup/shutdown files which are in /etc by default. This
253 can be overriden using one of the options below when invoking "configure".
254
255 --enable-etcdir=directory # default directory for global zsh scripts
256 --enable-zshenv=pathname # the full pathname of the global zshenv script
257 --enable-zshrc=pathname # the full pathname of the global zshrc script
258 --enable-zlogin=pathname # the full pathname of the global zlogin script
259 --enable-zprofile=pathname # the full pathname of the global zprofile script
260 --enable-zlogout=pathname # the full pathname of the global zlogout script
261
262 Any startup/shutdown script can be disabled by giving the
263 --disable-scriptname option to "configure". The --disable-etcdir option
f18221f spelling corrections (13610)
Oliver Kiddle authored
264 disables all startup/shutdown files which are not explicitly enabled.
c175751 Initial revision
Tanaka Akira authored
265
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
266 Shell functions
267 ---------------
268
269 By default, the shell functions which are installed with `make install' or
270 `make install.fns' go into the directory ${datadir}/zsh/functions, which
271 unless you have specified --datadir is the same as
272 ${prefix}/share/zsh/$ZSH_VERSION/functions ($prefix itself defaults to
273 /usr/local, as described below). This directory will also be compiled into
274 the shell as the default directory for the variable $fpath/$FPATH. You can
275 override it with --enable-fndir=directory; --disable-fndir or
276 --enable-fndir=no will turn off both installation of functions and the
277 setting of a default value for $fpath/$FPATH. Note the presence of
278 $ZSH_VERSION (e.g. `3.1.7') to avoid clashes between versions of zsh.
279 If you only run one version of zsh at once, installing into a common
caa994e installfns bits
Peter Stephenson authored
280 directory such as /usr/local/share/zsh/functions is fine --- note, however,
281 that uninstallation is more likely to create problems in this case.
282
283 The functions to be installed are controlled by config.modules. These
284 appear at the end of the line after `functions=': note that the rest of the
285 line is taken verbatim as shell command line text, i.e. no quoting is used
286 around the value as a whole and unquoted wildcards will be expanded. To
287 prevent any functions from being installed, either remove the `functions='
288 entry or delete the reset of the line after it.
289
290 Functions not specific to a particular module are listed on the zsh/main
291 line. None of these are crucial to shell operation, so you may choose not
292 to install them. For other modules, the functions will be installed if and
293 only if the module itself is installed. This will usually be what you
294 want; in particular, the zsh/complete and zsh/zftp modules are of much less
295 use without the associated functions. The functions listed with zsh/zle
3d7263f after-move cleanup
Sven Wischnowsky authored
296 are optional, however.
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
297
298 You can also use the configure option --enable-function-subdirs to allow
299 shell functions to be installed into subdirectories of the function
3d7263f after-move cleanup
Sven Wischnowsky authored
300 directory, i.e. `Base/*' files will be installed into `FNDIR/Base, and so
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
301 on. This also initialises $fpath/$FPATH appropriately.
302
303 The option --enable-site-fndir controls whether to create and initialise
304 $fpath to include a directory for site-specific functions. By default this
305 is created in the location ${datadir}/zsh/site-functions, i.e. parallel to
306 the version-specific functions directory, and inserted at the start of the
307 $fpath array on shell startup. This directory will not be affected by
308 `make uninstall' or `make uninstall.fns', although the version-specific
309 directory and its contents will be deleted.
310
311 Support for large files and integers
312 ------------------------------------
313
314 Some 32-bit systems allow special compilation modes to get around the 2GB
315 file size barrier. The option --enable-lfs turns on the configure check
316 for support for large files. This is now enabled by default; use
317 --disable-lfs to turn it off. Not all systems recognize the test used by
318 zsh (via the getconf command), so flags may need to be set by hand. On
319 HP-UX 10.20, zsh has been successfully compiled with large file support by
320 configuring with
321 CC="cc -Ae" CPPFLAGS="-D_LARGEFILE_SOURCE -D_FILE64" configure \
322 --enable-lfs ...
323 You can also give a value to --enable-lfs, which will be interpreted as the
324 name of a 64-bit integer type, for example --enable-lfs="long long"
325 (although this type is checked for anyway).
326
327 Furthermore, use of --enable-lfs will also enable 64-bit arithmetic for
328 shell parameters, and anywhere they are used such as in mathematical
329 formulae. This depends only on the shell finding a suitable 64-bit integer
330 type; it does not require that support for large files is actually
331 enabled. Hence you might consider using --enable-lfs on any 32-bit system
332 with a suitable compiler such as gcc.
333
334 Also note that if `configure' finds out that either of the types off_t or
335 ino_t are 64-bit quantities, but that long integers are only 32 bits, all
336 the above will be enabled automatically. This is necessary to ensure
337 correct handling of these types.
338
339 None of this is relevant for 64-bit systems; zsh should compile and run
340 without problems if (sizeof(long) == 8).
c175751 Initial revision
Tanaka Akira authored
341
342 Options For Configure
343 ---------------------
344
345 The `configure' program accepts many options, not all of which are useful
346 or relevant to zsh. To get the complete list of configure options, run
347 "./configure --help". The following list should contain most of the
348 options of interest for configuring zsh.
349
350 Configuration:
351 --cache-file=FILE # cache test results in FILE
352 --help # print a help message
353 --version # print the version of autoconf that create configure
354 --quiet, --silent # do not print `checking...' messages
355 --no-create # do not create output files
356
357 Directories:
358 --prefix=PREFIX # install host independent files in PREFIX [/usr/local]
359 --exec-prefix=EPREFIX # install host dependent files in EPREFIX [same as prefix]
360 --bindir=DIR # install user executables in DIR [EPREFIX/bin]
361 --infodir=DIR # install info documentation in DIR [PREFIX/info]
362 --mandir=DIR # install man documentation in DIR [PREFIX/man]
363 --srcdir=DIR # find the sources in DIR [configure dir or ..]
364
365 Features:
366 --enable-FEATURE # enable use of this feature
367 --disable-FEATURE # disable use of this feature
368
369 The FEATURES currently supported are:
370 zsh-debug # use it if you want to debug zsh
371 zsh-mem # use zsh's memory allocators
372 zsh-mem-debug # debug zsh's memory allocators
373 zsh-mem-warning # turn on warnings of memory allocation errors
374 zsh-secure-free # turn on memory checking of free()
375 zsh-hash-debug # turn on debugging of internal hash tables
376 etcdir=directory # default directory for global zsh scripts
377 zshenv=pathname # the full pathname of the global zshenv script
378 zshrc=pathname # the full pathname of the global zshrc script
379 zlogin=pathname # the full pathname of the global zlogin script
380 zprofile=pathname # the full pathname of the global zprofile script
381 zlogout=pathname # the full pathname of the global zlogout script
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
382 fndir=directory # the directory where shell functions will go
383 site-fndir=directory# the directory where site-specific functions can go
384 function-subdirs # if functions will be installed into subdirectories
385 omit-modules=mod1,..# don't compile nor install the modules named mod1,...
c175751 Initial revision
Tanaka Akira authored
386 dynamic # allow dynamically loaded binary modules
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
387 lfs # allow configure check for large files
388 locale # allow use of locale library
Something went wrong with that request. Please try again.