Debian Codegraph @

texk/dvipng/dvipng-src/INSTALL

raw
1 Installing dvipng
2 *****************
3
4 Installing dvipng should be simple: merely ‘./configure’, ‘make’, and
5 ‘make install’.
6
7 Prerequisites
8 =============
9
10 • The GD Graphics Draw library, libgd
11
12 The drawing library ‘libgd’ is necessary, and is downloadable at
13 <https://bitbucket.org/libgd/gd-libgd/downloads>, and there are
14 binary packages for most operating systems from their respective
15 distributors. In any case, the library installs using ‘autoconf’
16 so it should not be difficult for you to install it from source,
17 and then proceed with installing dvipng.
18
19 • The path-searching library kpathsea
20
21 Kpathsea is most likely included in your LaTeX installation, but it
22 may happen that ./configure does not find it; see below. If you do
23 not have it, download it from <http://www.ctan.org> and compile it.
24 I have no experience with this, so I cannot help much here.
25
26 • The font-rendering library FreeType 2
27
28 While not strictly necessary, a recent FreeType 2 is recommended
29 since dvipng currently will produce better-quality images when this
30 library is available. To take advantage of this, you should have
31 at least FreeType 2.1.9.
32
33 FreeType 2 will enable direct support for PostScript and TrueType
34 fonts, so that dvipng will not need to generate bitmapped variants
35 on disk of the TeX fonts since modern TeX distributions include
36 PostScript versions of them. Then, you can render images at
37 different (and unusual) resolutions without cluttering the disk
38 with lots of bitmapped fonts.
39
40 Finally, it will enable subfont support in dvipng. That is, if you
41 want to render CJK-LaTeX characters, you must have FreeType 2
42 installed.
43
44 • libpng and libz
45
46 To be able to compress and write PNG files to disk, dvipng (or
47 really libgd) uses libpng which in turn uses libz. These should be
48 available on any modern system, if not, download them and install
49 them.
50
51 • The ‘texinfo’ package
52
53 This is needed for building the documentation.
54
55 Configure
56 =========
57
58 The first step is to configure the source code, telling it where various
59 files will be. To do so, run
60
61 ./configure OPTIONS
62
63 (Note: if you have fetched dvipng from CVS rather than a regular
64 release, you will have to first generate ‘./configure’ by running
65 ‘autoconf’ 2.53 or later.)
66
67 On many machines, you will not need to specify any options, but if
68 ‘configure’ cannot determine something on its own, you'll need to help
69 it out. For a list of the options type
70
71 ./configure --help
72
73 On some machines, the libraries will be installed in directories that
74 are not in the linker's search path. This will generate an error when
75 running ‘./configure’, indicating that it cannot find libgd or
76 libkpathsea (most likely). You then need to specify the path to the
77 respective library's object files. They are typically called e.g.,
78 ‘libgd.a’ or ‘libgd.so’. If they are located in e.g., ‘/sw/local/lib’,
79 do
80
81 ./configure LDFLAGS=-L/sw/local/lib
82
83 If the library is available as a shared object file (‘.so’), the
84 runtime linker may also need to be told where to find the library, then
85 use
86
87 ./configure LDFLAGS='-L/sw/local/lib -R/sw/local/lib'
88
89 When either of these is necessary, it is likely that the C header
90 files are also installed in directories that are not in the C
91 preprocessor's search path. This will also generate an error when
92 running ‘./configure’, indicating that it cannot find e.g., ‘gd.h’ or
93 ‘kpathsea.h’ (most likely). You then need to specify the path to the
94 respective library's C header files. If they are located in e.g.,
95 ‘/sw/local/include’, do
96
97 ./configure CPPFLAGS=-I/sw/local/include
98
99 On my SUN Solaris workstation, I had to combine this into
100
101 ./configure CPPFLAGS='-I/sw/local/include -I/sw/tex/teTeX/1.0/include'\
102 LDFLAGS='-L/sw/local/lib -R/sw/local/lib -L/sw/tex/teTeX/1.0/lib/'
103
104 where the backslash denotes a continuation of the line.
105
106 Build/install
107 =============
108
109 Once ‘configure’ has been run, simply enter
110
111 make
112
113 at the prompt to compile the C code, and build the documentation files.
114 To install the files into the locations chosen earlier, type
115
116 make install
117
118 You may need special privileges to install, e.g., if you are installing
119 into system directories.
120
121 Installation outside the texmf tree
122 ===================================
123
124 In some cases, a dvipng binary installed outside the texmf tree will not
125 be able to find virtual fonts, or the PostScript font maps (normally
126 used by dvips). This may be because _only_ $SELFAUTOLOC, $SELFAUTODIR,
127 and $SELFAUTOPARENT are used in the texmf tree configuration file
128 ‘texmf.cnf’. If so, give the switch ‘--enable-selfauto-set’ to
129 ‘./configure’. This will make dvipng adjust these three internally so
130 that kpathsea thinks that dvipng _is_ installed in the texmf tree.
131
132 Installation for non-privileged users
133 =====================================
134
135 Often people without system administration privileges want to install
136 software for their private use. In that case you need to specify more
137 options to the ‘configure’ script, usually this is done by using the
138 ‘--prefix’ option to the ‘configure’ script, and let it point to the
139 personal home directory. In that way, resulting binaries will be
140 installed under the ‘bin’ subdirectory of your home directory, manual
141 pages under ‘man’ and so on. That way, it is reasonably easy to
142 maintain a bunch of additional packages, since the prefix argument is
143 supported by most ‘configure’ scripts.
144
145 You'll have to add something like ‘/home/myself/bin’ to your ‘PATH’
146 shell variable, if it isn't there already, and similarly set the
147 ‘INFOPATH’ and ‘MANPATH’ variables to be able to access the
148 documentation.
149
150 Copying
151 =======
152
153 This program is released under the GNU Lesser General Public License
154 version 3, see the COPYING file in the dvipng distribution or
155 <http://www.gnu.org/licenses/>.
156
157 Copyright © 2002-2015, 2019 Jan-Åke Larsson