]> git.saurik.com Git - wxWidgets.git/blob - src/tiff/html/build.html
No real changes, just avoid overloaded virtual wxWebView::SetPage().
[wxWidgets.git] / src / tiff / html / build.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta name="generator" content=
5 "HTML Tidy for Solaris (vers 12 April 2005), 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="#UNIX">Building on a UNIX system</a>.</li>
14 <li><a href="#MacMPW">Building on a Macintosh system with
15 MPW</a>.</li>
16 <li><a href="#MacCW">Building on a Macintosh system with
17 CodeWarrior</a>.</li>
18 <li><a href="#PC">Building on an MS-DOS or Windows system</a>.</li>
19 <li><a href="#DJGPP">Building on MS-DOS with the DJGPP v2
20 compiler</a>.</li>
21 <li><a href="#VMS">Building on a VMS system</a>.</li>
22 <li><a href="#Acorn">Building on an Acorn RISC OS system</a>.</li>
23 <li><a href="#Other">Building the Software on Other
24 Systems</a></li>
25 </ul>
26 <br clear="left">
27 This chapter contains step-by-step instructions on how to configure
28 and build the TIFF software distribution. The software is most
29 easily built on a UNIX system, but with a little bit of work it can
30 easily be built and used on other non-UNIX platforms. <a name=
31 "UNIX" id="UNIX"></a>
32 <hr>
33 <h2>Building on a UNIX System</h2>
34 To build the software on a UNIX system you need to first run the
35 configure shell script that is located in the top level of the
36 source directory. This script probes the target system for
37 necessary tools and functions and constructs a build environment in
38 which the software may be compiled. Once configuration is done, you
39 simply run <tt>make</tt> (or <tt>gmake</tt>) to build the software
40 and then <tt>make install</tt> to do the installation; for example:
41 <div style="margin-left: 2em">
42 <pre>
43 hyla% <b>cd tiff-v3.4beta099</b>
44 hyla% <b>./configure</b>
45 <i>...lots of messages...</i>
46 hyla% <b>make</b>
47 <i>...lots of messages...</i>
48 hyla# <b>make install</b>
49 </pre></div>
50 Supplied makefiles are depend on GNU <tt>make</tt> utility, so you
51 will need the one. Depending on your installation <b>make</b>
52 command may invoke standard system <tt>make</tt> and <b>gmake</b>
53 invoke GNU make. In this case you should use former. If you don't
54 have <tt>make</tt> at all, but only <tt>gmake</tt>, you should
55 export environment variable <tt>MAKE=gmake</tt> before
56 <b>./configure</b>.
57 <p>In general, the software is designed such that the following
58 should be ``<i>make-able</i>'' in each directory:</p>
59 <div style="margin-left: 2em">
60 <pre>
61 make [all] build stuff
62 make install build&amp;install stuff
63 make clean remove .o files, executables and cruft
64 make distclean remove everything, that can be recreated
65 </pre></div>
66 Note that after running "<tt>make distclean</tt>" the
67 <tt>configure</tt> script must be run again to create the Makefiles
68 and other make-related files. <a name="BuildTrees" id=
69 "BuildTrees"></a>
70 <hr width="65%" align="right">
71 <h3>Build Trees</h3>
72 There are two schemes for configuring and building the software. If
73 you intend to build the software for only one target system, you
74 can configure the software so that it is built in the same
75 directories as the source code.
76 <div style="margin-left: 2em">
77 <pre>
78 hyla% <b>cd tiff-v3.4beta099</b>
79 hyla% <b>ls</b>
80 COPYRIGHT VERSION config.sub dist man
81 Makefile.in config.guess configure html port
82 README config.site contrib libtiff tools
83 hyla% <b>./configure</b>
84 </pre></div>
85 <p>Otherwise, you can configure a build tree that is parallel to
86 the source tree hierarchy but which contains only configured files
87 and files created during the build procedure.</p>
88 <div style="margin-left: 2em">
89 <pre>
90 hyla% <b>cd tiff-v3.4beta099</b>
91 hyla% <b>mkdir obj obj/mycpu</b>
92 hyla% <b>cd obj/mycpu</b>
93 hyla% <b>../../configure</b>
94 </pre></div>
95 This second scheme is useful for:
96 <ul>
97 <li>building multiple targets from a single source tree</li>
98 <li>building from a read-only source tree (e.g. if you receive the
99 distribution on CD-ROM)</li>
100 </ul>
101 <a name="ConfigOptions" id="ConfigOptions"></a>
102 <hr width="65%" align="right">
103 <h3>Configuration Options</h3>
104 The configuration process is critical to the proper compilation,
105 installation, and operation of the software. The configure script
106 runs a series of tests to decide whether or not the target system
107 supports required functionality and, if it does not, whether it can
108 emulate or workaround the missing functions. This procedure is
109 fairly complicated and, due to the nonstandard nature of most UNIX
110 systems, prone to error. The first time that you configure the
111 software for use you should check the output from the configure
112 script and look for anything that does not make sense for your
113 system.
114 <p>A second function of the configure script is to set the default
115 configuration parameters for the software. Of particular note are
116 the directories where the software is to be installed. By default
117 the software is installed in the <b>/usr/local</b> hierarchy. To
118 change this behaviour the appropriate parameters can be specified
119 on the command line to configure. Run <b>./configure --help</b> to
120 get a list of possible options. Installation related options are
121 shown below.</p>
122 <pre>
123 <tt>
124 Installation directories:
125 --prefix=PREFIX install architecture-independent files in PREFIX
126 [/usr/local]
127 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
128 [PREFIX]
129
130 By default, `make install' will install all the files in
131 `/usr/local/bin', `/usr/local/lib' etc. You can specify
132 an installation prefix other than `/usr/local' using `--prefix',
133 for instance `--prefix=$HOME'.
134
135 For better control, use the options below.
136
137 Fine tuning of the installation directories:
138 --bindir=DIR user executables [EPREFIX/bin]
139 --sbindir=DIR system admin executables [EPREFIX/sbin]
140 --libexecdir=DIR program executables [EPREFIX/libexec]
141 --datadir=DIR read-only architecture-independent data [PREFIX/share]
142 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
143 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
144 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
145 --libdir=DIR object code libraries [EPREFIX/lib]
146 --includedir=DIR C header files [PREFIX/include]
147 --oldincludedir=DIR C header files for non-gcc [/usr/include]
148 --infodir=DIR info documentation [PREFIX/info]
149 --mandir=DIR man documentation [PREFIX/man]
150
151 Program names:
152 --program-prefix=PREFIX prepend PREFIX to installed program names
153 --program-suffix=SUFFIX append SUFFIX to installed program names
154 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
155 </tt>
156 </pre>
157 <a name="Packages" id="Packages"></a>
158 <hr width="65%" align="right">
159 <h3>Configuring Optional Packages/Support</h3>
160 The TIFF software comes with several packages that are installed
161 only as needed, or only if specifically configured at the time the
162 configure script is run. Packages can be configured via the
163 <b>configure</b> script commandline parameters.
164 <dl>
165 <dt><i>Static/Shared Objects Support</i></dt>
166 <dd><tt>--enable-shared[=PKGS]&nbsp;&nbsp;&nbsp;&nbsp;build shared
167 libraries [default=yes]<br>
168 --enable-static[=PKGS]&nbsp;&nbsp;&nbsp;&nbsp;build static
169 libraries [default=yes]</tt>
170 <p>These options control whether or not to configure the software
171 to build a shared and static binaries for the TIFF library. Use of
172 shared libraries can significantly reduce the disk space needed for
173 users of the TIFF software. If shared libarries are not used then
174 the code is statically linked into each application that uses it.
175 By default both types of binaries is configured.</p>
176 <p><tt>--enable-rpath&nbsp;&nbsp;&nbsp;&nbsp;Enable runtime linker
177 paths (-R libtool option)</tt></p>
178 <p>Add library directories (see other options below) to the TIFF
179 library run-time linker path.</p>
180 </dd>
181 <dt><i>JPEG Support</i></dt>
182 <dd><tt>--disable-jpeg&nbsp;&nbsp;&nbsp;&nbsp;disable IJG JPEG
183 library usage (required for JPEG compression, enabled by default)
184 --with-jpeg-include-dir=DIR&nbsp;&nbsp;&nbsp;&nbsp;location of IJG
185 JPEG library headers
186 --with-jpeg-lib-dir=DIR&nbsp;&nbsp;&nbsp;&nbsp;location of IJG JPEG
187 library binary)</tt></dd>
188 <dd>The <tt>JPEG</tt> package enables support for the handling of
189 TIFF images with JPEG-encoded data. Support for JPEG-encoded data
190 requires the Independent JPEG Group (IJG) <tt>libjpeg</tt>
191 distribution; this software is available at <a href=
192 "ftp://ftp.uu.net/graphics/jpeg/">ftp.uu.net:/graphics/jpeg/</a>.
193 <b>configure</b> script automatically tries to search the working
194 IJG JPEG installation. If it fails to find library, JPEG support
195 will be automatically disabled.If you want specify the exact paths
196 to library binary and headers, use above switches for that.</dd>
197 <dt><i>ZIP Support</i></dt>
198 <dd>The <tt>ZIP</tt> support enables support for the handling of
199 TIFF images with deflate-encoded data. Support for deflate-encoded
200 data requires the freely available <tt>zlib</tt> distribution
201 written by Jean-loup Gailly and Mark Adler; this software is
202 available at <a href=
203 "ftp://ftp.uu.net/pub/archiving/zip/zlib/">ftp.uu.net:/pub/archiving/zip/zlib/</a>
204 (or try <a href=
205 "ftp://quest.jpl.nasa.gov/beta/zlib/">quest.jpl.nasa.gov:/beta/zlib/</a>).
206 If ZIP support is enabled the <tt>DIRS_LIBINC</tt> and
207 <tt>DIR_GZLIB</tt> parameters should also be set (see below). By
208 default this package is not configured.</dd>
209 </dl>
210 <a name="Sample" id="Sample"></a>
211 <hr width="65%" align="right">
212 <h3>A Sample Configuration Session</h3>
213 This section shows a sample configuration session and describes the
214 work done. The session is shown indented in a <tt>fixed width
215 font</tt> with user-supplied input in a <tt><b>bold font</b></tt>.
216 Comments are shown in a normal or <i>italic</i> font. This session
217 was collected on a 486 machine running BSDI 1.1.
218 <div style="margin-left: 2em">
219 <pre>
220 <tt>
221 wullbrandt% <b>mkdir tiff</b>
222 wullbrandt% <b>cd tiff</b>
223 wullbrandt% <b>ln -s /hosts/oxford/usr/people/sam/tiff src</b>
224 </tt>
225 </pre></div>
226 A build tree separate from the source tree is used here. In fact,
227 in this case the distribution is accessed from a read-only
228 NFS-mounted filesystem.
229 <div style="margin-left: 2em">
230 <pre>
231 <tt>
232 wullbrandt% <b>src/configure</b>
233 Configuring TIFF Software v3.4beta015.
234
235 Reading site-wide parameters from ../tiff-v3.4beta015/config.site.
236 Reading local parameters from config.local.
237 Gosh, aren't you lucky to have a i386-unknown-bsdi1.1 system!
238 </tt>
239 </pre></div>
240 Note that configure announces the distribution version and the
241 deduced target configuration (<tt>i386-unknown-bsdi1.1</tt> here).
242 <div style="margin-left: 2em">
243 <pre>
244 <tt>
245 Using /usr/local/bin/gcc for a C compiler (set CC to override).
246 Looks like /usr/local/bin/gcc supports the -g option.
247 Using " -g" for C compiler options.
248 </tt>
249 </pre></div>
250 configure checked the normal shell search path for potential ANSI C
251 compilers. The compiler is selected according to it properly
252 compiling a small ANSI C test program. A specific compiler may be
253 requested by setting the <tt>CC</tt> environment variable to the
254 appropriate pathname, by supplying the parameter on the command
255 line, e.g. <tt>-with-CC=gcc</tt>, or by setting <tt>CC</tt> in a
256 configuration file.
257 <p><img src="images/info.gif" align="left" hspace="10"> <em>Note
258 that an ANSI C compiler is required to build the software. If a C
259 compiler requires options to enable ANSI C compilation, they can be
260 specified with the <tt>ENVOPTS</tt> parameter.</em></p>
261 <p>Once a compiler is selected configure checks to see if the
262 compiler accepts a -g option to enable the generation of debugging
263 symbols, and if the compiler includes an ANSI C preprocessor.</p>
264 <div style="margin-left: 2em">
265 <pre>
266 <tt>
267 Using /usr/ucb/make to configure the software.
268 </tt>
269 </pre></div>
270 Next various system-specific libraries that may or may not be
271 needed are checked for (none are needed in this case). If your
272 system requires a library that is not automatically included it can
273 be specified by setting the <tt>MACHDEPLIBS</tt> parameter.
274 <p><i>Creating port.h.</i> The <b>port.h</b> file is included by
275 all the C code in the library (but not the tools). It includes
276 definitions for functions and type definitions that are missing
277 from system include files, <tt>#defines</tt> to enable or disable
278 system-specific functionality, and other odds and ends.</p>
279 <div style="margin-left: 2em">
280 <pre>
281 <tt>
282 Creating libtiff/port.h with necessary definitions.
283 ... using LSB2MSB bit order for your i386 cpu
284 ... using big-endian byte order for your i386 cpu
285 ... configure use of mmap for memory-mapped files
286 ... O_RDONLY is in &lt;fcntl.h&gt;
287 ... using double for promoted floating point parameters
288 ... enabling use of inline functions
289 Done creating libtiff/port.h.
290 </tt>
291 </pre></div>
292 This file can take a long time to create so configure generates the
293 file only when it is needed, either because the file does not exist
294 or because a different target or compiler is to be used. Note that
295 running "<tt>make distclean</tt>" in the top-level directory of the
296 build tree will remove the <b>port.h</b> file (along with all the
297 other files generated by configure).
298 <p><i>Selecting emulated library functions.</i> Certain library
299 functions used by the tools are not present on all systems and can
300 be emulated using other system functionality. configure checks for
301 the presence of such functions and if they are missing, will
302 configure emulation code from the <b>port</b> directory to use
303 instead. Building the TIFF software on unsupported systems may
304 require adding to the code to the <b>port</b> directory.</p>
305 <div style="margin-left: 2em">
306 <pre>
307 <tt>
308 Checking system libraries for functionality to emulate.
309 Done checking system libraries.
310 </tt>
311 </pre></div>
312 If a routine must be emulated and configure does not automatically
313 check for it, the routine name can be specified using the
314 <tt>PORTFUNCS</tt> parameter. To add emulation support for a new
315 function <tt>foo</tt>, create a file <b>port/foo.c</b> that
316 contains the emulation code and then set <tt>PORTFUNCS=foo</tt> in
317 a configuration file or modify the configure script to
318 automatically check for the missing function.
319 <div style="margin-left: 2em">
320 <pre>
321 <tt>
322 Checking for Dynamic Shared Object (DSO) support.
323 Done checking for DSO support.
324 </tt>
325 </pre></div>
326 If the <tt>DSO</tt> package is enabled (<tt>DSO=auto</tt> or
327 <tt>DSO=yes</tt>), then configure will verify the system and
328 compiler are capable of constructing SVR4-style DSO's in the
329 expected way. Note that while a system may support DSO's the
330 compiler may not be capable of generating the required
331 position-independent code and/or the compiler may not pass the
332 needed options through to the loader.
333 <p><i>Selecting utility programs.</i> configure locates various
334 system utility programs that are used during installation of the
335 software.</p>
336 <div style="margin-left: 2em">
337 <pre>
338 <tt>
339 Selecting programs used during installation.
340 Looks like mv supports the -f option to force a move.
341 Looks like /bin/ln supports the -s option to create a symbolic link.
342 Done selecting programs.
343 </tt>
344 </pre></div>
345 <p><i>Selecting default configuration parameters.</i> The remainder
346 of the work done by configure involves setting up configuration
347 parameters that control the placement and setup of files during the
348 installation procedure.</p>
349 <div style="margin-left: 2em">
350 <pre>
351 <tt>
352 Selecting default TIFF configuration parameters.
353
354 Looks like manual pages go in /usr/contrib/man.
355 Looks like manual pages should be installed with bsd-nroff-gzip-0.gz.
356
357 TIFF configuration parameters are:
358
359 [ 1] Directory for tools: /usr/contrib/bin
360 [ 2] Directory for libraries: /usr/contrib/lib
361 [ 3] Directory for include files: /usr/contrib/include
362 [ 4] Directory for manual pages: /usr/contrib/man
363 [ 5] Manual page installation scheme: bsd-nroff-gzip-0.gz
364
365 Are these ok [yes]?
366 </tt>
367 </pre></div>
368 At this point you can interactively modify any of the displayed
369 parameters. Hitting a carriage return or typing <tt>yes</tt> will
370 accept the current parameters. Typing one of the number displayed
371 along the left hand side causes configure to prompt for a new value
372 of the specified parameter. Typing anything else causes configure
373 to prompt for a new value <em>for each parameter</em>. In general
374 hitting carriage return will accept the current value and typing
375 anything that is unacceptable will cause a help message to be
376 displayed. A description of each of the configuration parameters is
377 given below.
378 <p>Once acceptable parameters are setup configure will generate all
379 the files that depend on these parameters. Note that certain files
380 may or may not be created based on the configuration of optional
381 packages and/or the functions supported by target system.</p>
382 <div style="margin-left: 2em">
383 <pre>
384 <tt>
385 Creating Makefile from ../tiff-v3.4beta015/Makefile.in
386 Creating libtiff/Makefile from ../tiff-v3.4beta015/libtiff/Makefile.in
387 Creating man/Makefile from ../tiff-v3.4beta015/man/Makefile.in
388 Creating tools/Makefile from ../tiff-v3.4beta015/tools/Makefile.in
389 Creating port/install.sh from ../tiff-v3.4beta015/port/install.sh.in
390 Done.
391 </tt>
392 </pre></div>
393 <a name="DSOSupport" id="DSOSupport"></a>
394 <hr>
395 <h3>Shared Library Support</h3>
396 It is desirable to make the TIFF library be a shared object on
397 systems that have support for shared libraries. Unfortunately the
398 rules to use to build a shared library vary between operating
399 systems and even compilers. The distributed software includes
400 support for building a shared version of the library on a number of
401 different systems. This support is split between rules in the file
402 <b>libtiff/Makefile.in</b> that construct the shared library and
403 checks done by the <tt>configure</tt> script to verify that the
404 expected rules are supported by compilation tools for the target
405 system.
406 <p>To add new support for building a shared library both these
407 files must be updated. In the configure script search for the
408 section where the autoconfiguration setting of the <tt>DSO</tt>
409 parameter is handled and add a new case for the target system that
410 sets the <tt>DSOSUF</tt>, <tt>DSOLD</tt>, <tt>DSOOPTS</tt>, and
411 <tt>LIBCOPTS</tt> options as appropriate for the system.
412 <tt>DSOSUF</tt> specifies the filename suffix used for the shared
413 library (e.g. ``.so'' for Dynamic Shared Objects on most SVR4-based
414 systems). <tt>DSOLD</tt> specifies the program to use to build the
415 shared library from a compiled object file; typically ``${LD}''
416 though on some systems it is better to use the C compiler directly
417 so system-dependent options and libraries are automatically
418 supplied. <tt>DSOOPTS</tt> are options that must be specified to
419 <tt>DSOLD</tt> when building the shared library. <tt>LIBCOPTS</tt>
420 are options to pass to the C compiler when constructing a
421 relocatable object file to include in a shared library; e.g. ``-K
422 PIC'' on a Sun system. The <tt>DSO</tt> parameter must also be set
423 to a unique label that identifies the target system and compilation
424 tools. This label is used to select a target in
425 <b>libtiff/Makefile.in</b> to do the actual work in building the
426 shared library. Finally, to complete support for the shared library
427 added the appropriate rules to <b>libtiff/Makefile.in</b> under the
428 target specified in the <tt>configure</tt> script. <a name="PC" id=
429 "PC"></a></p>
430 <hr>
431 <h2>Building the Software under Windows 95/98/NT/2000 with MS
432 VC++</h2>
433 With Microsoft Visual C++ installed, and properly configured for
434 commandline use (you will likely need to source VCVARS32.BAT in
435 AUTOEXEC.bAT or somewhere similar) you should be able to use the
436 provided <tt>makefile.vc</tt>.
437 <p>The source package is delivered using Unix line termination
438 conventions, which work with MSVC but do not work with Windows
439 'notepad'. If you use unzip from the <a href=
440 "http://www.info-zip.org/pub/infozip/">Info-Zip</a> package, you
441 can extract the files using Windows normal line termination
442 conventions with a command similar to:</p>
443 <pre>
444 unzip -aa -a tiff-3.7.4.zip
445 </pre>
446 <p>By default libtiff expects that a pre-built zlib and jpeg
447 library are provided by the user. If this is not the case, then you
448 may edit libtiff\tiffconf.h using a text editor (e.g. notepad) and
449 comment out the entries for JPEG_SUPPORT, PIXARLOG_SUPPORT, and
450 ZIP_SUPPORT. Ignore the comment at the top of the file which says
451 that it has no influence on the build, because the statement is not
452 true for Windows. However, by taking this approach, libtiff will
453 not be able to open some TIFF files.</p>
454 <p>To build using the provided makefile.vc you may use:</p>
455 <pre>
456 C:\tiff-3.7.4&gt; nmake /f makefile.vc clean
457 C:\tiff-3.7.4&gt; nmake /f makefile.vc
458
459 or (the hard way)
460
461 C:\tiff-3.7.4&gt; cd port
462 C:\tiff-3.7.4\port&gt; nmake /f makefile.vc clean
463 C:\tiff-3.7.4\port&gt; nmake /f makefile.vc
464 C:\tiff-3.7.4&gt; cd ../libtiff
465 C:\tiff-3.7.4\libtiff&gt; nmake /f makefile.vc clean
466 C:\tiff-3.7.4\libtiff&gt; nmake /f makefile.vc
467 C:\tiff-3.7.4\libtiff&gt; cd ..\tools
468 C:\tiff-3.7.4\tools&gt; nmake /f makefile.vc clean
469 C:\tiff-3.7.4\tools&gt; nmake /f makefile.vc
470 </pre>
471 <p>This will build the library file
472 <tt>libtiff\libtiff\libtiff.lib</tt>. This can be used in Win32
473 programs. You may want to adjust the build options before start
474 compiling. All parameters contained in the <tt>nmake.opt</tt>
475 file.This is a plain text file you can open with your favorite text
476 editor.</p>
477 <p>The makefile also builds a DLL (libtiff.dll) with an associated
478 import library (libtiff_i.lib). Any builds using libtiff will need
479 to include the LIBTIFF\LIBTIFF directory in the include path.</p>
480 <p>The <tt>libtiff\tools\makefile.vc</tt> should build .exe's for
481 all the standard TIFF tool programs.</p>
482 <p><a name="DJGPP" id="DJGPP"></a></p>
483 <hr>
484 <h2>Building the Software under MS/DOS with the DJGPP v2
485 compiler</h2>
486 [<i>From the file <b>contrib/dosdjgpp/README</b>.</i>]
487 <p>The directory <b>contrib/dosdjgpp</b> contains the files
488 necessary to build the library and tools with the DJGPP v2 compiler
489 under MSDOS.</p>
490 <p>All you have to do is copy the files in the directory into the
491 respective directories and run make. If you want, you can use the
492 <b>conf.bat</b> script to do that for you, make sure that the file
493 is stored with MSDOS text EOL-convention (CR/LF), otherwise the
494 <b>command.com</b> will not do anything.</p>
495 <p>Note that you probably will not be able to build the library
496 with the v1.x versions of djgpp, due to two problems. First, the
497 top makefile calls a sub-make for each directory and you are likely
498 to run out of memory, since each recursive invocation of a djgpp
499 v1.x program requires about 130k, to avoid that, you can enter the
500 directories manually and call make (well, there are only two dirs).
501 The 2nd problem is that djgpp 1.x doesn't call the coff2exe
502 (stubify) program when creating an executable. This means that all
503 programs compiled are not converted to exe and consequently are not
504 available for calling directly. For the tools directory, you can
505 just call coff2exe for each program after make finishes, but in the
506 libtiff directory, a few programs are created during the make
507 process that have to be called for make to continue (e.g.
508 mkg3states). Make will probably report an error at each such stage.
509 To fix that, either add a coff2exe call before each program is
510 called or call coff2exe manually and rerun make (there 2-3 such
511 programs). <a name="MacMPW" id="MacMPW"></a></p>
512 <hr>
513 <h2>Building the Software on a Macintosh with MPW</h2>
514 The directory <b>contrib/mac-mpw</b> contains support for compiling
515 the library and tools under the MPW Shell on a Macintosh system.
516 This support was contributed by Niles Ritter (<a href=
517 "mailto:ndr@tazboy.jpl.nasa.gov">ndr@tazboy.jpl.nasa.gov</a>).
518 <p>[<i>From the file <b>contrib/mac-mpw/README</b>.</i>]</p>
519 <p>This directory contains all of the utilities and makefile source
520 to build the LIBTIFF library and tools from the MPW Shell. The file
521 BUILD.mpw in this directory is an executable script which uses all
522 of these files to create the MPW makefiles and run them.</p>
523 <p>The &lt;file&gt;.make files are not MPW makefiles as such, but
524 are when run through the "mactrans" program, which turns the ascii
525 "%nn" metacharacters into the standard weird MPW make
526 characters.</p>
527 <p>This translation trick is necessary to protect the files when
528 they are put into unix tarfiles, which tend to mangle the special
529 characters. <a name="MacCW" id="MacCW"></a></p>
530 <hr>
531 <h2>Building the Software on a Macintosh with CodeWarrior</h2>
532 The directory <b>contrib/mac-cw</b> contains support for compiling
533 the library and tools with MetroWerks CodeWarrior 6.1 on a
534 Macintosh system. This support was contributed by Niles Ritter
535 (<a href=
536 "mailto:ndr@tazboy.jpl.nasa.gov">ndr@tazboy.jpl.nasa.gov</a>).
537 <p>[<i>From the file <b>contrib/mac-cw/README</b>.</i>] In this
538 directory you will find a Makefile.script Applescript file, which
539 should be run in order to build the libtiff code using MetroWerks
540 CodeWarrior. Refer to the "metrowerks.note" instructions on
541 building the library for 68k and PowerPC native code, as well as
542 building some of the libtiff tools, which are rather unix-like, but
543 at least give an example of how to link everything together.
544 <a name="VMS" id="VMS"></a></p>
545 <hr>
546 <h2>Building the Software on a VMS System</h2>
547 The VMS port was done by Karsten Spang (<a href=
548 "mailto:krs@kampsax.dk">krs@kampsax.dk</a>), who also "sort of"
549 maintains it. The VMS specific files are not in the main
550 directories. Instead they are placed under
551 <tt>[.CONTRIB.VMS...]</tt> in the distribution tree. Installation:
552 It is assumed that you have unpacked the tar file into a VMS
553 directory tree, in this text called DISK:[TIFF].
554 <ol>
555 <li>Move the VMS specific files to their proper directories.
556 <pre>
557 $ SET DEFAULT DISK:[TIFF.CONTRIB.VMS]
558 $ RENAME [.LIBTIFF]*.* [-.-.LIBTIFF]
559 $ RENAME [.TOOLS]*.* [-.-.TOOLS]
560 </pre></li>
561 <li>Compile the library.
562 <pre>
563 $ SET DEFAULT DISK:[TIFF.LIBTIFF]
564 $ @MAKEVMS
565 </pre></li>
566 <li>Compile the tools.
567 <pre>
568 $ SET DEFAULT DISK:[TIFF.TOOLS]
569 $ @MAKEVMS
570 </pre></li>
571 <li>Define the programs.
572 <pre>
573 $ DEFINE TIFFSHR DISK:[TIFF.LIBTIFF]TIFFSHR
574 $ FAX2PS :==$DISK:[TIFF.TOOLS]FAX2PS
575 $ FAX2TIFF :==$DISK:[TIFF.TOOLS]FAX2TIFF
576 $ GIF2TIFF :==$DISK:[TIFF.TOOLS]GIF2TIFF
577 $ PAL2RGB :==$DISK:[TIFF.TOOLS]PAL2RGB
578 $ PPM2TIFF :==$DISK:[TIFF.TOOLS]PPM2TIFF
579 $ RAS2TIFF :==$DISK:[TIFF.TOOLS]RAS2TIFF
580 $ RGB2YCBCR :==$DISK:[TIFF.TOOLS]RGB2YCBCR
581 $ THUMBNAIL :==$DISK:[TIFF.TOOLS]THUMBNAIL
582 $ TIFF2BW :==$DISK:[TIFF.TOOLS]TIFF2BW
583 $ TIFF2PS :==$DISK:[TIFF.TOOLS]TIFF2PS
584 $ TIFFCMP :==$DISK:[TIFF.TOOLS]TIFFCMP
585 $ TIFFCP :==$DISK:[TIFF.TOOLS]TIFFCP
586 $ TIFFDITHER:==$DISK:[TIFF.TOOLS]TIFFDITHER
587 $ TIFFDUMP :==$DISK:[TIFF.TOOLS]TIFFDUMP
588 $ TIFFINFO :==$DISK:[TIFF.TOOLS]TIFFINFO
589 $ TIFFMEDIAN:==$DISK:[TIFF.TOOLS]TIFFMEDIAN
590 $ TIFFSPLIT :==$DISK:[TIFF.TOOLS]TIFFSPLIT
591 $ YCBCR :==$DISK:[TIFF.TOOLS]YCBCR
592 </pre></li>
593 </ol>
594 You will want to add these lines to your <tt>LOGIN.COM</tt> file,
595 after changing the name of the directory that you have used on your
596 machine.
597 <p>This release has been tested on OpenVMS/VAX 5.5-2, using VAX C
598 3.2. A previous release was tested under OpenVMS/AXP ?.? using DEC
599 C ?.?, it is believed that this release as well works on AXP. The
600 code contains some GNU C specific things. This does *not* imply,
601 however, that the VAX/GCC configuration has been tested, *it has
602 not*.</p>
603 <p>The command procedures (<tt>MAKEVMS.COM</tt>) for building the
604 library and tools, is believed to choose the correct options for
605 the VAX and AXP cases automatically.</p>
606 <p>On the AXP, IEEE floating point is used by default. If you want
607 VAX floating point, remove the <tt>/FLOAT=IEEE_FLOAT</tt>
608 qualifier, and change <tt>HAVE_IEEEFP=1</tt> to
609 <tt>HAVE_IEEEFP=0</tt> in the <tt>MAKEVMS.COM</tt> files in both
610 the <b>libtiff</b> and <b>tools</b> directories.</p>
611 <h3>Compiling your own program on a VMS system:</h3>
612 When compiling a source file in which you <tt>"#include
613 &lt;tiffio.h&gt;"</tt>, use the following command
614 <pre>
615 $ CC/INCLUDE=DISK:[TIFF.LIBTIFF]
616 </pre>
617 This ensures that the header file is found. On the AXP, also add
618 <tt>/FLOAT=IEEE_FLOAT</tt> (if used when building the library).
619 <h3>Linking your own program to the TIFF library on a VMS
620 system:</h3>
621 You can link to the library in two ways: Either using the shareable
622 library, or using the object library. On the VAX these
623 possibilities are:
624 <ol>
625 <li>Using the shareable TIFF library.
626 <pre>
627 $ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS,SYS$INPUT:/OPTIONS
628 SYS$SHARE:VAXCRTL/SHAREABLE
629 </pre></li>
630 <li>Using the TIFF object library.
631 <pre>
632 $ LINK MY_PROGRAM, -
633 DISK:[TIFF.LIBTIFF]TIFF/LIBRARY/INCLUDE=(TIF_FAX3SM,TIF_CODEC), -
634 SYS$INPUT:/OPTIONS
635 SYS$SHARE:VAXCRTL/SHAREABLE
636 </pre></li>
637 </ol>
638 On AXP (and possibly also using DEC C on VAX) the corresponding
639 commands are
640 <ol>
641 <li>Using the shareable TIFF library.
642 <pre>
643 $ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS
644 </pre></li>
645 <li>Using the TIFF object library.
646 <pre>
647 $ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/LIBRARY
648 </pre></li>
649 </ol>
650 Method 1 uses the shortest link time and smallest <tt>.EXE</tt>
651 files, but it requires that <tt>TIFFSHR</tt> is defined as above at
652 link time and <strong>at run time</strong>. Using the compilation
653 procedure above, the tools are linked in this way.
654 <p>Method 2 gives somewhat longer link time and larger
655 <tt>.EXE</tt> files, but does not require <tt>TIFFSHR</tt> to be
656 defined. This method is recommended if you want to run your program
657 on another machine, and for some reason don't want to have the
658 library on that machine. If you plan to have more than one program
659 (including the tools) on the machine, it is recommended that you
660 copy the library to the other machine and use method 1. <a name=
661 "Acorn" id="Acorn"></a></p>
662 <hr>
663 <h2>Building the Software on an Acorn RISC OS system</h2>
664 The directory <b>contrib/acorn</b> contains support for compiling
665 the library under Acorn C/C++ under Acorn's RISC OS 3.10 or above.
666 Subsequent pathnames will use the Acorn format: The full-stop or
667 period character is a pathname delimeter, and the slash character
668 is not interpreted; the reverse position from Unix. Thus
669 "libtiff/tif_acorn.c" becomes "libtiff.tif_acorn/c".
670 <p>This support was contributed by Peter Greenham. (<a href=
671 "mailto:peter@enlarion.demon.co.uk">peter@enlarion.demon.co.uk</a>).</p>
672 <h3>Installing LibTIFF:</h3>
673 <p>LIBTIFF uses several files which have names longer than the
674 normal RISC OS maximum of ten characters. This complicates matters.
675 Maybe one day Acorn will address the problem and implement long
676 filenames properly. Until then this gets messy, especially as I'm
677 trying to do this with obeyfiles and not have to include binaries
678 in this distribution.</p>
679 <p>First of all, ensure you have Truncate configured on (type
680 <tt>*Configure Truncate On</tt>)</p>
681 <p>Although it is, of course, preferable to have long filenames,
682 LIBTIFF can be installed with short filenames, and it will compile
683 and link without problems. However, <i>getting</i> it there is more
684 problematic. <b>contrib.acorn.install</b> is an installation
685 obeyfile which will create a normal Acorn-style library from the
686 source (ie: with c, h and o folders etc.), but needs the
687 distribution library to have been unpacked into a location which is
688 capable of supporting long filenames, even if only temporarily.</p>
689 <p>My recommendation, until Acorn address this problem properly, is
690 to use Jason Tribbeck's <a href=
691 "ftp://ftp.demon.co.uk/pub/mirrors/hensa/micros/arch/riscos/c/c020/longfiles.arc">
692 LongFilenames</a>, or any other working system that gives you long
693 filenames, like a nearby NFS server for instance.</p>
694 <p>If you are using Longfilenames, even if only temporarily to
695 install LIBTIFF, unpack the TAR into a RAMDisc which has been
696 longfilenamed (ie: <tt>*addlongfs ram</tt>) and then install from
697 there to the hard disk. Unfortunately Longfilenames seems a bit
698 unhappy about copying a bunch of long-named files across the same
699 filing system, but is happy going between systems. You'll need to
700 create a ramdisk of about 2Mb.</p>
701 <p>Now you can run the installation script I've supplied (in
702 contrib.acorn), which will automate the process of installing
703 LIBTIFF as an Acorn-style library. The syntax is as follows:</p>
704 <p><tt>install &lt;source_dir&gt; &lt;dest_dir&gt;</tt></p>
705 <p>Install will then create &lt;dest_dir&gt; and put the library in
706 there. For example, having used LongFilenames on the RAMDisk and
707 unpacked the library into there, you can then type:</p>
708 <p><tt>Obey RAM::RamDisc0.$.contrib.acorn.install RAM::RamDisc0.$
709 ADFS::4.$.LIBTIFF</tt></p>
710 <p>It doesn't matter if the destination location can cope with long
711 filenames or not. The filenames will be truncated if necessary
712 (*Configure Truncate On if you get errors) and all will be
713 well.</p>
714 <h3>Compiling LibTIFF:</h3>
715 <p>Once the LibTIFF folder has been created and the files put
716 inside, making the library should be just a matter of running
717 '<b>SetVars</b>' to set the appropriate system variables, then
718 running '<b>Makefile</b>'.</p>
719 <p><b>OSLib</b></p>
720 <p><a href=
721 "ftp://ftp.acorn.co.uk/pub/riscos/releases/oslib/oslib.arc">OSLib</a>
722 is a comprehensive API for RISC OS machines, written by Jonathan
723 Coxhead of Acorn Computers (although OSLib is not an official Acorn
724 product). Using the OSLib SWI veneers produces code which is more
725 compact and more efficient than code written using _kernel_swi or
726 _swi. The Acorn port of LibTIFF can take advantage of this if
727 present. Edit the Makefile and go to the Static dependencies
728 section. The first entry is:</p>
729 <pre>
730 # Static dependencies:
731 @.o.tif_acorn: @.c.tif_acorn
732 cc $(ccflags) -o @.o.tif_acorn @.c.tif_acorn
733 </pre>
734 <p>Change the cc line to:</p>
735 <pre>
736 cc $(ccflags) -DINCLUDE_OSLIB -o @.o.tif_acorn @.c.tif_acorn
737 </pre>
738 <p>Remember, however, that OSLib is only <i>recommended</i> for
739 efficiency's sake. It is not required. <a name="Other" id=
740 "Other"></a></p>
741 <hr>
742 <h2>Building the Software on Other Systems</h2>
743 This section contains information that might be useful if you are
744 working on a non-UNIX system that is not directly supported. All
745 library-related files described below are located in the
746 <b>libtiff</b> directory.
747 <p>The library requires two files that are generated
748 <i>on-the-fly</i>. The file <b>tif_fax3sm.c</b> has the state
749 tables for the Group 3 and Group 4 decoders. This file is generated
750 by the <tt>mkg3states</tt> program on a UNIX system; for
751 example,</p>
752 <div style="margin-left: 2em">
753 <pre>
754 <tt>
755 cd libtiff
756 cc -o mkg3states mkg3states.c
757 rm -f tif_fax3sm.c
758 ./mkg3states -c const tif_fax3sm.c
759 </tt>
760 </pre></div>
761 The <tt>-c</tt> option can be used to control whether or not the
762 resutling tables are generated with a <tt>const</tt> declaration.
763 The <tt>-s</tt> option can be used to specify a C storage class for
764 the table declarations. The <tt>-b</tt> option can be used to force
765 data values to be explicitly bracketed with ``{}'' (apparently
766 needed for some MS-Windows compilers); otherwise the structures are
767 emitted in as compact a format as possible. Consult the source code
768 for this program if you have questions.
769 <p>The second file required to build the library, <b>version.h</b>,
770 contains the version information returned by the
771 <tt>TIFFGetVersion</tt> routine. This file is built on most systems
772 using the <tt>mkversion</tt> program and the contents of the
773 <tt>VERSION</tt> and <tt>tiff.alpha</tt> files; for example,</p>
774 <div style="margin-left: 2em">
775 <pre>
776 cd libtiff
777 cc -o mkversion mkversion.c
778 rm -f version.h
779 ./mkversion -v ../VERSION -a ../dist/tiff.alpha version.h
780 </pre></div>
781 <p>Otherwise, when building the library on a non-UNIX system be
782 sure to consult the files <b>tiffcomp.h</b> and <b>tiffconf.h</b>.
783 The former contains system compatibility definitions while the
784 latter is provided so that the software configuration can be
785 controlled on systems that do not support the make facility for
786 building the software.</p>
787 <p>Systems without a 32-bit compiler may not be able to handle some
788 of the codecs in the library; especially the Group 3 and 4 decoder.
789 If you encounter problems try disabling support for a particular
790 codec; consult the <a href=
791 "internals.html#Config">documentation</a>.</p>
792 <p>Programs in the tools directory are written to assume an ANSI C
793 compilation environment. There may be a few POSIX'isms as well. The
794 code in the <b>port</b> directory is provided to emulate routines
795 that may be missing on some systems. On UNIX systems the
796 <tt>configure</tt> script automatically figures out which routines
797 are not present on a system and enables the use of the equivalent
798 emulation routines from the <b>port</b> directory. It may be
799 necessary to manually do this work on a non-UNIX system. <a name=
800 "Testing" id="Testing"></a></p>
801 <hr>
802 <h2>Checking out the Software</h2>
803 <p>Assuming you have working versions of <tt>tiffgt</tt> and
804 <tt>tiffsv</tt>, you can just use them to view any of the sample
805 images available for testing (see the <a href="images.html">section
806 on obtaining the test images</a>). Otherwise, you can do a cursory
807 check of the library with the <tt>tiffcp</tt> and <tt>tiffcmp</tt>
808 programs. For example,</p>
809 <div style="margin-left: 2em">
810 <pre>
811 tiffcp -lzw cramps.tif x.tif
812 tiffcmp cramps.tif x.tif
813 </pre></div>
814 <p>(<tt>tiffcmp</tt> should be silent if the files compare
815 correctly). <a name="TOC" id="TOC"></a></p>
816 <hr>
817 <h2>Table of Contents</h2>
818 The following files makup the core library:
819 <pre>
820 libtiff/tiff.h TIFF spec definitions
821 libtiff/tiffcomp.h non-UNIX OS-compatibility definitions
822 libtiff/tiffconf.h non-UNIX configuration definitions
823 libtiff/tiffio.h public TIFF library definitions
824 libtiff/tiffiop.h private TIFF library definitions
825 libtiff/t4.h CCITT Group 3/4 code tables+definitions
826 libtiff/tif_dir.h private defs for TIFF directory handling
827 libtiff/tif_fax3.h CCITT Group 3/4-related definitions
828 libtiff/tif_predict.h private defs for Predictor tag support
829 libtiff/uvcode.h LogL/LogLuv codec-specific definitions
830 libtiff/version.h version string (generated by Makefile)
831
832 libtiff/tif_acorn.c Acorn-related OS support
833 libtiff/tif_apple.c Apple-related OS support
834 libtiff/tif_atari.c Atari-related OS support
835 libtiff/tif_aux.c auxilary directory-related functions
836 libtiff/tif_close.c close an open TIFF file
837 libtiff/tif_codec.c configuration table of builtin codecs
838 libtiff/tif_compress.c compression scheme support
839 libtiff/tif_dir.c directory tag interface code
840 libtiff/tif_dirinfo.c directory known tag support code
841 libtiff/tif_dirread.c directory reading code
842 libtiff/tif_dirwrite.c directory writing code
843 libtiff/tif_dumpmode.c "no" compression codec
844 libtiff/tif_error.c library error handler
845 libtiff/tif_fax3.c CCITT Group 3 and 4 codec
846 libtiff/tif_fax3sm.c G3/G4 state tables (generated by mkg3states)
847 libtiff/tif_flush.c i/o and directory state flushing
848 libtiff/tif_getimage.c TIFFRGBAImage support
849 libtiff/tif_jpeg.c JPEG codec (interface to the IJG distribution)
850 libtiff/tif_luv.c SGI LogL/LogLuv codec
851 libtiff/tif_lzw.c LZW codec
852 libtiff/tif_msdos.c MSDOS-related OS support
853 libtiff/tif_next.c NeXT 2-bit scheme codec (decoding only)
854 libtiff/tif_open.c open and simply query code
855 libtiff/tif_packbits.c Packbits codec
856 libtiff/tif_pixarlog.c Pixar codec
857 libtiff/tif_predict.c Predictor tag support
858 libtiff/tif_print.c directory printing support
859 libtiff/tif_read.c image data reading support
860 libtiff/tif_strip.c some strip-related code
861 libtiff/tif_swab.c byte and bit swapping support
862 libtiff/tif_thunder.c Thunderscan codec (decoding only)
863 libtiff/tif_tile.c some tile-related code
864 libtiff/tif_unix.c UNIX-related OS support
865 libtiff/tif_version.c library version support
866 libtiff/tif_vms.c VMS-related OS support
867 libtiff/tif_warning.c library warning handler
868 libtiff/tif_win3.c Windows-3.1-related OS support
869 libtiff/tif_win32.c Win32 (95/98/NT) related OS support
870 libtiff/tif_write.c image data writing support
871 libtiff/tif_zip.c Deflate codec
872
873 libtiff/mkg3states.c program to generate G3/G4 decoder state tables
874 libtiff/mkspans.c program to generate black-white span tables
875 libtiff/mkversion.c program to generate libtiff/version.h.
876 </pre>
877 <hr>
878 Last updated: $Date: 2005/12/24 22:25:05 $
879 </body>
880 </html>