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