From 036132130dbaab641dd1175c9c97934c16da9797 Mon Sep 17 00:00:00 2001
From: Bob Friesenhahn In general, the software is designed such that the following
+targets will always be available Otherwise, you can configure a build tree that is parallel to
+the source tree hierarchy (or in some completely different place)
+but which contains only configured files and files created during
+the build procedure. Note that cmake --build . is a build-system-independent way
+of building a target; you can always use the build system directly. Alternatively, using the MSBuild system on Windows (64-bit Release
+build with VS2013):
+ A second function of the configure script is to set the default
+configuration parameters for the software. Of particular note are the
+directories where the software is to be installed. By default the
+software is installed in the /usr/local hierarchy. To change
+this behaviour the appropriate parameters can be specified on the
+command line. Run cmake --help to get a full list of possible
+options, and cmake -LH to list all the configurable options for
+this software package, or cmake -LAH to show all advanced
+options in addition. Standard installation related options are shown
+below. This option controls whether or not to configure the software
+to build a shared and static binaries for the TIFF library. Use of
+shared libraries can significantly reduce the disk space needed for
+users of the TIFF software. If shared libraries are not used then
+the code is statically linked into each application that uses it.
+ ld-version-script[=ON|OFF] Enable linker version
+script (default is ON) Add shared library symbol versioning on ELF-based systems (e.g.
+Linux and FreeBSD) which use the GNU linker. This is needed if
+several major versions of libtiff might be loaded at once into the
+same program.
-
This chapter contains step-by-step instructions on how to configure
@@ -22,8 +23,216 @@ and build the TIFF software distribution. The software is most
easily built on a UNIX system, but with a little bit of work it can
easily be built and used on other non-UNIX platforms.
+
+Building on all systems with CMake
CMake may be used to
+generate build files for most common build systems and IDEs, and
+supports all UNIX-like systems as well as Windows. See
+the CMake website for further
+details. To build the software on you need to first run
+cmake to configure the build and generate the system-specific
+build files. This reads the top-level CMakeLists.txt file,
+which probes the target system for necessary tools and functions,
+checks any options you specified to configure the build, and then
+outputs build files configured for your system. If using Unix
+Makefiles, once configuration is done, you simply
+run make (or gmake) to build the software and
+then make install to do the installation. For other build
+systems, you do the equivalent steps with the tool for that system.
+For example, on any UNIX system:
+
+% cd ./tiff-4.0.5
+% cmake
+ ...lots of messages...
+% make
+ ...lots of messages...
+% make test
+ ...lots of messages...
+# make install
+
+make [all] build stuff
+make test run the test suite
+make install build and install stuff
+make clean remove object files, executables and cruft
+
+Build Trees
+There are two schemes for configuring and building the software. If
+you intend to build the software for only one target system, you
+can configure the software so that it is built in the same
+directories as the source code.
+
+% gzip -dc tiff-4.0.5.tar.gz | tar -xf -
+% cd ./tiff-4.0.5
+% cmake
+% make
+% make test
+% make install
+
+% gzip -dc tiff-4.0.5.tar.gz | tar -xf -
+% mkdir tiff-4.0.5-build
+% cd ./tiff-4.0.5-build
+% cmake ../tiff-4.0.5
+% make
+% make test
+% make install
+
+
+
+
+Generators
The default generator for UNIX is Unix
+Makefiles, and on Windows is NMake Makefiles or MSBuild
+depending upon the setup. Run cmake --help to list all the
+generators available for your platform. For example, to use the Ninja
+build system on UNIX or
+Windows:
+
+cmake -G Ninja
+cmake --build .
+ctest -V
+cmake --build . --target install
+
+
+cmake -G "Visual Studio 12 2013 Win64"
+cmake --build . --config Release
+ctest -V -C Release
+cmake --build . --config Release --target install
+
+With the above configuration, it's also possible to open the generated
+solution file with the Visual Studio IDE as well as building on the
+command-line.
+
+
+Configuration Options
+The configuration process is critical to the proper compilation,
+installation, and operation of the
+software. The CMakeLists.txt script runs a series of tests to
+decide whether or not the target system supports required
+functionality and, if it does not, whether it can emulate or
+workaround the missing functions. After running cmake, check
+the CMakeCache.txt file; this contains all the results of the
+checks performed and the options set by the user. If cmake
+failed to run, check CMakeFiles/CMakeOutput.log
+and CMakeFiles/CMakeError.log; these should record the error
+which caused the failure.
+
+
+Installation directories:
+ CMAKE_INSTALL_PREFIX
+
+Fine tuning of the installation directories:
+ CMAKE_INSTALL_BINDIR user executables [PREFIX/bin]
+ CMAKE_INSTALL_SBINDIR system admin executables [PREFIX/sbin]
+ CMAKE_INSTALL_LIBEXECDIR program executables [PREFIX/libexec]
+ CMAKE_INSTALL_SYSCONFDIR read-only single-machine data [PREFIX/etc]
+ CMAKE_INSTALL_SHAREDSTATEDIR modifiable architecture-independent data [PREFIX/com]
+ CMAKE_INSTALL_LOCALSTATEDIR modifiable single-machine data [PREFIX/var]
+ CMAKE_INSTALL_LIBDIR object code libraries [PREFIX/lib]
+ CMAKE_INSTALL_INCLUDEDIR C header files [PREFIX/include]
+ CMAKE_INSTALL_OLDINCLUDEDIR C header files for non-gcc [/usr/include]
+ CMAKE_INSTALL_DATAROOTDIR read-only arch.-independent data root [PREFIX/share]
+ CMAKE_INSTALL_DATADIR read-only architecture-independent data [DATAROOTDIR]
+ CMAKE_INSTALL_LOCALEDIR locale-dependent data [DATAROOTDIR/locale]
+ CMAKE_INSTALL_MANDIR man documentation [DATAROOTDIR/man]
+ CMAKE_INSTALL_DOCDIR documentation root [DATAROOTDIR/doc/tiff]
+
+
+Also see the
+CMake documentation
+for additional variables which may be set.
+
+
+Configuring Optional Packages/Support
+The TIFF software comes with several packages that are installed
+only as needed, or only if specifically configured at the time the
+configure script is run. Packages can be configured via the
+cmake commandline parameters.
+
+
+
+
+
+JPEG_INCLUDE_DIR=DIR location of IJG
+JPEG library headers
+JPEG_LIBRARY=DIR location of IJG JPEG
+library binary)
-Building on a UNIX System
+Building on a UNIX System with Autoconf
To build the software on a UNIX system you need to first run the
configure shell script that is located in the top level of the
source directory. This script probes the target system for
@@ -33,14 +242,14 @@ simply run make (or gmake) to build the software
and then make install to do the installation; for example:
-hyla% cd ./tiff-4.0.0
-hyla% ./configure
+% cd ./tiff-4.0.5
+% ./configure
...lots of messages...
-hyla% make
+% make
...lots of messages...
-hyla% make check
+% make check
...lots of messages...
-hyla# make install
+# make install
make [all] build stuff make check run the test suite -make install build&install stuff -make clean remove .o files, executables and cruft +make install build and install stuff +make clean remove object files, executables and cruft make distclean remove everything, that can be recreatedNote that after running "make distclean" the @@ -66,12 +275,12 @@ can configure the software so that it is built in the same directories as the source code.
-hyla% gzip -dc tiff-4.0.0.tar.gz | tar -xf - -hyla% cd ./tiff-4.0.0 -hyla% ./configure -hyla% make -hyla% make check -hyla% make install +% gzip -dc tiff-4.0.5.tar.gz | tar -xf - +% cd ./tiff-4.0.5 +% ./configure +% make +% make check +% make install
Otherwise, you can configure a build tree that is parallel to the source tree hierarchy (or in some completely different place) @@ -79,13 +288,13 @@ but which contains only configured files and files created during the build procedure.
-hyla% gzip -dc tiff-4.0.0.tar.gz | tar -xf - -hyla% mkdir tiff-4.0.0-build -hyla% cd ./tiff-4.0.0-build -hyla% ../tiff-4.0.0/configure -hyla% make -hyla% make check -hyla% make install +% gzip -dc tiff-4.0.5.tar.gz | tar -xf - +% mkdir tiff-4.0.5-build +% cd ./tiff-4.0.5-build +% ../tiff-4.0.5/configure +% make +% make check +% make install
These options control whether or not to configure the software to build a shared and static binaries for the TIFF library. Use of shared libraries can significantly reduce the disk space needed for -users of the TIFF software. If shared libarries are not used then +users of the TIFF software. If shared libraries are not used then the code is statically linked into each application that uses it. By default both types of binaries is configured.
@@ -199,7 +408,7 @@ distribution; this software is available at http://www.ijg.org/. configure script automatically tries to search for a working IJG JPEG installation. If it fails to find library, JPEG support will be -automatically disabled.If you want specify the exact paths to +automatically disabled. If you want specify the exact paths to library binary and headers, use above switches for that.
- unzip -aa -a tiff-4.0.0.zip + unzip -aa -a tiff-4.0.5.zip
By default the nmake-based libtiff build does not depend on any additional libraries. Normally libtiff should be built with at least @@ -249,20 +457,20 @@ tif_config.vc.h to tif_config.h, overwriting any files which may be present. Likewise, the 'nmake clean' step removes those files.
To build using the provided makefile.vc you may use:
- C:\tiff-4.0.0> nmake /f makefile.vc clean - C:\tiff-4.0.0> nmake /f makefile.vc + C:\tiff-4.0.5> nmake /f makefile.vc clean + C:\tiff-4.0.5> nmake /f makefile.vc or (the hard way) - C:\tiff-4.0.0> cd port - C:\tiff-4.0.0\port> nmake /f makefile.vc clean - C:\tiff-4.0.0\port> nmake /f makefile.vc - C:\tiff-4.0.0> cd ../libtiff - C:\tiff-4.0.0\libtiff> nmake /f makefile.vc clean - C:\tiff-4.0.0\libtiff> nmake /f makefile.vc - C:\tiff-4.0.0\libtiff> cd ..\tools - C:\tiff-4.0.0\tools> nmake /f makefile.vc clean - C:\tiff-4.0.0\tools> nmake /f makefile.vc + C:\tiff-4.0.5> cd port + C:\tiff-4.0.5\port> nmake /f makefile.vc clean + C:\tiff-4.0.5\port> nmake /f makefile.vc + C:\tiff-4.0.5> cd ../libtiff + C:\tiff-4.0.5\libtiff> nmake /f makefile.vc clean + C:\tiff-4.0.5\libtiff> nmake /f makefile.vc + C:\tiff-4.0.5\libtiff> cd ..\tools + C:\tiff-4.0.5\tools> nmake /f makefile.vc clean + C:\tiff-4.0.5\tools> nmake /f makefile.vc
This will build the library file libtiff\libtiff\libtiff.lib.
@@ -524,6 +732,6 @@ libtiff/mkspans.c program to generate black-white span tables libtiff/mkversion.c program to generate libtiff/version.h.