xref: /libtiff-4.0.7/html/build.html (revision 03613213)
1f1e1b43bSBob Friesenhahn<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2f1e1b43bSBob Friesenhahn<html>
3f1e1b43bSBob Friesenhahn<head>
4f1e1b43bSBob Friesenhahn<meta name="generator" content=
57802e5baSBob Friesenhahn"HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
6f1e1b43bSBob Friesenhahn<title>Building the TIFF Software Distribution</title>
7f1e1b43bSBob Friesenhahn</head>
8f1e1b43bSBob Friesenhahn<body bgcolor="white">
9f1e1b43bSBob Friesenhahn<h1><font face="Arial, Helvetica, Sans"><img src=
10f1e1b43bSBob Friesenhahn"images/cramps.gif" width="159" height="203" align="left" border=
11f1e1b43bSBob Friesenhahn"1" hspace="6"> Building the Software Distribution</font></h1>
12f1e1b43bSBob Friesenhahn<ul>
13*03613213SBob Friesenhahn<li><a href="#CMAKE">Building on all systems with CMake</a>.</li>
14*03613213SBob Friesenhahn<li><a href="#UNIX">Building on a UNIX system with Autoconf</a>.</li>
15*03613213SBob Friesenhahn<li><a href="#PC">Building on an MS-DOS or Windows system with nmake</a>.</li>
16f1e1b43bSBob Friesenhahn<li><a href="#VMS">Building on a VMS system</a>.</li>
17f1e1b43bSBob Friesenhahn<li><a href="#Other">Building the Software on Other
18*03613213SBob FriesenhahnSystems.</a></li>
19f1e1b43bSBob Friesenhahn</ul>
20f1e1b43bSBob Friesenhahn<br clear="left">
210ef31e1fSMike WellesThis chapter contains step-by-step instructions on how to configure
22f1e1b43bSBob Friesenhahnand build the TIFF software distribution. The software is most
23f1e1b43bSBob Friesenhahneasily built on a UNIX system, but with a little bit of work it can
247802e5baSBob Friesenhahneasily be built and used on other non-UNIX platforms.
25f1e1b43bSBob Friesenhahn<hr>
26*03613213SBob Friesenhahn<a name="CMake" id="CMAKE"></a>
27*03613213SBob Friesenhahn<h2>Building on all systems with CMake</h2> CMake may be used to
28*03613213SBob Friesenhahngenerate build files for most common build systems and IDEs, and
29*03613213SBob Friesenhahnsupports all UNIX-like systems as well as Windows. See
30*03613213SBob Friesenhahnthe <a href="http://www.cmake.org/">CMake website</a> for further
31*03613213SBob Friesenhahndetails. To build the software on you need to first run
32*03613213SBob Friesenhahn<tt>cmake</tt> to configure the build and generate the system-specific
33*03613213SBob Friesenhahnbuild files. This reads the top-level <tt>CMakeLists.txt</tt> file,
34*03613213SBob Friesenhahnwhich probes the target system for necessary tools and functions,
35*03613213SBob Friesenhahnchecks any options you specified to configure the build, and then
36*03613213SBob Friesenhahnoutputs build files configured for your system.  If using <tt>Unix
37*03613213SBob FriesenhahnMakefiles</tt>, once configuration is done, you simply
38*03613213SBob Friesenhahnrun <tt>make</tt> (or <tt>gmake</tt>) to build the software and
39*03613213SBob Friesenhahnthen <tt>make install</tt> to do the installation.  For other build
40*03613213SBob Friesenhahnsystems, you do the equivalent steps with the tool for that system.
41*03613213SBob FriesenhahnFor example, on any UNIX system:
42*03613213SBob Friesenhahn<div style="margin-left: 2em">
43*03613213SBob Friesenhahn<pre>
44*03613213SBob Friesenhahn% <b>cd ./tiff-4.0.5</b>
45*03613213SBob Friesenhahn% <b>cmake</b>
46*03613213SBob Friesenhahn    <i>...lots of messages...</i>
47*03613213SBob Friesenhahn% <b>make</b>
48*03613213SBob Friesenhahn    <i>...lots of messages...</i>
49*03613213SBob Friesenhahn% <b>make test</b>
50*03613213SBob Friesenhahn    <i>...lots of messages...</i>
51*03613213SBob Friesenhahn# <b>make install</b>
52*03613213SBob Friesenhahn</pre></div>
53*03613213SBob FriesenhahnBuilding is dependent on a <tt>make</tt> utility and a C
54*03613213SBob Friesenhahn(and optionally a C++ compiler), so you will need these tools.
55*03613213SBob Friesenhahn<p>In general, the software is designed such that the following
56*03613213SBob Friesenhahntargets will always be available</p>
57*03613213SBob Friesenhahn<div style="margin-left: 2em">
58*03613213SBob Friesenhahn<pre>
59*03613213SBob Friesenhahnmake [all]      build stuff
60*03613213SBob Friesenhahnmake test       run the test suite
61*03613213SBob Friesenhahnmake install    build and install stuff
62*03613213SBob Friesenhahnmake clean      remove object files, executables and cruft
63*03613213SBob Friesenhahn</pre></div>
64*03613213SBob Friesenhahn<a name="CMakeBuildTrees" id= "CMakeBuildTrees"></a>
65*03613213SBob Friesenhahn<hr width="65%" align="right">
66*03613213SBob Friesenhahn<h3>Build Trees</h3>
67*03613213SBob FriesenhahnThere are two schemes for configuring and building the software. If
68*03613213SBob Friesenhahnyou intend to build the software for only one target system, you
69*03613213SBob Friesenhahncan configure the software so that it is built in the same
70*03613213SBob Friesenhahndirectories as the source code.
71*03613213SBob Friesenhahn<div style="margin-left: 2em">
72*03613213SBob Friesenhahn<pre>
73*03613213SBob Friesenhahn% <b>gzip -dc tiff-4.0.5.tar.gz | tar -xf -</b>
74*03613213SBob Friesenhahn% <b>cd ./tiff-4.0.5</b>
75*03613213SBob Friesenhahn% <b>cmake</b>
76*03613213SBob Friesenhahn% <b>make</b>
77*03613213SBob Friesenhahn% <b>make test</b>
78*03613213SBob Friesenhahn% <b>make install</b>
79*03613213SBob Friesenhahn</pre></div>
80*03613213SBob Friesenhahn<p>Otherwise, you can configure a build tree that is parallel to
81*03613213SBob Friesenhahnthe source tree hierarchy (or in some completely different place)
82*03613213SBob Friesenhahnbut which contains only configured files and files created during
83*03613213SBob Friesenhahnthe build procedure.</p>
84*03613213SBob Friesenhahn<div style="margin-left: 2em">
85*03613213SBob Friesenhahn<pre>
86*03613213SBob Friesenhahn% <b>gzip -dc tiff-4.0.5.tar.gz | tar -xf -</b>
87*03613213SBob Friesenhahn% <b>mkdir tiff-4.0.5-build</b>
88*03613213SBob Friesenhahn% <b>cd ./tiff-4.0.5-build</b>
89*03613213SBob Friesenhahn% <b>cmake ../tiff-4.0.5</b>
90*03613213SBob Friesenhahn% <b>make</b>
91*03613213SBob Friesenhahn% <b>make test</b>
92*03613213SBob Friesenhahn% <b>make install</b>
93*03613213SBob Friesenhahn</pre></div>
94*03613213SBob FriesenhahnThis second scheme is useful for:
95*03613213SBob Friesenhahn<ul>
96*03613213SBob Friesenhahn<li>building multiple targets from a single source tree</li>
97*03613213SBob Friesenhahn<li>building from a read-only source tree (e.g. if you receive the
98*03613213SBob Friesenhahndistribution on CD-ROM)</li>
99*03613213SBob Friesenhahn<li>sharing the source files via a network, but building on
100*03613213SBob Friesenhahnmultiple systems</li>
101*03613213SBob Friesenhahn<li>keeping the source tree clean
102*03613213SBob Friesenhahn(unlike <tt>autoconf</tt>, <tt>cmake</tt> does not provide
103*03613213SBob Friesenhahna <tt>distclean</tt> target, so out of source builds are
104*03613213SBob Friesenhahnrecommended)</li>
105*03613213SBob Friesenhahn</ul>
106*03613213SBob Friesenhahn<a name="CMakeGenerators" id= "CMakeGenerators"></a>
107*03613213SBob Friesenhahn<hr width="65%" align="right">
108*03613213SBob Friesenhahn<h3>Generators</h3> The default generator for UNIX is <tt>Unix
109*03613213SBob FriesenhahnMakefiles</tt>, and on Windows is <tt>NMake Makefiles</tt> or MSBuild
110*03613213SBob Friesenhahndepending upon the setup.  Run <b>cmake --help</b> to list all the
111*03613213SBob Friesenhahngenerators available for your platform.  For example, to use the Ninja
112*03613213SBob Friesenhahn<a href="https://martine.github.io/ninja/">build system</a> on UNIX or
113*03613213SBob FriesenhahnWindows:
114*03613213SBob Friesenhahn<pre>
115*03613213SBob Friesenhahn<b>cmake -G Ninja</b>
116*03613213SBob Friesenhahn<b>cmake --build .</b>
117*03613213SBob Friesenhahn<b>ctest -V</b>
118*03613213SBob Friesenhahn<b>cmake --build . --target install</b>
119*03613213SBob Friesenhahn</pre>
120*03613213SBob Friesenhahn<p>Note that <b>cmake --build .</b> is a build-system-independent way
121*03613213SBob Friesenhahnof building a target; you can always use the build system directly.</p>
122*03613213SBob Friesenhahn<p>Alternatively, using the MSBuild system on Windows (64-bit Release
123*03613213SBob Friesenhahnbuild with VS2013):
124*03613213SBob Friesenhahn</p>
125*03613213SBob Friesenhahn<pre>
126*03613213SBob Friesenhahn<b>cmake -G "Visual Studio 12 2013 Win64"</b>
127*03613213SBob Friesenhahn<b>cmake --build . --config Release</b>
128*03613213SBob Friesenhahn<b>ctest -V -C Release</b>
129*03613213SBob Friesenhahn<b>cmake --build . --config Release --target install</b>
130*03613213SBob Friesenhahn</pre>
131*03613213SBob FriesenhahnWith the above configuration, it's also possible to open the generated
132*03613213SBob Friesenhahnsolution file with the Visual Studio IDE as well as building on the
133*03613213SBob Friesenhahncommand-line.
134*03613213SBob Friesenhahn<a name="CMakeConfigOptions" id="CMakeConfigOptions"></a>
135*03613213SBob Friesenhahn<hr width="65%" align="right">
136*03613213SBob Friesenhahn<h3>Configuration Options</h3>
137*03613213SBob FriesenhahnThe configuration process is critical to the proper compilation,
138*03613213SBob Friesenhahninstallation, and operation of the
139*03613213SBob Friesenhahnsoftware. The <tt>CMakeLists.txt</tt> script runs a series of tests to
140*03613213SBob Friesenhahndecide whether or not the target system supports required
141*03613213SBob Friesenhahnfunctionality and, if it does not, whether it can emulate or
142*03613213SBob Friesenhahnworkaround the missing functions.  After running <tt>cmake</tt>, check
143*03613213SBob Friesenhahnthe <tt>CMakeCache.txt</tt> file; this contains all the results of the
144*03613213SBob Friesenhahnchecks performed and the options set by the user.  If <tt>cmake</tt>
145*03613213SBob Friesenhahnfailed to run, check <tt>CMakeFiles/CMakeOutput.log</tt>
146*03613213SBob Friesenhahnand <tt>CMakeFiles/CMakeError.log</tt>; these should record the error
147*03613213SBob Friesenhahnwhich caused the failure.
148*03613213SBob Friesenhahn<p>A second function of the configure script is to set the default
149*03613213SBob Friesenhahnconfiguration parameters for the software. Of particular note are the
150*03613213SBob Friesenhahndirectories where the software is to be installed. By default the
151*03613213SBob Friesenhahnsoftware is installed in the <b>/usr/local</b> hierarchy. To change
152*03613213SBob Friesenhahnthis behaviour the appropriate parameters can be specified on the
153*03613213SBob Friesenhahncommand line. Run <b>cmake --help</b> to get a full list of possible
154*03613213SBob Friesenhahnoptions, and <b>cmake -LH</b> to list all the configurable options for
155*03613213SBob Friesenhahnthis software package, or <b>cmake -LAH</b> to show all advanced
156*03613213SBob Friesenhahnoptions in addition. Standard installation related options are shown
157*03613213SBob Friesenhahnbelow.</p>
158*03613213SBob Friesenhahn<pre>
159*03613213SBob Friesenhahn<tt>
160*03613213SBob FriesenhahnInstallation directories:
161*03613213SBob Friesenhahn  CMAKE_INSTALL_PREFIX
162*03613213SBob Friesenhahn
163*03613213SBob FriesenhahnFine tuning of the installation directories:
164*03613213SBob Friesenhahn  CMAKE_INSTALL_BINDIR            user executables [PREFIX/bin]
165*03613213SBob Friesenhahn  CMAKE_INSTALL_SBINDIR           system admin executables [PREFIX/sbin]
166*03613213SBob Friesenhahn  CMAKE_INSTALL_LIBEXECDIR        program executables [PREFIX/libexec]
167*03613213SBob Friesenhahn  CMAKE_INSTALL_SYSCONFDIR        read-only single-machine data [PREFIX/etc]
168*03613213SBob Friesenhahn  CMAKE_INSTALL_SHAREDSTATEDIR    modifiable architecture-independent data [PREFIX/com]
169*03613213SBob Friesenhahn  CMAKE_INSTALL_LOCALSTATEDIR     modifiable single-machine data [PREFIX/var]
170*03613213SBob Friesenhahn  CMAKE_INSTALL_LIBDIR            object code libraries [PREFIX/lib]
171*03613213SBob Friesenhahn  CMAKE_INSTALL_INCLUDEDIR        C header files [PREFIX/include]
172*03613213SBob Friesenhahn  CMAKE_INSTALL_OLDINCLUDEDIR     C header files for non-gcc [/usr/include]
173*03613213SBob Friesenhahn  CMAKE_INSTALL_DATAROOTDIR       read-only arch.-independent data root [PREFIX/share]
174*03613213SBob Friesenhahn  CMAKE_INSTALL_DATADIR           read-only architecture-independent data [DATAROOTDIR]
175*03613213SBob Friesenhahn  CMAKE_INSTALL_LOCALEDIR         locale-dependent data [DATAROOTDIR/locale]
176*03613213SBob Friesenhahn  CMAKE_INSTALL_MANDIR            man documentation [DATAROOTDIR/man]
177*03613213SBob Friesenhahn  CMAKE_INSTALL_DOCDIR            documentation root [DATAROOTDIR/doc/tiff]
178*03613213SBob Friesenhahn</tt>
179*03613213SBob Friesenhahn</pre>
180*03613213SBob FriesenhahnAlso see the
181*03613213SBob FriesenhahnCMake <a href="http://www.cmake.org/cmake/help/v3.3/">documentation</a>
182*03613213SBob Friesenhahnfor <a href="http://www.cmake.org/cmake/help/v3.3/manual/cmake-variables.7.html"
183*03613213SBob Friesenhahn>additional variables</a> which may be set.
184*03613213SBob Friesenhahn<a name="CMakePackages" id="CMakePackages"></a>
185*03613213SBob Friesenhahn<hr width="65%" align="right">
186*03613213SBob Friesenhahn<h3>Configuring Optional Packages/Support</h3>
187*03613213SBob FriesenhahnThe TIFF software comes with several packages that are installed
188*03613213SBob Friesenhahnonly as needed, or only if specifically configured at the time the
189*03613213SBob Friesenhahnconfigure script is run. Packages can be configured via the
190*03613213SBob Friesenhahn<b>cmake</b> commandline parameters.
191*03613213SBob Friesenhahn<dl>
192*03613213SBob Friesenhahn<dt><i>Static/Shared Objects Support</i></dt>
193*03613213SBob Friesenhahn<dd><tt>BUILD_SHARED_LIBS[=ON|OFF]&nbsp;&nbsp;&nbsp;&nbsp;build shared
194*03613213SBob Friesenhahnlibraries [default=ON]</tt><br>
195*03613213SBob Friesenhahn<p>This option controls whether or not to configure the software
196*03613213SBob Friesenhahnto build a shared and static binaries for the TIFF library. Use of
197*03613213SBob Friesenhahnshared libraries can significantly reduce the disk space needed for
198*03613213SBob Friesenhahnusers of the TIFF software. If shared libraries are not used then
199*03613213SBob Friesenhahnthe code is statically linked into each application that uses it.
200*03613213SBob Friesenhahn</p>
201*03613213SBob Friesenhahn<p><tt>ld-version-script[=ON|OFF]&nbsp;&nbsp;Enable linker version
202*03613213SBob Friesenhahnscript (default is ON)</tt></p>
203*03613213SBob Friesenhahn<p>Add shared library symbol versioning on ELF-based systems (e.g.
204*03613213SBob FriesenhahnLinux and FreeBSD) which use the GNU linker. This is needed if
205*03613213SBob Friesenhahnseveral major versions of libtiff might be loaded at once into the
206*03613213SBob Friesenhahnsame program.</p>
207*03613213SBob Friesenhahn</dd>
208*03613213SBob Friesenhahn<dt><i>JPEG Support</i></dt>
209*03613213SBob Friesenhahn<dd><tt>jpeg[=ON|OFF]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enable IJG JPEG
210*03613213SBob Friesenhahnlibrary usage (required for JPEG compression, enabled by default)<br>
211*03613213SBob FriesenhahnJPEG_INCLUDE_DIR=DIR&nbsp;location of IJG
212*03613213SBob FriesenhahnJPEG library headers<br>
213*03613213SBob FriesenhahnJPEG_LIBRARY=DIR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location of IJG JPEG
214*03613213SBob Friesenhahnlibrary binary)</tt></dd>
215*03613213SBob Friesenhahn<dd>The <tt>JPEG</tt> package enables support for the handling of
216*03613213SBob FriesenhahnTIFF images with JPEG-encoded data. Support for JPEG-encoded data
217*03613213SBob Friesenhahnrequires the Independent JPEG Group (IJG) <tt>libjpeg</tt>
218*03613213SBob Friesenhahndistribution; this software is available at <a href=
219*03613213SBob Friesenhahn"http://www.ijg.org/">http://www.ijg.org/</a>. <b>cmake</b>
220*03613213SBob Friesenhahnscript automatically tries to search for a working IJG JPEG
221*03613213SBob Friesenhahninstallation. If it fails to find library, JPEG support will be
222*03613213SBob Friesenhahnautomatically disabled. If you want specify the exact paths to
223*03613213SBob Friesenhahnlibrary binary and headers, use above options for that.</dd>
224*03613213SBob Friesenhahn<dt><i>ZIP Support</i></dt>
225*03613213SBob Friesenhahn<dd>The <tt>ZIP</tt> support enables support for the handling of TIFF
226*03613213SBob Friesenhahnimages with deflate-encoded data (enabled by default if
227*03613213SBob Friesenhahnavailable). Support for deflate-encoded data requires the freely
228*03613213SBob Friesenhahnavailable <tt>zlib</tt> distribution written by Jean-loup Gailly and
229*03613213SBob FriesenhahnMark Adler; this software is available at <a href=
230*03613213SBob Friesenhahn"http://www.zlib.org/">http://www.zlib.org/</a>.</dd>
231*03613213SBob Friesenhahn</dl>
232*03613213SBob Friesenhahn<a name="Sample" id="Sample"></a>
233*03613213SBob Friesenhahn<hr width="65%" align="right">
2347802e5baSBob Friesenhahn<a name="UNIX" id="UNIX"></a>
235*03613213SBob Friesenhahn<h2>Building on a UNIX System with Autoconf</h2>
236f1e1b43bSBob FriesenhahnTo build the software on a UNIX system you need to first run the
237f1e1b43bSBob Friesenhahnconfigure shell script that is located in the top level of the
238f1e1b43bSBob Friesenhahnsource directory. This script probes the target system for
239f1e1b43bSBob Friesenhahnnecessary tools and functions and constructs a build environment in
240f1e1b43bSBob Friesenhahnwhich the software may be compiled. Once configuration is done, you
241f1e1b43bSBob Friesenhahnsimply run <tt>make</tt> (or <tt>gmake</tt>) to build the software
242f1e1b43bSBob Friesenhahnand then <tt>make install</tt> to do the installation; for example:
243f1e1b43bSBob Friesenhahn<div style="margin-left: 2em">
244f1e1b43bSBob Friesenhahn<pre>
245*03613213SBob Friesenhahn% <b>cd ./tiff-4.0.5</b>
246*03613213SBob Friesenhahn% <b>./configure</b>
247f1e1b43bSBob Friesenhahn    <i>...lots of messages...</i>
248*03613213SBob Friesenhahn% <b>make</b>
249f1e1b43bSBob Friesenhahn    <i>...lots of messages...</i>
250*03613213SBob Friesenhahn% <b>make check</b>
2517802e5baSBob Friesenhahn    <i>...lots of messages...</i>
252*03613213SBob Friesenhahn# <b>make install</b>
253f1e1b43bSBob Friesenhahn</pre></div>
2547802e5baSBob FriesenhahnSupplied makefiles are dependent on a <tt>make</tt> utility and a C
2557802e5baSBob Friesenhahn(and optionally a C++ compiler), so you will need these tools.
256f1e1b43bSBob Friesenhahn<p>In general, the software is designed such that the following
257f1e1b43bSBob Friesenhahnshould be ``<i>make-able</i>'' in each directory:</p>
258f1e1b43bSBob Friesenhahn<div style="margin-left: 2em">
259f1e1b43bSBob Friesenhahn<pre>
2600ef31e1fSMike Wellesmake [all]      build stuff
2617802e5baSBob Friesenhahnmake check      run the test suite
262*03613213SBob Friesenhahnmake install    build and install stuff
263*03613213SBob Friesenhahnmake clean      remove object files, executables and cruft
264cb5ad4a8SAndrey Kiselevmake distclean  remove everything, that can be recreated
265f1e1b43bSBob Friesenhahn</pre></div>
266f1e1b43bSBob FriesenhahnNote that after running "<tt>make distclean</tt>" the
267f1e1b43bSBob Friesenhahn<tt>configure</tt> script must be run again to create the Makefiles
268f1e1b43bSBob Friesenhahnand other make-related files. <a name="BuildTrees" id=
269f1e1b43bSBob Friesenhahn"BuildTrees"></a>
270f1e1b43bSBob Friesenhahn<hr width="65%" align="right">
271f1e1b43bSBob Friesenhahn<h3>Build Trees</h3>
272f1e1b43bSBob FriesenhahnThere are two schemes for configuring and building the software. If
273f1e1b43bSBob Friesenhahnyou intend to build the software for only one target system, you
274f1e1b43bSBob Friesenhahncan configure the software so that it is built in the same
275f1e1b43bSBob Friesenhahndirectories as the source code.
276f1e1b43bSBob Friesenhahn<div style="margin-left: 2em">
277f1e1b43bSBob Friesenhahn<pre>
278*03613213SBob Friesenhahn% <b>gzip -dc tiff-4.0.5.tar.gz | tar -xf -</b>
279*03613213SBob Friesenhahn% <b>cd ./tiff-4.0.5</b>
280*03613213SBob Friesenhahn% <b>./configure</b>
281*03613213SBob Friesenhahn% <b>make</b>
282*03613213SBob Friesenhahn% <b>make check</b>
283*03613213SBob Friesenhahn% <b>make install</b>
284f1e1b43bSBob Friesenhahn</pre></div>
285f1e1b43bSBob Friesenhahn<p>Otherwise, you can configure a build tree that is parallel to
2867802e5baSBob Friesenhahnthe source tree hierarchy (or in some completely different place)
2877802e5baSBob Friesenhahnbut which contains only configured files and files created during
2887802e5baSBob Friesenhahnthe build procedure.</p>
289f1e1b43bSBob Friesenhahn<div style="margin-left: 2em">
290f1e1b43bSBob Friesenhahn<pre>
291*03613213SBob Friesenhahn% <b>gzip -dc tiff-4.0.5.tar.gz | tar -xf -</b>
292*03613213SBob Friesenhahn% <b>mkdir tiff-4.0.5-build</b>
293*03613213SBob Friesenhahn% <b>cd ./tiff-4.0.5-build</b>
294*03613213SBob Friesenhahn% <b>../tiff-4.0.5/configure</b>
295*03613213SBob Friesenhahn% <b>make</b>
296*03613213SBob Friesenhahn% <b>make check</b>
297*03613213SBob Friesenhahn% <b>make install</b>
298f1e1b43bSBob Friesenhahn</pre></div>
2990ef31e1fSMike WellesThis second scheme is useful for:
300f1e1b43bSBob Friesenhahn<ul>
301f1e1b43bSBob Friesenhahn<li>building multiple targets from a single source tree</li>
302f1e1b43bSBob Friesenhahn<li>building from a read-only source tree (e.g. if you receive the
303f1e1b43bSBob Friesenhahndistribution on CD-ROM)</li>
3047802e5baSBob Friesenhahn<li>sharing the source files via a network, but building on
3057802e5baSBob Friesenhahnmultiple systems</li>
306f1e1b43bSBob Friesenhahn</ul>
307f1e1b43bSBob Friesenhahn<a name="ConfigOptions" id="ConfigOptions"></a>
308f1e1b43bSBob Friesenhahn<hr width="65%" align="right">
309f1e1b43bSBob Friesenhahn<h3>Configuration Options</h3>
310f1e1b43bSBob FriesenhahnThe configuration process is critical to the proper compilation,
311f1e1b43bSBob Friesenhahninstallation, and operation of the software. The configure script
312f1e1b43bSBob Friesenhahnruns a series of tests to decide whether or not the target system
313f1e1b43bSBob Friesenhahnsupports required functionality and, if it does not, whether it can
314f1e1b43bSBob Friesenhahnemulate or workaround the missing functions. This procedure is
315f1e1b43bSBob Friesenhahnfairly complicated and, due to the nonstandard nature of most UNIX
316f1e1b43bSBob Friesenhahnsystems, prone to error. The first time that you configure the
317f1e1b43bSBob Friesenhahnsoftware for use you should check the output from the configure
318f1e1b43bSBob Friesenhahnscript and look for anything that does not make sense for your
319f1e1b43bSBob Friesenhahnsystem.
320f1e1b43bSBob Friesenhahn<p>A second function of the configure script is to set the default
321f1e1b43bSBob Friesenhahnconfiguration parameters for the software. Of particular note are
322f1e1b43bSBob Friesenhahnthe directories where the software is to be installed. By default
323f1e1b43bSBob Friesenhahnthe software is installed in the <b>/usr/local</b> hierarchy. To
324f1e1b43bSBob Friesenhahnchange this behaviour the appropriate parameters can be specified
325f1e1b43bSBob Friesenhahnon the command line to configure. Run <b>./configure --help</b> to
3267802e5baSBob Friesenhahnget a full list of possible options. Standard installation related
3277802e5baSBob Friesenhahnoptions are shown below.</p>
328f1e1b43bSBob Friesenhahn<pre>
329f1e1b43bSBob Friesenhahn<tt>
330cb5ad4a8SAndrey KiselevInstallation directories:
331cb5ad4a8SAndrey Kiselev  --prefix=PREFIX         install architecture-independent files in PREFIX
332cb5ad4a8SAndrey Kiselev                          [/usr/local]
333cb5ad4a8SAndrey Kiselev  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
334cb5ad4a8SAndrey Kiselev                          [PREFIX]
3350ef31e1fSMike Welles
336cb5ad4a8SAndrey KiselevBy default, `make install' will install all the files in
337cb5ad4a8SAndrey Kiselev`/usr/local/bin', `/usr/local/lib' etc.  You can specify
338cb5ad4a8SAndrey Kiselevan installation prefix other than `/usr/local' using `--prefix',
339cb5ad4a8SAndrey Kiselevfor instance `--prefix=$HOME'.
3400ef31e1fSMike Welles
341cb5ad4a8SAndrey KiselevFor better control, use the options below.
3420ef31e1fSMike Welles
343cb5ad4a8SAndrey KiselevFine tuning of the installation directories:
344cb5ad4a8SAndrey Kiselev  --bindir=DIR            user executables [EPREFIX/bin]
345cb5ad4a8SAndrey Kiselev  --sbindir=DIR           system admin executables [EPREFIX/sbin]
346cb5ad4a8SAndrey Kiselev  --libexecdir=DIR        program executables [EPREFIX/libexec]
347cb5ad4a8SAndrey Kiselev  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
348cb5ad4a8SAndrey Kiselev  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
349cb5ad4a8SAndrey Kiselev  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
350cb5ad4a8SAndrey Kiselev  --libdir=DIR            object code libraries [EPREFIX/lib]
351cb5ad4a8SAndrey Kiselev  --includedir=DIR        C header files [PREFIX/include]
352cb5ad4a8SAndrey Kiselev  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
3537802e5baSBob Friesenhahn  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
3547802e5baSBob Friesenhahn  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
3557802e5baSBob Friesenhahn  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
3567802e5baSBob Friesenhahn  --mandir=DIR            man documentation [DATAROOTDIR/man]
3577802e5baSBob Friesenhahn  --docdir=DIR            documentation root [DATAROOTDIR/doc/tiff]
3587802e5baSBob Friesenhahn  --htmldir=DIR           html documentation [DOCDIR]
3590ef31e1fSMike Welles
360cb5ad4a8SAndrey KiselevProgram names:
361cb5ad4a8SAndrey Kiselev  --program-prefix=PREFIX            prepend PREFIX to installed program names
362cb5ad4a8SAndrey Kiselev  --program-suffix=SUFFIX            append SUFFIX to installed program names
363cb5ad4a8SAndrey Kiselev  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
364f1e1b43bSBob Friesenhahn</tt>
365f1e1b43bSBob Friesenhahn</pre>
366f1e1b43bSBob Friesenhahn<a name="Packages" id="Packages"></a>
367f1e1b43bSBob Friesenhahn<hr width="65%" align="right">
368f1e1b43bSBob Friesenhahn<h3>Configuring Optional Packages/Support</h3>
369f1e1b43bSBob FriesenhahnThe TIFF software comes with several packages that are installed
370f1e1b43bSBob Friesenhahnonly as needed, or only if specifically configured at the time the
371f1e1b43bSBob Friesenhahnconfigure script is run. Packages can be configured via the
372f1e1b43bSBob Friesenhahn<b>configure</b> script commandline parameters.
373f1e1b43bSBob Friesenhahn<dl>
374f1e1b43bSBob Friesenhahn<dt><i>Static/Shared Objects Support</i></dt>
375f1e1b43bSBob Friesenhahn<dd><tt>--enable-shared[=PKGS]&nbsp;&nbsp;&nbsp;&nbsp;build shared
376f1e1b43bSBob Friesenhahnlibraries [default=yes]<br>
377f1e1b43bSBob Friesenhahn--enable-static[=PKGS]&nbsp;&nbsp;&nbsp;&nbsp;build static
378f1e1b43bSBob Friesenhahnlibraries [default=yes]</tt>
379f1e1b43bSBob Friesenhahn<p>These options control whether or not to configure the software
380f1e1b43bSBob Friesenhahnto build a shared and static binaries for the TIFF library. Use of
381f1e1b43bSBob Friesenhahnshared libraries can significantly reduce the disk space needed for
382*03613213SBob Friesenhahnusers of the TIFF software. If shared libraries are not used then
383f1e1b43bSBob Friesenhahnthe code is statically linked into each application that uses it.
384f1e1b43bSBob FriesenhahnBy default both types of binaries is configured.</p>
3857802e5baSBob Friesenhahn<p>
3867802e5baSBob Friesenhahn<tt>--enable-rpath&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enable
3877802e5baSBob Friesenhahnruntime linker paths (-R libtool option)</tt></p>
388f1e1b43bSBob Friesenhahn<p>Add library directories (see other options below) to the TIFF
389f1e1b43bSBob Friesenhahnlibrary run-time linker path.</p>
3907802e5baSBob Friesenhahn<p><tt>--enable-ld-version-script&nbsp;&nbsp;Enable linker version
3917802e5baSBob Friesenhahnscript (default is disabled)</tt></p>
3927802e5baSBob Friesenhahn<p>Add shared library symbol versioning on ELF-based systems (e.g.
3937802e5baSBob FriesenhahnLinux and FreeBSD) which use the GNU linker. This is needed if
3947802e5baSBob Friesenhahnseveral major versions of libtiff might be loaded at once into the
3957802e5baSBob Friesenhahnsame program.</p>
396f1e1b43bSBob Friesenhahn</dd>
397f1e1b43bSBob Friesenhahn<dt><i>JPEG Support</i></dt>
398f1e1b43bSBob Friesenhahn<dd><tt>--disable-jpeg&nbsp;&nbsp;&nbsp;&nbsp;disable IJG JPEG
399f1e1b43bSBob Friesenhahnlibrary usage (required for JPEG compression, enabled by default)
400f1e1b43bSBob Friesenhahn--with-jpeg-include-dir=DIR&nbsp;&nbsp;&nbsp;&nbsp;location of IJG
401f1e1b43bSBob FriesenhahnJPEG library headers
402f1e1b43bSBob Friesenhahn--with-jpeg-lib-dir=DIR&nbsp;&nbsp;&nbsp;&nbsp;location of IJG JPEG
403f1e1b43bSBob Friesenhahnlibrary binary)</tt></dd>
404f1e1b43bSBob Friesenhahn<dd>The <tt>JPEG</tt> package enables support for the handling of
405f1e1b43bSBob FriesenhahnTIFF images with JPEG-encoded data. Support for JPEG-encoded data
406f1e1b43bSBob Friesenhahnrequires the Independent JPEG Group (IJG) <tt>libjpeg</tt>
407f1e1b43bSBob Friesenhahndistribution; this software is available at <a href=
4087802e5baSBob Friesenhahn"http://www.ijg.org/">http://www.ijg.org/</a>. <b>configure</b>
4097802e5baSBob Friesenhahnscript automatically tries to search for a working IJG JPEG
4107802e5baSBob Friesenhahninstallation. If it fails to find library, JPEG support will be
4117802e5baSBob Friesenhahnautomatically disabled. If you want specify the exact paths to
4127802e5baSBob Friesenhahnlibrary binary and headers, use above switches for that.</dd>
413f1e1b43bSBob Friesenhahn<dt><i>ZIP Support</i></dt>
414f1e1b43bSBob Friesenhahn<dd>The <tt>ZIP</tt> support enables support for the handling of
415f1e1b43bSBob FriesenhahnTIFF images with deflate-encoded data. Support for deflate-encoded
416f1e1b43bSBob Friesenhahndata requires the freely available <tt>zlib</tt> distribution
417f1e1b43bSBob Friesenhahnwritten by Jean-loup Gailly and Mark Adler; this software is
418f1e1b43bSBob Friesenhahnavailable at <a href=
4197802e5baSBob Friesenhahn"http://www.zlib.org/">http://www.zlib.org/</a>. If ZIP support is
4207802e5baSBob Friesenhahnenabled the <tt>DIRS_LIBINC</tt> and <tt>DIR_GZLIB</tt> parameters
4217802e5baSBob Friesenhahnshould also be set (see below). By default this package is not
4227802e5baSBob Friesenhahnconfigured.</dd>
423f1e1b43bSBob Friesenhahn</dl>
424f1e1b43bSBob Friesenhahn<a name="Sample" id="Sample"></a>
425f1e1b43bSBob Friesenhahn<hr width="65%" align="right">
4267802e5baSBob Friesenhahn<a name="PC" id="PC"></a>
427*03613213SBob Friesenhahn<h2>Building the Software under Windows 2000/XP/7/8/10 with nmake</h2>
428f1e1b43bSBob FriesenhahnWith Microsoft Visual C++ installed, and properly configured for
429f1e1b43bSBob Friesenhahncommandline use (you will likely need to source VCVARS32.BAT in
430f1e1b43bSBob FriesenhahnAUTOEXEC.bAT or somewhere similar) you should be able to use the
431f1e1b43bSBob Friesenhahnprovided <tt>makefile.vc</tt>.
432f1e1b43bSBob Friesenhahn<p>The source package is delivered using Unix line termination
433f1e1b43bSBob Friesenhahnconventions, which work with MSVC but do not work with Windows
434f1e1b43bSBob Friesenhahn'notepad'. If you use unzip from the <a href=
435f1e1b43bSBob Friesenhahn"http://www.info-zip.org/pub/infozip/">Info-Zip</a> package, you
436f1e1b43bSBob Friesenhahncan extract the files using Windows normal line termination
437f1e1b43bSBob Friesenhahnconventions with a command similar to:</p>
43891eb1e2dSFrank Warmerdam<pre>
439*03613213SBob Friesenhahn  unzip -aa -a tiff-4.0.5.zip
44091eb1e2dSFrank Warmerdam</pre>
44137c8b068SBob Friesenhahn<p>By default the nmake-based libtiff build does not depend on any
44237c8b068SBob Friesenhahnadditional libraries.  Normally libtiff should be built with at least
44337c8b068SBob FriesenhahnJPEG and ZIP support so that it can open JPEG and ZIP-compressed TIFF
44437c8b068SBob Friesenhahnfiles.  In order to add additional libraries (e.g. libjpeg, zlib,
44537c8b068SBob Friesenhahnjbigkit), build those libraries according to their own particular
44637c8b068SBob Friesenhahnbuild instructions, and then edit 'nmake.opt' (using a capable
44737c8b068SBob Friesenhahnplain-text editor) to enable use of the libraries, including
44837c8b068SBob Friesenhahnspecifying where the libraries are installed.  It is also necessary to
44937c8b068SBob Friesenhahnedit libtiff/tiffconf.vc.h to enable the related configuration defines
45037c8b068SBob Friesenhahn(<em>JPEG_SUPPORT</em>, <em>OJPEG_SUPPORT</em>, <em>PIXARLOG_SUPPORT</em>,
45137c8b068SBob Friesenhahn<em>ZIP_SUPPORT</em>), or to disable features which are normally
45237c8b068SBob Friesenhahnincluded by default.  Ignore the comment at the top of the
45337c8b068SBob Friesenhahnlibtiff/tiffconf.vc.h file which says that it has no influence on the
45437c8b068SBob Friesenhahnbuild, because the statement is not true for Windows. Please note that
45537c8b068SBob Friesenhahnthe nmake build copies tiffconf.vc.h to tiffconf.h, and copies
45637c8b068SBob Friesenhahntif_config.vc.h to tif_config.h, overwriting any files which may be
45737c8b068SBob Friesenhahnpresent.  Likewise, the 'nmake clean' step removes those files.</p>
458f1e1b43bSBob Friesenhahn<p>To build using the provided makefile.vc you may use:</p>
459f1e1b43bSBob Friesenhahn<pre>
460*03613213SBob Friesenhahn  C:\tiff-4.0.5&gt; nmake /f makefile.vc clean
461*03613213SBob Friesenhahn  C:\tiff-4.0.5&gt; nmake /f makefile.vc
4620ef31e1fSMike Welles
463f1e1b43bSBob Friesenhahn    or (the hard way)
46491eb1e2dSFrank Warmerdam
465*03613213SBob Friesenhahn  C:\tiff-4.0.5&gt; cd port
466*03613213SBob Friesenhahn  C:\tiff-4.0.5\port&gt; nmake /f makefile.vc clean
467*03613213SBob Friesenhahn  C:\tiff-4.0.5\port&gt; nmake /f makefile.vc
468*03613213SBob Friesenhahn  C:\tiff-4.0.5&gt; cd ../libtiff
469*03613213SBob Friesenhahn  C:\tiff-4.0.5\libtiff&gt; nmake /f makefile.vc clean
470*03613213SBob Friesenhahn  C:\tiff-4.0.5\libtiff&gt; nmake /f makefile.vc
471*03613213SBob Friesenhahn  C:\tiff-4.0.5\libtiff&gt; cd ..\tools
472*03613213SBob Friesenhahn  C:\tiff-4.0.5\tools&gt; nmake /f makefile.vc clean
473*03613213SBob Friesenhahn  C:\tiff-4.0.5\tools&gt; nmake /f makefile.vc
474f1e1b43bSBob Friesenhahn</pre>
47537c8b068SBob Friesenhahn<p>This will build the library
47637c8b068SBob Friesenhahnfile <tt>libtiff\libtiff\libtiff.lib</tt>.</p>
477f1e1b43bSBob Friesenhahn<p>The makefile also builds a DLL (libtiff.dll) with an associated
47837c8b068SBob Friesenhahnimport library (libtiff_i.lib). Any builds using libtiff will need to
47937c8b068SBob Friesenhahninclude the LIBTIFF\LIBTIFF directory in the include path.</p>
480f1e1b43bSBob Friesenhahn<p>The <tt>libtiff\tools\makefile.vc</tt> should build .exe's for
481f1e1b43bSBob Friesenhahnall the standard TIFF tool programs.</p>
482f1e1b43bSBob Friesenhahn<hr>
4837802e5baSBob Friesenhahn<a name="VMS" id="VMS"></a>
484f1e1b43bSBob Friesenhahn<h2>Building the Software on a VMS System</h2>
485f1e1b43bSBob FriesenhahnThe VMS port was done by Karsten Spang (<a href=
486f1e1b43bSBob Friesenhahn"mailto:[email protected]">[email protected]</a>), who also "sort of"
487f1e1b43bSBob Friesenhahnmaintains it. The VMS specific files are not in the main
488f1e1b43bSBob Friesenhahndirectories. Instead they are placed under
489f1e1b43bSBob Friesenhahn<tt>[.CONTRIB.VMS...]</tt> in the distribution tree. Installation:
490f1e1b43bSBob FriesenhahnIt is assumed that you have unpacked the tar file into a VMS
491f1e1b43bSBob Friesenhahndirectory tree, in this text called DISK:[TIFF].
492f1e1b43bSBob Friesenhahn<ol>
493f1e1b43bSBob Friesenhahn<li>Move the VMS specific files to their proper directories.
494f1e1b43bSBob Friesenhahn<pre>
4950ef31e1fSMike Welles$ SET DEFAULT DISK:[TIFF.CONTRIB.VMS]
4960ef31e1fSMike Welles$ RENAME [.LIBTIFF]*.* [-.-.LIBTIFF]
4970ef31e1fSMike Welles$ RENAME [.TOOLS]*.* [-.-.TOOLS]
498f1e1b43bSBob Friesenhahn</pre></li>
499f1e1b43bSBob Friesenhahn<li>Compile the library.
500f1e1b43bSBob Friesenhahn<pre>
5010ef31e1fSMike Welles$ SET DEFAULT DISK:[TIFF.LIBTIFF]
5020ef31e1fSMike Welles$ @MAKEVMS
503f1e1b43bSBob Friesenhahn</pre></li>
504f1e1b43bSBob Friesenhahn<li>Compile the tools.
505f1e1b43bSBob Friesenhahn<pre>
5060ef31e1fSMike Welles$ SET DEFAULT DISK:[TIFF.TOOLS]
5070ef31e1fSMike Welles$ @MAKEVMS
508f1e1b43bSBob Friesenhahn</pre></li>
509f1e1b43bSBob Friesenhahn<li>Define the programs.
510f1e1b43bSBob Friesenhahn<pre>
5110ef31e1fSMike Welles$ DEFINE TIFFSHR DISK:[TIFF.LIBTIFF]TIFFSHR
5120ef31e1fSMike Welles$ FAX2PS    :==$DISK:[TIFF.TOOLS]FAX2PS
5130ef31e1fSMike Welles$ FAX2TIFF  :==$DISK:[TIFF.TOOLS]FAX2TIFF
5140ef31e1fSMike Welles$ GIF2TIFF  :==$DISK:[TIFF.TOOLS]GIF2TIFF
5150ef31e1fSMike Welles$ PAL2RGB   :==$DISK:[TIFF.TOOLS]PAL2RGB
5160ef31e1fSMike Welles$ PPM2TIFF  :==$DISK:[TIFF.TOOLS]PPM2TIFF
5170ef31e1fSMike Welles$ RAS2TIFF  :==$DISK:[TIFF.TOOLS]RAS2TIFF
5180ef31e1fSMike Welles$ RGB2YCBCR :==$DISK:[TIFF.TOOLS]RGB2YCBCR
5190ef31e1fSMike Welles$ THUMBNAIL :==$DISK:[TIFF.TOOLS]THUMBNAIL
5200ef31e1fSMike Welles$ TIFF2BW   :==$DISK:[TIFF.TOOLS]TIFF2BW
5210ef31e1fSMike Welles$ TIFF2PS   :==$DISK:[TIFF.TOOLS]TIFF2PS
5220ef31e1fSMike Welles$ TIFFCMP   :==$DISK:[TIFF.TOOLS]TIFFCMP
5230ef31e1fSMike Welles$ TIFFCP    :==$DISK:[TIFF.TOOLS]TIFFCP
5240ef31e1fSMike Welles$ TIFFDITHER:==$DISK:[TIFF.TOOLS]TIFFDITHER
5250ef31e1fSMike Welles$ TIFFDUMP  :==$DISK:[TIFF.TOOLS]TIFFDUMP
5260ef31e1fSMike Welles$ TIFFINFO  :==$DISK:[TIFF.TOOLS]TIFFINFO
5270ef31e1fSMike Welles$ TIFFMEDIAN:==$DISK:[TIFF.TOOLS]TIFFMEDIAN
5280ef31e1fSMike Welles$ TIFFSPLIT :==$DISK:[TIFF.TOOLS]TIFFSPLIT
5290ef31e1fSMike Welles$ YCBCR     :==$DISK:[TIFF.TOOLS]YCBCR
530f1e1b43bSBob Friesenhahn</pre></li>
531f1e1b43bSBob Friesenhahn</ol>
532f1e1b43bSBob FriesenhahnYou will want to add these lines to your <tt>LOGIN.COM</tt> file,
533f1e1b43bSBob Friesenhahnafter changing the name of the directory that you have used on your
534f1e1b43bSBob Friesenhahnmachine.
535f1e1b43bSBob Friesenhahn<p>This release has been tested on OpenVMS/VAX 5.5-2, using VAX C
536f1e1b43bSBob Friesenhahn3.2. A previous release was tested under OpenVMS/AXP ?.? using DEC
537f1e1b43bSBob FriesenhahnC ?.?, it is believed that this release as well works on AXP. The
538f1e1b43bSBob Friesenhahncode contains some GNU C specific things. This does *not* imply,
539f1e1b43bSBob Friesenhahnhowever, that the VAX/GCC configuration has been tested, *it has
540f1e1b43bSBob Friesenhahnnot*.</p>
541f1e1b43bSBob Friesenhahn<p>The command procedures (<tt>MAKEVMS.COM</tt>) for building the
542f1e1b43bSBob Friesenhahnlibrary and tools, is believed to choose the correct options for
543f1e1b43bSBob Friesenhahnthe VAX and AXP cases automatically.</p>
544f1e1b43bSBob Friesenhahn<p>On the AXP, IEEE floating point is used by default. If you want
545f1e1b43bSBob FriesenhahnVAX floating point, remove the <tt>/FLOAT=IEEE_FLOAT</tt>
546f1e1b43bSBob Friesenhahnqualifier, and change <tt>HAVE_IEEEFP=1</tt> to
547f1e1b43bSBob Friesenhahn<tt>HAVE_IEEEFP=0</tt> in the <tt>MAKEVMS.COM</tt> files in both
548f1e1b43bSBob Friesenhahnthe <b>libtiff</b> and <b>tools</b> directories.</p>
549f1e1b43bSBob Friesenhahn<h3>Compiling your own program on a VMS system:</h3>
550f1e1b43bSBob FriesenhahnWhen compiling a source file in which you <tt>"#include
551f1e1b43bSBob Friesenhahn&lt;tiffio.h&gt;"</tt>, use the following command
552f1e1b43bSBob Friesenhahn<pre>
5530ef31e1fSMike Welles    $ CC/INCLUDE=DISK:[TIFF.LIBTIFF]
554f1e1b43bSBob Friesenhahn</pre>
555f1e1b43bSBob FriesenhahnThis ensures that the header file is found. On the AXP, also add
556f1e1b43bSBob Friesenhahn<tt>/FLOAT=IEEE_FLOAT</tt> (if used when building the library).
557f1e1b43bSBob Friesenhahn<h3>Linking your own program to the TIFF library on a VMS
558f1e1b43bSBob Friesenhahnsystem:</h3>
5590ef31e1fSMike WellesYou can link to the library in two ways: Either using the shareable
560f1e1b43bSBob Friesenhahnlibrary, or using the object library. On the VAX these
561f1e1b43bSBob Friesenhahnpossibilities are:
562f1e1b43bSBob Friesenhahn<ol>
563f1e1b43bSBob Friesenhahn<li>Using the shareable TIFF library.
564f1e1b43bSBob Friesenhahn<pre>
5650ef31e1fSMike Welles$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS,SYS$INPUT:/OPTIONS
5660ef31e1fSMike Welles    SYS$SHARE:VAXCRTL/SHAREABLE
567f1e1b43bSBob Friesenhahn</pre></li>
568f1e1b43bSBob Friesenhahn<li>Using the TIFF object library.
569f1e1b43bSBob Friesenhahn<pre>
5700ef31e1fSMike Welles$ LINK MY_PROGRAM, -
5710ef31e1fSMike Welles    DISK:[TIFF.LIBTIFF]TIFF/LIBRARY/INCLUDE=(TIF_FAX3SM,TIF_CODEC), -
5720ef31e1fSMike Welles    SYS$INPUT:/OPTIONS
5730ef31e1fSMike Welles    SYS$SHARE:VAXCRTL/SHAREABLE
574f1e1b43bSBob Friesenhahn</pre></li>
575f1e1b43bSBob Friesenhahn</ol>
576f1e1b43bSBob FriesenhahnOn AXP (and possibly also using DEC C on VAX) the corresponding
577f1e1b43bSBob Friesenhahncommands are
578f1e1b43bSBob Friesenhahn<ol>
579f1e1b43bSBob Friesenhahn<li>Using the shareable TIFF library.
580f1e1b43bSBob Friesenhahn<pre>
5810ef31e1fSMike Welles$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS
582f1e1b43bSBob Friesenhahn</pre></li>
583f1e1b43bSBob Friesenhahn<li>Using the TIFF object library.
584f1e1b43bSBob Friesenhahn<pre>
5850ef31e1fSMike Welles$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/LIBRARY
586f1e1b43bSBob Friesenhahn</pre></li>
587f1e1b43bSBob Friesenhahn</ol>
588f1e1b43bSBob FriesenhahnMethod 1 uses the shortest link time and smallest <tt>.EXE</tt>
589f1e1b43bSBob Friesenhahnfiles, but it requires that <tt>TIFFSHR</tt> is defined as above at
590f1e1b43bSBob Friesenhahnlink time and <strong>at run time</strong>. Using the compilation
591f1e1b43bSBob Friesenhahnprocedure above, the tools are linked in this way.
592f1e1b43bSBob Friesenhahn<p>Method 2 gives somewhat longer link time and larger
593f1e1b43bSBob Friesenhahn<tt>.EXE</tt> files, but does not require <tt>TIFFSHR</tt> to be
594f1e1b43bSBob Friesenhahndefined. This method is recommended if you want to run your program
595f1e1b43bSBob Friesenhahnon another machine, and for some reason don't want to have the
596f1e1b43bSBob Friesenhahnlibrary on that machine. If you plan to have more than one program
597f1e1b43bSBob Friesenhahn(including the tools) on the machine, it is recommended that you
5987802e5baSBob Friesenhahncopy the library to the other machine and use method 1.</p>
599f1e1b43bSBob Friesenhahn<hr>
6007802e5baSBob Friesenhahn<a name="Other" id="Other"></a>
601f1e1b43bSBob Friesenhahn<h2>Building the Software on Other Systems</h2>
602f1e1b43bSBob FriesenhahnThis section contains information that might be useful if you are
603f1e1b43bSBob Friesenhahnworking on a non-UNIX system that is not directly supported. All
604f1e1b43bSBob Friesenhahnlibrary-related files described below are located in the
605f1e1b43bSBob Friesenhahn<b>libtiff</b> directory.
606f1e1b43bSBob Friesenhahn<p>The library requires two files that are generated
607f1e1b43bSBob Friesenhahn<i>on-the-fly</i>. The file <b>tif_fax3sm.c</b> has the state
608f1e1b43bSBob Friesenhahntables for the Group 3 and Group 4 decoders. This file is generated
609f1e1b43bSBob Friesenhahnby the <tt>mkg3states</tt> program on a UNIX system; for
610f1e1b43bSBob Friesenhahnexample,</p>
611f1e1b43bSBob Friesenhahn<div style="margin-left: 2em">
612f1e1b43bSBob Friesenhahn<pre>
613f1e1b43bSBob Friesenhahn<tt>
6140ef31e1fSMike Wellescd libtiff
6150ef31e1fSMike Wellescc -o mkg3states mkg3states.c
6160ef31e1fSMike Wellesrm -f tif_fax3sm.c
6170ef31e1fSMike Welles./mkg3states -c const tif_fax3sm.c
618f1e1b43bSBob Friesenhahn</tt>
619f1e1b43bSBob Friesenhahn</pre></div>
620f1e1b43bSBob FriesenhahnThe <tt>-c</tt> option can be used to control whether or not the
621f1e1b43bSBob Friesenhahnresutling tables are generated with a <tt>const</tt> declaration.
622f1e1b43bSBob FriesenhahnThe <tt>-s</tt> option can be used to specify a C storage class for
623f1e1b43bSBob Friesenhahnthe table declarations. The <tt>-b</tt> option can be used to force
624f1e1b43bSBob Friesenhahndata values to be explicitly bracketed with ``{}'' (apparently
625f1e1b43bSBob Friesenhahnneeded for some MS-Windows compilers); otherwise the structures are
626f1e1b43bSBob Friesenhahnemitted in as compact a format as possible. Consult the source code
627f1e1b43bSBob Friesenhahnfor this program if you have questions.
628f1e1b43bSBob Friesenhahn<p>The second file required to build the library, <b>version.h</b>,
629f1e1b43bSBob Friesenhahncontains the version information returned by the
630f1e1b43bSBob Friesenhahn<tt>TIFFGetVersion</tt> routine. This file is built on most systems
631f1e1b43bSBob Friesenhahnusing the <tt>mkversion</tt> program and the contents of the
632f1e1b43bSBob Friesenhahn<tt>VERSION</tt> and <tt>tiff.alpha</tt> files; for example,</p>
633f1e1b43bSBob Friesenhahn<div style="margin-left: 2em">
634f1e1b43bSBob Friesenhahn<pre>
6350ef31e1fSMike Wellescd libtiff
6360ef31e1fSMike Wellescc -o mkversion mkversion.c
6370ef31e1fSMike Wellesrm -f version.h
6380ef31e1fSMike Welles./mkversion -v ../VERSION -a ../dist/tiff.alpha version.h
639f1e1b43bSBob Friesenhahn</pre></div>
640f1e1b43bSBob Friesenhahn<p>Otherwise, when building the library on a non-UNIX system be
641f1e1b43bSBob Friesenhahnsure to consult the files <b>tiffcomp.h</b> and <b>tiffconf.h</b>.
642f1e1b43bSBob FriesenhahnThe former contains system compatibility definitions while the
643f1e1b43bSBob Friesenhahnlatter is provided so that the software configuration can be
644f1e1b43bSBob Friesenhahncontrolled on systems that do not support the make facility for
645f1e1b43bSBob Friesenhahnbuilding the software.</p>
646f1e1b43bSBob Friesenhahn<p>Systems without a 32-bit compiler may not be able to handle some
6470ef31e1fSMike Wellesof the codecs in the library; especially the Group 3 and 4 decoder.
6480ef31e1fSMike WellesIf you encounter problems try disabling support for a particular
649f1e1b43bSBob Friesenhahncodec; consult the <a href=
650f1e1b43bSBob Friesenhahn"internals.html#Config">documentation</a>.</p>
651f1e1b43bSBob Friesenhahn<p>Programs in the tools directory are written to assume an ANSI C
652f1e1b43bSBob Friesenhahncompilation environment. There may be a few POSIX'isms as well. The
653f1e1b43bSBob Friesenhahncode in the <b>port</b> directory is provided to emulate routines
654f1e1b43bSBob Friesenhahnthat may be missing on some systems. On UNIX systems the
655f1e1b43bSBob Friesenhahn<tt>configure</tt> script automatically figures out which routines
656f1e1b43bSBob Friesenhahnare not present on a system and enables the use of the equivalent
657f1e1b43bSBob Friesenhahnemulation routines from the <b>port</b> directory. It may be
658f1e1b43bSBob Friesenhahnnecessary to manually do this work on a non-UNIX system. <a name=
659f1e1b43bSBob Friesenhahn"Testing" id="Testing"></a></p>
660f1e1b43bSBob Friesenhahn<hr>
661f1e1b43bSBob Friesenhahn<h2>Checking out the Software</h2>
662f1e1b43bSBob Friesenhahn<p>Assuming you have working versions of <tt>tiffgt</tt> and
663f1e1b43bSBob Friesenhahn<tt>tiffsv</tt>, you can just use them to view any of the sample
664f1e1b43bSBob Friesenhahnimages available for testing (see the <a href="images.html">section
665f1e1b43bSBob Friesenhahnon obtaining the test images</a>). Otherwise, you can do a cursory
666f1e1b43bSBob Friesenhahncheck of the library with the <tt>tiffcp</tt> and <tt>tiffcmp</tt>
667f1e1b43bSBob Friesenhahnprograms. For example,</p>
668f1e1b43bSBob Friesenhahn<div style="margin-left: 2em">
669f1e1b43bSBob Friesenhahn<pre>
6700ef31e1fSMike Wellestiffcp -lzw cramps.tif x.tif
6710ef31e1fSMike Wellestiffcmp cramps.tif x.tif
672f1e1b43bSBob Friesenhahn</pre></div>
673f1e1b43bSBob Friesenhahn<p>(<tt>tiffcmp</tt> should be silent if the files compare
674f1e1b43bSBob Friesenhahncorrectly). <a name="TOC" id="TOC"></a></p>
675f1e1b43bSBob Friesenhahn<hr>
676f1e1b43bSBob Friesenhahn<h2>Table of Contents</h2>
6770ef31e1fSMike WellesThe following files makup the core library:
678f1e1b43bSBob Friesenhahn<pre>
6790ef31e1fSMike Welleslibtiff/tiff.h                  TIFF spec definitions
6800ef31e1fSMike Welleslibtiff/tiffcomp.h              non-UNIX OS-compatibility definitions
6810ef31e1fSMike Welleslibtiff/tiffconf.h              non-UNIX configuration definitions
6820ef31e1fSMike Welleslibtiff/tiffio.h                public TIFF library definitions
6830ef31e1fSMike Welleslibtiff/tiffiop.h               private TIFF library definitions
6840ef31e1fSMike Welleslibtiff/t4.h                    CCITT Group 3/4 code tables+definitions
6850ef31e1fSMike Welleslibtiff/tif_dir.h               private defs for TIFF directory handling
6860ef31e1fSMike Welleslibtiff/tif_fax3.h              CCITT Group 3/4-related definitions
6870ef31e1fSMike Welleslibtiff/tif_predict.h           private defs for Predictor tag support
6880ef31e1fSMike Welleslibtiff/uvcode.h                LogL/LogLuv codec-specific definitions
6890ef31e1fSMike Welleslibtiff/version.h               version string (generated by Makefile)
6900ef31e1fSMike Welleslibtiff/tif_apple.c             Apple-related OS support
6910ef31e1fSMike Welleslibtiff/tif_atari.c             Atari-related OS support
6920ef31e1fSMike Welleslibtiff/tif_aux.c               auxilary directory-related functions
6930ef31e1fSMike Welleslibtiff/tif_close.c             close an open TIFF file
6940ef31e1fSMike Welleslibtiff/tif_codec.c             configuration table of builtin codecs
6950ef31e1fSMike Welleslibtiff/tif_compress.c          compression scheme support
6960ef31e1fSMike Welleslibtiff/tif_dir.c               directory tag interface code
6970ef31e1fSMike Welleslibtiff/tif_dirinfo.c           directory known tag support code
6980ef31e1fSMike Welleslibtiff/tif_dirread.c           directory reading code
6990ef31e1fSMike Welleslibtiff/tif_dirwrite.c          directory writing code
7000ef31e1fSMike Welleslibtiff/tif_dumpmode.c          "no" compression codec
7010ef31e1fSMike Welleslibtiff/tif_error.c             library error handler
7020ef31e1fSMike Welleslibtiff/tif_fax3.c              CCITT Group 3 and 4 codec
7030ef31e1fSMike Welleslibtiff/tif_fax3sm.c            G3/G4 state tables (generated by mkg3states)
7040ef31e1fSMike Welleslibtiff/tif_flush.c             i/o and directory state flushing
7050ef31e1fSMike Welleslibtiff/tif_getimage.c          TIFFRGBAImage support
7060ef31e1fSMike Welleslibtiff/tif_jpeg.c              JPEG codec (interface to the IJG distribution)
7070ef31e1fSMike Welleslibtiff/tif_luv.c               SGI LogL/LogLuv codec
7080ef31e1fSMike Welleslibtiff/tif_lzw.c               LZW codec
7090ef31e1fSMike Welleslibtiff/tif_msdos.c             MSDOS-related OS support
7100ef31e1fSMike Welleslibtiff/tif_next.c              NeXT 2-bit scheme codec (decoding only)
7110ef31e1fSMike Welleslibtiff/tif_open.c              open and simply query code
7120ef31e1fSMike Welleslibtiff/tif_packbits.c          Packbits codec
7130ef31e1fSMike Welleslibtiff/tif_pixarlog.c          Pixar codec
7140ef31e1fSMike Welleslibtiff/tif_predict.c           Predictor tag support
7150ef31e1fSMike Welleslibtiff/tif_print.c             directory printing support
7160ef31e1fSMike Welleslibtiff/tif_read.c              image data reading support
7170ef31e1fSMike Welleslibtiff/tif_strip.c             some strip-related code
7180ef31e1fSMike Welleslibtiff/tif_swab.c              byte and bit swapping support
7190ef31e1fSMike Welleslibtiff/tif_thunder.c           Thunderscan codec (decoding only)
7200ef31e1fSMike Welleslibtiff/tif_tile.c              some tile-related code
7210ef31e1fSMike Welleslibtiff/tif_unix.c              UNIX-related OS support
7220ef31e1fSMike Welleslibtiff/tif_version.c           library version support
7230ef31e1fSMike Welleslibtiff/tif_vms.c               VMS-related OS support
7240ef31e1fSMike Welleslibtiff/tif_warning.c           library warning handler
7250ef31e1fSMike Welleslibtiff/tif_win3.c              Windows-3.1-related OS support
726152b9721SMike Welleslibtiff/tif_win32.c             Win32 (95/98/NT) related OS support
7270ef31e1fSMike Welleslibtiff/tif_write.c             image data writing support
7280ef31e1fSMike Welleslibtiff/tif_zip.c               Deflate codec
7290ef31e1fSMike Welles
7300ef31e1fSMike Welleslibtiff/mkg3states.c            program to generate G3/G4 decoder state tables
7310ef31e1fSMike Welleslibtiff/mkspans.c               program to generate black-white span tables
7320ef31e1fSMike Welleslibtiff/mkversion.c             program to generate libtiff/version.h.
733f1e1b43bSBob Friesenhahn</pre>
734f1e1b43bSBob Friesenhahn<hr>
735*03613213SBob FriesenhahnLast updated: $Date: 2015-08-29 15:30:11 $
736f1e1b43bSBob Friesenhahn</body>
737f1e1b43bSBob Friesenhahn</html>
738