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