2 dnl Tag Image File Format (TIFF) Software
4 dnl Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
6 dnl Permission to use, copy, modify, distribute, and sell this software and
7 dnl its documentation for any purpose is hereby granted without fee, provided
8 dnl that (i) the above copyright notices and this permission notice appear in
9 dnl all copies of the software and related documentation, and (ii) the names of
10 dnl Sam Leffler and Silicon Graphics may not be used in any advertising or
11 dnl publicity relating to the software without the specific, prior written
12 dnl permission of Sam Leffler and Silicon Graphics.
14 dnl THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
15 dnl EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
16 dnl WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
18 dnl IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
19 dnl ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
20 dnl OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
21 dnl WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
22 dnl LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
25 dnl Process this file with autoconf to produce a configure script.
28 AC_INIT([LibTIFF Software], 3.8.2, [tiff@lists.maptools.org], tiff)
29 AC_CONFIG_AUX_DIR(config)
30 AC_CONFIG_MACRO_DIR(m4)
33 dnl Compute the canonical build and host system type variables
38 dnl Do not rebuild generated files every time
42 dnl Don't fill the ALPHA_VERSION field, if not applicable.
43 LIBTIFF_MAJOR_VERSION=3
44 LIBTIFF_MINOR_VERSION=8
45 LIBTIFF_MICRO_VERSION=2
46 LIBTIFF_ALPHA_VERSION=
47 LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
48 dnl This will be used with the 'make release' target
49 LIBTIFF_RELEASE_DATE=`date +"%Y%m%d"`
51 # This is a special hack for OpenBSD and MirOS systems. The dynamic linker
52 # in OpenBSD uses some special semantics for shared libraries. Their soname
53 # contains only two numbers, major and minor.
54 # See http://bugzilla.remotesensing.org/show_bug.cgi?id=838 for details.
57 LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION:0
60 LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION:$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
64 AC_SUBST(LIBTIFF_MAJOR_VERSION)
65 AC_SUBST(LIBTIFF_MINOR_VERSION)
66 AC_SUBST(LIBTIFF_MICRO_VERSION)
67 AC_SUBST(LIBTIFF_ALPHA_VERSION)
68 AC_SUBST(LIBTIFF_VERSION)
69 AC_SUBST(LIBTIFF_VERSION_INFO)
70 AC_SUBST(LIBTIFF_RELEASE_DATE)
72 dnl Checks for programs.
76 dnl We want warnings. As many warnings as possible.
84 dnl Checks for libraries.
85 AC_CHECK_LIB([c], [main])
87 dnl We don't need to add math library at all targets
89 cygwin* | mingw32* | beos* | darwin*)
92 AC_CHECK_LIB(m,main,,,)
96 dnl Checks for header files.
97 AC_CHECK_HEADERS([assert.h fcntl.h limits.h malloc.h search.h sys/time.h unistd.h])
99 dnl Checks for typedefs, structures, and compiler characteristics.
106 AC_CHECK_SIZEOF(long)
109 dnl Some compilers (IBM VisualAge) has these types defined, so check it here:
110 AC_CHECK_TYPES([int8, int16, int32],,,
113 # include <inttypes.h>
117 dnl Checks for library functions.
118 AC_CHECK_FUNCS([floor isascii memmove memset mmap pow sqrt strchr strrchr strstr strtol])
120 dnl Will use local replacements for unavailable functions
121 AC_REPLACE_FUNCS(getopt)
122 AC_REPLACE_FUNCS(strcasecmp)
123 AC_REPLACE_FUNCS(strtoul)
124 AC_REPLACE_FUNCS(lfind)
126 dnl ---------------------------------------------------------------------------
127 dnl Check the native cpu bit order.
128 dnl ---------------------------------------------------------------------------
129 AC_MSG_CHECKING([native cpu bit order])
130 case "$target_cpu" in
132 HOST_FILLORDER=FILLORDER_LSB2MSB
133 AC_MSG_RESULT([lsb2msb])
136 HOST_FILLORDER=FILLORDER_MSB2LSB
137 AC_MSG_RESULT([msb2lsb])
140 AC_DEFINE_UNQUOTED(HOST_FILLORDER, $HOST_FILLORDER, [Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB)])
142 dnl ---------------------------------------------------------------------------
143 dnl Configure legacy tifconf.h HOST_BIGENDIAN.
144 dnl ---------------------------------------------------------------------------
145 if test "$ac_cv_c_bigendian" = yes ; then
150 AC_DEFINE_UNQUOTED(HOST_BIGENDIAN,$HOST_BIGENDIAN,[Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian (Intel)])
152 dnl ---------------------------------------------------------------------------
153 dnl Make the POSIX.2 features available.
154 dnl ---------------------------------------------------------------------------
156 #AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE, $_POSIX_C_SOURCE, [Define this macro to a positive integer to control which POSIX functionality is made available.])
158 dnl ---------------------------------------------------------------------------
159 dnl Set the floating point format.
160 dnl FIXME: write appropriate test.
161 dnl ---------------------------------------------------------------------------
163 AC_DEFINE_UNQUOTED(HAVE_IEEEFP, $HAVE_IEEEFP, [Define as 0 or 1 according to the floating point format suported by the machine])
165 dnl ---------------------------------------------------------------------------
166 dnl Enable run-time paths to libraries usage.
167 dnl ---------------------------------------------------------------------------
170 AS_HELP_STRING([--enable-rpath],
171 [Enable runtime linker paths (-R libtool option)]),
172 [HAVE_RPATH=$enableval], [HAVE_RPATH=no])
173 AM_CONDITIONAL(HAVE_RPATH, test "$HAVE_RPATH" = "yes")
175 dnl ---------------------------------------------------------------------------
176 dnl Support large files.
177 dnl ---------------------------------------------------------------------------
181 dnl ---------------------------------------------------------------------------
182 dnl Point to path where we should install documentation.
183 dnl ---------------------------------------------------------------------------
185 LIBTIFF_DOCDIR=\${prefix}/share/doc/${PACKAGE}-${LIBTIFF_VERSION}
188 AS_HELP_STRING([--with-docdir=DIR],
189 [directory where documentation should be installed]),,)
190 if test "x$with_docdir" != "x" ; then
191 LIBTIFF_DOCDIR=$with_docdir
194 AC_SUBST(LIBTIFF_DOCDIR)
196 dnl ---------------------------------------------------------------------------
197 dnl Switch on/off internal codecs.
198 dnl ---------------------------------------------------------------------------
201 AS_HELP_STRING([--disable-ccitt],
202 [disable support for CCITT Group 3 & 4 algorithms]),
203 [HAVE_CCITT=$enableval], [HAVE_CCITT=yes])
205 if test "$HAVE_CCITT" = "yes" ; then
206 AC_DEFINE(CCITT_SUPPORT,1,[Support CCITT Group 3 & 4 algorithms])
209 AC_ARG_ENABLE(packbits,
210 AS_HELP_STRING([--disable-packbits],
211 [disable support for Macintosh PackBits algorithm]),
212 [HAVE_PACKBITS=$enableval], [HAVE_PACKBITS=yes])
214 if test "$HAVE_PACKBITS" = "yes" ; then
215 AC_DEFINE(PACKBITS_SUPPORT,1,[Support Macintosh PackBits algorithm])
219 AS_HELP_STRING([--disable-lzw],
220 [disable support for LZW algorithm]),
221 [HAVE_LZW=$enableval], [HAVE_LZW=yes])
223 if test "$HAVE_LZW" = "yes" ; then
224 AC_DEFINE(LZW_SUPPORT,1,[Support LZW algorithm])
227 AC_ARG_ENABLE(thunder,
228 AS_HELP_STRING([--disable-thunder],
229 [disable support for ThunderScan 4-bit RLE algorithm]),
230 [HAVE_THUNDER=$enableval], [HAVE_THUNDER=yes])
232 if test "$HAVE_THUNDER" = "yes" ; then
233 AC_DEFINE(THUNDER_SUPPORT,1,[Support ThunderScan 4-bit RLE algorithm])
239 AS_HELP_STRING([--disable-next],
240 [disable support for NeXT 2-bit RLE algorithm]),
241 [HAVE_NEXT=$enableval], [HAVE_NEXT=yes])
243 if test "$HAVE_NEXT" = "yes" ; then
244 AC_DEFINE(NEXT_SUPPORT,1,[Support NeXT 2-bit RLE algorithm])
247 AC_ARG_ENABLE(logluv,
248 AS_HELP_STRING([--disable-logluv],
249 [disable support for LogLuv high dynamic range encoding]),
250 [HAVE_LOGLUV=$enableval], [HAVE_LOGLUV=yes])
252 if test "$HAVE_LOGLUV" = "yes" ; then
253 AC_DEFINE(LOGLUV_SUPPORT,1,[Support LogLuv high dynamic range encoding])
256 dnl ---------------------------------------------------------------------------
257 dnl Switch on/off support for Microsoft Document Imaging
258 dnl ---------------------------------------------------------------------------
261 AS_HELP_STRING([--disable-mdi],
262 [disable support for Microsoft Document Imaging]),
263 [HAVE_MDI=$enableval], [HAVE_MDI=yes])
265 if test "$HAVE_MDI" = "yes" ; then
266 AC_DEFINE(MDI_SUPPORT,1,[Support Microsoft Document Imaging format])
269 dnl ---------------------------------------------------------------------------
271 dnl ---------------------------------------------------------------------------
276 AS_HELP_STRING([--disable-zlib],
277 [disable Zlib usage (required for Deflate compression, enabled by default)]),,)
278 AC_ARG_WITH(zlib-include-dir,
279 AS_HELP_STRING([--with-zlib-include-dir=DIR],
280 [location of Zlib headers]),,)
281 AC_ARG_WITH(zlib-lib-dir,
282 AS_HELP_STRING([--with-zlib-lib-dir=DIR],
283 [location of Zlib library binary]),,)
285 if test "x$enable_zlib" != "xno" ; then
287 if test "x$with_zlib_lib_dir" != "x" ; then
288 LDFLAGS="-L$with_zlib_lib_dir $LDFLAGS"
291 AC_CHECK_LIB(z, inflateEnd, [zlib_lib=yes], [zlib_lib=no],)
292 if test "$zlib_lib" = "no" -a "x$with_zlib_lib_dir" != "x"; then
293 AC_MSG_ERROR([Zlib library not found at $with_zlib_lib_dir])
296 if test "x$with_zlib_include_dir" != "x" ; then
297 CPPFLAGS="-I$with_zlib_include_dir $CPPFLAGS"
299 AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no])
300 if test "$zlib_h" = "no" -a "x$with_zlib_include_dir" != "x" ; then
301 AC_MSG_ERROR([Zlib headers not found at $with_zlib_include_dir])
304 if test "$zlib_lib" = "yes" -a "$zlib_h" = "yes" ; then
310 if test "$HAVE_ZLIB" = "yes" ; then
311 AC_DEFINE(ZIP_SUPPORT,1,[Support Deflate compression])
314 if test "$HAVE_RPATH" = "yes" -a "x$with_zlib_lib_dir" != "x" ; then
315 LIBDIR="-R $with_zlib_lib_dir $LIBDIR"
320 dnl ---------------------------------------------------------------------------
321 dnl Check for Pixar log-format algorithm.
322 dnl ---------------------------------------------------------------------------
324 AC_ARG_ENABLE(pixarlog,
325 AS_HELP_STRING([--disable-pixarlog],
326 [disable support for Pixar log-format algorithm (requires Zlib)]),
327 [HAVE_PIXARLOG=$enableval], [HAVE_PIXARLOG=yes])
329 if test "$HAVE_ZLIB" = "yes" -a "$HAVE_PIXARLOG" = "yes" ; then
330 AC_DEFINE(PIXARLOG_SUPPORT, 1,
331 [Support Pixar log-format algorithm (requires Zlib)])
336 dnl ---------------------------------------------------------------------------
338 dnl ---------------------------------------------------------------------------
343 AS_HELP_STRING([--disable-jpeg],
344 [disable IJG JPEG library usage (required for JPEG compression, enabled by default)]),,)
345 AC_ARG_WITH(jpeg-include-dir,
346 AS_HELP_STRING([--with-jpeg-include-dir=DIR],
347 [location of IJG JPEG library headers]),,)
348 AC_ARG_WITH(jpeg-lib-dir,
349 AS_HELP_STRING([--with-jpeg-lib-dir=DIR],
350 [location of IJG JPEG library binary]),,)
352 if test "x$enable_jpeg" != "xno" ; then
354 if test "x$with_jpeg_lib_dir" != "x" ; then
355 LDFLAGS="-L$with_jpeg_lib_dir $LDFLAGS"
359 AC_CHECK_LIB(jpeg, jpeg_read_scanlines, [jpeg_lib=yes], [jpeg_lib=no],)
360 if test "$jpeg_lib" = "no" -a "x$with_jpeg_lib_dir" != "x" ; then
361 AC_MSG_ERROR([IJG JPEG library not found at $with_jpeg_lib_dir])
364 if test "x$with_jpeg_include_dir" != "x" ; then
365 CPPFLAGS="-I$with_jpeg_include_dir $CPPFLAGS"
367 AC_CHECK_HEADER(jpeglib.h, [jpeg_h=yes], [jpeg_h=no])
368 if test "$jpeg_h" = "no" -a "x$with_jpeg_include_dir" != "x" ; then
369 AC_MSG_ERROR([IJG JPEG library headers not found at $with_jpeg_include_dir])
372 if test "$jpeg_lib" = "yes" -a "$jpeg_h" = "yes" ; then
378 if test "$HAVE_JPEG" = "yes" ; then
379 AC_DEFINE(JPEG_SUPPORT,1,[Support JPEG compression (requires IJG JPEG library)])
382 if test "$HAVE_RPATH" = "yes" -a "x$with_jpeg_lib_dir" != "x" ; then
383 LIBDIR="-R $with_jpeg_lib_dir $LIBDIR"
388 dnl ---------------------------------------------------------------------------
389 dnl Check for Old JPEG.
390 dnl ---------------------------------------------------------------------------
392 AC_ARG_ENABLE(old-jpeg,
393 AS_HELP_STRING([--enable-old-jpeg],
394 [enable support for Old JPEG compresson (read contrib/ojpeg/README first! Compilation fails with unpatched IJG JPEG library)]),
395 [HAVE_OJPEG=$enableval], [HAVE_OJPEG=no])
397 if test "$HAVE_JPEG" = "yes" -a "$HAVE_OJPEG" = "yes" ; then
398 AC_DEFINE(OJPEG_SUPPORT, 1,
399 [Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation fails with unpatched IJG JPEG library)])
404 dnl ---------------------------------------------------------------------------
406 dnl ---------------------------------------------------------------------------
409 AS_HELP_STRING([--enable-cxx],
410 [enable C++ stream API building (requires C++ compiler)]),
411 [HAVE_CXX=$enableval], [HAVE_CXX=yes])
413 if test "$HAVE_CXX" = "yes" ; then
414 AC_DEFINE(CXX_SUPPORT, 1, [Support C++ stream API (requires C++ compiler)])
419 AM_CONDITIONAL(HAVE_CXX, test "$HAVE_CXX" = "yes")
421 dnl ---------------------------------------------------------------------------
422 dnl Check for OpenGL and GLUT.
423 dnl ---------------------------------------------------------------------------
433 if test "$no_x" != "yes" -a "$no_gl" != "yes" \
434 -a "$no_glu" != "yes" -a "$no_glut" != "yes" ; then
438 AM_CONDITIONAL(HAVE_OPENGL, test "$HAVE_OPENGL" = "yes")
440 dnl ===========================================================================
441 dnl ``Orthogonal Features''
442 dnl ===========================================================================
444 dnl ---------------------------------------------------------------------------
445 dnl Default handling of strip chopping support.
446 dnl ---------------------------------------------------------------------------
448 AC_ARG_ENABLE(strip-chopping,
449 AS_HELP_STRING([--disable-strip-chopping],
450 [disable support for strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)]),
451 [HAVE_STRIPCHOP=$enableval], [HAVE_STRIPCHOP=yes])
452 AC_ARG_WITH(default-strip-size,
453 AS_HELP_STRING([--with-default-strip-size=SIZE],
454 [default size of the strip in bytes (when strip chopping enabled) [[default=8192]]]),,)
456 if test "$HAVE_STRIPCHOP" = "yes" \
457 -a "x$with_default_strip_size" != "xno"; then
458 AC_DEFINE(STRIPCHOP_DEFAULT,TIFF_STRIPCHOP,[Support strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)])
460 if test "x$with_default_strip_size" = "x" \
461 -o "x$with_default_strip_size" = "xyes"; then
462 with_default_strip_size="8192"
465 AC_DEFINE_UNQUOTED(STRIP_SIZE_DEFAULT,$with_default_strip_size,[Default size of the strip in bytes (when strip chopping enabled)])
469 dnl ---------------------------------------------------------------------------
470 dnl Default subifd support.
471 dnl ---------------------------------------------------------------------------
472 AC_DEFINE(SUBIFD_SUPPORT,1,[Enable SubIFD tag (330) support])
474 dnl ---------------------------------------------------------------------------
475 dnl Default handling of ASSOCALPHA support.
476 dnl ---------------------------------------------------------------------------
478 AC_ARG_ENABLE(extrasample-as-alpha,
479 AS_HELP_STRING([--disable-extrasample-as-alpha],
480 [the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don't mark the alpha properly]),
481 [HAVE_EXTRASAMPLE_AS_ALPHA=$enableval],
482 [HAVE_EXTRASAMPLE_AS_ALPHA=yes])
484 if test "$HAVE_EXTRASAMPLE_AS_ALPHA" = "yes" ; then
485 AC_DEFINE(DEFAULT_EXTRASAMPLE_AS_ALPHA, 1,
486 [Treat extra sample as alpha (default enabled). The RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don't mark the alpha properly.])
489 dnl ---------------------------------------------------------------------------
490 dnl Default handling of YCbCr subsampling support.
491 dnl See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() for details.
492 dnl ---------------------------------------------------------------------------
494 AC_ARG_ENABLE(check-ycbcr-subsampling,
495 AS_HELP_STRING([--disable-check-ycbcr-subsampling],
496 [disable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag]),
497 [CHECK_JPEG_YCBCR_SUBSAMPLING=$enableval],
498 [CHECK_JPEG_YCBCR_SUBSAMPLING=yes])
500 if test "$CHECK_JPEG_YCBCR_SUBSAMPLING" = "yes" ; then
501 AC_DEFINE(CHECK_JPEG_YCBCR_SUBSAMPLING, 1,
502 [Pick up YCbCr subsampling info from the JPEG data stream to support files lacking the tag (default enabled).])
505 dnl ---------------------------------------------------------------------------
509 AC_CONFIG_HEADERS([libtiff/tif_config.h libtiff/tiffconf.h])
511 AC_CONFIG_FILES([Makefile \
513 contrib/acorn/Makefile \
514 contrib/addtiffo/Makefile \
515 contrib/dbs/Makefile \
516 contrib/dbs/xtiff/Makefile \
517 contrib/iptcutil/Makefile \
518 contrib/mac-cw/Makefile \
519 contrib/mac-mpw/Makefile \
520 contrib/mfs/Makefile \
521 contrib/ojpeg/Makefile \
522 contrib/pds/Makefile \
523 contrib/ras/Makefile \
524 contrib/stream/Makefile \
525 contrib/tags/Makefile \
526 contrib/win_dib/Makefile \
528 html/images/Makefile \
537 dnl ---------------------------------------------------------------------------
538 dnl Display configuration status
539 dnl ---------------------------------------------------------------------------
542 LOC_MSG([Libtiff is now configured for ${host}])
544 LOC_MSG([ Installation directory: ${prefix}])
545 LOC_MSG([ Documentation directory: ${LIBTIFF_DOCDIR}])
546 LOC_MSG([ C compiler: ${CC} ${CFLAGS}])
547 LOC_MSG([ C++ compiler: ${CXX} ${CXXFLAGS}])
548 LOC_MSG([ Enable runtime linker paths: ${HAVE_RPATH}])
549 LOC_MSG([ Support Microsoft Document Imaging: ${HAVE_MDI}])
551 LOC_MSG([ Support for internal codecs:])
552 LOC_MSG([ CCITT Group 3 & 4 algorithms: ${HAVE_CCITT}])
553 LOC_MSG([ Macintosh PackBits algorithm: ${HAVE_PACKBITS}])
554 LOC_MSG([ LZW algorithm: ${HAVE_LZW}])
555 LOC_MSG([ ThunderScan 4-bit RLE algorithm: ${HAVE_THUNDER}])
556 LOC_MSG([ NeXT 2-bit RLE algorithm: ${HAVE_NEXT}])
557 LOC_MSG([ LogLuv high dynamic range encoding: ${HAVE_LOGLUV}])
559 LOC_MSG([ Support for external codecs:])
560 LOC_MSG([ ZLIB support: ${HAVE_ZLIB}])
561 LOC_MSG([ Pixar log-format algorithm: ${HAVE_PIXARLOG}])
562 LOC_MSG([ JPEG support: ${HAVE_JPEG}])
563 LOC_MSG([ Old JPEG support: ${HAVE_OJPEG}])
565 LOC_MSG([ C++ support: ${HAVE_CXX}])
567 LOC_MSG([ OpenGL support: ${HAVE_OPENGL}])