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}). This is most useful for
862 fonts (bitmaps, TFM's, and arbitrarily-sizable Metafont sources such as
863 the Sauter and EC fonts), since any given document can use fonts never
864 before referenced. Trying to build all fonts in advance is therefore
865 impractical, if not impossible.
867 The script is passed the name of the file to create and possibly other
868 arguments, as explained below. It must echo the full pathname of the
869 file it created (and nothing else) to standard output; it can write
870 diagnostics to standard error.
873 * mktex configuration::
874 * mktex script names::
875 * mktex script arguments::
879 @node mktex configuration
880 @subsubsection @file{mktex} configuration
882 @cindex @file{mktex} script configuration
883 @cindex configuration of @file{mktex} scripts
884 @cindex enabling @file{mktex} scripts
885 @cindex disabling @file{mktex} scripts
887 The following file types can run an external program to create missing
888 files: @file{pk}, @file{tfm}, @file{mf}, @file{tex}; the scripts are
889 named @file{mktexpk}, @file{mktextfm}, @file{mktexmf}, and
892 In the absence of @code{configure} options specifying otherwise,
893 everything but @file{mktextex} will be enabled by default. The
894 @code{configure} options to change the defaults are:
896 @cindex @code{configure} options for @file{mktex} scripts
897 @opindex --without-mktexmf-default
898 @opindex --without-mktexpk-default
899 @opindex --without-mktextfm-default
900 @opindex --with-mktextex-default
902 --without-mktexmf-default
903 --without-mktexpk-default
904 --without-mktextfm-default
905 --with-mktextex-default
908 The @code{configure} setting is overridden if the environment variable
909 or configuration file value named for the script is set; e.g.,
910 @file{MKTEXPK} (@pxref{mktex script arguments}).
913 @cindex site overrides for @code{mktex@dots{}}
914 As distributed, all the scripts source a file
915 @file{texmf/web2c/mktex.cnf} if it exists, so you can override
916 various defaults. See @file{mktex.opt}, for instance, which defines
917 the default mode, resolution, some special directory names, etc. If you
918 prefer not to change the distributed scripts, you can simply create
919 @file{mktex.cnf} with the appropriate definitions (you do not need to
920 create it if you have nothing to put in it). @file{mktex.cnf} has no
921 special syntax; it's an arbitrary Bourne shell script. The distribution
922 contains a sample @file{mktex.cnf} for you to copy and modify as you
923 please (it is not installed anywhere).
927 In addition, you can configure a number of features with the
928 @code{MT_FEATURES} variable, which you can define:
931 in @file{mktex.opt}, as just mentioned;
934 by editing the file @file{mktex.opt}, either before @samp{make
935 install} (in the source hierarchy) or after (in the installed
939 or in the environment.
942 If none of the options below are enabled, @code{mktexpk},
943 @code{mktextfm}, and @code{mktexmf} follow the following procedure to
944 decide where fonts should be installed. Find the tree where the font's
945 sources are, and test the permissions of the @samp{fonts} directory of
946 that tree to determine whether it is writable. If it is, put the files
947 in the tree in appropriate locations. If it isn't writable, see whether
948 the tree is a system tree (named in @code{SYSTEXMF}). If so, the
949 @code{VARTEXFONTS} tree is used. In all other cases the working
952 The @samp{appendonlydir} option is enabled by default.
956 @cindex directories, making append-only
958 Tell @code{mktexdir} to create directories append-only, i.e., set
959 their sticky bit (@pxref{Mode Structure,,, coreutils, GNU Core
960 Utilities}). This feature is silently ignored on non-Unix platforms
961 (e.g. Windows/NT and MS-DOS) which don't support similar functionality.
962 This feature is enabled by default.
965 @cindex 8.3 filenames, using
966 @cindex DOS compatible names
967 @flindex dpi@var{nnn} directories
968 Use 8.3 names; e.g., @file{dpi600/cmr10.pk} instead of
969 @file{cmr10.600pk}. Note that this feature only affects filenames that
970 would otherwise clash with other TeX-related filenames; @file{mktex}
971 scripts do nothing about filenames which exceed the 8+3 MS-DOS limits
972 but remain unique when truncated (by the OS) to these limits, and nether
973 do the scripts care about possible clashes with files which aren't
974 related with TeX. For example, @file{cmr10.600pk} would clash with
975 @file{cmr10.600gf} and is therefore changed when @samp{dosnames} is in
976 effect, but @file{mf.pool} and @file{mp.base} don't clash with any
977 TeX-related files and are therefore unchanged.
979 This feature is turned on by default on MS-DOS. If you do not wish
980 @samp{dosnames} to be set on an MS-DOS platform, you need to set the
981 @code{MT_FEATURES} environment variable to a value that doesn't include
982 @samp{dosnames}. You can also change the default setting by editing
983 @file{mktex.opt}, but only if you use the @file{mktex} shell scripts;
984 the emulation programs don't consult @file{mktex.opt}.
989 Instead of deriving the location of a font in the destination tree from
990 the location of the sources, the aliases and directory names from the
991 Fontname distribution are used. (@pxref{Top,, Introduction, fontname,
995 @cindex metafont driver files
996 Let mktexpk and mktextfm create metafont driver files in a temporary
997 directory. These will be used for just one metafont run and not
998 installed permanently.
1001 @cindex mode directory, omitting
1002 Omit the directory level for the mode name; this is fine as long as
1003 you generate fonts for only one mode.
1006 @cindex supplier directory, omitting
1007 Omit the font supplier name directory level.
1010 @cindex typeface directory, omitting
1011 Omit the font typeface name directory level.
1014 @cindex supplier directory, omitting
1015 @cindex typeface directory, omitting
1016 Omit the font supplier and typeface name directory levels. This feature
1017 is deprecated in favour of @samp{stripsupplier} and @samp{striptypeface}.
1020 @flindex /var/tmp/texfonts
1022 @cindex Linux File System Standard
1023 When this option is enabled, fonts that would otherwise be written in
1024 system texmf tree go to the @code{VARTEXFONTS} tree instead. The
1025 default value in @file{kpathsea/Makefile.in} is
1026 @file{/var/tmp/texfonts}. The @cite{Linux File System Standard}
1027 recommends @file{/var/tex/fonts}.
1029 @vindex USE_VARTEXFONTS
1030 The @samp{varfonts} setting in @code{MT_FEATURES} is overridden by the
1031 @code{USE_VARTEXFONTS} environment variable: if set to @samp{1}, the
1032 feature is enabled, and if set to @samp{0}, the feature is disabled.
1036 Force generated files that would go into a system tree (as defined by
1037 @code{SYSTEXMF}) into @code{TEXMFVAR}. Starting with te@TeX{}-3.0, the
1038 variable @code{TEXMFVAR} is always set. The @samp{varfonts} feature takes
1039 precedence if also set.
1041 @vindex USE_TEXMFVAR
1042 The @samp{texmfvar} setting in @code{MT_FEATURES} is overridden by the
1043 @code{USE_TEXMFVAR} environment variable: if set to @samp{1}, the
1044 feature is enabled, and if set to @samp{0}, the feature is disabled.
1048 @node mktex script names
1049 @subsubsection @file{mktex} script names
1051 @cindex @file{mktex} script names
1052 @cindex names for @file{mktex} scripts
1055 @vindex kpse_make_specs
1056 The following table shows the default name of the script for each
1057 possible file types. (The source is the variable @code{kpse_make_specs}
1058 in @file{kpathsea/tex-make.c}.)
1071 Metafont input files.
1081 @noindent These names are overridden by an environment variable specific
1082 to the program---for example, @code{DVIPSMAKEPK} for Dvipsk.
1084 @comment next two paragraphs are repeated in dvips.texi
1085 @flindex missfont.log
1086 @cindex failed @code{mktex@dots{}} script invocation
1087 If a @code{mktex@dots{}} script fails, the invocation is appended to a
1088 file @file{missfont.log} (by default) in the current directory. You can
1089 then execute the log file to create the missing files after fixing the
1093 @vindex MISSFONT_LOG
1094 If the current directory is not writable and the environment variable or
1095 configuration file value @code{TEXMFOUTPUT} is set, its value is
1096 used. Otherwise, nothing is written. The name @samp{missfont.log} is
1097 overridden by the @code{MISSFONT_LOG} environment variable or
1098 configuration file value.
1101 @node mktex script arguments
1102 @subsubsection @file{mktex} script arguments
1104 @cindex arguments to @file{mktex}
1106 The first argument to a @file{mktex} script is always the name
1107 of the file to be created.
1109 In the default @file{mktexpk} implementation, additional arguments may
1113 @item --dpi @var{num}
1114 Sets the resolution of the generated font to @var{num}.
1115 @item --mfmode @var{name}
1116 Sets the Metafont mode to @var{name}.
1117 @item --bdpi @var{num}
1118 Sets the the ``base dpi'' for the font. This must match the mode being
1120 @item --mag @var{string}
1121 A ``magstep'' string suitable for the Metafont @code{mag} variable.
1122 This must match the combination of @var{bdpi} and @var{dpi} being used.
1123 @item --destdir @var{string}
1124 A directory name. If the directory is absolute, it is used as-is.
1125 Otherwise, it is appended to the root destination directory set in the
1129 @c The feature mentioned here doesn't seem to be implemented.
1130 @c Worse, the variable name clashed with the "switch" used to select
1131 @c whether a mktex program is run at all. However, a dearth of
1132 @c complains suggests that no-one was using it anyway.
1134 @c @vindex MKTEXPK @r{environment variable}
1135 @c @cindex specification for @code{mktexpk}
1136 @c You can change the specification for the arguments passed to the
1137 @c external script by setting the environment variable named as the script
1138 @c name, but all capitals---@code{MKTEXPK}, for example. If you've
1139 @c changed the script name by setting (say) @code{DVIPSMAKEPK} to
1140 @c @samp{foo}, then the spec is taken from the environment variable
1143 @c The spec can contain any variable references, to the above variables or
1144 @c any others. As an example, the default spec for @code{mktexpk} is:
1146 @c $KPATHSEA_DPI $MAKETEX_BASE_DPI $MAKETEX_MAG $MAKETEX_MODE
1149 @c @noindent The convention of passing the name of the file to be created
1150 @c as the first argument cannot be changed.
1153 @node Installation testing
1154 @subsection Installation testing
1156 @cindex testing, post-installation
1157 @cindex installation testing
1159 Besides the tests listed in @ref{Simple installation}, you can try
1160 running @samp{make check}. This includes the torture tests (trip, trap,
1161 and mptrap) that come with Web2c (@pxref{Triptrap,,, web2c, Web2c}).
1167 @cindex security considerations
1169 None of the programs in the @TeX{} system require any special system
1170 privileges, so there's no first-level security concern of people gaining
1171 illegitimate root access.
1173 @cindex trojan horse attack
1174 @flindex .rhosts@r{, writable by @TeX{}}
1175 A @TeX{} document, however, can write to arbitrary files, e.g.,
1176 @file{~/.rhosts}, and thus an unwitting user who runs @TeX{} on a random
1177 document is vulnerable to a trojan horse attack. This loophole is
1178 closed by default, but you can be permissive if you so desire in
1179 @file{texmf.cnf}. @xref{tex invocation,,, web2c, Web2c}. MetaPost has
1182 Dvips, Xdvi, and @TeX{} can also execute shell commands under some
1183 circumstances. To disable this, see the @samp{-R} option in @ref{Option
1184 details,,, dvips, Dvips}, the xdvi man page, and @ref{tex
1185 invocation,,, web2c, Web2c}, respectively.
1187 @cindex local cache of fonts
1188 @cindex cache of fonts, local
1189 Another security issue arises because it's very useful---almost
1190 necessary---to make arbitrary fonts on user demand with @code{mktexpk}
1191 and friends. Where do these files get installed? By default, the
1192 @code{mktexpk} distributed with Kpathsea assumes a world-writable
1193 @file{/var/tmp} directory; this is a simple and convenient approach, but
1194 it may not suit your situation because it means that a local cache of
1195 fonts is created on every machine.
1197 @cindex globally writable directories
1198 To avoid this duplication, many people consider a shared, globally
1199 writable font tree desirable, in spite of the potential security
1200 problems. To do this you should change the value of @code{VARTEXFONTS}
1201 in @file{texmf.cnf} to refer to some globally known directory.
1202 @xref{mktex configuration}.
1204 @cindex append-only directories and @code{mktexpk}
1205 The first restriction you can apply is to make newly-created directories
1206 under @file{texmf} be append-only with an option in @file{mktex.cnf}.
1207 @xref{mktex configuration}.
1209 @cindex group-writable directories
1210 @cindex setgid scripts
1211 Another approach is to establish a group (or user) for @TeX{} files,
1212 make the @file{texmf} tree writable only to that group (or user), and
1213 make @code{mktexpk} et al.@: setgid to that group (or setuid to that
1214 user). Then users must invoke the scripts to install things. (If
1215 you're worried about the inevitable security holes in scripts, then you
1216 could write a C wrapper to exec the script.)
1218 @cindex file permissions
1219 @cindex permissions, file
1220 The @file{mktex@dots{}} scripts install files with the same read and
1221 write permissions as the directory they are installed in. The
1222 executable, sgid, suid, and sticky bits are always cleared.
1224 @cindex directory permissions
1225 @cindex permissions, directory
1226 Any directories created by the @file{mktex@dots{}} scripts have the
1227 same permissions as their parent directory, unless the
1228 @code{appendonlydir} feature is used, in which case the sticky bit is