Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 401 lines (321 sloc) 18.346 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
e4d828b Document "make check".
Bart Schaefer authored
155 It's then a good idea to check that your build is working properly:
156 make check
157
158 If you have trouble with a particular test, you can run it separately:
159 make TESTNUM=C02 check
160
161 The TESTNUM value can be a single test number, as above, or a letter to
162 run an entire category of tests:
163 make TESTNUM=Y check
164
165 See Test/README for a list of test categories.
166
c175751 Initial revision
Tanaka Akira authored
167 Installing Zsh
168 --------------
169
170 If no make/compilation errors occur, then to install the zsh binary, do
171 the command:
172 make install.bin
173
174 Any previous copy of zsh will be renamed "zsh.old"
175
176 To install the dynamically-loadable modules, do the command:
177 make install.modules
178
179 To install the zsh man page, do the command:
180 make install.man
181
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
182 To install all the shell functions which come with the distribution, do the
183 command:
184 make install.fns
c175751 Initial revision
Tanaka Akira authored
185
186 Or alternatively, you can install all the above with the command:
187 make install
188
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
189 To install the zsh info files (this must be done separately), do the
190 command:
191 make install.info
192
193 If the programme install-info is available, "make install.info" will
194 insert an entry in the file "dir" in the same directory as the info
195 files. Otherwise you will have to edit the topmost node of the info
196 tree "dir" manually in order to have the zsh info files available to
197 your info reader.
c175751 Initial revision
Tanaka Akira authored
198
199 Building Zsh On Additional Architectures
200 ----------------------------------------
201
202 To build zsh on additional architectures, you can do a "make distclean".
203 This should restore the zsh source distribution back to its original
204 state. You can then configure zsh as above on other architectures in
205 which you wish to build zsh. Or alternatively, you can use a different
206 build directory for each architecture.
207
208 Using A Different Build Directory
209 ---------------------------------
210
211 You can compile the zsh in a different directory from the one containing
212 the source code. Doing so allows you to compile it on more than one
213 architecture at the same time. To do this, you must use a version of
214 "make" that supports the "VPATH" variable, such as GNU "make". "cd" to
215 the directory where you want the object files and executables to go and
216 run the "configure" script. "configure" automatically checks for the
217 source code in the directory that "configure" is in. For example,
218
219 cd /usr/local/SunOS/zsh
220 /usr/local/src/zsh-3.0/configure
221 make
222
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
223
224 =====================
225 CONFIGURATION OPTIONS
226 =====================
227
c175751 Initial revision
Tanaka Akira authored
228 Memory Routines
229 ---------------
230
231 Included in this release are alternate malloc and associated functions
232 which reduce memory usage on some systems. To use these, add the option
233 --enable-zsh-mem
234 when invoking "configure".
235
236 You should check Etc/MACHINES to see if there are specific recommendations
237 about using the zsh malloc routines on your particular architecture.
238
239 Debugging Routines
240 ------------------
241
242 You can turn on various debugging options when invoking "configure".
243
244 To turn on some extra checking in the memory management routines, you
245 can use the following options when invoking "configure".
246 --enable-zsh-mem-warning # turn on warnings of memory allocation errors
247 --enable-zsh-secure-free # turn on memory checking of free()
248
249 If you are using zsh's memory allocation routines (--enable-zsh-mem), you
250 can turn on debugging of this code. This enables the builtin "mem".
251 --enable-zsh-mem-debug # debug zsh's memory allocators
252
253 You can turn on some debugging information of zsh's internal hash tables.
254 This enables the builtin "hashinfo".
255 --enable-zsh-hash-debug # turn on debugging of internal hash tables
256
257 To add some sanity checks and generate debugging information for debuggers
258 you can use the following option. This also disables optimization.
259 --enable-zsh-debug # use it if you want to debug zsh
260
261 Startup/shutdown files
262 ----------------------
263
264 Zsh has several startup/shutdown files which are in /etc by default. This
265 can be overriden using one of the options below when invoking "configure".
266
267 --enable-etcdir=directory # default directory for global zsh scripts
268 --enable-zshenv=pathname # the full pathname of the global zshenv script
269 --enable-zshrc=pathname # the full pathname of the global zshrc script
270 --enable-zlogin=pathname # the full pathname of the global zlogin script
271 --enable-zprofile=pathname # the full pathname of the global zprofile script
272 --enable-zlogout=pathname # the full pathname of the global zlogout script
273
274 Any startup/shutdown script can be disabled by giving the
275 --disable-scriptname option to "configure". The --disable-etcdir option
f18221f spelling corrections (13610)
Oliver Kiddle authored
276 disables all startup/shutdown files which are not explicitly enabled.
c175751 Initial revision
Tanaka Akira authored
277
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
278 Shell functions
279 ---------------
280
281 By default, the shell functions which are installed with `make install' or
282 `make install.fns' go into the directory ${datadir}/zsh/functions, which
283 unless you have specified --datadir is the same as
284 ${prefix}/share/zsh/$ZSH_VERSION/functions ($prefix itself defaults to
285 /usr/local, as described below). This directory will also be compiled into
286 the shell as the default directory for the variable $fpath/$FPATH. You can
287 override it with --enable-fndir=directory; --disable-fndir or
288 --enable-fndir=no will turn off both installation of functions and the
289 setting of a default value for $fpath/$FPATH. Note the presence of
290 $ZSH_VERSION (e.g. `3.1.7') to avoid clashes between versions of zsh.
291 If you only run one version of zsh at once, installing into a common
caa994e installfns bits
Peter Stephenson authored
292 directory such as /usr/local/share/zsh/functions is fine --- note, however,
293 that uninstallation is more likely to create problems in this case.
294
295 The functions to be installed are controlled by config.modules. These
296 appear at the end of the line after `functions=': note that the rest of the
297 line is taken verbatim as shell command line text, i.e. no quoting is used
298 around the value as a whole and unquoted wildcards will be expanded. To
299 prevent any functions from being installed, either remove the `functions='
300 entry or delete the reset of the line after it.
301
302 Functions not specific to a particular module are listed on the zsh/main
303 line. None of these are crucial to shell operation, so you may choose not
304 to install them. For other modules, the functions will be installed if and
305 only if the module itself is installed. This will usually be what you
306 want; in particular, the zsh/complete and zsh/zftp modules are of much less
307 use without the associated functions. The functions listed with zsh/zle
3d7263f after-move cleanup
Sven Wischnowsky authored
308 are optional, however.
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
309
310 You can also use the configure option --enable-function-subdirs to allow
311 shell functions to be installed into subdirectories of the function
3d7263f after-move cleanup
Sven Wischnowsky authored
312 directory, i.e. `Base/*' files will be installed into `FNDIR/Base, and so
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
313 on. This also initialises $fpath/$FPATH appropriately.
314
315 The option --enable-site-fndir controls whether to create and initialise
316 $fpath to include a directory for site-specific functions. By default this
317 is created in the location ${datadir}/zsh/site-functions, i.e. parallel to
318 the version-specific functions directory, and inserted at the start of the
319 $fpath array on shell startup. This directory will not be affected by
320 `make uninstall' or `make uninstall.fns', although the version-specific
321 directory and its contents will be deleted.
322
323 Support for large files and integers
324 ------------------------------------
325
326 Some 32-bit systems allow special compilation modes to get around the 2GB
327 file size barrier. The option --enable-lfs turns on the configure check
328 for support for large files. This is now enabled by default; use
329 --disable-lfs to turn it off. Not all systems recognize the test used by
330 zsh (via the getconf command), so flags may need to be set by hand. On
331 HP-UX 10.20, zsh has been successfully compiled with large file support by
332 configuring with
333 CC="cc -Ae" CPPFLAGS="-D_LARGEFILE_SOURCE -D_FILE64" configure \
334 --enable-lfs ...
335 You can also give a value to --enable-lfs, which will be interpreted as the
336 name of a 64-bit integer type, for example --enable-lfs="long long"
337 (although this type is checked for anyway).
338
339 Furthermore, use of --enable-lfs will also enable 64-bit arithmetic for
340 shell parameters, and anywhere they are used such as in mathematical
341 formulae. This depends only on the shell finding a suitable 64-bit integer
342 type; it does not require that support for large files is actually
343 enabled. Hence you might consider using --enable-lfs on any 32-bit system
344 with a suitable compiler such as gcc.
345
346 Also note that if `configure' finds out that either of the types off_t or
347 ino_t are 64-bit quantities, but that long integers are only 32 bits, all
348 the above will be enabled automatically. This is necessary to ensure
349 correct handling of these types.
350
351 None of this is relevant for 64-bit systems; zsh should compile and run
352 without problems if (sizeof(long) == 8).
c175751 Initial revision
Tanaka Akira authored
353
354 Options For Configure
355 ---------------------
356
357 The `configure' program accepts many options, not all of which are useful
358 or relevant to zsh. To get the complete list of configure options, run
359 "./configure --help". The following list should contain most of the
360 options of interest for configuring zsh.
361
362 Configuration:
363 --cache-file=FILE # cache test results in FILE
364 --help # print a help message
365 --version # print the version of autoconf that create configure
366 --quiet, --silent # do not print `checking...' messages
367 --no-create # do not create output files
368
369 Directories:
370 --prefix=PREFIX # install host independent files in PREFIX [/usr/local]
371 --exec-prefix=EPREFIX # install host dependent files in EPREFIX [same as prefix]
372 --bindir=DIR # install user executables in DIR [EPREFIX/bin]
373 --infodir=DIR # install info documentation in DIR [PREFIX/info]
374 --mandir=DIR # install man documentation in DIR [PREFIX/man]
375 --srcdir=DIR # find the sources in DIR [configure dir or ..]
376
377 Features:
378 --enable-FEATURE # enable use of this feature
379 --disable-FEATURE # disable use of this feature
380
381 The FEATURES currently supported are:
382 zsh-debug # use it if you want to debug zsh
383 zsh-mem # use zsh's memory allocators
384 zsh-mem-debug # debug zsh's memory allocators
385 zsh-mem-warning # turn on warnings of memory allocation errors
386 zsh-secure-free # turn on memory checking of free()
387 zsh-hash-debug # turn on debugging of internal hash tables
388 etcdir=directory # default directory for global zsh scripts
389 zshenv=pathname # the full pathname of the global zshenv script
390 zshrc=pathname # the full pathname of the global zshrc script
391 zlogin=pathname # the full pathname of the global zlogin script
392 zprofile=pathname # the full pathname of the global zprofile script
393 zlogout=pathname # the full pathname of the global zlogout script
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
394 fndir=directory # the directory where shell functions will go
395 site-fndir=directory# the directory where site-specific functions can go
396 function-subdirs # if functions will be installed into subdirectories
397 omit-modules=mod1,..# don't compile nor install the modules named mod1,...
c175751 Initial revision
Tanaka Akira authored
398 dynamic # allow dynamically loaded binary modules
78526bb 12596: Update INSTALL for module aliasing changes.
Bart Schaefer authored
399 lfs # allow configure check for large files
400 locale # allow use of locale library
Something went wrong with that request. Please try again.