1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<meta name="generator" content=
5"HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
6<title>Building the TIFF Software Distribution</title>
7</head>
8<body bgcolor="white">
9<h1><font face="Arial, Helvetica, Sans"><img src=
10"images/cramps.gif" width="159" height="203" align="left" border=
11"1" hspace="6"> Building the Software Distribution</font></h1>
12<ul>
13<li><a href="#CMAKE">Building on all systems with CMake</a>.</li>
14<li><a href="#UNIX">Building on a UNIX system with Autoconf</a>.</li>
15<li><a href="#PC">Building on an MS-DOS or Windows system with nmake</a>.</li>
16<li><a href="#VMS">Building on a VMS system</a>.</li>
17<li><a href="#Other">Building the Software on Other
18Systems.</a></li>
19</ul>
20<br clear="left">
21This chapter contains step-by-step instructions on how to configure
22and build the TIFF software distribution. The software is most
23easily built on a UNIX system, but with a little bit of work it can
24easily be built and used on other non-UNIX platforms.
25<hr>
26<a name="CMake" id="CMAKE"></a>
27<h2>Building on all systems with CMake</h2> CMake may be used to
28generate build files for most common build systems and IDEs, and
29supports all UNIX-like systems as well as Windows. See
30the <a href="http://www.cmake.org/">CMake website</a> for further
31details. To build the software on you need to first run
32<tt>cmake</tt> to configure the build and generate the system-specific
33build files. This reads the top-level <tt>CMakeLists.txt</tt> file,
34which probes the target system for necessary tools and functions,
35checks any options you specified to configure the build, and then
36outputs build files configured for your system.  If using <tt>Unix
37Makefiles</tt>, once configuration is done, you simply
38run <tt>make</tt> (or <tt>gmake</tt>) to build the software and
39then <tt>make install</tt> to do the installation.  For other build
40systems, you do the equivalent steps with the tool for that system.
41For example, on any UNIX system:
42<div style="margin-left: 2em">
43<pre>
44% <b>cd ./tiff-4.0.5</b>
45% <b>cmake</b>
46    <i>...lots of messages...</i>
47% <b>make</b>
48    <i>...lots of messages...</i>
49% <b>make test</b>
50    <i>...lots of messages...</i>
51# <b>make install</b>
52</pre></div>
53Building is dependent on a <tt>make</tt> utility and a C
54(and optionally a C++ compiler), so you will need these tools.
55<p>In general, the software is designed such that the following
56targets will always be available</p>
57<div style="margin-left: 2em">
58<pre>
59make [all]      build stuff
60make test       run the test suite
61make install    build and install stuff
62make clean      remove object files, executables and cruft
63</pre></div>
64<a name="CMakeBuildTrees" id= "CMakeBuildTrees"></a>
65<hr width="65%" align="right">
66<h3>Build Trees</h3>
67There are two schemes for configuring and building the software. If
68you intend to build the software for only one target system, you
69can configure the software so that it is built in the same
70directories as the source code.
71<div style="margin-left: 2em">
72<pre>
73% <b>gzip -dc tiff-4.0.5.tar.gz | tar -xf -</b>
74% <b>cd ./tiff-4.0.5</b>
75% <b>cmake</b>
76% <b>make</b>
77% <b>make test</b>
78% <b>make install</b>
79</pre></div>
80<p>Otherwise, you can configure a build tree that is parallel to
81the source tree hierarchy (or in some completely different place)
82but which contains only configured files and files created during
83the build procedure.</p>
84<div style="margin-left: 2em">
85<pre>
86% <b>gzip -dc tiff-4.0.5.tar.gz | tar -xf -</b>
87% <b>mkdir tiff-4.0.5-build</b>
88% <b>cd ./tiff-4.0.5-build</b>
89% <b>cmake ../tiff-4.0.5</b>
90% <b>make</b>
91% <b>make test</b>
92% <b>make install</b>
93</pre></div>
94This second scheme is useful for:
95<ul>
96<li>building multiple targets from a single source tree</li>
97<li>building from a read-only source tree (e.g. if you receive the
98distribution on CD-ROM)</li>
99<li>sharing the source files via a network, but building on
100multiple systems</li>
101<li>keeping the source tree clean
102(unlike <tt>autoconf</tt>, <tt>cmake</tt> does not provide
103a <tt>distclean</tt> target, so out of source builds are
104recommended)</li>
105</ul>
106<a name="CMakeGenerators" id= "CMakeGenerators"></a>
107<hr width="65%" align="right">
108<h3>Generators</h3> The default generator for UNIX is <tt>Unix
109Makefiles</tt>, and on Windows is <tt>NMake Makefiles</tt> or MSBuild
110depending upon the setup.  Run <b>cmake --help</b> to list all the
111generators available for your platform.  For example, to use the Ninja
112<a href="https://martine.github.io/ninja/">build system</a> on UNIX or
113Windows:
114<pre>
115<b>cmake -G Ninja</b>
116<b>cmake --build .</b>
117<b>ctest -V</b>
118<b>cmake --build . --target install</b>
119</pre>
120<p>Note that <b>cmake --build .</b> is a build-system-independent way
121of building a target; you can always use the build system directly.</p>
122<p>Alternatively, using the MSBuild system on Windows (64-bit Release
123build with VS2013):
124</p>
125<pre>
126<b>cmake -G "Visual Studio 12 2013 Win64"</b>
127<b>cmake --build . --config Release</b>
128<b>ctest -V -C Release</b>
129<b>cmake --build . --config Release --target install</b>
130</pre>
131With the above configuration, it's also possible to open the generated
132solution file with the Visual Studio IDE as well as building on the
133command-line.
134<a name="CMakeConfigOptions" id="CMakeConfigOptions"></a>
135<hr width="65%" align="right">
136<h3>Configuration Options</h3>
137The configuration process is critical to the proper compilation,
138installation, and operation of the
139software. The <tt>CMakeLists.txt</tt> script runs a series of tests to
140decide whether or not the target system supports required
141functionality and, if it does not, whether it can emulate or
142workaround the missing functions.  After running <tt>cmake</tt>, check
143the <tt>CMakeCache.txt</tt> file; this contains all the results of the
144checks performed and the options set by the user.  If <tt>cmake</tt>
145failed to run, check <tt>CMakeFiles/CMakeOutput.log</tt>
146and <tt>CMakeFiles/CMakeError.log</tt>; these should record the error
147which caused the failure.
148<p>A second function of the configure script is to set the default
149configuration parameters for the software. Of particular note are the
150directories where the software is to be installed. By default the
151software is installed in the <b>/usr/local</b> hierarchy. To change
152this behaviour the appropriate parameters can be specified on the
153command line. Run <b>cmake --help</b> to get a full list of possible
154options, and <b>cmake -LH</b> to list all the configurable options for
155this software package, or <b>cmake -LAH</b> to show all advanced
156options in addition. Standard installation related options are shown
157below.</p>
158<pre>
159<tt>
160Installation directories:
161  CMAKE_INSTALL_PREFIX
162
163Fine tuning of the installation directories:
164  CMAKE_INSTALL_BINDIR            user executables [PREFIX/bin]
165  CMAKE_INSTALL_SBINDIR           system admin executables [PREFIX/sbin]
166  CMAKE_INSTALL_LIBEXECDIR        program executables [PREFIX/libexec]
167  CMAKE_INSTALL_SYSCONFDIR        read-only single-machine data [PREFIX/etc]
168  CMAKE_INSTALL_SHAREDSTATEDIR    modifiable architecture-independent data [PREFIX/com]
169  CMAKE_INSTALL_LOCALSTATEDIR     modifiable single-machine data [PREFIX/var]
170  CMAKE_INSTALL_LIBDIR            object code libraries [PREFIX/lib]
171  CMAKE_INSTALL_INCLUDEDIR        C header files [PREFIX/include]
172  CMAKE_INSTALL_OLDINCLUDEDIR     C header files for non-gcc [/usr/include]
173  CMAKE_INSTALL_DATAROOTDIR       read-only arch.-independent data root [PREFIX/share]
174  CMAKE_INSTALL_DATADIR           read-only architecture-independent data [DATAROOTDIR]
175  CMAKE_INSTALL_LOCALEDIR         locale-dependent data [DATAROOTDIR/locale]
176  CMAKE_INSTALL_MANDIR            man documentation [DATAROOTDIR/man]
177  CMAKE_INSTALL_DOCDIR            documentation root [DATAROOTDIR/doc/tiff]
178</tt>
179</pre>
180Also see the
181CMake <a href="http://www.cmake.org/cmake/help/v3.3/">documentation</a>
182for <a href="http://www.cmake.org/cmake/help/v3.3/manual/cmake-variables.7.html"
183>additional variables</a> which may be set.
184<a name="CMakePackages" id="CMakePackages"></a>
185<hr width="65%" align="right">
186<h3>Configuring Optional Packages/Support</h3>
187The TIFF software comes with several packages that are installed
188only as needed, or only if specifically configured at the time the
189configure script is run. Packages can be configured via the
190<b>cmake</b> commandline parameters.
191<dl>
192<dt><i>Static/Shared Objects Support</i></dt>
193<dd><tt>BUILD_SHARED_LIBS[=ON|OFF]&nbsp;&nbsp;&nbsp;&nbsp;build shared
194libraries [default=ON]</tt><br>
195<p>This option controls whether or not to configure the software
196to build a shared and static binaries for the TIFF library. Use of
197shared libraries can significantly reduce the disk space needed for
198users of the TIFF software. If shared libraries are not used then
199the code is statically linked into each application that uses it.
200</p>
201<p><tt>ld-version-script[=ON|OFF]&nbsp;&nbsp;Enable linker version
202script (default is ON)</tt></p>
203<p>Add shared library symbol versioning on ELF-based systems (e.g.
204Linux and FreeBSD) which use the GNU linker. This is needed if
205several major versions of libtiff might be loaded at once into the
206same program.</p>
207</dd>
208<dt><i>JPEG Support</i></dt>
209<dd><tt>jpeg[=ON|OFF]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enable IJG JPEG
210library usage (required for JPEG compression, enabled by default)<br>
211JPEG_INCLUDE_DIR=DIR&nbsp;location of IJG
212JPEG library headers<br>
213JPEG_LIBRARY=DIR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location of IJG JPEG
214library binary)</tt></dd>
215<dd>The <tt>JPEG</tt> package enables support for the handling of
216TIFF images with JPEG-encoded data. Support for JPEG-encoded data
217requires the Independent JPEG Group (IJG) <tt>libjpeg</tt>
218distribution; this software is available at <a href=
219"http://www.ijg.org/">http://www.ijg.org/</a>. <b>cmake</b>
220script automatically tries to search for a working IJG JPEG
221installation. If it fails to find library, JPEG support will be
222automatically disabled. If you want specify the exact paths to
223library binary and headers, use above options for that.</dd>
224<dt><i>ZIP Support</i></dt>
225<dd>The <tt>ZIP</tt> support enables support for the handling of TIFF
226images with deflate-encoded data (enabled by default if
227available). Support for deflate-encoded data requires the freely
228available <tt>zlib</tt> distribution written by Jean-loup Gailly and
229Mark Adler; this software is available at <a href=
230"http://www.zlib.org/">http://www.zlib.org/</a>.</dd>
231</dl>
232<a name="Sample" id="Sample"></a>
233<hr width="65%" align="right">
234<a name="UNIX" id="UNIX"></a>
235<h2>Building on a UNIX System with Autoconf</h2>
236To build the software on a UNIX system you need to first run the
237configure shell script that is located in the top level of the
238source directory. This script probes the target system for
239necessary tools and functions and constructs a build environment in
240which the software may be compiled. Once configuration is done, you
241simply run <tt>make</tt> (or <tt>gmake</tt>) to build the software
242and then <tt>make install</tt> to do the installation; for example:
243<div style="margin-left: 2em">
244<pre>
245% <b>cd ./tiff-4.0.5</b>
246% <b>./configure</b>
247    <i>...lots of messages...</i>
248% <b>make</b>
249    <i>...lots of messages...</i>
250% <b>make check</b>
251    <i>...lots of messages...</i>
252# <b>make install</b>
253</pre></div>
254Supplied makefiles are dependent on a <tt>make</tt> utility and a C
255(and optionally a C++ compiler), so you will need these tools.
256<p>In general, the software is designed such that the following
257should be ``<i>make-able</i>'' in each directory:</p>
258<div style="margin-left: 2em">
259<pre>
260make [all]      build stuff
261make check      run the test suite
262make install    build and install stuff
263make clean      remove object files, executables and cruft
264make distclean  remove everything, that can be recreated
265</pre></div>
266Note that after running "<tt>make distclean</tt>" the
267<tt>configure</tt> script must be run again to create the Makefiles
268and other make-related files. <a name="BuildTrees" id=
269"BuildTrees"></a>
270<hr width="65%" align="right">
271<h3>Build Trees</h3>
272There are two schemes for configuring and building the software. If
273you intend to build the software for only one target system, you
274can configure the software so that it is built in the same
275directories as the source code.
276<div style="margin-left: 2em">
277<pre>
278% <b>gzip -dc tiff-4.0.5.tar.gz | tar -xf -</b>
279% <b>cd ./tiff-4.0.5</b>
280% <b>./configure</b>
281% <b>make</b>
282% <b>make check</b>
283% <b>make install</b>
284</pre></div>
285<p>Otherwise, you can configure a build tree that is parallel to
286the source tree hierarchy (or in some completely different place)
287but which contains only configured files and files created during
288the build procedure.</p>
289<div style="margin-left: 2em">
290<pre>
291% <b>gzip -dc tiff-4.0.5.tar.gz | tar -xf -</b>
292% <b>mkdir tiff-4.0.5-build</b>
293% <b>cd ./tiff-4.0.5-build</b>
294% <b>../tiff-4.0.5/configure</b>
295% <b>make</b>
296% <b>make check</b>
297% <b>make install</b>
298</pre></div>
299This second scheme is useful for:
300<ul>
301<li>building multiple targets from a single source tree</li>
302<li>building from a read-only source tree (e.g. if you receive the
303distribution on CD-ROM)</li>
304<li>sharing the source files via a network, but building on
305multiple systems</li>
306</ul>
307<a name="ConfigOptions" id="ConfigOptions"></a>
308<hr width="65%" align="right">
309<h3>Configuration Options</h3>
310The configuration process is critical to the proper compilation,
311installation, and operation of the software. The configure script
312runs a series of tests to decide whether or not the target system
313supports required functionality and, if it does not, whether it can
314emulate or workaround the missing functions. This procedure is
315fairly complicated and, due to the nonstandard nature of most UNIX
316systems, prone to error. The first time that you configure the
317software for use you should check the output from the configure
318script and look for anything that does not make sense for your
319system.
320<p>A second function of the configure script is to set the default
321configuration parameters for the software. Of particular note are
322the directories where the software is to be installed. By default
323the software is installed in the <b>/usr/local</b> hierarchy. To
324change this behaviour the appropriate parameters can be specified
325on the command line to configure. Run <b>./configure --help</b> to
326get a full list of possible options. Standard installation related
327options are shown below.</p>
328<pre>
329<tt>
330Installation directories:
331  --prefix=PREFIX         install architecture-independent files in PREFIX
332                          [/usr/local]
333  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
334                          [PREFIX]
335
336By default, `make install' will install all the files in
337`/usr/local/bin', `/usr/local/lib' etc.  You can specify
338an installation prefix other than `/usr/local' using `--prefix',
339for instance `--prefix=$HOME'.
340
341For better control, use the options below.
342
343Fine tuning of the installation directories:
344  --bindir=DIR            user executables [EPREFIX/bin]
345  --sbindir=DIR           system admin executables [EPREFIX/sbin]
346  --libexecdir=DIR        program executables [EPREFIX/libexec]
347  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
348  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
349  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
350  --libdir=DIR            object code libraries [EPREFIX/lib]
351  --includedir=DIR        C header files [PREFIX/include]
352  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
353  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
354  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
355  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
356  --mandir=DIR            man documentation [DATAROOTDIR/man]
357  --docdir=DIR            documentation root [DATAROOTDIR/doc/tiff]
358  --htmldir=DIR           html documentation [DOCDIR]
359
360Program names:
361  --program-prefix=PREFIX            prepend PREFIX to installed program names
362  --program-suffix=SUFFIX            append SUFFIX to installed program names
363  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
364</tt>
365</pre>
366<a name="Packages" id="Packages"></a>
367<hr width="65%" align="right">
368<h3>Configuring Optional Packages/Support</h3>
369The TIFF software comes with several packages that are installed
370only as needed, or only if specifically configured at the time the
371configure script is run. Packages can be configured via the
372<b>configure</b> script commandline parameters.
373<dl>
374<dt><i>Static/Shared Objects Support</i></dt>
375<dd><tt>--enable-shared[=PKGS]&nbsp;&nbsp;&nbsp;&nbsp;build shared
376libraries [default=yes]<br>
377--enable-static[=PKGS]&nbsp;&nbsp;&nbsp;&nbsp;build static
378libraries [default=yes]</tt>
379<p>These options control whether or not to configure the software
380to build a shared and static binaries for the TIFF library. Use of
381shared libraries can significantly reduce the disk space needed for
382users of the TIFF software. If shared libraries are not used then
383the code is statically linked into each application that uses it.
384By default both types of binaries is configured.</p>
385<p>
386<tt>--enable-rpath&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enable
387runtime linker paths (-R libtool option)</tt></p>
388<p>Add library directories (see other options below) to the TIFF
389library run-time linker path.</p>
390<p><tt>--enable-ld-version-script&nbsp;&nbsp;Enable linker version
391script (default is disabled)</tt></p>
392<p>Add shared library symbol versioning on ELF-based systems (e.g.
393Linux and FreeBSD) which use the GNU linker. This is needed if
394several major versions of libtiff might be loaded at once into the
395same program.</p>
396</dd>
397<dt><i>JPEG Support</i></dt>
398<dd><tt>--disable-jpeg&nbsp;&nbsp;&nbsp;&nbsp;disable IJG JPEG
399library usage (required for JPEG compression, enabled by default)
400--with-jpeg-include-dir=DIR&nbsp;&nbsp;&nbsp;&nbsp;location of IJG
401JPEG library headers
402--with-jpeg-lib-dir=DIR&nbsp;&nbsp;&nbsp;&nbsp;location of IJG JPEG
403library binary)</tt></dd>
404<dd>The <tt>JPEG</tt> package enables support for the handling of
405TIFF images with JPEG-encoded data. Support for JPEG-encoded data
406requires the Independent JPEG Group (IJG) <tt>libjpeg</tt>
407distribution; this software is available at <a href=
408"http://www.ijg.org/">http://www.ijg.org/</a>. <b>configure</b>
409script automatically tries to search for a working IJG JPEG
410installation. If it fails to find library, JPEG support will be
411automatically disabled. If you want specify the exact paths to
412library binary and headers, use above switches for that.</dd>
413<dt><i>ZIP Support</i></dt>
414<dd>The <tt>ZIP</tt> support enables support for the handling of
415TIFF images with deflate-encoded data. Support for deflate-encoded
416data requires the freely available <tt>zlib</tt> distribution
417written by Jean-loup Gailly and Mark Adler; this software is
418available at <a href=
419"http://www.zlib.org/">http://www.zlib.org/</a>. If ZIP support is
420enabled the <tt>DIRS_LIBINC</tt> and <tt>DIR_GZLIB</tt> parameters
421should also be set (see below). By default this package is not
422configured.</dd>
423</dl>
424<a name="Sample" id="Sample"></a>
425<hr width="65%" align="right">
426<a name="PC" id="PC"></a>
427<h2>Building the Software under Windows 2000/XP/7/8/10 with nmake</h2>
428With Microsoft Visual C++ installed, and properly configured for
429commandline use (you will likely need to source VCVARS32.BAT in
430AUTOEXEC.bAT or somewhere similar) you should be able to use the
431provided <tt>makefile.vc</tt>.
432<p>The source package is delivered using Unix line termination
433conventions, which work with MSVC but do not work with Windows
434'notepad'. If you use unzip from the <a href=
435"http://www.info-zip.org/pub/infozip/">Info-Zip</a> package, you
436can extract the files using Windows normal line termination
437conventions with a command similar to:</p>
438<pre>
439  unzip -aa -a tiff-4.0.5.zip
440</pre>
441<p>By default the nmake-based libtiff build does not depend on any
442additional libraries.  Normally libtiff should be built with at least
443JPEG and ZIP support so that it can open JPEG and ZIP-compressed TIFF
444files.  In order to add additional libraries (e.g. libjpeg, zlib,
445jbigkit), build those libraries according to their own particular
446build instructions, and then edit 'nmake.opt' (using a capable
447plain-text editor) to enable use of the libraries, including
448specifying where the libraries are installed.  It is also necessary to
449edit libtiff/tiffconf.vc.h to enable the related configuration defines
450(<em>JPEG_SUPPORT</em>, <em>OJPEG_SUPPORT</em>, <em>PIXARLOG_SUPPORT</em>,
451<em>ZIP_SUPPORT</em>), or to disable features which are normally
452included by default.  Ignore the comment at the top of the
453libtiff/tiffconf.vc.h file which says that it has no influence on the
454build, because the statement is not true for Windows. Please note that
455the nmake build copies tiffconf.vc.h to tiffconf.h, and copies
456tif_config.vc.h to tif_config.h, overwriting any files which may be
457present.  Likewise, the 'nmake clean' step removes those files.</p>
458<p>To build using the provided makefile.vc you may use:</p>
459<pre>
460  C:\tiff-4.0.5&gt; nmake /f makefile.vc clean
461  C:\tiff-4.0.5&gt; nmake /f makefile.vc
462
463    or (the hard way)
464
465  C:\tiff-4.0.5&gt; cd port
466  C:\tiff-4.0.5\port&gt; nmake /f makefile.vc clean
467  C:\tiff-4.0.5\port&gt; nmake /f makefile.vc
468  C:\tiff-4.0.5&gt; cd ../libtiff
469  C:\tiff-4.0.5\libtiff&gt; nmake /f makefile.vc clean
470  C:\tiff-4.0.5\libtiff&gt; nmake /f makefile.vc
471  C:\tiff-4.0.5\libtiff&gt; cd ..\tools
472  C:\tiff-4.0.5\tools&gt; nmake /f makefile.vc clean
473  C:\tiff-4.0.5\tools&gt; nmake /f makefile.vc
474</pre>
475<p>This will build the library
476file <tt>libtiff\libtiff\libtiff.lib</tt>.</p>
477<p>The makefile also builds a DLL (libtiff.dll) with an associated
478import library (libtiff_i.lib). Any builds using libtiff will need to
479include the LIBTIFF\LIBTIFF directory in the include path.</p>
480<p>The <tt>libtiff\tools\makefile.vc</tt> should build .exe's for
481all the standard TIFF tool programs.</p>
482<hr>
483<a name="VMS" id="VMS"></a>
484<h2>Building the Software on a VMS System</h2>
485The VMS port was done by Karsten Spang (<a href=
486"mailto:krs@kampsax.dk">krs@kampsax.dk</a>), who also "sort of"
487maintains it. The VMS specific files are not in the main
488directories. Instead they are placed under
489<tt>[.CONTRIB.VMS...]</tt> in the distribution tree. Installation:
490It is assumed that you have unpacked the tar file into a VMS
491directory tree, in this text called DISK:[TIFF].
492<ol>
493<li>Move the VMS specific files to their proper directories.
494<pre>
495$ SET DEFAULT DISK:[TIFF.CONTRIB.VMS]
496$ RENAME [.LIBTIFF]*.* [-.-.LIBTIFF]
497$ RENAME [.TOOLS]*.* [-.-.TOOLS]
498</pre></li>
499<li>Compile the library.
500<pre>
501$ SET DEFAULT DISK:[TIFF.LIBTIFF]
502$ @MAKEVMS
503</pre></li>
504<li>Compile the tools.
505<pre>
506$ SET DEFAULT DISK:[TIFF.TOOLS]
507$ @MAKEVMS
508</pre></li>
509<li>Define the programs.
510<pre>
511$ DEFINE TIFFSHR DISK:[TIFF.LIBTIFF]TIFFSHR
512$ FAX2PS    :==$DISK:[TIFF.TOOLS]FAX2PS
513$ FAX2TIFF  :==$DISK:[TIFF.TOOLS]FAX2TIFF
514$ GIF2TIFF  :==$DISK:[TIFF.TOOLS]GIF2TIFF
515$ PAL2RGB   :==$DISK:[TIFF.TOOLS]PAL2RGB
516$ PPM2TIFF  :==$DISK:[TIFF.TOOLS]PPM2TIFF
517$ RAS2TIFF  :==$DISK:[TIFF.TOOLS]RAS2TIFF
518$ RGB2YCBCR :==$DISK:[TIFF.TOOLS]RGB2YCBCR
519$ THUMBNAIL :==$DISK:[TIFF.TOOLS]THUMBNAIL
520$ TIFF2BW   :==$DISK:[TIFF.TOOLS]TIFF2BW
521$ TIFF2PS   :==$DISK:[TIFF.TOOLS]TIFF2PS
522$ TIFFCMP   :==$DISK:[TIFF.TOOLS]TIFFCMP
523$ TIFFCP    :==$DISK:[TIFF.TOOLS]TIFFCP
524$ TIFFDITHER:==$DISK:[TIFF.TOOLS]TIFFDITHER
525$ TIFFDUMP  :==$DISK:[TIFF.TOOLS]TIFFDUMP
526$ TIFFINFO  :==$DISK:[TIFF.TOOLS]TIFFINFO
527$ TIFFMEDIAN:==$DISK:[TIFF.TOOLS]TIFFMEDIAN
528$ TIFFSPLIT :==$DISK:[TIFF.TOOLS]TIFFSPLIT
529$ YCBCR     :==$DISK:[TIFF.TOOLS]YCBCR
530</pre></li>
531</ol>
532You will want to add these lines to your <tt>LOGIN.COM</tt> file,
533after changing the name of the directory that you have used on your
534machine.
535<p>This release has been tested on OpenVMS/VAX 5.5-2, using VAX C
5363.2. A previous release was tested under OpenVMS/AXP ?.? using DEC
537C ?.?, it is believed that this release as well works on AXP. The
538code contains some GNU C specific things. This does *not* imply,
539however, that the VAX/GCC configuration has been tested, *it has
540not*.</p>
541<p>The command procedures (<tt>MAKEVMS.COM</tt>) for building the
542library and tools, is believed to choose the correct options for
543the VAX and AXP cases automatically.</p>
544<p>On the AXP, IEEE floating point is used by default. If you want
545VAX floating point, remove the <tt>/FLOAT=IEEE_FLOAT</tt>
546qualifier, and change <tt>HAVE_IEEEFP=1</tt> to
547<tt>HAVE_IEEEFP=0</tt> in the <tt>MAKEVMS.COM</tt> files in both
548the <b>libtiff</b> and <b>tools</b> directories.</p>
549<h3>Compiling your own program on a VMS system:</h3>
550When compiling a source file in which you <tt>"#include
551&lt;tiffio.h&gt;"</tt>, use the following command
552<pre>
553    $ CC/INCLUDE=DISK:[TIFF.LIBTIFF]
554</pre>
555This ensures that the header file is found. On the AXP, also add
556<tt>/FLOAT=IEEE_FLOAT</tt> (if used when building the library).
557<h3>Linking your own program to the TIFF library on a VMS
558system:</h3>
559You can link to the library in two ways: Either using the shareable
560library, or using the object library. On the VAX these
561possibilities are:
562<ol>
563<li>Using the shareable TIFF library.
564<pre>
565$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS,SYS$INPUT:/OPTIONS
566    SYS$SHARE:VAXCRTL/SHAREABLE
567</pre></li>
568<li>Using the TIFF object library.
569<pre>
570$ LINK MY_PROGRAM, -
571    DISK:[TIFF.LIBTIFF]TIFF/LIBRARY/INCLUDE=(TIF_FAX3SM,TIF_CODEC), -
572    SYS$INPUT:/OPTIONS
573    SYS$SHARE:VAXCRTL/SHAREABLE
574</pre></li>
575</ol>
576On AXP (and possibly also using DEC C on VAX) the corresponding
577commands are
578<ol>
579<li>Using the shareable TIFF library.
580<pre>
581$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS
582</pre></li>
583<li>Using the TIFF object library.
584<pre>
585$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/LIBRARY
586</pre></li>
587</ol>
588Method 1 uses the shortest link time and smallest <tt>.EXE</tt>
589files, but it requires that <tt>TIFFSHR</tt> is defined as above at
590link time and <strong>at run time</strong>. Using the compilation
591procedure above, the tools are linked in this way.
592<p>Method 2 gives somewhat longer link time and larger
593<tt>.EXE</tt> files, but does not require <tt>TIFFSHR</tt> to be
594defined. This method is recommended if you want to run your program
595on another machine, and for some reason don't want to have the
596library on that machine. If you plan to have more than one program
597(including the tools) on the machine, it is recommended that you
598copy the library to the other machine and use method 1.</p>
599<hr>
600<a name="Other" id="Other"></a>
601<h2>Building the Software on Other Systems</h2>
602This section contains information that might be useful if you are
603working on a non-UNIX system that is not directly supported. All
604library-related files described below are located in the
605<b>libtiff</b> directory.
606<p>The library requires two files that are generated
607<i>on-the-fly</i>. The file <b>tif_fax3sm.c</b> has the state
608tables for the Group 3 and Group 4 decoders. This file is generated
609by the <tt>mkg3states</tt> program on a UNIX system; for
610example,</p>
611<div style="margin-left: 2em">
612<pre>
613<tt>
614cd libtiff
615cc -o mkg3states mkg3states.c
616rm -f tif_fax3sm.c
617./mkg3states -c const tif_fax3sm.c
618</tt>
619</pre></div>
620The <tt>-c</tt> option can be used to control whether or not the
621resutling tables are generated with a <tt>const</tt> declaration.
622The <tt>-s</tt> option can be used to specify a C storage class for
623the table declarations. The <tt>-b</tt> option can be used to force
624data values to be explicitly bracketed with ``{}'' (apparently
625needed for some MS-Windows compilers); otherwise the structures are
626emitted in as compact a format as possible. Consult the source code
627for this program if you have questions.
628<p>The second file required to build the library, <b>version.h</b>,
629contains the version information returned by the
630<tt>TIFFGetVersion</tt> routine. This file is built on most systems
631using the <tt>mkversion</tt> program and the contents of the
632<tt>VERSION</tt> and <tt>tiff.alpha</tt> files; for example,</p>
633<div style="margin-left: 2em">
634<pre>
635cd libtiff
636cc -o mkversion mkversion.c
637rm -f version.h
638./mkversion -v ../VERSION -a ../dist/tiff.alpha version.h
639</pre></div>
640<p>Otherwise, when building the library on a non-UNIX system be
641sure to consult the files <b>tiffcomp.h</b> and <b>tiffconf.h</b>.
642The former contains system compatibility definitions while the
643latter is provided so that the software configuration can be
644controlled on systems that do not support the make facility for
645building the software.</p>
646<p>Systems without a 32-bit compiler may not be able to handle some
647of the codecs in the library; especially the Group 3 and 4 decoder.
648If you encounter problems try disabling support for a particular
649codec; consult the <a href=
650"internals.html#Config">documentation</a>.</p>
651<p>Programs in the tools directory are written to assume an ANSI C
652compilation environment. There may be a few POSIX'isms as well. The
653code in the <b>port</b> directory is provided to emulate routines
654that may be missing on some systems. On UNIX systems the
655<tt>configure</tt> script automatically figures out which routines
656are not present on a system and enables the use of the equivalent
657emulation routines from the <b>port</b> directory. It may be
658necessary to manually do this work on a non-UNIX system. <a name=
659"Testing" id="Testing"></a></p>
660<hr>
661<h2>Checking out the Software</h2>
662<p>Assuming you have working versions of <tt>tiffgt</tt> and
663<tt>tiffsv</tt>, you can just use them to view any of the sample
664images available for testing (see the <a href="images.html">section
665on obtaining the test images</a>). Otherwise, you can do a cursory
666check of the library with the <tt>tiffcp</tt> and <tt>tiffcmp</tt>
667programs. For example,</p>
668<div style="margin-left: 2em">
669<pre>
670tiffcp -lzw cramps.tif x.tif
671tiffcmp cramps.tif x.tif
672</pre></div>
673<p>(<tt>tiffcmp</tt> should be silent if the files compare
674correctly). <a name="TOC" id="TOC"></a></p>
675<hr>
676<h2>Table of Contents</h2>
677The following files makup the core library:
678<pre>
679libtiff/tiff.h                  TIFF spec definitions
680libtiff/tiffcomp.h              non-UNIX OS-compatibility definitions
681libtiff/tiffconf.h              non-UNIX configuration definitions
682libtiff/tiffio.h                public TIFF library definitions
683libtiff/tiffiop.h               private TIFF library definitions
684libtiff/t4.h                    CCITT Group 3/4 code tables+definitions
685libtiff/tif_dir.h               private defs for TIFF directory handling
686libtiff/tif_fax3.h              CCITT Group 3/4-related definitions
687libtiff/tif_predict.h           private defs for Predictor tag support
688libtiff/uvcode.h                LogL/LogLuv codec-specific definitions
689libtiff/version.h               version string (generated by Makefile)
690libtiff/tif_apple.c             Apple-related OS support
691libtiff/tif_atari.c             Atari-related OS support
692libtiff/tif_aux.c               auxilary directory-related functions
693libtiff/tif_close.c             close an open TIFF file
694libtiff/tif_codec.c             configuration table of builtin codecs
695libtiff/tif_compress.c          compression scheme support
696libtiff/tif_dir.c               directory tag interface code
697libtiff/tif_dirinfo.c           directory known tag support code
698libtiff/tif_dirread.c           directory reading code
699libtiff/tif_dirwrite.c          directory writing code
700libtiff/tif_dumpmode.c          "no" compression codec
701libtiff/tif_error.c             library error handler
702libtiff/tif_fax3.c              CCITT Group 3 and 4 codec
703libtiff/tif_fax3sm.c            G3/G4 state tables (generated by mkg3states)
704libtiff/tif_flush.c             i/o and directory state flushing
705libtiff/tif_getimage.c          TIFFRGBAImage support
706libtiff/tif_jpeg.c              JPEG codec (interface to the IJG distribution)
707libtiff/tif_luv.c               SGI LogL/LogLuv codec
708libtiff/tif_lzw.c               LZW codec
709libtiff/tif_msdos.c             MSDOS-related OS support
710libtiff/tif_next.c              NeXT 2-bit scheme codec (decoding only)
711libtiff/tif_open.c              open and simply query code
712libtiff/tif_packbits.c          Packbits codec
713libtiff/tif_pixarlog.c          Pixar codec
714libtiff/tif_predict.c           Predictor tag support
715libtiff/tif_print.c             directory printing support
716libtiff/tif_read.c              image data reading support
717libtiff/tif_strip.c             some strip-related code
718libtiff/tif_swab.c              byte and bit swapping support
719libtiff/tif_thunder.c           Thunderscan codec (decoding only)
720libtiff/tif_tile.c              some tile-related code
721libtiff/tif_unix.c              UNIX-related OS support
722libtiff/tif_version.c           library version support
723libtiff/tif_vms.c               VMS-related OS support
724libtiff/tif_warning.c           library warning handler
725libtiff/tif_win3.c              Windows-3.1-related OS support
726libtiff/tif_win32.c             Win32 (95/98/NT) related OS support
727libtiff/tif_write.c             image data writing support
728libtiff/tif_zip.c               Deflate codec
729
730libtiff/mkg3states.c            program to generate G3/G4 decoder state tables
731libtiff/mkspans.c               program to generate black-white span tables
732libtiff/mkversion.c             program to generate libtiff/version.h.
733</pre>
734<hr>
735Last updated: $Date: 2015-08-29 15:30:11 $
736</body>
737</html>
738