xref: /libtiff-4.0.7/html/build.html (revision 152b9721)
1<HTML>
2<HEAD>
3<TITLE>
4Building the TIFF Software Distribution
5</TITLE>
6</HEAD>
7<BODY BGCOLOR=white>
8<FONT FACE="Arial, Helvetica, Sans">
9<H1>
10<IMG SRC=images/cramps.gif WIDTH=159 HEIGHT=203 ALIGN=left BORDER=1 HSPACE=6>
11Building the Software Distribution
12</H1>
13
14<UL>
15<LI><A HREF=#UNIX>Building on a UNIX system</A>.
16<LI><A HREf=#MacMPW>Building on a Macintosh system with MPW</A>.
17<LI><A HREf=#MacCW>Building on a Macintosh system with CodeWarrior</A>.
18<LI><A HREF=#PC>Building on an MS-DOS or Windows system</A>.
19<LI><A HREF=#DJGPP>Building on MS-DOS with the DJGPP v2 compiler</A>.
20<LI><A HREF=#VMS>Building on a VMS system</A>.
21<LI><A HREF=#Acorn>Building on an Acorn RISC OS system</A>.
22<LI><A HREF=#Other>Building the Software on Other Systems</A>
23</UL>
24
25<BR CLEAR=left>
26
27This chapter contains step-by-step instructions on how to configure
28and build the TIFF software distribution.
29The software is most easily built on a UNIX system, but with a little
30bit of work it can easily be built and used on other non-UNIX platforms.
31
32<A NAME=UNIX><HR><H2>Building on a UNIX System</H2></A>
33
34To build the software on a UNIX system
35you need to first run the configure shell script
36that is located in the top level of the source directory.
37This script probes the target system for necessary tools and functions
38and constructs a build environment in which the software may be
39compiled.
40Once configuration is done, you simply run <TT>make</TT>
41 to build the software
42and then <TT>make install</TT> to do the installation; for example:
43
44<UL><PRE>
45hyla% <B>cd tiff-v3.4beta099</B>
46hyla% <B>./configure</B>
47    <I>...lots of messages...</I>
48hyla% <B>make</B>
49    <I>...lots of messages...</I>
50hyla# <B>make install</B>
51</PRE></UL>
52
53In general, the software is designed such that the following should
54be ``<I>make-able</I>'' in each directory:
55
56<UL><PRE>
57make [all]	build stuff
58make install	build&install stuff
59make clean	remove .o files and cruft, but not executables
60make clobber	remove everything that can be recreated
61make distclean	remove <EM>absolutely everything</EM> that can be recreated
62</PRE></UL>
63
64Note that after running "<TT>make clobber</TT>" or
65"<TT>make distclean</TT>" the <TT>configure</TT> script must
66be run again to create the Makefiles and other make-related files.
67
68<A NAME="BuildTrees"><P><HR WIDTH=65% ALIGN=right><H3>Build Trees</H3></A>
69
70There are two schemes for configuring and building the software.
71If you intend to build the software for only one target system, you
72can configure the software so that it is built in the same directories
73as the source code.
74
75<UL><PRE>
76hyla% <B>cd tiff-v3.4beta099</B>
77hyla% <B>ls</B>
78COPYRIGHT       VERSION         config.sub      dist            man
79Makefile.in     config.guess    configure       html            port
80README          config.site     contrib         libtiff         tools
81hyla% <B>./configure</B>
82</PRE></UL>
83
84<P>
85Otherwise, you can configure a build tree that
86is parallel to the source tree hierarchy but which contains only
87configured files and files created during the build procedure.
88
89<UL><PRE>
90hyla% <B>cd tiff-v3.4beta099</B>
91hyla% <B>mkdir obj obj/mycpu</B>
92hyla% <B>cd obj/mycpu</B>
93hyla% <B>../../configure</B>
94</PRE></UL>
95
96This second scheme is useful for:
97
98<UL>
99<LI>building multiple targets from a single source tree
100<LI>building from a read-only source tree (e.g. if you receive
101  the distribution on CD-ROM)
102</UL>
103
104<A NAME="ConfigFiles"><P><HR WIDTH=65% ALIGN=right><H3>Configuration Files</H3></A>
105
106The configuration process is critical to the proper compilation,
107installation, and operation of the software.
108The configure script runs a series of tests to
109decide whether or not the target system
110supports required functionality and, if it does not, whether it
111can emulate or workaround the missing functions.
112This procedure is fairly complicated and, due to the nonstandard
113nature of most UNIX systems, prone to error.
114The first time that you configure the software for use you should
115check the output from the configure script and look for anything
116that does not make sense for your system.
117A sample configure run is shown below together with an explanation
118of some of the work that is done.
119
120<P>
121A second function of the configure script is to set the default
122configuration parameters for the software.
123Of particular note are the directories where the software is to be
124installed.
125By default the software is installed in the <B>/usr/local</B> hierarchy.
126To change this behaviour the appropriate parameters can be
127specified either:
128<UL>
129<LI>on the command line to configure,
130<LI>in a site-wide configuration file, or
131<LI>in a target-specific configuration file.
132</UL>
133configure reads any site-wide configure file first, and
134then any target-specific configuration file.
135This permits target-specific definitions to override
136site-wide definitions.
137
138<P>
139Site-wide configuration files are named
140<B>config.site</B> and are automatically searched for first
141in any directory specified on the command line to configure
142(using the <TT>-site</TT> option), or if that fails, in
143the directory in in which the configure script is located.
144
145<P>
146Target-specific configuration files are named <B>config.local</B>
147and are looked for first in the top-level configuration directory,
148or, if that fails, in the directory in which the configure script
149is located.
150
151<P>
152Configuration files are just shell scripts that define
153shell variables that control the configuration process.
154For example, the following file might be used on a BSDI system to
155configure the software for installation in the <B>/usr/contrib</B> area.
156
157<PRE>
158#
159# Parameters suitable for BSDI 1.1
160#
161DIR_BIN="/usr/contrib/bin"		# directory for client apps
162DIR_LIB="/usr/contrib/lib"		# directory for libraries
163DIR_MAN="/usr/contrib/man"		# directory for manual pages
164</PRE>
165
166<P>
167For a complete list of the possible configuration parameters look
168at the sample <B>config.site</B> file provided in the distribution; the
169section below describes some of the more important parameters.
170
171<A NAME="Packages"><P><HR WIDTH=65% ALIGN=right><H3>Configuring Optional Packages/Support</H3></A>
172
173The TIFF software comes with several packages that are installed only
174as needed, or only if specifically configured at the time
175the configure script is run.  Packages can be configured in a
176<B>config.site</B> or <B>config.local</B> file, or by using a
177<TT>-with-&lt;PACKAGE&gt;</TT> option when invoking configure;
178e.g. <TT>configure -with-AFM</TT>.
179
180<DL>
181<DT><I>DSO Support</I>
182<DD>The <TT>DSO</TT> support controls whether or not to
183configure the software
184to build a Dynamic Shared Object for the TIFF library.
185Use of DSOs can significantly reduce the disk space needed for
186users of the TIFF software.
187If DSOs are not used then the code is statically linked into
188each application that uses it.
189By default this support is configured only if the system appears
190to suport DSOs in a way that fits into the normal build scheme
191(<TT>auto</TT>).
192If DSO support is <EM>explicitly enabled</EM> and there is no
193support for using DSOs in the expected way then DSOs are not used.
194
195<P>
196<DT><I>JPEG Support</I>
197<DD>The <TT>JPEG</TT> package enables support for the handling
198of TIFF images with JPEG-encoded data.
199Support for JPEG-encoded data requires the Independent JPEG Group (IJG)
200<TT>libjpeg</TT> distribution; this software is available at
201<A HREF=ftp://ftp.uu.net/graphics/jpeg/>ftp.uu.net:/graphics/jpeg/</A>.
202If JPEG support is enabled the <TT>DIRS_LIBINC</TT> and <TT>DIR_JPEGLIB</TT>
203parameters should also be set (see below).
204By default JPEG support is not configured.
205
206<P>
207<DT><I>ZIP Support</I>
208<DD>The <TT>ZIP</TT> support enables support for the handling
209of TIFF images with deflate-encoded data.
210Support for deflate-encoded data requires the freely available
211<TT>zlib</TT> distribution written by Jean-loup Gailly and Mark Adler;
212this software is available at
213<A HREF=ftp://ftp.uu.net/pub/archiving/zip/zlib/>ftp.uu.net:/pub/archiving/zip/zlib/</A>
214(or try <A HREF=ftp://quest.jpl.nasa.gov/beta/zlib/>quest.jpl.nasa.gov:/beta/zlib/</A>).
215If ZIP support is enabled the <TT>DIRS_LIBINC</TT> and <TT>DIR_GZLIB</TT>
216parameters should also be set (see below).
217By default this package is not configured.
218
219</DL>
220
221<A NAME="Sample"><P><HR WIDTH=65% ALIGN=right><H3>A Sample Configuration Session</H3></A>
222
223This section shows a sample configuration session and describes
224the work done.  The session is shown indented in a <TT>fixed width
225font</TT> with user-supplied input in a <TT><B>bold font</B></TT>.
226Comments are shown in a normal or <I>italic</I> font.
227This session was collected on a 486 machine running BSDI 1.1.
228
229<UL><PRE><TT>
230wullbrandt% <B>mkdir tiff</B>
231wullbrandt% <B>cd tiff</B>
232wullbrandt% <B>ln -s /hosts/oxford/usr/people/sam/tiff src</B>
233</TT></PRE></UL>
234
235A build tree separate from the source tree is used here.
236In fact, in this case the distribution is accessed from
237a read-only NFS-mounted filesystem.
238
239<UL><PRE><TT>
240wullbrandt% <B>src/configure</B>
241Configuring TIFF Software v3.4beta015.
242
243Reading site-wide parameters from ../tiff-v3.4beta015/config.site.
244Reading local parameters from config.local.
245Gosh, aren't you lucky to have a i386-unknown-bsdi1.1 system!
246</TT></PRE></UL>
247
248Note that configure announces the distribution version and the
249deduced target configuration (<TT>i386-unknown-bsdi1.1</TT> here).
250
251<UL><PRE><TT>
252Using /usr/local/bin/gcc for a C compiler (set CC to override).
253Looks like /usr/local/bin/gcc supports the -g option.
254Using " -g" for C compiler options.
255</TT></PRE></UL>
256
257configure checked the normal shell search path for potential
258ANSI C compilers.  The compiler is selected according to it properly
259compiling a small ANSI C test program.  A specific compiler may be requested
260by setting the <TT>CC</TT> environment variable to the appropriate
261pathname, by supplying the parameter on the command line, e.g.
262<TT>-with-CC=gcc</TT>, or by setting <TT>CC</TT> in a configuration
263file.
264
265<P>
266<IMG SRC="images/info.gif" ALIGN=left HSPACE=10>
267<EM>Note that an ANSI C compiler is required to build the software.
268If a C compiler requires options to enable ANSI C compilation, they
269can be specified with the <TT>ENVOPTS</TT> parameter.</EM>
270
271<P>
272Once a compiler is selected configure checks to see
273if the compiler accepts a -g option to enable the generation
274    of debugging symbols, and
275if the compiler includes an ANSI C preprocessor.
276
277<UL><PRE><TT>
278Using /usr/ucb/make to configure the software.
279</TT></PRE></UL>
280
281Next various system-specific libraries that may or may not be needed
282are checked for (none are needed in this case).
283If your system requires a library that is not
284automatically included it can be specified by setting the
285<TT>MACHDEPLIBS</TT> parameter.
286
287<P><I>Creating port.h.</I>
288The <B>port.h</B> file is included by all the C code
289in the library (but not the tools).
290It includes definitions for functions and type
291definitions that are missing from system include files, <TT>#defines</TT>
292to enable or disable system-specific functionality, and other
293odds and ends.
294
295<UL><PRE><TT>
296Creating libtiff/port.h with necessary definitions.
297... using LSB2MSB bit order for your i386 cpu
298... using big-endian byte order for your i386 cpu
299... configure use of mmap for memory-mapped files
300... O_RDONLY is in &lt;fcntl.h&gt;
301... using double for promoted floating point parameters
302... enabling use of inline functions
303Done creating libtiff/port.h.
304</TT></PRE></UL>
305
306This file can take a long time to create so configure
307generates the file only when it is needed, either because the
308file does not exist or because a different target or compiler
309is to be used.
310Note that running "<TT>make distclean</TT>" in the top-level directory
311of the build tree will remove the <B>port.h</B> file (along
312with all the other files generated by configure).
313
314<P><I>Selecting emulated library functions.</I>
315Certain library functions used by the tools are not present on all systems
316and can be emulated using other system functionality.
317configure checks for the presence of such functions and if they are
318missing, will configure emulation code from the <B>port</B> directory
319to use instead.  Building the TIFF
320software on unsupported systems may require
321adding to the code to the <B>port</B> directory.
322
323<UL><PRE><TT>
324Checking system libraries for functionality to emulate.
325Done checking system libraries.
326</TT></PRE></UL>
327
328If a routine must be emulated and configure does not automatically
329check for it, the routine name can be specified using the <TT>PORTFUNCS</TT>
330parameter.  To add emulation support for a new function <TT>foo</TT>,
331create a file <B>port/foo.c</B> that contains the emulation code
332and then set <TT>PORTFUNCS=foo</TT> in a configuration file or modify
333the configure script to automatically check for the missing function.
334
335<UL><PRE><TT>
336Checking for Dynamic Shared Object (DSO) support.
337Done checking for DSO support.
338</TT></PRE></UL>
339
340If the <TT>DSO</TT> package is enabled (<TT>DSO=auto</TT> or
341<TT>DSO=yes</TT>), then
342configure will verify the system and compiler are capable of
343constructing SVR4-style DSO's in the expected way.  Note that
344while a system may support DSO's the compiler may not be
345capable of generating the required position-independent
346code and/or the compiler may not pass the needed options
347through to the loader.
348
349<P><I>Selecting utility programs.</I>
350configure locates various system utility programs that are
351used during installation of the software.
352
353<UL><PRE><TT>
354Selecting programs used during installation.
355Looks like mv supports the -f option to force a move.
356Looks like /bin/ln supports the -s option to create a symbolic link.
357Done selecting programs.
358</TT></PRE></UL>
359
360<P><I>Selecting default configuration parameters.</I>
361The remainder of the work done by configure involves setting up
362configuration parameters that control the placement and
363setup of files during the installation procedure.
364
365<UL><PRE><TT>
366Selecting default TIFF configuration parameters.
367
368Looks like manual pages go in /usr/contrib/man.
369Looks like manual pages should be installed with bsd-nroff-gzip-0.gz.
370
371TIFF configuration parameters are:
372
373[ 1] Directory for tools:               /usr/contrib/bin
374[ 2] Directory for libraries:           /usr/contrib/lib
375[ 3] Directory for include files:       /usr/contrib/include
376[ 4] Directory for manual pages:        /usr/contrib/man
377[ 5] Manual page installation scheme:   bsd-nroff-gzip-0.gz
378
379Are these ok [yes]?
380</TT></PRE></UL>
381
382
383
384At this point you can interactively modify any of the
385displayed parameters.  Hitting a carriage return or typing
386<TT>yes</TT> will accept the current parameters.  Typing one
387of the number displayed along the left hand side causes
388configure to prompt for a new value of the specified parameter.
389Typing anything else causes configure to prompt for a new
390value <EM>for each parameter</EM>.
391In general hitting carriage return will accept the current
392value and typing anything that is unacceptable will cause a
393help message to be displayed.
394A description of each of the configuration parameters is given below.
395
396<P>
397Once acceptable parameters are setup configure will generate
398all the files that depend on these parameters.  Note that certain
399files may or may not be created based on the configuration of
400optional packages and/or the functions supported by target system.
401
402<UL><PRE><TT>
403Creating Makefile from ../tiff-v3.4beta015/Makefile.in
404Creating libtiff/Makefile from ../tiff-v3.4beta015/libtiff/Makefile.in
405Creating man/Makefile from ../tiff-v3.4beta015/man/Makefile.in
406Creating tools/Makefile from ../tiff-v3.4beta015/tools/Makefile.in
407Creating port/install.sh from ../tiff-v3.4beta015/port/install.sh.in
408Done.
409</TT></PRE></UL>
410
411<A NAME=DSOSupport><P><HR><H3>Shared Library Support</H3></A>
412
413It is desirable to make the TIFF library be a shared object
414on systems that have support for shared libraries.
415Unfortunately the rules to use to build a shared library
416vary between operating systems and even compilers.
417The distributed software includes support for building a shared
418version of the library on a number of different systems.
419This support is split between rules in the file
420<B>libtiff/Makefile.in</B> that construct the shared library
421and checks done by the <TT>configure</TT> script to verify that
422the expected rules are supported by compilation tools for
423the target system.
424
425<P>
426To add new support for building a shared library both these files
427must be updated.
428In the configure script search for the section where the autoconfiguration
429setting of the <TT>DSO</TT> parameter is handled and
430add a new case for the target system that sets the
431<TT>DSOSUF</TT>,
432<TT>DSOLD</TT>,
433<TT>DSOOPTS</TT>,
434and
435<TT>LIBCOPTS</TT>
436options as appropriate for the system.
437<TT>DSOSUF</TT> specifies the filename suffix used for the shared
438library (e.g. ``.so'' for Dynamic Shared Objects on most SVR4-based
439systems).
440<TT>DSOLD</TT> specifies the program to use to build the shared library
441from a compiled object file; typically ``${LD}'' though on some systems
442it is better to use the C compiler directly so system-dependent options and
443libraries are automatically supplied.
444<TT>DSOOPTS</TT> are options that must be specified to <TT>DSOLD</TT>
445when building the shared library.
446<TT>LIBCOPTS</TT> are options to pass to the C compiler when constructing
447a relocatable object file to include in a shared library; e.g. ``-K PIC''
448on a Sun system.
449The <TT>DSO</TT> parameter must also be set to a unique label that identifies
450the target system and compilation tools.
451This label is used to select
452a target in <B>libtiff/Makefile.in</B> to do the actual work in building
453the shared library.
454Finally, to complete support for the shared library added the appropriate
455rules to <B>libtiff/Makefile.in</B> under the target specified in the
456<TT>configure</TT> script.
457
458
459
460
461<A NAME="Parameters"><P><HR WIDTH=65% ALIGN=right><H3>Configuration Parameters</H3></A>
462
463This section gives a brief description of the less obvious
464configuration parameters.  Consult the distributed <B>config.site</B>
465for a <EM>complete list of parameters</EM>.
466The list here is sorted alphabetically.
467
468<P>
469<TABLE BORDER CELLPADDING=3>
470
471<TR>
472<TD VALIGN=top><TT>AROPTS</TT></TD>
473<TD>The options passed to ar when creating an archive.
474Note that configure will automatically check to see if ar
475supports an <TT>s</TT> to create a symbol table instead of
476using ranlib.</TD>
477</TR>
478
479<TR>
480<TD VALIGN=top><TT>DIR_BIN</TT></TD>
481<TD>The directory where client applications should be installed; by
482default this is <B>/usr/local/bin</B>.</TD>
483</TR>
484
485<TR>
486<TD VALIGN=top><TT>DIR_GZLIB</TT></TD>
487<TD>The pathname of the directory containing the zlib library
488(when ZIP or PixarLog compression support is enabled);
489e.g. ``<TT>../src/zlib</TT>''.</TD>
490</TR>
491
492<TR>
493<TD VALIGN=top><TT>DIR_JPEGLIB</TT></TD>
494<TD>The pathname of the directory containing the JPEG library
495(when JPEG support is enabled); e.g. ``<TT>/usr/local/lib</TT>''.</TD>
496</TR>
497
498<TR>
499<TD VALIGN=top><TT>DIR_LIB</TT></TD>
500<TD>The directory to install libraries and DSO's; by default
501this is <B>/usr/local/lib</B>.</TD>
502</TR>
503
504<TR>
505<TD VALIGN=top><TT>DIR_MAN</TT></TD>
506<TD>The top-most directory of the manual area where manual
507pages should be installed.</TD>
508</TR>
509
510<TR>
511<TD VALIGN=top><TT>DIRS_LIBINC</TT></TD>
512<TD>A space-separated list of directories in which to search for
513include files when building the library and tools.
514If JPEG or ZIP support is configured this parameter should include
515the directories where the associated include files are located.</TD>
516</TR>
517
518<TR>
519<TD VALIGN=top><TT>DIST_ALPHA</TT></TD>
520<TD>The alpha version number for the distribution; e.g. if this
521is version 3.4beta031 then the the major number is 31.</TD>
522</TR>
523
524<TR>
525<TD VALIGN=top><TT>DIST_MAJOR</TT></TD>
526<TD>The major version number for the distribution; e.g. if this
527is version 3.4beta031 then the the major number is 3.</TD>
528</TR>
529
530<TR>
531<TD VALIGN=top><TT>DIST_MINOR</TT></TD>
532<TD>The minor version number for the distribution; e.g. if this
533is version 3.4beta031 then the the major number is 4.</TD>
534</TR>
535
536<TR>
537<TD VALIGN=top><TT>DSOSUF</TT></TD>
538<TD>When DSO's are built, the filename suffix for a DSO.
539If this is set to <TT>"a"</TT> then  statically linked archives are used.</TD>
540</TR>
541
542<TR>
543<TD VALIGN=top><TT>DSOSUF_VERSION</TT></TD>
544<TD>When DSO's are built, a version-specific filename suffix for a DSO.
545If this is set to something other than the value of <TT>DSO</TT> then
546the file <B>libtiff.<TT>DSOSUF_VERSION</TT></B> will be installed and
547a link to it named <B>libtiff.<TT>DSOSUF</TT></B> will automatically
548be created.  (Note that this means that rule for building the target
549DSO must generate a file named <B>libtiff.<TT>DSOSUF_VERSION</TT></B>.)</TD>
550</TR>
551
552<TR>
553<TD VALIGN=top><TT>ENVOPTS</TT></TD>
554<TD>Options to pass to <TT>CC</TT> to force ANSI C compilation.</TD>
555</TR>
556
557<TR>
558<TD VALIGN=top><TT>FILLORDER</TT></TD>
559<TD>The order of bits in a byte on the server machine;
560either LSB2MSB or MSB2LSB.
561This is normally selected according to the target system.</TD>
562</TR>
563
564<TR>
565<TD VALIGN=top><TT>GCOPTS</TT></TD>
566<TD>Special options to pass the C compiler.  If this parameter
567is set, then configure may append other options to this list.</TD>
568</TR>
569
570<TR>
571<TD VALIGN=top><TT>INSTALL</TT></TD>
572<TD>The pathname of the install program to use.  Note that this program
573must emulate the command line interface used by the IRIX install program.</TD>
574</TR>
575
576<TR>
577<TD VALIGN=top><TT>LIBPORT</TT></TD>
578<TD>The pathname of the library that holds code to emulate missing
579system functionality.
580Normally this parameter is set by configure based on whether or
581not emulation code is required for the target.
582</TR>
583
584<TR>
585<TD VALIGN=top><TT>LLDOPTS</TT>
586<TD>Extra command line options passed to <TT>CC</TT>
587when linking an executable.
588This option is usually set only when DSO support is enabled
589(to force the executable to search for the TIFF DSO
590in non-standard locations in the filesystem.)</TD>
591</TR>
592
593<TR>
594<TD VALIGN=top><TT>MACHDEPLIBS</TT></TD>
595<TD>Target-dependent libraries that should be used when linking
596tools.
597Note that if this parameter is specified configure will append to
598the list of libraries.</TD>
599</TR>
600
601<TR>
602<TD VALIGN=top><TT>MANSCHEME</TT></TD>
603<TD>The scheme to use when preparing and installing manual pages.
604Schemes are constructed according to:
605<UL>
606&lt;<I>organization</I>&gt;-&lt;<I>formatting</I>&gt;-&lt;<I>compression</I>&gt;[-&lt;<I>suffix</I>&gt;]
607</UL>
608where:
609&lt;<I>organization</I>&gt; is either <TT>bsd</TT>
610for BSD-style section organization (e.g.  file formats in
611section 5) or <TT>sysv</TT> for System V-style
612organization (e.g. file formats in section 4).
613&lt;<I>formatting</I>&gt; is either <TT>nroff</TT> to force
614installation of formatted materials (using nroff) or
615<TT>source</TT> to get the nroff source installed.
616&lt;<I>compression</I>&gt; is either the name of a program
617to compress the manual pages (gipz, compress, pack) or
618<TT>cat</TT> for uncompressed data.
619&lt;<I>suffix</I>&gt; is either the file suffix to convert
620installed pages to (e.g. 0.gz for gzip-compressed pages under BSD)
621or <TT>strip</TT> to force the normal ".4f" suffix to be converted to ".4"
622(or ".5" if using the BSD organization).  If no -&lt;suffix&gt;
623is specified then filenames are not converted when they are installed.</TD>
624</TR>
625
626<TR>
627<TD VALIGN=top><TT>PORTFUNCS</TT></TD>
628<TD>A list of non-standard functions that should be emulated.
629Normally this list is constructed by configure based on checks it does.
630If this parameter is set, configure will append to the specified list.</TD>
631</TR>
632
633<TR>
634<TD VALIGN=top><TT>SETMAKE</TT></TD>
635<TD>If make does not automatically set <TT>$MAKE</TT> to
636the name of the make program to invoke for subdirectories, then
637configure will create an explicit definition.
638If this parameter is set, then it will be used instead.
639by default <TT>bin</TT> is used.</TD>
640</TR>
641
642</TABLE>
643
644
645<A NAME=PC><P><HR><H2>Building the Software under MS/DOS or Windows</H2></A>
646
647<I>
648There is a Makefile for Microsoft C.
649There is OS support for MS-DOS and for Windows.
650Someone needs to fill this in, but no DOS-weenies seem to
651give a damn so this section is blank for now ....
652</I>
653
654
655
656<A NAME=DJGPP><P><HR><H2>Building the Software under MS/DOS with the DJGPP v2 compiler</H2></A>
657
658[<I>From the file <B>contrib/dosdjgpp/README</B>.</I>]
659
660<P>
661The directory <B>contrib/dosdjgpp</B>
662contains the files necessary to build the library and tools
663with the DJGPP v2 compiler under MSDOS.
664
665<P>
666All you have to do is copy the files in the directory
667into the respective directories and run
668make. If you want, you can use the <B>conf.bat</B> script
669to do that for you, make sure that
670the file is stored with MSDOS text EOL-convention (CR/LF), otherwise the
671<B>command.com</B> will not do anything.
672
673<P>
674Note that you probably will not be able to build the library with the v1.x
675versions of djgpp, due to two problems. First, the top makefile calls a
676sub-make for each directory and you are likely to run out of memory, since
677each recursive invocation of a djgpp v1.x program requires about 130k, to
678avoid that, you can enter the directories manually and call make (well, there
679are only two dirs). The 2nd problem is that djgpp 1.x doesn't call the
680coff2exe (stubify) program when creating an executable. This means that all
681programs compiled are not converted to exe and consequently are not available
682for calling directly. For the tools directory, you can just call coff2exe for
683each program after make finishes, but in the libtiff directory, a few programs
684are created during the make process that have to be called for make to
685continue (e.g. mkg3states). Make will probably report an error at each
686such stage. To fix that, either add a coff2exe call before each program is
687called or call coff2exe manually and rerun make (there 2-3 such programs).
688
689
690<A NAME=MacMPW><P><HR><H2>Building the Software on a Macintosh with MPW</H2></A>
691
692The directory <B>contrib/mac-mpw</B> contains support for
693compiling the library and tools under the MPW Shell on a
694Macintosh system.
695This support was contributed by Niles Ritter
696(<A HREF=mailto:[email protected]>[email protected]</A>).
697
698<P>
699[<I>From the file <B>contrib/mac-mpw/README</B>.</I>]
700
701<P>
702This directory contains all of the utilities and makefile source
703to build the LIBTIFF library and tools from the MPW Shell. The
704file BUILD.mpw in this directory is an executable script
705which uses all of these files to create the MPW makefiles and
706run them.
707
708<P>
709The <file>.make files are not MPW makefiles as such,
710but are when run through the "mactrans" program, which turns
711the ascii "%nn" metacharacters into the standard weird MPW
712make characters.
713
714<P>
715This translation trick is necessary to protect the files when
716they are put into unix tarfiles, which tend to mangle the
717special characters.
718
719
720
721<A NAME=MacCW><P><HR><H2>Building the Software on a Macintosh with CodeWarrior</H2></A>
722
723The directory <B>contrib/mac-cw</B> contains support for
724compiling the library and tools with MetroWerks CodeWarrior 6.1
725on a Macintosh system.
726This support was contributed by Niles Ritter
727(<A HREF=mailto:[email protected]>[email protected]</A>).
728
729<P>
730[<I>From the file <B>contrib/mac-cw/README</B>.</I>]
731
732In this directory you will find a Makefile.script Applescript
733file, which should be run in order to build the libtiff code
734using MetroWerks CodeWarrior.
735
736Refer to the "metrowerks.note" instructions on building the
737library for 68k and PowerPC native code, as well as building
738some of the libtiff tools, which are rather unix-like, but
739at least give an example of how to link everything together.
740
741
742
743<A NAME=VMS><P><HR><H2>Building the Software on a VMS System</H2></A>
744
745The VMS port was done by Karsten Spang
746(<A HREF="mailto:[email protected]">[email protected]</a>), who also
747"sort of" maintains it.
748The VMS specific files are not in the main directories. Instead they
749are placed under <TT>[.CONTRIB.VMS...]</TT> in the distribution tree.
750
751Installation:
752
753It is assumed that you have unpacked the tar file into a VMS directory
754tree, in this text called DISK:[TIFF].
755
756<OL>
757<LI>Move the VMS specific files to their proper directories.
758<PRE>
759$ SET DEFAULT DISK:[TIFF.CONTRIB.VMS]
760$ RENAME [.LIBTIFF]*.* [-.-.LIBTIFF]
761$ RENAME [.TOOLS]*.* [-.-.TOOLS]
762</PRE>
763<LI>Compile the library.
764<PRE>
765$ SET DEFAULT DISK:[TIFF.LIBTIFF]
766$ @MAKEVMS
767</PRE>
768<LI>Compile the tools.
769<PRE>
770$ SET DEFAULT DISK:[TIFF.TOOLS]
771$ @MAKEVMS
772</PRE>
773<LI>Define the programs.
774<PRE>
775$ DEFINE TIFFSHR DISK:[TIFF.LIBTIFF]TIFFSHR
776$ FAX2PS    :==$DISK:[TIFF.TOOLS]FAX2PS
777$ FAX2TIFF  :==$DISK:[TIFF.TOOLS]FAX2TIFF
778$ GIF2TIFF  :==$DISK:[TIFF.TOOLS]GIF2TIFF
779$ PAL2RGB   :==$DISK:[TIFF.TOOLS]PAL2RGB
780$ PPM2TIFF  :==$DISK:[TIFF.TOOLS]PPM2TIFF
781$ RAS2TIFF  :==$DISK:[TIFF.TOOLS]RAS2TIFF
782$ RGB2YCBCR :==$DISK:[TIFF.TOOLS]RGB2YCBCR
783$ THUMBNAIL :==$DISK:[TIFF.TOOLS]THUMBNAIL
784$ TIFF2BW   :==$DISK:[TIFF.TOOLS]TIFF2BW
785$ TIFF2PS   :==$DISK:[TIFF.TOOLS]TIFF2PS
786$ TIFFCMP   :==$DISK:[TIFF.TOOLS]TIFFCMP
787$ TIFFCP    :==$DISK:[TIFF.TOOLS]TIFFCP
788$ TIFFDITHER:==$DISK:[TIFF.TOOLS]TIFFDITHER
789$ TIFFDUMP  :==$DISK:[TIFF.TOOLS]TIFFDUMP
790$ TIFFINFO  :==$DISK:[TIFF.TOOLS]TIFFINFO
791$ TIFFMEDIAN:==$DISK:[TIFF.TOOLS]TIFFMEDIAN
792$ TIFFSPLIT :==$DISK:[TIFF.TOOLS]TIFFSPLIT
793$ YCBCR     :==$DISK:[TIFF.TOOLS]YCBCR
794</PRE>
795</OL>
796
797You will want to add these lines  to your <TT>LOGIN.COM</TT>
798file, after changing
799the name of the directory that you have used on your machine.
800
801<P>
802This release has been tested on OpenVMS/VAX 5.5-2, using VAX C 3.2.
803A previous release was tested under OpenVMS/AXP ?.? using DEC C ?.?, it is
804believed that this release as well works on AXP.
805The code contains some GNU C specific things. This does *not* imply,
806however, that the VAX/GCC configuration has been tested, *it has not*.
807
808<P>
809The command procedures (<TT>MAKEVMS.COM</TT>) for building the
810library and tools,
811is believed to choose the correct options for the VAX and AXP cases
812automatically.
813
814<P>
815On the AXP, IEEE floating point is used by default. If you want VAX
816floating point, remove the <TT>/FLOAT=IEEE_FLOAT</TT> qualifier, and change
817<TT>HAVE_IEEEFP=1</TT> to <TT>HAVE_IEEEFP=0</TT> in the <TT>MAKEVMS.COM</TT>
818files in both the <B>libtiff</B> and <B>tools</B> directories.
819
820
821<H3>Compiling your own program on a VMS system:</H3>
822
823When compiling a source file in which you
824<TT>"#include <tiffio.h>"</TT>, use the
825following command
826<PRE>
827    $ CC/INCLUDE=DISK:[TIFF.LIBTIFF]
828</PRE>
829This  ensures  that the  header  file is  found.
830On the AXP, also add <TT>/FLOAT=IEEE_FLOAT</TT>
831(if used when building the library).
832
833
834<H3>Linking your own program to the TIFF library on a VMS system:</H3>
835
836You can link to the library in two ways: Either using the shareable
837library, or using the object  library.
838On the VAX these possibilities are:
839
840<OL>
841<LI>Using the shareable TIFF library.
842<PRE>
843$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS,SYS$INPUT:/OPTIONS
844    SYS$SHARE:VAXCRTL/SHAREABLE
845</PRE>
846<LI>Using the TIFF object library.
847<PRE>
848$ LINK MY_PROGRAM, -
849    DISK:[TIFF.LIBTIFF]TIFF/LIBRARY/INCLUDE=(TIF_FAX3SM,TIF_CODEC), -
850    SYS$INPUT:/OPTIONS
851    SYS$SHARE:VAXCRTL/SHAREABLE
852</PRE>
853</OL>
854
855On AXP (and possibly also using DEC C on VAX) the corresponding commands are
856<OL>
857<LI>Using the shareable TIFF library.
858<PRE>
859$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS
860</PRE>
861<LI>Using the TIFF object library.
862<PRE>
863$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/LIBRARY
864</PRE>
865</OL>
866
867Method 1 uses the shortest link time and smallest <TT>.EXE</TT>
868files, but it
869requires that <TT>TIFFSHR</TT> is defined as above at link time and
870<STRONG>at run time</STRONG>.
871Using the compilation procedure above, the tools are linked in this way.
872
873<P>
874Method 2 gives somewhat longer link time and larger <TT>.EXE</TT>
875files, but does
876not require <TT>TIFFSHR</TT> to be defined. This method is recommended if you
877want to run your program on another machine, and for some reason don't
878want to have the library on that machine. If you plan to have more than
879one program (including the tools) on the machine, it is recommended that
880you copy the library to the other machine and use method 1.
881
882
883
884<A NAME=Acorn><P><HR><H2>Building the Software on an Acorn RISC OS system</H2></A>
885
886The directory <B>contrib/acorn</B> contains support for compiling the library
887under Acorn C/C++ under Acorn's RISC OS 3.10 or above. Subsequent pathnames
888will use the Acorn format: The full-stop or period character is a pathname
889delimeter, and the slash character is not interpreted; the reverse position
890from Unix. Thus "libtiff/tif_acorn.c" becomes "libtiff.tif_acorn/c".
891
892<P>
893This support was contributed by Peter Greenham. (<A HREF=mailto:[email protected]>[email protected]</A>).
894
895<P>
896<H3>Installing LibTIFF:</H3>
897
898<P>
899LIBTIFF uses several files which have names longer than the normal RISC OS
900maximum of ten characters. This complicates matters. Maybe one day Acorn will
901address the problem and implement long filenames properly. Until then this
902gets messy, especially as I'm trying to do this with obeyfiles and not have
903to include binaries in this distribution.
904
905<P>
906First of all, ensure you have Truncate configured on (type <TT>*Configure
907Truncate On</TT>)
908
909<P>
910Although it is, of course, preferable to have long filenames, LIBTIFF can be
911installed with short filenames, and it will compile and link without
912problems. However, <I>getting</I> it there is more problematic.
913<B>contrib.acorn.install</B> is an installation obeyfile which will create a normal
914Acorn-style library from the source (ie: with c, h and o folders etc.), but
915needs the distribution library to have been unpacked into a location which is
916capable of supporting long filenames, even if only temporarily.
917
918<P>
919My recommendation, until Acorn address this problem properly, is to use Jason
920Tribbeck's <A
921HREF=ftp://ftp.demon.co.uk/pub/mirrors/hensa/micros/arch/riscos/c/c020/longfiles.arc>LongFilenames</A>, or any other
922working system that gives you long filenames, like a nearby NFS server for
923instance.
924
925<P>
926If you are using Longfilenames, even if only temporarily to install LIBTIFF,
927unpack the TAR into a RAMDisc which has been longfilenamed (ie: <TT>*addlongfs
928ram</TT>) and then install from there to the hard disk. Unfortunately
929Longfilenames seems a bit unhappy about copying a bunch of long-named files
930across the same filing system, but is happy going between systems. You'll
931need to create a ramdisk of about 2Mb.
932
933<P>
934Now you can run the installation script I've supplied (in contrib.acorn),
935which will automate the process of installing LIBTIFF as an Acorn-style
936library. The syntax is as follows:
937
938<P><TT>
939install &lt;source_dir&gt; &lt;dest_dir&gt;
940
941</TT><P>
942Install will then create &lt;dest_dir&gt; and put the library in there. For
943example, having used LongFilenames on the RAMDisk and unpacked the library
944into there, you can then type:
945
946<P><TT>
947Obey RAM::RamDisc0.$.contrib.acorn.install RAM::RamDisc0.$ ADFS::4.$.LIBTIFF
948</TT><P>
949
950It doesn't matter if the destination location can cope with long filenames or
951not. The filenames will be truncated if necessary (*Configure Truncate On if
952you get errors) and all will be well.
953
954<P>
955<H3>Compiling LibTIFF:</H3>
956
957<P>
958Once the LibTIFF folder has been created and the files put inside, making the
959library should be just a matter of running '<B>SetVars</B>' to set the
960appropriate system variables, then running '<B>Makefile</B>'.
961
962<P>
963<B>OSLib</B>
964
965<P>
966<A HREF=ftp://ftp.acorn.co.uk/pub/riscos/releases/oslib/oslib.arc>OSLib</A>
967is a comprehensive API for RISC OS machines, written by Jonathan Coxhead of
968Acorn Computers (although OSLib is not an official Acorn product). Using the
969OSLib SWI veneers produces code which is more compact and more efficient than
970code written using _kernel_swi or _swi. The Acorn port of LibTIFF can take
971advantage of this if present. Edit the Makefile and go to the Static
972dependencies section. The first entry is:
973
974<PRE>
975# Static dependencies:
976@.o.tif_acorn:   @.c.tif_acorn
977	cc $(ccflags) -o @.o.tif_acorn @.c.tif_acorn
978</PRE>
979<P>
980Change the cc line to:
981<PRE>
982	cc $(ccflags) -DINCLUDE_OSLIB -o @.o.tif_acorn @.c.tif_acorn
983</PRE>
984<P>
985Remember, however, that OSLib is only <I>recommended</I> for efficiency's
986sake. It is not required.
987
988
989
990<A NAME=Other><P><HR><H2>Building the Software on Other Systems</H2></A>
991
992This section contains information that might be useful
993if you are working on a non-UNIX system that is not directly supported.
994All library-related files described below are located in the <B>libtiff</B>
995directory.
996
997<P>
998The library requires two files that are generated <I>on-the-fly</I>.
999The file <B>tif_fax3sm.c</B> has the state tables for the
1000Group 3 and Group 4 decoders.
1001This file is generated by the <TT>mkg3states</TT> program
1002on a UNIX system; for example,
1003
1004<UL><PRE><TT>
1005cd libtiff
1006cc -o mkg3states mkg3states.c
1007rm -f tif_fax3sm.c
1008./mkg3states -c const tif_fax3sm.c
1009</TT></PRE></UL>
1010
1011The <TT>-c</TT> option can be used to control whether or not the
1012resutling tables are generated with a <TT>const</TT> declaration.
1013The <TT>-s</TT> option can be used to specify a C storage class
1014for the table declarations.
1015The <TT>-b</TT> option can be used to force data values to be
1016explicitly bracketed with ``{}'' (apparently needed for some
1017MS-Windows compilers); otherwise the structures are emitted in
1018as compact a format as possible.
1019Consult the source code for this program if you have questions.
1020
1021<P>
1022The second file required to build the library, <B>version.h</B>,
1023contains the version
1024information returned by the <TT>TIFFGetVersion</TT> routine.
1025This file is built on most systems using the
1026<TT>mkversion</TT> program and the contents of the
1027<TT>VERSION</TT> and <TT>tiff.alpha</TT> files; for example,
1028
1029<UL><PRE>
1030cd libtiff
1031cc -o mkversion mkversion.c
1032rm -f version.h
1033./mkversion -v ../VERSION -a ../dist/tiff.alpha version.h
1034</PRE></UL>
1035
1036<P>
1037Otherwise, when building the library on a non-UNIX system be sure to
1038consult the files <B>tiffcomp.h</B> and <B>tiffconf.h</B>.
1039The former contains system compatibility definitions while the latter
1040is provided so that the software configuration can be controlled
1041on systems that do not support the make facility for building
1042the software.
1043
1044<P>
1045Systems without a 32-bit compiler may not be able to handle some
1046of the codecs in the library; especially the Group 3 and 4 decoder.
1047If you encounter problems try disabling support for a particular
1048codec; consult the <A HREF=internals.html#Config>documentation</A>.
1049
1050<P>
1051Programs in the tools directory are written to assume an ANSI C
1052compilation environment.
1053There may be a few POSIX'isms as well.
1054The code in the <B>port</B> directory is provided to emulate routines
1055that may be missing on some systems.
1056On UNIX systems the <TT>configure</TT> script automatically figures
1057out which routines are not present on a system and enables the use
1058of the equivalent emulation routines from the <B>port</B> directory.
1059It may be necessary to manually do this work on a non-UNIX system.
1060
1061
1062<A NAME=Testing><P><HR><H2>Checking out the Software</H2></A>
1063
1064<P>
1065Assuming you have working versions of <TT>tiffgt</TT> and <TT>tiffsv</TT>,
1066you can just
1067use them to view any of the sample images available for testing
1068(see the <A HREF=images.html>section on obtaining the test images</A>).
1069Otherwise, you can do a cursory check of the library with
1070the <TT>tiffcp</TT> and <TT>tiffcmp</TT> programs. For example,
1071
1072<UL><PRE>
1073tiffcp -lzw cramps.tif x.tif
1074tiffcmp cramps.tif x.tif
1075</PRE></UL>
1076
1077<P>
1078(<TT>tiffcmp</TT> should be silent if the files compare correctly).
1079
1080
1081
1082<A NAME=TOC><P><HR><H2>Table of Contents</H2></A>
1083
1084The following files makup the core library:
1085
1086<PRE>
1087libtiff/tiff.h			TIFF spec definitions
1088libtiff/tiffcomp.h		non-UNIX OS-compatibility definitions
1089libtiff/tiffconf.h		non-UNIX configuration definitions
1090libtiff/tiffio.h		public TIFF library definitions
1091libtiff/tiffiop.h		private TIFF library definitions
1092libtiff/t4.h			CCITT Group 3/4 code tables+definitions
1093libtiff/tif_dir.h		private defs for TIFF directory handling
1094libtiff/tif_fax3.h		CCITT Group 3/4-related definitions
1095libtiff/tif_predict.h		private defs for Predictor tag support
1096libtiff/uvcode.h		LogL/LogLuv codec-specific definitions
1097libtiff/version.h		version string (generated by Makefile)
1098
1099libtiff/tif_acorn.c		Acorn-related OS support
1100libtiff/tif_apple.c		Apple-related OS support
1101libtiff/tif_atari.c		Atari-related OS support
1102libtiff/tif_aux.c		auxilary directory-related functions
1103libtiff/tif_close.c		close an open TIFF file
1104libtiff/tif_codec.c		configuration table of builtin codecs
1105libtiff/tif_compress.c		compression scheme support
1106libtiff/tif_dir.c		directory tag interface code
1107libtiff/tif_dirinfo.c		directory known tag support code
1108libtiff/tif_dirread.c		directory reading code
1109libtiff/tif_dirwrite.c		directory writing code
1110libtiff/tif_dumpmode.c		"no" compression codec
1111libtiff/tif_error.c		library error handler
1112libtiff/tif_fax3.c		CCITT Group 3 and 4 codec
1113libtiff/tif_fax3sm.c		G3/G4 state tables (generated by mkg3states)
1114libtiff/tif_flush.c		i/o and directory state flushing
1115libtiff/tif_getimage.c		TIFFRGBAImage support
1116libtiff/tif_jpeg.c		JPEG codec (interface to the IJG distribution)
1117libtiff/tif_luv.c		SGI LogL/LogLuv codec
1118libtiff/tif_lzw.c		LZW codec
1119libtiff/tif_msdos.c		MSDOS-related OS support
1120libtiff/tif_next.c		NeXT 2-bit scheme codec (decoding only)
1121libtiff/tif_open.c		open and simply query code
1122libtiff/tif_packbits.c		Packbits codec
1123libtiff/tif_pixarlog.c		Pixar codec
1124libtiff/tif_predict.c		Predictor tag support
1125libtiff/tif_print.c		directory printing support
1126libtiff/tif_read.c		image data reading support
1127libtiff/tif_strip.c		some strip-related code
1128libtiff/tif_swab.c		byte and bit swapping support
1129libtiff/tif_thunder.c		Thunderscan codec (decoding only)
1130libtiff/tif_tile.c		some tile-related code
1131libtiff/tif_unix.c		UNIX-related OS support
1132libtiff/tif_version.c		library version support
1133libtiff/tif_vms.c		VMS-related OS support
1134libtiff/tif_warning.c		library warning handler
1135libtiff/tif_win3.c		Windows-3.1-related OS support
1136libtiff/tif_win32.c		Win32 (95/98/NT) related OS support
1137libtiff/tif_write.c		image data writing support
1138libtiff/tif_zip.c		Deflate codec
1139
1140libtiff/mkg3states.c		program to generate G3/G4 decoder state tables
1141libtiff/mkspans.c		program to generate black-white span tables
1142libtiff/mkversion.c		program to generate libtiff/version.h.
1143</PRE>
1144
1145<P>
1146<HR>
1147
1148Last updated: $Date: 1999-08-16 16:47:11 $
1149
1150</BODY>
1151</HTML>
1152