15 (A copy of this chapter is in the distribution file @file{kpathsea/INSTALL}.)
18 The procedure for Kpathsea (and Web2c, etc.) configuration and
19 installation follows. If you encounter trouble, see @ref{Common
20 problems}, a copy of which is in the file @file{kpathsea/BUGS}.
23 * Simple installation:: If you just want to do it.
24 * Custom installation:: If you want to change things around.
25 * Security:: Who can write what files, etc.
26 * TeX directory structure:: Managing the horde of TeX input files.
27 * unixtex.ftp:: Getting software via FTP, on CD-ROM, or on tape.
28 * Reporting bugs:: Where and how to report bugs.
32 @node Simple installation
33 @section Simple installation
35 @cindex simple installation
36 @cindex installation, simple
38 @cindex precompiled executables, instead of installation
39 @cindex installation, getting executables instead of
40 Installing @TeX{} and friends for the first time can be a daunting
41 experience. Thus, you may prefer to skip this whole thing and just get
42 precompiled executables: see @ref{unixtex.ftp}.
44 This section explains what to do if you wish to take the defaults for
45 everything, and generally to install in the simplest possible way. Most
46 steps here refer to corresponding subsection in the next section which
47 explains how to override defaults and generally gives more details.
49 By default everything will be installed under @file{/usr/local} and the
50 following discussion assumes this. However, if you already have @TeX{}
51 installed, its location is used to derive the directory under which
52 everything is to be installed.
56 Be sure you have enough disk space: approximately 8 megabytes for the
57 compressed archives, 15MB for sources, 50MB for compilation, 40MB for
58 the (initial) installed system (including library files). @xref{Disk
62 Retrieve these distribution archives:
64 @item ftp://ftp.tug.org/tex/texk.tar.gz
65 These are the sources, which you will be compiling.
67 @item ftp://ftp.tug.org/tex/texklib.tar.gz
68 This is a basic set of input files. You should unpack it in the
69 directory @file{/usr/local/share}; doing so will create a @file{texmf}
73 These archives are mirrored on the CTAN hosts, in the
74 @file{systems/web2c} directory.
76 @noindent @xref{Kpathsea application distributions}.
79 When using the default search paths, there is no need to edit any
80 distribution files. @xref{Changing search paths}.
83 At the top level of the distribution, run @samp{sh configure}. (If you
84 have the GNU Bash shell installed, run @samp{bash configure}.)
85 @xref{Running configure}.
88 @samp{make}. @xref{Running make}. If you are using a BSD 4.4 system
89 such as FreeBSD or NetBSD, you may have to use GNU make (often installed
90 in @file{/usr/local/bin}), not the BSD make.
93 @samp{make install}. @xref{Installing files}.
96 @samp{make distclean}. @xref{Cleaning up}.
99 Set up a cron job to rebuild the filename database that makes searching
100 faster. This line will rebuild it every midnight:
102 0 0 * * * cd /usr/local/share/texmf && @var{/bindir}/mktexlsr
104 @xref{Filename database generation}, and @ref{Filename database}.
107 @cindex printer configuration files
108 @cindex PostScript fonts, additional
109 @cindex color printers, configuring
110 If you're installing Dvips, you also need to set up configuration files
111 for your printers and make any additional PostScript fonts available.
112 @xref{Installation,,, dvips, Dvips}. If you have any color printers,
113 see @ref{Color device configuration,,, dvips, Dvips}.
116 The first time you run a DVI driver, a bunch of PK fonts will be built
117 by Metafont via @code{mktexpk} (and added to the filename database).
118 This will take some time. Don't be alarmed; they will created only this
119 first time (unless something is wrong with your path definitions).
121 By default, @code{mktexpk} will create these fonts in a hierarchy
122 under @file{/var/tmp/texfonts}; it simply assumes that @file{/var/tmp}
123 exists and is globally writable. If you need a different arrangement,
124 see @ref{mktex configuration}.
126 @xref{mktex scripts}.
129 @cindex fonts, being created
130 @pindex mktexpk @r{, initial runs}
131 @cindex tests, simple
132 For some simple tests, try @samp{tex story \\bye} and @samp{latex
133 sample2e}. Then run @file{xdvi story} or @file{dvips sample2e} on the
134 resulting DVI files to preview/print the documents. @xref{Installation
139 @node Custom installation
140 @section Custom installation
142 @cindex custom installation
143 @cindex installation, customized
145 Most sites need to modify the default installation procedure in some
146 way, perhaps merely changing the prefix from @samp{/usr/local}, perhaps
147 adding extra compiler or loader options to work around @code{configure}
148 bugs. This section explains how to override default choices. For
149 additional distribution-specific information:
151 @item @file{dviljk/INSTALL}.
152 @item @xref{Installation,,,dvips,Dvips}.
153 @item @xref{Installation,,,web2c,Web2c}.
154 @item @file{xdvik/INSTALL}.
157 @cindex non-Unix operating systems
158 @cindex Amiga support
162 These instructions are for Unix systems. Other operating-system
163 specific distributions have their own instructions. The code base
164 itself supports Amiga, DOS, OS/2, and VMS.
167 Following are the same steps as in the previous section (which describes
168 the simplest installation), but with much more detail.
172 * Kpathsea application distributions::
173 * Changing search paths::
174 * Running configure::
178 * Filename database generation::
180 * Installation testing::
185 @subsection Disk space
187 @cindex disk space, needed
188 @cindex total disk space
189 @cindex size of distribution archives
190 Here is a table showing the disk space needed for each distribution
191 (described in the next section). The `(totals)' line reflects the
192 @samp{texk} source distribution and @samp{texklib}; the individual
193 distributions don't enter into it. Sizes are in megabytes. All numbers
196 @multitable {distribution} {.tar.gz} {unpacked} {compiled} {installed}
197 @item Distribution @tab .tar.gz @tab Unpacked @tab Compiled @tab Installed
198 @item dviljk @tab .9 @tab 3.8 @tab
199 @item dvipsk @tab .9 @tab 3.2 @tab
200 @item xdvik @tab .7 @tab 2.5 @tab
201 @item web2c @tab 1.3 @tab 5.0 @tab
202 @item web @tab 1.9 @tab 6.5 @tab - @tab -
203 @item texk @tab 7.5 @tab 32.1 @tab 95.3 @tab 33.5
204 @item texklib @tab 6.3 @tab 15.0 @tab - @tab 15.0
205 @item (totals) @tab 14.6 @tab 47.1 @tab 95.3 @tab 48.5
209 @node Kpathsea application distributions
210 @subsection Kpathsea application distributions
212 @cindex distributions, compiling simultaneously
213 @cindex version number, of Kpathsea
214 @cindex Kpathsea version number
216 @cindex distributions, not compiling
217 @cindex NeXT, lacking X11
218 @cindex X11, lacking on NeXT
219 The archive @url{ftp://ftp.tug.org/tex/texk.tar.gz} contains all of the
220 Kpathsea applications I maintain, and the library itself. For example,
221 since NeXT does not generally support X11, you'd probably want to skip
222 @samp{xdvik} (or simply remove it after unpacking @file{texk.tar.gz}.
223 If you are not interested in all of them, you can also retrieve them
230 @cindex LaserJet drive
231 DVI to PCL, for LaserJet printers.
234 @cindex PDF generation
235 @cindex PostScript driver
236 DVI to PostScript, for previewers, printers, or PDF generation.
239 The software needed to compile @TeX{} and friends.
242 The original WEB source files, also used in compilation.
245 @cindex X11 previewer
246 DVI previewing under the X window system.
251 @cindex non-English typesetting
252 If you want to use the Babel La@TeX{} package for support of non-English
253 typesetting, you may need to retrieve additional files. See the file
254 @file{install.txt} in the Babel distribution.
257 @node Changing search paths
258 @subsection Changing search paths
260 @cindex search paths, changing default
261 @cindex paths, changing default
262 @flindex texmf.in@r{, editing}
263 If the search paths for your installation differ from the standard
264 @TeX{} directory structure (@pxref{Top,, Introduction, tds, A Directory
265 Structure for @TeX{} files}), edit the file @file{kpathsea/texmf.in}
266 as desired, before running @code{configure}. For example, if you have
267 all your fonts or macros in one big directory.
269 You may also wish to edit the file @file{mktex.cnf}, either before or
270 after installation, to control various aspects of @code{mktexpk} and
271 friends. @xref{mktex configuration}.
273 You do not need to edit @file{texmf.in} to change the default
274 top-level or other installation @emph{directories} (only the paths).
275 You can and should do that when you run @code{configure} (next step).
277 You also do not need to edit @file{texmf.in} if you are willing to
278 rely on @file{texmf.cnf} at runtime to define the paths, and let the
279 compile-time default paths be incorrect. Usually there is no harm in
282 The section below explains default generation in more detail.
285 * Default path features::
286 * Default path generation::
290 @node Default path features
291 @subsubsection Default path features
293 @cindex default path features
294 @cindex features, of default paths
296 The purpose of having all the different files described in the section
297 above is to avoid having the same information in more than one place. If
298 you change the installation directories or top-level prefix at
299 @code{configure}-time, those changes will propagate through the whole
300 sequence. And if you change the default paths in @file{texmf.in},
301 those changes are propagated to the compile-time defaults.
303 The Make definitions are all repeated in several @t{Makefile}'s; but
304 changing the top-level @file{Makefile} should suffice, as it passes down
305 all the variable definitions, thus overriding the submakes. (The
306 definitions are repeated so you can run Make in the subdirectories, if
307 you should have occasion to.)
310 @cindex paths, device name included in
311 By default, the bitmap font paths end with @samp{/$MAKETEX_MODE}, thus
312 including the device name (usually a Metafont mode name such as
313 @samp{ljfour}). This distinguishes two different devices with the same
314 resolution---a write/white from a write/black 300@dmn{dpi} printer, for
317 @findex kpse_init_prog@r{, and @code{MAKETEX_MODE}}
319 However, since most sites don't have this complication, Kpathsea
320 (specifically, the @code{kpse_init_prog} function in
321 @file{kpathsea/proginit.c}) has a special case: if the mode has not been
322 explicitly set by the user (or in a configuration file), it sets
323 @code{MAKETEX_MODE} to @code{/}. This makes the default PK path, for
324 example, expand into @code{@dots{}/pk//}, so fonts will be found even if
325 there is no subdirectory for the mode (if you arranged things that way
326 because your site has only one printer, for example) or if the program
327 is mode-independent (e.g., @code{pktype}).
329 To make the paths independent of the mode, simply edit
330 @file{texmf.in} before installation, or the installed
331 @file{texmf.cnf}, and remove the @samp{$MAKETEX_MODE}.
333 @xref{mktex script arguments}, for how this interacts with @code{mktexpk}.
336 @flindex kpathsea/HIER
337 @xref{TeX directory structure,, @TeX{} directory structure}, for a
338 description of the default arrangement of the input files that comprise
339 the @TeX{} system. The file @file{kpathsea/HIER} is a copy of that
343 @node Default path generation
344 @subsubsection Default path generation
346 @cindex default paths, changing
347 @cindex paths, changing default
348 @cindex installation, changing default directories
349 @cindex directories, changing default installation
351 This section describes how the default paths are constructed.
353 You may wish to ignore the whole mess and simply edit @file{texmf.cnf}
354 after it is installed, perhaps even copying it into place beforehand so
355 you can complete the installation, if it seems necessary.
357 @cindex default paths, how they're made
358 To summarize the chain of events that go into defining the default paths:
362 @samp{configure} creates a @file{Makefile} from each @file{Makefile.in}.
366 When Make runs in the @file{kpathsea} directory, it creates a file
367 @file{texmf.sed} that substitutes the Make value of @code{$(var)} for a
368 string @code{@@var@@}. The variables in question are the one that
369 define the installation directories.
373 @flindex texmf.cnf@r{, generated}
374 @file{texmf.sed} (together with a little extra magic---see
375 @file{kpathsea/Makefile}) is applied to @file{texmf.in} to generate
376 @file{texmf.cnf}. This is the file that will eventually be installed
381 The definitions in @file{texmf.cnf} are recast as C @code{#define}'s in
382 @file{paths.h}. These values will be the compile-time defaults; they
383 are not used at runtime unless no @file{texmf.cnf} file can be found.
385 (That's a lie: the compile-time defaults are what any extra @t{:}'s in
386 @file{texmf.cnf} expand into; but the paths as distributed have no extra
387 @t{:}'s, and there's no particular reason for them to.)
391 @node Running configure
392 @subsection Running @code{configure}
394 @flindex configure@r{, running}
397 @findex ac_include@r{, Autoconf extension}
398 @cindex @@@var{var}@@ substitutions
399 @cindex system dependencies
400 Run @code{sh configure @var{options}} (in the top-level directory, the
401 one containing @file{kpathsea/}), possibly using a shell other than
402 @code{sh} (@pxref{configure shells}).
404 @code{configure} adapts the source distribution to the present system
405 via @code{#define}'s in @file{*/c-auto.h}, which are created from the
406 corresponding @file{c-auto.in}. It also creates a @file{Makefile} from
407 the corresponding @file{Makefile.in}, doing @samp{@@@var{var}@@} and
408 @samp{ac_include} substitutions).
410 @flindex README.CONFIGURE
411 @flindex kpathsea/README.CONFIGURE
412 @code{configure} is the best place to control the configuration,
413 compilation, and installed location of the software, either via
414 command-line options, or by setting environment variables before
415 invoking it. For example, you can disable @code{mktexpk} by default
416 with the option @samp{--disable-mktexpk}.
417 @xref{configure options}.
421 * configure options::
422 * configure environment::
423 * configure scenarios::
428 @node configure shells
429 @subsubsection @code{configure} shells
431 @cindex shells and @code{configure}
432 @pindex bash@r{, recommended for running @code{configure}}
434 Considerable effort has gone into trying to ensure that the
435 @code{configure} scripts can be run by most Bourne shell variants.
436 If @code{sh} runs into trouble, your best bet is to use Bash, the GNU
437 Bourne-again shell (@pxref{Top,,,bash,Bash Reference Manual}).
439 Bourne shell variants for which problems have been reported in the past
443 @pindex ksh@r{, losing with @code{configure}}
444 @pindex bsh@r{, ok with @code{configure}}
445 @cindex Korn shell@r{, losing with @code{configure}}
446 @cindex AIX shells and @code{configure}
447 Old versions of the Korn shell may fail to handle the scripts. The Korn
448 shell may be installed as @file{/bin/sh} on AIX, in which case
449 @file{/bin/bsh} may serve instead.
452 @pindex ash@r{, losing with @code{configure}}
453 @cindex NetBSD shells and @code{configure}
454 @cindex FreeBSD shells and @code{configure}
455 @cindex Linux shells and @code{configure}
456 Old versions of ash are unable to handle the scripts. Ash is sometimes
457 installed as @file{/bin/sh} on NetBSD, FreeBSD, and Linux systems.
458 @file{/bin/bash} should be available for those systems, but might not be
459 part of a default installation.
461 @item @r{Ultrix} /bin/sh
462 @cindex DEC shells and @code{configure}
463 @cindex Ultrix shells and @code{configure}
464 @pindex sh5@r{, ok with @code{configure}}
465 @file{/bin/sh} under Ultrix is a DEC-grown shell that is notably
466 deficient in many ways. @file{/bin/sh5} may be necessary.
470 @node configure options
471 @subsubsection @code{configure} options
473 @cindex @code{configure} options
475 For a complete list of all @code{configure} options, run @samp{configure
476 --help} or see @ref{Invoking configure,, Running @code{configure} scripts,
477 autoconf, Autoconf}, (a copy is in the file @file{kpathsea/README.CONFIGURE}).
478 The generic options are listed first in the @samp{--help} output, and
479 the package-specific options come last. The environment variables
480 @code{configure} pays attention to are listed below.
482 Options particularly likely to be useful are @samp{--prefix},
483 @samp{--datadir}, and the like; see @ref{configure scenarios}.
485 @opindex --with @r{options}
486 @opindex --enable @r{options}
487 @cindex configuration of optional features
488 @cindex options to @code{configure}
489 This section gives pointers to descriptions of the @samp{--with} and
490 @samp{--enable} options to @code{configure} that Kpathsea-using programs
494 @item --without-mktexmf-default
495 @itemx --without-mktexpk-default
496 @itemx --without-mktextfm-default
497 @itemx --with-mktextex-default
498 Enable or disable the dynamic generation programs. @xref{mktex
501 @item --enable-shared
502 @opindex --enable-shared
503 Build Kpathsea as a shared library, and link against it. Also build the
504 usual static library. @xref{Shared library}.
506 @item --disable-static
507 @opindex --disable-static
508 Build only the shared library. Implies @samp{--enable-shared}.
510 @item --enable-maintainer-mode
511 @opindex --enable-maintainer-mode
512 Enables make targets that are useful for the maintainer and likely to be
513 a pain for anyone else; the makefiles created when this option is
514 enabled may not work at all for you. You have been warned.
517 @node configure environment
518 @subsubsection @code{configure} environment
520 @code{configure} uses the value of the following environment variables in
521 determining your system's characteristics, and substitutes for them in
526 @pindex gcc@r{, compiling with}
527 @pindex cc@r{, compiling with}
528 The compiler to use: default is @code{gcc} if it's installed, otherwise
532 @cindex compiler options, specifying
533 Options to give the compiler: default is @samp{-g -O2} for @code{gcc},
534 @samp{-g} otherwise. @code{CFLAGS} comes after any other options. You
535 may need to include @code{-w} here if your compilations commonly have
536 useless warnings (e.g., @code{NULL redefined}), or @code{configure} may
537 fail to detect the presence of header files (it takes the messages on
538 standard error to mean the header file doesn't exist).
541 @cindex configuration compiler options
542 Options to pass to the compiler preprocessor; this matters most for
543 configuration, not the actual source compilation. The @code{configure}
544 script often does only preprocessing (e.g., to check for the existence
545 of @t{#include} files), and @code{CFLAGS} is not used for this. You may
546 need to set this to something like
547 @samp{-I/usr/local/include/wwwhatever} if you have the libwww library
548 installed for hyper-xdvik (see @file{xdvik/INSTALL}).
551 @cindex preprocessor options
552 Additional preprocessor options, but not used by @code{configure}.
553 Provided for enabling or disabling program features, as documented in
554 the various program-specific installation instructions. @code{DEFS}
555 comes before any compiler options included by the distribution
556 @file{Makefile}s or by @code{configure}.
559 @cindex loader options
560 Additional options to give to the loader. @code{LDFLAGS} comes before
561 any other linker options.
564 @cindex libraries, specifying additional
565 Additional libraries to link with.
569 @node configure scenarios
570 @subsubsection @code{configure} scenarios
572 Here are some common installation scenarios:
576 Including X support in Metafont. This is disabled by default, since
577 many sites have no use for it, and it's a leading cause of configuration
584 @cindex @TeX{} hierarchy, one
585 Putting the binaries, @TeX{} files, GNU info files, etc.@: into a single
586 @TeX{} hierarchy, say @file{/here/texmf}, requires overriding defaults in
589 configure --prefix=/here/texmf --datadir=/here
593 @cindex multiple architectures, compiling on
594 @cindex architectures, compiling multiple
595 @cindex symbolic link trees, for multiple architectures
596 @opindex --srcdir@r{, for building multiple architectures}
597 @pindex lndir @r{for building symlink trees}
598 You can compile on multiple architectures simultaneously either by
599 building symbolic link trees with the @code{lndir} script from the X11
600 distribution, or with the @samp{--srcdir} option:
602 configure --srcdir=@var{srcdir}
606 @cindex multiple architectures, directories for
607 If you are installing binaries for multiple architectures into a single
608 hierarchy, you will probably want to override the default @file{bin} and
609 @file{lib} directories, something like this:
611 configure --prefix=@var{texmf} --datadir=@var{texmf} \
612 --bindir=@var{texmf}/@var{arch}/bin --libdir=@var{texmf}/@var{arch}/lib
613 make texmf=@var{texmf}
616 @cindex automounter, and configuration
617 @noindent (Unless you make provisions for architecture-specific files in
618 other ways, e.g., with Depot or an automounter.)
621 @opindex -O@r{, compiling with}
622 @opindex -g@r{, compiling without}
623 @cindex optimization, enabling
624 @cindex debugging with @samp{-g}, disabling
625 To compile with optimization (to compile without debugging, remove the
628 env CFLAGS="-g -O" sh configure @dots{}
630 @noindent For a potential problem if you optimize, see @ref{TeX or
631 Metafont failing,, @TeX{} or Metafont failing}.
636 @subsubsection Shared library
638 @cindex shared library, making
640 @opindex --enable-shared
641 You can compile Kpathsea as a shared library on a few systems, by
642 specifying the option @samp{--enable-shared} when you run
646 The main advantage in doing this is that the executables can then share
647 the code, thus decreasing memory and disk space requirements.
649 On some systems, you can record the location of shared libraries in a
650 binary, usually by giving certain options to the linker. Then
651 individual users do not need to set their system's environment variable
652 (e.g., @code{LD_LIBRARY_PATH}) to find shared libraries. If you want to
653 do this, you will need to add the necessary options to @code{LDFLAGS}
654 yourself; for example, on Solaris, include something like
655 @samp{-R$@{prefix@}/lib}, on IRIX or Linux, use
656 @samp{-rpath$@{prefix@}/lib}. (Unfortunately, making this happen by
657 default is very difficult, because of interactions with an existing
658 installed shared library.)
662 @subsection Running @code{make}
664 @pindex make@r{, running}
666 @flindex texmf.cnf@r{, creating}
667 @flindex paths.h@r{, creating}
668 @code{make} (still in the top-level directory). This also creates the
669 @file{texmf.cnf} and @file{paths.h} files that define the default search
670 paths, and (by default) the @samp{plain} and @samp{latex} @TeX{} formats.
672 @cindex fallback resolutions, overriding
673 You can override directory names and other values at @code{make}-time.
674 @file{make/paths.make} lists the variables most commonly reset. For
675 example, @samp{make default_texsizes=600} changes the list of fallback
678 You can also override each of @code{configure}'s environment variables
679 (@pxref{configure environment}). The Make variables have the same names.
681 Finally, you can supply additional options via the following variables.
682 (@code{configure} does not use these.)
687 @cindex preprocessor options, additional
688 Preprocessor options.
691 @cindex compiler options, additional
695 @cindex loader options, initial
696 Loader options (included at beginning of link commands).
699 @cindex loader options, final
700 More loader options (included at end of link commands).
703 @cindex Make arguments, additional
704 Additional Make arguments passed to all sub-@code{make}'s. You may need
705 to include assignments to the other variables here via @code{XMAKEARGS};
706 for example: @samp{make XMAKEARGS="CFLAGS=-O XDEFS=-DA4"}.
709 @cindex compiler, changing
710 @cindex libraries, changing
711 It's generally a bad idea to use a different compiler (@samp{CC}) or
712 libraries (@code{LIBS}) for compilation than you did for configuration,
713 since the values @code{configure} determined may then be incorrect.
715 @cindex universe, BSD vs.@: system V
717 @cindex system V universe
718 @cindex Solaris BSD compatibility, not
719 @flindex libucb@r{, avoiding}
720 @flindex ucbinclude@r{, avoiding}
721 Adding compiler options to change the ``universe'' you are using
722 (typically BSD vs.@: system V) is generally a cause of trouble. It's
723 best to use the native environment, whatever that is; @code{configure}
724 and the software usually adapt best to that. In particular, under
725 Solaris 2.x, you should not use the BSD-compatibility library
726 (@file{libucb}) or include files (@file{ucbinclude}).
729 If you want to use the Babel La@TeX{} package for support of non-English
730 typesetting, you need to modify some files before making the La@TeX{}
731 format. See the file @file{install.txt} in the Babel distribution.
734 @node Installing files
735 @subsection Installing files
737 @cindex installing files
739 The basic command is the usual @code{make install}. For security
740 issues, @pxref{Security}.
742 The first time you install any manual in the GNU Info system, you should
743 add a line (you choose where) to the file @file{dir} in your
744 @samp{$(infodir)} directory. Sample text for this is given near the top
745 of the Texinfo source files (@file{kpathsea/kpathsea.texi},
746 @file{dvipsk/dvips.texi}, and @file{web2c/doc/web2c.texi}).
747 If you have a recent version of the GNU Texinfo distribution installed
748 (@url{ftp://prep.ai.mit.edu/pub/gnu/texinfo-3.9.tar.gz} or later), this
749 should happen automatically.
751 On the offchance that this is your first Info installation, the
752 @file{dir} file I use is included in the distribution as
753 @file{etc/dir-example}.
755 @cindex multiple architectures, installing on
756 @cindex architecture-(in)dependent files, installing only
757 @cindex installation, architecture-(in)dependent files only
758 You may wish to use one of the following targets, especially if you are
759 installing on multiple architectures:
762 @findex install-exec @r{Make target}
763 @code{make install-exec} to install in architecture-dependent
764 directories, i.e., ones that depend on the @code{$(exec_prefix)} Make
765 variable. This includes links to binaries, libraries, etc., not just
769 @findex install-data @r{Make target}
770 @code{make install-data} to install in architecture-independent
771 directories, such as documentation, configuration files, pool files, etc.
775 @cindex Andrew File System, installing with
776 @flindex /afs/@dots{} @r{, installing into}
777 If you use the Andrew File System, the normal path (e.g.,
778 @var{prefix}/bin) only gets you to a read-only copy of the files, and
779 you must specify a different path for installation. The best way to do this
780 is by setting the @samp{prefix} variable on the @code{make} command
781 line. The sequence becomes something like this:
783 configure --prefix=/whatever
785 make install prefix=/afs/.@var{system.name}/system/1.3/@@sys/whatever
787 @flindex ls-R @r{and AFS}
788 @cindex relative filenames in @file{ls-R}
789 @noindent With AFS, you will definitely want to use relative filenames in
790 @file{ls-R} (@pxref{Filename database}), not absolute filenames. This
791 is done by default, but check anyway.
795 @subsection Cleaning up
797 @findex distclean @r{Make target}
798 The basic command is @code{make distclean}. This removes all files
799 created by the build.
804 @findex mostlyclean @r{Make target}
805 @code{make mostlyclean} if you intend to compile on another
806 architecture. For Web2C, since the generated C files are portable,
807 they are not removed. If the @code{lex} vs.@: @code{flex} situation
808 is going to be different on the next machine, @code{rm
812 @findex clean @r{Make target}
813 @code{make clean} to remove files created by compiling, but leave
814 configuration files and Makefiles.
817 @findex maintainer-clean @r{Make target}
818 @code{make maintainer-clean} to remove everything that the Makefiles can
819 rebuild. This is more than @samp{distclean} removes, and you should
820 only use it if you are thoroughly conversant with (and have the necessary
821 versions of) Autoconf.
824 @findex extraclean @r{Make target}
825 @code{make extraclean} to remove other junk, e.g., core files, log
826 files, patch rejects. This is independent of the other @samp{clean}
831 @node Filename database generation
832 @subsection Filename database generation
834 @cindex filename database generation
835 @cindex generation of filename database
837 You will probably want to set up a @code{cron} entry on the appropriate
838 machine(s) to rebuild the filename database nightly or so, as in:
840 0 0 * * * cd @var{texmf} && @var{/bindir}/mktexlsr
842 @noindent @xref{Filename database}.
844 Although the @code{mktex@dots{}} scripts make every effort to add
845 newly-created files on the fly, it can't hurt to make sure you get a
846 fresh version every so often.
850 @subsection @file{mktex} scripts
852 @cindex @file{mktex} scripts
853 @cindex scripts for file creation
855 @cindex font set, infinite
856 @cindex dynamic creation of files
857 @cindex Sauter fonts, and dynamic source creation
858 @cindex EC fonts, and dynamic source creation
859 If Kpathsea cannot otherwise find a file, for some file types it is
860 configured by default to invoke an external program to create it
861 dynamically (@pxref{mktex configuration}). These are collectively
862 known as @dfn{@code{mktex} scripts}, since most of them are named
865 For example, this is useful for fonts (bitmaps, TFM's, and
866 arbitrarily-sizable Metafont sources such as the Sauter and EC fonts),
867 since any given document can use fonts never before referenced.
868 Building all fonts in advance is therefore impractical, if not
871 It is also useful for the @TeX{} @samp{.fmt} (and Metafont
872 @samp{.base} and Metapost @samp{.mem} files, @pxref{Memory
873 dumps,,,Web2c,web2c}), where pre-generating every format consumes a
874 lot of both time and space.
876 The script is passed the name of the file to create and possibly other
877 arguments, as explained below. It must echo the full pathname of the
878 file it created (and nothing else) to standard output; it can write
879 diagnostics to standard error.
882 * config: mktex configuration.
883 * names: mktex script names.
884 * args: mktex script arguments.
888 @node mktex configuration
889 @subsubsection @file{mktex} configuration
891 @cindex @file{mktex} script configuration
892 @cindex configuration of @file{mktex} scripts
893 @cindex enabling @file{mktex} scripts
894 @cindex disabling @file{mktex} scripts
896 The list of file types and program names that can run an external
897 program to create missing files is listed in the next section. In the
898 absence of @code{configure} options specifying otherwise, everything
899 but @file{mktextex} will be enabled by default. The @code{configure}
900 options to change the defaults are:
902 @cindex @code{configure} options for @file{mktex} scripts
903 @opindex --without-mktexfmt-default
904 @opindex --without-mktexmf-default
905 @opindex --without-mktexocp-default
906 @opindex --without-mktexofm-default
907 @opindex --without-mktexpk-default
908 @opindex --without-mktextfm-default
909 @opindex --with-mktextex-default
911 --without-mktexfmt-default
912 --without-mktexmf-default
913 --without-mktexocp-default
914 --without-mktexofm-default
915 --without-mktexpk-default
916 --without-mktextfm-default
917 --with-mktextex-default
920 The @code{configure} setting is overridden if the environment variable
921 or configuration file value named for the script is set; e.g.,
922 @file{MKTEXPK} (@pxref{mktex script arguments}).
924 @flindex fmtutils.cnf
925 @code{mktexfmt} reads a file @file{fmtutil.cnf}, typically located in
926 @file{texmf/web2c/} to glean its configuration information. The rest
927 of the files and features in this section are primarily intended for
928 the font generation scripts.
932 @cindex site overrides for @code{mktex@dots{}}
933 As distributed, all the scripts source a file
934 @file{texmf/web2c/mktex.cnf} if it exists, so you can override various
936 See @file{mktex.opt}, for instance, which defines the default mode,
937 resolution, some special directory names, etc. If you prefer not to
938 change the distributed scripts, you can simply create @file{mktex.cnf}
939 with the appropriate definitions (you do not need to create it if you
940 have nothing to put in it). @file{mktex.cnf} has no special syntax;
941 it's an arbitrary Bourne shell script. The distribution contains a
942 sample @file{mktex.cnf} for you to copy and modify as you please (it
943 is not installed anywhere).
947 In addition, you can configure a number of features with the
948 @code{MT_FEATURES} variable, which you can define:
952 in @file{mktex.opt}, as just mentioned;
955 by editing the file @file{mktex.opt}, either before @samp{make
956 install} (in the source hierarchy) or after (in the installed
960 or in the environment.
963 If none of the options below are enabled, @code{mktexpk},
964 @code{mktextfm}, and @code{mktexmf} follow the following procedure to
965 decide where fonts should be installed. Find the tree where the font's
966 sources are, and test the permissions of the @samp{fonts} directory of
967 that tree to determine whether it is writable. If it is, put the files
968 in the tree in appropriate locations. If it isn't writable, see whether
969 the tree is a system tree (named in @code{SYSTEXMF}). If so, the
970 @code{VARTEXFONTS} tree is used. In all other cases the working
973 The @samp{appendonlydir} option is enabled by default.
977 @cindex directories, making append-only
979 Tell @code{mktexdir} to create directories append-only, i.e., set
980 their sticky bit (@pxref{Mode Structure,,, coreutils, GNU Core
981 Utilities}). This feature is silently ignored on non-Unix platforms
982 (e.g. Windows/NT and MS-DOS) which don't support similar functionality.
983 This feature is enabled by default.
986 @cindex 8.3 filenames, using
987 @cindex DOS compatible names
988 @flindex dpi@var{nnn} directories
989 Use 8.3 names; e.g., @file{dpi600/cmr10.pk} instead of
990 @file{cmr10.600pk}. Note that this feature only affects filenames that
991 would otherwise clash with other TeX-related filenames; @file{mktex}
992 scripts do nothing about filenames which exceed the 8+3 MS-DOS limits
993 but remain unique when truncated (by the OS) to these limits, and nether
994 do the scripts care about possible clashes with files which aren't
995 related with TeX. For example, @file{cmr10.600pk} would clash with
996 @file{cmr10.600gf} and is therefore changed when @samp{dosnames} is in
997 effect, but @file{mf.pool} and @file{mp.base} don't clash with any
998 TeX-related files and are therefore unchanged.
1000 This feature is turned on by default on MS-DOS. If you do not wish
1001 @samp{dosnames} to be set on an MS-DOS platform, you need to set the
1002 @code{MT_FEATURES} environment variable to a value that doesn't include
1003 @samp{dosnames}. You can also change the default setting by editing
1004 @file{mktex.opt}, but only if you use the @file{mktex} shell scripts;
1005 the emulation programs don't consult @file{mktex.opt}.
1010 Instead of deriving the location of a font in the destination tree from
1011 the location of the sources, the aliases and directory names from the
1012 Fontname distribution are used. (@pxref{Top,, Introduction, fontname,
1016 @cindex metafont driver files
1017 Let mktexpk and mktextfm create metafont driver files in a temporary
1018 directory. These will be used for just one metafont run and not
1019 installed permanently.
1022 @cindex mode directory, omitting
1023 Omit the directory level for the mode name; this is fine as long as
1024 you generate fonts for only one mode.
1027 @cindex supplier directory, omitting
1028 Omit the font supplier name directory level.
1031 @cindex typeface directory, omitting
1032 Omit the font typeface name directory level.
1035 @cindex supplier directory, omitting
1036 @cindex typeface directory, omitting
1037 Omit the font supplier and typeface name directory levels. This feature
1038 is deprecated in favour of @samp{stripsupplier} and @samp{striptypeface}.
1041 @flindex /var/tmp/texfonts
1043 @cindex Linux File System Standard
1044 When this option is enabled, fonts that would otherwise be written in
1045 system texmf tree go to the @code{VARTEXFONTS} tree instead. The
1046 default value in @file{kpathsea/Makefile.in} is
1047 @file{/var/tmp/texfonts}. The @cite{Linux File System Standard}
1048 recommends @file{/var/tex/fonts}.
1050 @vindex USE_VARTEXFONTS
1051 The @samp{varfonts} setting in @code{MT_FEATURES} is overridden by the
1052 @code{USE_VARTEXFONTS} environment variable: if set to @samp{1}, the
1053 feature is enabled, and if set to @samp{0}, the feature is disabled.
1057 Force generated files that would go into a system tree (as defined by
1058 @code{SYSTEXMF}) into @code{TEXMFVAR}. Starting with te@TeX{}-3.0, the
1059 variable @code{TEXMFVAR} is always set. The @samp{varfonts} feature takes
1060 precedence if also set.
1062 @vindex USE_TEXMFVAR
1063 The @samp{texmfvar} setting in @code{MT_FEATURES} is overridden by the
1064 @code{USE_TEXMFVAR} environment variable: if set to @samp{1}, the
1065 feature is enabled, and if set to @samp{0}, the feature is disabled.
1069 @node mktex script names
1070 @subsubsection @file{mktex} script names
1072 @cindex @file{mktex} script names
1073 @cindex names for @file{mktex} scripts
1075 The following table shows the default name of the script for each
1076 of the file types which support runtime generation.
1082 (@samp{.fmt}, @samp{.base}, @samp{.mem}) @TeX{}/Metafont/MetaPost
1083 formats. This script is also named @command{fmtutil}, and reads
1084 @file{fmtutil.cnf} for configuration information.
1088 (@samp{.mf}) Metafont input files.
1092 (@samp{.ocp}) Omega compiled process files.
1096 (@samp{.ofm}) Omega font metric files.
1100 (@samp{pk}) Glyph fonts.
1104 (@samp{.tex}) @TeX{} input files (disabled by default).
1108 (@samp{.tfm}) TFM files.
1114 @noindent These names can be overridden by an environment variable specific
1115 to the program---for example, @code{DVIPSMAKEPK} for Dvipsk.
1117 @comment next two paragraphs are repeated in dvips.texi
1118 @flindex missfont.log
1119 @cindex failed @code{mktex@dots{}} script invocation
1120 If a @code{mktex@dots{}} script fails, the invocation is appended to a
1121 file @file{missfont.log} (by default) in the current directory. You can
1122 then execute the log file to create the missing files after fixing the
1126 @vindex MISSFONT_LOG
1127 If the current directory is not writable and the environment variable or
1128 configuration file value @code{TEXMFOUTPUT} is set, its value is
1129 used. Otherwise, nothing is written. The name @samp{missfont.log} is
1130 overridden by the @code{MISSFONT_LOG} environment variable or
1131 configuration file value.
1134 @node mktex script arguments
1135 @subsubsection @file{mktex} script arguments
1137 @cindex arguments to @file{mktex}
1139 The first argument to a @file{mktex} script is always the name
1140 of the file to be created.
1142 In the default @file{mktexpk} implementation, additional arguments may
1146 @item --dpi @var{num}
1147 Sets the resolution of the generated font to @var{num}.
1148 @item --mfmode @var{name}
1149 Sets the Metafont mode to @var{name}.
1150 @item --bdpi @var{num}
1151 Sets the the ``base dpi'' for the font. This must match the mode being
1153 @item --mag @var{string}
1154 A ``magstep'' string suitable for the Metafont @code{mag} variable.
1155 This must match the combination of @var{bdpi} and @var{dpi} being used.
1156 @item --destdir @var{string}
1157 A directory name. If the directory is absolute, it is used as-is.
1158 Otherwise, it is appended to the root destination directory set in the
1163 @node Installation testing
1164 @subsection Installation testing
1166 @cindex testing, post-installation
1167 @cindex installation testing
1169 Besides the tests listed in @ref{Simple installation}, you can try
1170 running @samp{make check}. This includes the torture tests (trip, trap,
1171 and mptrap) that come with Web2c (@pxref{Triptrap,,, web2c, Web2c}).
1177 @cindex security considerations
1179 None of the programs in the @TeX{} system require any special system
1180 privileges, so there's no first-level security concern of people gaining
1181 illegitimate root access.
1183 @cindex trojan horse attack
1184 @flindex .rhosts@r{, writable by @TeX{}}
1185 A @TeX{} document, however, can write to arbitrary files, e.g.,
1186 @file{~/.rhosts}, and thus an unwitting user who runs @TeX{} on a random
1187 document is vulnerable to a trojan horse attack. This loophole is
1188 closed by default, but you can be permissive if you so desire in
1189 @file{texmf.cnf}. @xref{tex invocation,,, web2c, Web2c}. MetaPost has
1192 Dvips, Xdvi, and @TeX{} can also execute shell commands under some
1193 circumstances. To disable this, see the @samp{-R} option in @ref{Option
1194 details,,, dvips, Dvips}, the xdvi man page, and @ref{tex
1195 invocation,,, web2c, Web2c}, respectively.
1197 @cindex local cache of fonts
1198 @cindex cache of fonts, local
1199 Another security issue arises because it's very useful---almost
1200 necessary---to make arbitrary fonts on user demand with @code{mktexpk}
1201 and friends. Where do these files get installed? By default, the
1202 @code{mktexpk} distributed with Kpathsea assumes a world-writable
1203 @file{/var/tmp} directory; this is a simple and convenient approach, but
1204 it may not suit your situation because it means that a local cache of
1205 fonts is created on every machine.
1207 @cindex globally writable directories
1208 To avoid this duplication, many people consider a shared, globally
1209 writable font tree desirable, in spite of the potential security
1210 problems. To do this you should change the value of @code{VARTEXFONTS}
1211 in @file{texmf.cnf} to refer to some globally known directory.
1212 @xref{mktex configuration}.
1214 @cindex append-only directories and @code{mktexpk}
1215 The first restriction you can apply is to make newly-created directories
1216 under @file{texmf} be append-only with an option in @file{mktex.cnf}.
1217 @xref{mktex configuration}.
1219 @cindex group-writable directories
1220 @cindex setgid scripts
1221 Another approach is to establish a group (or user) for @TeX{} files,
1222 make the @file{texmf} tree writable only to that group (or user), and
1223 make @code{mktexpk} et al.@: setgid to that group (or setuid to that
1224 user). Then users must invoke the scripts to install things. (If
1225 you're worried about the inevitable security holes in scripts, then you
1226 could write a C wrapper to exec the script.)
1228 @cindex file permissions
1229 @cindex permissions, file
1230 The @file{mktex@dots{}} scripts install files with the same read and
1231 write permissions as the directory they are installed in. The
1232 executable, sgid, suid, and sticky bits are always cleared.
1234 @cindex directory permissions
1235 @cindex permissions, directory
1236 Any directories created by the @file{mktex@dots{}} scripts have the
1237 same permissions as their parent directory, unless the
1238 @code{appendonlydir} feature is used, in which case the sticky bit is