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],[4.0.3],[tiff@lists.maptools.org],[tiff])
29 AC_CONFIG_AUX_DIR(config)
30 AC_CONFIG_MACRO_DIR(m4)
33 dnl Compute the canonical host (run-time) system type variable
37 dnl Do not rebuild generated files every time
41 dnl Don't fill the ALPHA_VERSION field, if not applicable.
42 LIBTIFF_MAJOR_VERSION=4
43 LIBTIFF_MINOR_VERSION=0
44 LIBTIFF_MICRO_VERSION=3
45 LIBTIFF_ALPHA_VERSION=
46 LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
47 dnl This will be used with the 'make release' target
48 LIBTIFF_RELEASE_DATE=`date +"%Y%m%d"`
50 dnl Libtool library revision control info
51 dnl See the libtool documentation under the heading "Libtool's versioning
52 dnl system" in order to understand the meaning of these fields
55 dnl The most recent interface number that this library implements.
57 dnl The implementation number of the current interface.
59 dnl The difference between the newest and oldest interfaces that
60 dnl this library implements. In other words, the library implements
61 dnl all the interface numbers in the range from number current -
64 dnl Here are a set of rules to help you update your library version
67 dnl 1. Start with version information of `0:0:0' for each libtool library.
68 dnl 2. Update the version information only immediately before a public
69 dnl release of your software. More frequent updates are unnecessary, and
70 dnl only guarantee that the current interface number gets larger faster.
71 dnl 3. If the library source code has changed at all since the last update,
72 dnl then increment revision (`c:r:a' becomes `c:r+1:a').
73 dnl 4. If any interfaces have been added, removed, or changed since the last
74 dnl update, increment current, and set revision to 0.
75 dnl 5. If any interfaces have been added since the last public release, then
77 dnl 6. If any interfaces have been removed since the last public release,
78 dnl then set age to 0.
82 LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
84 # This is a special hack for OpenBSD and MirOS systems. The dynamic linker
85 # in OpenBSD uses some special semantics for shared libraries. Their soname
86 # contains only two numbers, major and minor.
87 # See http://bugzilla.remotesensing.org/show_bug.cgi?id=838 for details.
90 # LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION:0
93 # LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION:$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION
97 AC_SUBST(LIBTIFF_MAJOR_VERSION)
98 AC_SUBST(LIBTIFF_MINOR_VERSION)
99 AC_SUBST(LIBTIFF_MICRO_VERSION)
100 AC_SUBST(LIBTIFF_ALPHA_VERSION)
101 AC_SUBST(LIBTIFF_VERSION)
102 AC_SUBST(LIBTIFF_VERSION_INFO)
103 AC_SUBST(LIBTIFF_RELEASE_DATE)
105 dnl Checks for programs.
109 dnl We want warnings. As many warnings as possible.
110 VL_PROG_CC_WARNINGS()
116 # Check if LD supports linker scripts, and define automake conditional
117 # HAVE_LD_VERSION_SCRIPT if so. This functionality is currently
118 # constrained to compilers using GNU ld on ELF systems or systems
119 # which provide an adequate emulation thereof.
120 AC_ARG_ENABLE([ld-version-script],
121 AS_HELP_STRING([--enable-ld-version-script],
122 [enable linker version script (default is disabled)]),
123 [have_ld_version_script=$enableval], [have_ld_version_script=no])
124 if test "$have_ld_version_script" != no; then
125 AC_MSG_CHECKING([if LD -Wl,--version-script works])
126 save_LDFLAGS="$LDFLAGS"
127 LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
128 cat > conftest.map <<EOF
137 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
138 [have_ld_version_script=yes], [have_ld_version_script=no])
140 LDFLAGS="$save_LDFLAGS"
141 AC_MSG_RESULT($have_ld_version_script)
143 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
146 dnl Tests for Windows
150 dnl initialize libtool
154 # Enable support for silent build rules
157 dnl We don't need to add math library to all targets
159 cygwin* | mingw32* | beos* | darwin*)
162 AC_CHECK_LIB(m,sin,,,)
167 AC_SUBST(tiff_libs_private)
169 dnl Checks for header files.
170 AC_CHECK_HEADERS([assert.h fcntl.h io.h limits.h malloc.h search.h sys/time.h unistd.h])
172 dnl Checks for typedefs, structures, and compiler characteristics.
181 dnl ---------------------------------------------------------------------------
182 dnl Compute sized types for current CPU and compiler options
183 dnl ---------------------------------------------------------------------------
185 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
186 AC_CHECK_SIZEOF(signed short)
188 # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
189 AC_CHECK_SIZEOF(unsigned short)
191 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
192 AC_CHECK_SIZEOF(signed int)
194 # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
195 AC_CHECK_SIZEOF(unsigned int)
197 # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
198 AC_CHECK_SIZEOF(signed long)
200 # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
201 AC_CHECK_SIZEOF(unsigned long)
203 # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG.
204 # If 'long long' is not supported then the value defined is zero.
205 AC_CHECK_SIZEOF(signed long long)
207 # Obtain size of a 'unsigned long long' and define as
208 # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
209 # supported then the value defined is zero.
210 AC_CHECK_SIZEOF(unsigned long long)
212 # Obtain the size of an 'unsigned char *' and define as
213 # SIZEOF_UNSIGNED_CHAR_P. Result is available in
214 # ac_cv_sizeof_unsigned_char_p.
215 AC_CHECK_SIZEOF(unsigned char *)
217 AC_MSG_CHECKING(for signed 8-bit type)
219 AC_MSG_RESULT($INT8_T)
220 AC_DEFINE_UNQUOTED(TIFF_INT8_T,$INT8_T,[Signed 8-bit type])
222 AC_MSG_CHECKING(for unsigned 8-bit type)
223 UINT8_T='unsigned char'
224 AC_MSG_RESULT($UINT8_T)
225 AC_DEFINE_UNQUOTED(TIFF_UINT8_T,$UINT8_T,[Unsigned 8-bit type])
227 AC_MSG_CHECKING(for signed 16-bit type)
228 INT16_T='signed short'
229 AC_MSG_RESULT($INT16_T)
230 AC_DEFINE_UNQUOTED(TIFF_INT16_T,$INT16_T,[Signed 16-bit type])
233 AC_MSG_CHECKING(for unsigned 16-bit type)
234 UINT16_T='unsigned short'
235 AC_MSG_RESULT($UINT16_T)
236 AC_DEFINE_UNQUOTED(TIFF_UINT16_T,$UINT16_T,[Unsigned 16-bit type])
238 AC_MSG_CHECKING(for signed 32-bit type)
241 if test $ac_cv_sizeof_signed_int -eq 4
245 elif test $ac_cv_sizeof_signed_long -eq 4
247 INT32_T='signed long'
250 AC_MSG_RESULT($INT32_T)
251 AC_DEFINE_UNQUOTED(TIFF_INT32_T,$INT32_T,[Signed 32-bit type])
252 AC_DEFINE_UNQUOTED(TIFF_INT32_FORMAT,$INT32_FORMAT,[Signed 32-bit type formatter])
254 AC_MSG_CHECKING(for unsigned 32-bit type)
257 if test $ac_cv_sizeof_unsigned_int -eq 4
259 UINT32_T='unsigned int'
261 elif test $ac_cv_sizeof_unsigned_long -eq 4
263 UINT32_T='unsigned long'
264 UINT32_FORMAT='"%lu"'
266 AC_MSG_RESULT($UINT32_T)
267 AC_DEFINE_UNQUOTED(TIFF_UINT32_T,$UINT32_T,[Unsigned 32-bit type])
268 AC_DEFINE_UNQUOTED(TIFF_UINT32_FORMAT,$UINT32_FORMAT,[Unsigned 32-bit type formatter])
270 AC_MSG_CHECKING(for signed 64-bit type)
273 if test $ac_cv_sizeof_signed_long -eq 8
275 INT64_T='signed long'
277 elif test $ac_cv_sizeof_signed_long_long -eq 8
279 INT64_T='signed long long'
282 # MinGW32 understands 'long long', but uses printf from WIN32 CRT
283 INT64_FORMAT='"%I64d"'
286 INT64_FORMAT='"%lld"'
292 AC_MSG_RESULT($INT64_T)
293 AC_DEFINE_UNQUOTED(TIFF_INT64_T,$INT64_T,[Signed 64-bit type])
294 AC_DEFINE_UNQUOTED(TIFF_INT64_FORMAT,$INT64_FORMAT,[Signed 64-bit type formatter])
296 AC_MSG_CHECKING(for unsigned 64-bit type)
299 if test $ac_cv_sizeof_unsigned_long -eq 8
301 UINT64_T='unsigned long'
302 UINT64_FORMAT='"%lu"'
303 elif test $ac_cv_sizeof_unsigned_long_long -eq 8
305 UINT64_T='unsigned long long'
308 # MinGW32 understands 'unsigned long long', but uses printf from WIN32 CRT
309 UINT64_FORMAT='"%I64u"'
312 UINT64_FORMAT='"%llu"'
316 AC_MSG_RESULT($UINT64_T)
317 AC_DEFINE_UNQUOTED(TIFF_UINT64_T,$UINT64_T,[Unsigned 64-bit type])
318 AC_DEFINE_UNQUOTED(TIFF_UINT64_FORMAT,$UINT64_FORMAT,[Unsigned 64-bit type formatter])
320 # Determine TIFF equivalent of ssize_t
321 AC_MSG_CHECKING(for signed size type)
323 SSIZE_FORMAT='unknown'
324 if test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_unsigned_char_p
326 SSIZE_T='signed long'
328 elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_unsigned_char_p
330 SSIZE_T='signed long long'
331 SSIZE_FORMAT='"%lld"'
333 AC_MSG_RESULT($SSIZE_T)
334 AC_DEFINE_UNQUOTED(TIFF_SSIZE_T,$SSIZE_T,[Signed size type])
335 AC_DEFINE_UNQUOTED(TIFF_SSIZE_FORMAT,$SSIZE_FORMAT,[Signed size type formatter])
337 # Determine the type to use for the difference between two pointers.
338 # We will default to the POSIX ptrdiff_t if it is available, but will
339 # be prepared for the case when it is not.
341 PTRDIFF_FORMAT='"%ld"'
342 AC_CHECK_TYPE(ptrdiff_t,[PTRDIFF_T=ptrdiff_t])
343 if test $PTRDIFF_T = unknown
346 PTRDIFF_FORMAT=$SSIZE_FORMAT
348 AC_MSG_CHECKING(for pointer difference type)
349 AC_MSG_RESULT($PTRDIFF_T)
350 AC_DEFINE_UNQUOTED(TIFF_PTRDIFF_T,$PTRDIFF_T,[Pointer difference type])
351 AC_DEFINE_UNQUOTED(TIFF_PTRDIFF_FORMAT,$PTRDIFF_FORMAT,[Pointer difference type formatter])
353 dnl Some compilers (IBM VisualAge) has these types defined, so check it here:
354 AC_CHECK_TYPES([int8, int16, int32],,,
357 # include <inttypes.h>
361 dnl Checks for library functions.
362 AC_CHECK_FUNCS([floor isascii memmove memset mmap pow setmode sqrt strchr strrchr strstr strtol strtoull])
364 dnl Will use local replacements for unavailable functions
365 AC_REPLACE_FUNCS(getopt)
366 AC_REPLACE_FUNCS(strcasecmp)
367 AC_REPLACE_FUNCS(strtoul)
368 AC_REPLACE_FUNCS(strtoull)
369 AC_REPLACE_FUNCS(lfind)
371 dnl ---------------------------------------------------------------------------
372 dnl Check the native cpu bit order.
373 dnl ---------------------------------------------------------------------------
374 AC_MSG_CHECKING([native cpu bit order])
377 HOST_FILLORDER=FILLORDER_LSB2MSB
378 AC_MSG_RESULT([lsb2msb])
381 HOST_FILLORDER=FILLORDER_MSB2LSB
382 AC_MSG_RESULT([msb2lsb])
385 AC_DEFINE_UNQUOTED(HOST_FILLORDER, $HOST_FILLORDER, [Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB)])
387 dnl ---------------------------------------------------------------------------
388 dnl Configure legacy tifconf.h HOST_BIGENDIAN.
389 dnl ---------------------------------------------------------------------------
390 if test "$ac_cv_c_bigendian" = yes ; then
395 AC_DEFINE_UNQUOTED(HOST_BIGENDIAN,$HOST_BIGENDIAN,[Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian (Intel)])
397 dnl ---------------------------------------------------------------------------
398 dnl Make the POSIX.2 features available.
399 dnl ---------------------------------------------------------------------------
401 #AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE, $_POSIX_C_SOURCE, [Define this macro to a positive integer to control which POSIX functionality is made available.])
403 dnl ---------------------------------------------------------------------------
404 dnl Set the floating point format.
405 dnl FIXME: write appropriate test.
406 dnl ---------------------------------------------------------------------------
408 AC_DEFINE_UNQUOTED(HAVE_IEEEFP, $HAVE_IEEEFP, [Define as 0 or 1 according to the floating point format suported by the machine])
410 dnl ---------------------------------------------------------------------------
411 dnl Enable run-time paths to libraries usage.
412 dnl ---------------------------------------------------------------------------
415 AS_HELP_STRING([--enable-rpath],
416 [Enable runtime linker paths (-R libtool option)]),
417 [HAVE_RPATH=$enableval], [HAVE_RPATH=no])
418 AM_CONDITIONAL(HAVE_RPATH, test "$HAVE_RPATH" = "yes")
420 dnl ---------------------------------------------------------------------------
421 dnl Support large files.
422 dnl ---------------------------------------------------------------------------
426 dnl ---------------------------------------------------------------------------
427 dnl Point to path where we should install documentation.
428 dnl ---------------------------------------------------------------------------
430 LIBTIFF_DOCDIR=\${prefix}/share/doc/${PACKAGE}-${LIBTIFF_VERSION}
433 AS_HELP_STRING([--with-docdir=DIR],
434 [directory where documentation should be installed]),,)
435 if test "x$with_docdir" != "x" ; then
436 LIBTIFF_DOCDIR=$with_docdir
439 AC_SUBST(LIBTIFF_DOCDIR)
441 dnl ---------------------------------------------------------------------------
442 dnl Switch on/off internal codecs.
443 dnl ---------------------------------------------------------------------------
446 AS_HELP_STRING([--disable-ccitt],
447 [disable support for CCITT Group 3 & 4 algorithms]),
448 [HAVE_CCITT=$enableval], [HAVE_CCITT=yes])
450 if test "$HAVE_CCITT" = "yes" ; then
451 AC_DEFINE(CCITT_SUPPORT,1,[Support CCITT Group 3 & 4 algorithms])
454 AC_ARG_ENABLE(packbits,
455 AS_HELP_STRING([--disable-packbits],
456 [disable support for Macintosh PackBits algorithm]),
457 [HAVE_PACKBITS=$enableval], [HAVE_PACKBITS=yes])
459 if test "$HAVE_PACKBITS" = "yes" ; then
460 AC_DEFINE(PACKBITS_SUPPORT,1,[Support Macintosh PackBits algorithm])
464 AS_HELP_STRING([--disable-lzw],
465 [disable support for LZW algorithm]),
466 [HAVE_LZW=$enableval], [HAVE_LZW=yes])
468 if test "$HAVE_LZW" = "yes" ; then
469 AC_DEFINE(LZW_SUPPORT,1,[Support LZW algorithm])
472 AC_ARG_ENABLE(thunder,
473 AS_HELP_STRING([--disable-thunder],
474 [disable support for ThunderScan 4-bit RLE algorithm]),
475 [HAVE_THUNDER=$enableval], [HAVE_THUNDER=yes])
477 if test "$HAVE_THUNDER" = "yes" ; then
478 AC_DEFINE(THUNDER_SUPPORT,1,[Support ThunderScan 4-bit RLE algorithm])
484 AS_HELP_STRING([--disable-next],
485 [disable support for NeXT 2-bit RLE algorithm]),
486 [HAVE_NEXT=$enableval], [HAVE_NEXT=yes])
488 if test "$HAVE_NEXT" = "yes" ; then
489 AC_DEFINE(NEXT_SUPPORT,1,[Support NeXT 2-bit RLE algorithm])
492 AC_ARG_ENABLE(logluv,
493 AS_HELP_STRING([--disable-logluv],
494 [disable support for LogLuv high dynamic range encoding]),
495 [HAVE_LOGLUV=$enableval], [HAVE_LOGLUV=yes])
497 if test "$HAVE_LOGLUV" = "yes" ; then
498 AC_DEFINE(LOGLUV_SUPPORT,1,[Support LogLuv high dynamic range encoding])
501 dnl ---------------------------------------------------------------------------
502 dnl Switch on/off support for Microsoft Document Imaging
503 dnl ---------------------------------------------------------------------------
506 AS_HELP_STRING([--disable-mdi],
507 [disable support for Microsoft Document Imaging]),
508 [HAVE_MDI=$enableval], [HAVE_MDI=yes])
510 if test "$HAVE_MDI" = "yes" ; then
511 AC_DEFINE(MDI_SUPPORT,1,[Support Microsoft Document Imaging format])
514 dnl ---------------------------------------------------------------------------
516 dnl ---------------------------------------------------------------------------
521 AS_HELP_STRING([--disable-zlib],
522 [disable Zlib usage (required for Deflate compression, enabled by default)]),,)
523 AC_ARG_WITH(zlib-include-dir,
524 AS_HELP_STRING([--with-zlib-include-dir=DIR],
525 [location of Zlib headers]),,)
526 AC_ARG_WITH(zlib-lib-dir,
527 AS_HELP_STRING([--with-zlib-lib-dir=DIR],
528 [location of Zlib library binary]),,)
530 if test "x$enable_zlib" != "xno" ; then
532 if test "x$with_zlib_lib_dir" != "x" ; then
533 LDFLAGS="-L$with_zlib_lib_dir $LDFLAGS"
536 AC_CHECK_LIB(z, inflateEnd, [zlib_lib=yes], [zlib_lib=no],)
537 if test "$zlib_lib" = "no" -a "x$with_zlib_lib_dir" != "x"; then
538 AC_MSG_ERROR([Zlib library not found at $with_zlib_lib_dir])
541 if test "x$with_zlib_include_dir" != "x" ; then
542 CPPFLAGS="-I$with_zlib_include_dir $CPPFLAGS"
544 AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no])
545 if test "$zlib_h" = "no" -a "x$with_zlib_include_dir" != "x" ; then
546 AC_MSG_ERROR([Zlib headers not found at $with_zlib_include_dir])
549 if test "$zlib_lib" = "yes" -a "$zlib_h" = "yes" ; then
555 if test "$HAVE_ZLIB" = "yes" ; then
556 AC_DEFINE(ZIP_SUPPORT,1,[Support Deflate compression])
558 tiff_libs_private="-lz ${tiff_libs_private}"
560 if test "$HAVE_RPATH" = "yes" -a "x$with_zlib_lib_dir" != "x" ; then
561 LIBDIR="-R $with_zlib_lib_dir $LIBDIR"
566 dnl ---------------------------------------------------------------------------
567 dnl Check for Pixar log-format algorithm.
568 dnl ---------------------------------------------------------------------------
570 AC_ARG_ENABLE(pixarlog,
571 AS_HELP_STRING([--disable-pixarlog],
572 [disable support for Pixar log-format algorithm (requires Zlib)]),
573 [HAVE_PIXARLOG=$enableval], [HAVE_PIXARLOG=yes])
575 if test "$HAVE_ZLIB" = "yes" -a "$HAVE_PIXARLOG" = "yes" ; then
576 AC_DEFINE(PIXARLOG_SUPPORT, 1,
577 [Support Pixar log-format algorithm (requires Zlib)])
582 dnl ---------------------------------------------------------------------------
584 dnl ---------------------------------------------------------------------------
589 AS_HELP_STRING([--disable-jpeg],
590 [disable IJG JPEG library usage (required for JPEG compression, enabled by default)]),,)
591 AC_ARG_WITH(jpeg-include-dir,
592 AS_HELP_STRING([--with-jpeg-include-dir=DIR],
593 [location of IJG JPEG library headers]),,)
594 AC_ARG_WITH(jpeg-lib-dir,
595 AS_HELP_STRING([--with-jpeg-lib-dir=DIR],
596 [location of IJG JPEG library binary]),,)
598 if test "x$enable_jpeg" != "xno" ; then
600 if test "x$with_jpeg_lib_dir" != "x" ; then
601 LDFLAGS="-L$with_jpeg_lib_dir $LDFLAGS"
605 AC_CHECK_LIB(jpeg, jpeg_read_scanlines, [jpeg_lib=yes], [jpeg_lib=no],)
606 if test "$jpeg_lib" = "no" -a "x$with_jpeg_lib_dir" != "x" ; then
607 AC_MSG_ERROR([IJG JPEG library not found at $with_jpeg_lib_dir])
610 if test "x$with_jpeg_include_dir" != "x" ; then
611 CPPFLAGS="-I$with_jpeg_include_dir $CPPFLAGS"
613 AC_CHECK_HEADER(jpeglib.h, [jpeg_h=yes], [jpeg_h=no])
614 if test "$jpeg_h" = "no" -a "x$with_jpeg_include_dir" != "x" ; then
615 AC_MSG_ERROR([IJG JPEG library headers not found at $with_jpeg_include_dir])
618 if test "$jpeg_lib" = "yes" -a "$jpeg_h" = "yes" ; then
624 if test "$HAVE_JPEG" = "yes" ; then
625 AC_DEFINE(JPEG_SUPPORT,1,[Support JPEG compression (requires IJG JPEG library)])
627 tiff_libs_private="-ljpeg ${tiff_libs_private}"
629 if test "$HAVE_RPATH" = "yes" -a "x$with_jpeg_lib_dir" != "x" ; then
630 LIBDIR="-R $with_jpeg_lib_dir $LIBDIR"
635 dnl ---------------------------------------------------------------------------
636 dnl Check for Old JPEG.
637 dnl ---------------------------------------------------------------------------
639 AC_ARG_ENABLE(old-jpeg,
640 AS_HELP_STRING([--disable-old-jpeg],
641 [disable support for Old JPEG compresson (read-only, enabled by default)]),
642 [HAVE_OJPEG=${enableval}], [HAVE_OJPEG=yes])
644 if test "$HAVE_JPEG" = "yes" -a "$HAVE_OJPEG" = "yes" ; then
645 AC_DEFINE(OJPEG_SUPPORT, 1,
646 [Support Old JPEG compresson (read-only)])
651 dnl ---------------------------------------------------------------------------
652 dnl Check for JBIG-KIT.
653 dnl ---------------------------------------------------------------------------
658 AS_HELP_STRING([--disable-jbig],
659 [disable JBIG-KIT usage (required for ISO JBIG compression, enabled by default)]),,)
660 AC_ARG_WITH(jbig-include-dir,
661 AS_HELP_STRING([--with-jbig-include-dir=DIR],
662 [location of JBIG-KIT headers]),,)
663 AC_ARG_WITH(jbig-lib-dir,
664 AS_HELP_STRING([--with-jbig-lib-dir=DIR],
665 [location of JBIG-KIT library binary]),,)
667 if test "x$enable_jbig" != "xno" ; then
669 if test "x$with_jbig_lib_dir" != "x" ; then
670 LDFLAGS="-L$with_jbig_lib_dir $LDFLAGS"
674 AC_CHECK_LIB(jbig, jbg_dec_init, [jbig_lib=yes], [jbig_lib=no],)
675 if test "$jbig_lib" = "no" -a "x$with_jbig_lib_dir" != "x" ; then
676 AC_MSG_ERROR([JBIG-KIT library not found at $with_jbig_lib_dir])
679 if test "x$with_jbig_include_dir" != "x" ; then
680 CPPFLAGS="-I$with_jbig_include_dir $CPPFLAGS"
682 AC_CHECK_HEADER(jbig.h, [jbig_h=yes], [jbig_h=no])
683 if test "$jbig_h" = "no" -a "x$with_jbig_include_dir" != "x" ; then
684 AC_MSG_ERROR([JBIG-KIT library headers not found at $with_jbig_include_dir])
687 if test "$jbig_lib" = "yes" -a "$jbig_h" = "yes" ; then
693 if test "$HAVE_JBIG" = "yes" ; then
694 AC_DEFINE(JBIG_SUPPORT,1,[Support ISO JBIG compression (requires JBIG-KIT library)])
696 tiff_libs_private="-ljbig ${tiff_libs_private}"
698 if test "$HAVE_RPATH" = "yes" -a "x$with_jbig_lib_dir" != "x" ; then
699 LIBDIR="-R $with_jbig_lib_dir $LIBDIR"
702 # Older versions of jbigkit lack jbg_newlen
703 AC_CHECK_FUNCS([jbg_newlen])
707 dnl ---------------------------------------------------------------------------
708 dnl Check for liblzma2.
709 dnl ---------------------------------------------------------------------------
714 AS_HELP_STRING([--disable-lzma],
715 [disable liblzma usage (required for LZMA2 compression, enabled by default)]),,)
716 AC_ARG_WITH(lzma-include-dir,
717 AS_HELP_STRING([--with-lzma-include-dir=DIR],
718 [location of liblzma headers]),,)
719 AC_ARG_WITH(lzma-lib-dir,
720 AS_HELP_STRING([--with-lzma-lib-dir=DIR],
721 [location of liblzma library binary]),,)
723 if test "x$enable_lzma" != "xno" ; then
725 if test "x$with_lzma_lib_dir" != "x" ; then
726 LDFLAGS="-L$with_lzma_lib_dir $LDFLAGS"
729 AC_CHECK_LIB(lzma, lzma_code, [lzma_lib=yes], [lzma_lib=no],)
730 if test "$lzma_lib" = "no" -a "x$with_lzma_lib_dir" != "x"; then
731 AC_MSG_ERROR([lzma library not found at $with_lzma_lib_dir])
734 if test "x$with_lzma_include_dir" != "x" ; then
735 CPPFLAGS="-I$with_lzma_include_dir $CPPFLAGS"
737 AC_CHECK_HEADER(lzma.h, [lzma_h=yes], [lzma_h=no])
738 if test "$lzma_h" = "no" -a "x$with_lzma_include_dir" != "x" ; then
739 AC_MSG_ERROR([Liblzma headers not found at $with_lzma_include_dir])
742 if test "$lzma_lib" = "yes" -a "$lzma_h" = "yes" ; then
748 if test "$HAVE_LZMA" = "yes" ; then
749 AC_DEFINE(LZMA_SUPPORT,1,[Support LZMA2 compression])
751 tiff_libs_private="-llzma ${tiff_libs_private}"
753 if test "$HAVE_RPATH" = "yes" -a "x$with_lzma_lib_dir" != "x" ; then
754 LIBDIR="-R $with_lzma_lib_dir $LIBDIR"
759 dnl ---------------------------------------------------------------------------
760 dnl Should 8/12 bit jpeg mode be enabled?
761 dnl ---------------------------------------------------------------------------
765 AC_ARG_ENABLE(jpeg12,
766 AS_HELP_STRING([--enable-jpeg12],
767 [enable libjpeg 8/12bit dual mode]),,)
768 AC_ARG_WITH(jpeg12-include-dir,
769 AS_HELP_STRING([--with-jpeg12-include-dir=DIR],
770 [location of libjpeg 12bit headers]),,)
771 AC_ARG_WITH(jpeg12-lib,
772 AS_HELP_STRING([--with-jpeg12-lib=LIBRARY],
773 [path to libjpeg 12bit library]),,)
775 if test "x$enable_jpeg12" == "xyes" ; then
777 if test "x$with_jpeg12_lib" != "x" ; then
778 LIBS="$with_jpeg12_lib $LIBS"
783 AC_DEFINE(JPEG_DUAL_MODE_8_12,1,[8/12 bit libjpeg dual mode enabled])
784 if test "x$with_jpeg12_include_dir" != "x" ; then
785 AC_DEFINE_UNQUOTED(LIBJPEG_12_PATH,"$with_jpeg12_include_dir/jpeglib.h",[12bit libjpeg primary include file with path])
790 dnl ---------------------------------------------------------------------------
792 dnl ---------------------------------------------------------------------------
795 AS_HELP_STRING([--enable-cxx],
796 [enable C++ stream API building (requires C++ compiler)]),
797 [HAVE_CXX=$enableval], [HAVE_CXX=yes])
799 if test "$HAVE_CXX" = "yes" ; then
800 AC_DEFINE(CXX_SUPPORT, 1, [Support C++ stream API (requires C++ compiler)])
805 AM_CONDITIONAL(HAVE_CXX, test "$HAVE_CXX" = "yes")
807 dnl ---------------------------------------------------------------------------
808 dnl Check for OpenGL and GLUT.
809 dnl ---------------------------------------------------------------------------
816 dnl AX_CHECK_GL sets GL_CFLAGS & GL_LIBS. Also PTHREAD_LIBS,
817 dnl PTHREAD_CFLAGS, & PTHREAD_CC as a side-effect
820 dnl AX_CHECK_GLU sets GLU_CFLAGS & GLU_LIBS
823 dnl AX_CHECK_GLUT sets GLUT_CFLAGS & GLUT_LIBS
826 if test "$no_x" != "yes" -a "$no_gl" != "yes" \
827 -a "$no_glu" != "yes" -a "$no_glut" != "yes" ; then
831 AM_CONDITIONAL(HAVE_OPENGL, test "$HAVE_OPENGL" = "yes")
833 dnl ---------------------------------------------------------------------------
834 dnl Check for Win32 IO: make sure we have windows.h but not cygwin
835 dnl this must be after the ogl test, since that looks for windows.h and we
837 dnl ---------------------------------------------------------------------------
844 if test x"$ac_cv_header_windows_h" = xyes; then
846 AC_DEFINE(USE_WIN32_FILEIO,1,[define to use win32 IO system])
850 AM_CONDITIONAL([WIN32_IO], [test "$win32_io_ok" = yes])
852 dnl ---------------------------------------------------------------------------
853 dnl Check for X Athena Widgets
854 dnl ---------------------------------------------------------------------------
860 dnl if test "$no_xaw" != "yes" ; then
864 dnl AM_CONDITIONAL(HAVE_XAW, test "$HAVE_XAW" = "yes")
866 dnl ===========================================================================
867 dnl ``Orthogonal Features''
868 dnl ===========================================================================
870 dnl ---------------------------------------------------------------------------
871 dnl Default handling of strip chopping support.
872 dnl ---------------------------------------------------------------------------
874 AC_ARG_ENABLE(strip-chopping,
875 AS_HELP_STRING([--disable-strip-chopping],
876 [disable support for strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)]),
877 [HAVE_STRIPCHOP=$enableval], [HAVE_STRIPCHOP=yes])
878 AC_ARG_WITH(default-strip-size,
879 AS_HELP_STRING([--with-default-strip-size=SIZE],
880 [default size of the strip in bytes (when strip chopping enabled) [[default=8192]]]),,)
882 if test "$HAVE_STRIPCHOP" = "yes" \
883 -a "x$with_default_strip_size" != "xno"; then
884 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)])
886 if test "x$with_default_strip_size" = "x" \
887 -o "x$with_default_strip_size" = "xyes"; then
888 with_default_strip_size="8192"
891 AC_DEFINE_UNQUOTED(STRIP_SIZE_DEFAULT,$with_default_strip_size,[Default size of the strip in bytes (when strip chopping enabled)])
895 dnl ---------------------------------------------------------------------------
896 dnl Should we try to defer loading of strip/tile offsets and sizes to
897 dnl optimize directory scanning? These is an experimental feature for
899 dnl ---------------------------------------------------------------------------
901 AC_ARG_ENABLE(defer-strile-load,
902 AS_HELP_STRING([--enable-defer-strile-load],
903 [enable deferred strip/tile offset/size loading (experimental)]),
904 [HAVE_DEFER_STRILE_LOAD=$enableval], [HAVE_DEFER_STRILE_LOAD=no])
906 if test "$HAVE_DEFER_STRILE_LOAD" = "yes" ; then
907 AC_DEFINE(DEFER_STRILE_LOAD,1,[enable deferred strip/tile offset/size loading (experimental)])
911 dnl ---------------------------------------------------------------------------
912 dnl Check for support of CHUNKY_STRIP_READ_SUPPORT, a mechanism to allowing
913 dnl reading large strips (usually one strip files) in chunks when using
914 dnl TIFFReadScanline(). This is an experimental feature in libtiff 4.0.
915 dnl ---------------------------------------------------------------------------
917 AC_ARG_ENABLE(chunky-strip-read,
918 AS_HELP_STRING([--enable-chunky-strip-read],
919 [enable reading large strips in chunks for TIFFReadScanline() (experimental)]),
920 [HAVE_CHUNKY_STRIP_READ=$enableval], [HAVE_CHUNKY_STRIP_READ=no])
922 if test "$HAVE_CHUNKY_STRIP_READ" = "yes" ; then
923 AC_DEFINE(CHUNKY_STRIP_READ_SUPPORT,1,[enable partial strip reading for large strips (experimental)])
927 dnl ---------------------------------------------------------------------------
928 dnl Default subifd support.
929 dnl ---------------------------------------------------------------------------
930 AC_DEFINE(SUBIFD_SUPPORT,1,[Enable SubIFD tag (330) support])
932 dnl ---------------------------------------------------------------------------
933 dnl Default handling of ASSOCALPHA support.
934 dnl ---------------------------------------------------------------------------
936 AC_ARG_ENABLE(extrasample-as-alpha,
937 AS_HELP_STRING([--disable-extrasample-as-alpha],
938 [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]),
939 [HAVE_EXTRASAMPLE_AS_ALPHA=$enableval],
940 [HAVE_EXTRASAMPLE_AS_ALPHA=yes])
942 if test "$HAVE_EXTRASAMPLE_AS_ALPHA" = "yes" ; then
943 AC_DEFINE(DEFAULT_EXTRASAMPLE_AS_ALPHA, 1,
944 [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.])
947 dnl ---------------------------------------------------------------------------
948 dnl Default handling of YCbCr subsampling support.
949 dnl See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() for details.
950 dnl ---------------------------------------------------------------------------
952 AC_ARG_ENABLE(check-ycbcr-subsampling,
953 AS_HELP_STRING([--disable-check-ycbcr-subsampling],
954 [disable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag]),
955 [CHECK_JPEG_YCBCR_SUBSAMPLING=$enableval],
956 [CHECK_JPEG_YCBCR_SUBSAMPLING=yes])
958 if test "$CHECK_JPEG_YCBCR_SUBSAMPLING" = "yes" ; then
959 AC_DEFINE(CHECK_JPEG_YCBCR_SUBSAMPLING, 1,
960 [Pick up YCbCr subsampling info from the JPEG data stream to support files lacking the tag (default enabled).])
963 dnl ---------------------------------------------------------------------------
967 AC_CONFIG_HEADERS([libtiff/tif_config.h libtiff/tiffconf.h])
969 AC_CONFIG_FILES([Makefile \
972 contrib/addtiffo/Makefile \
973 contrib/dbs/Makefile \
974 contrib/dbs/xtiff/Makefile \
975 contrib/iptcutil/Makefile \
976 contrib/mfs/Makefile \
977 contrib/pds/Makefile \
978 contrib/ras/Makefile \
979 contrib/stream/Makefile \
980 contrib/tags/Makefile \
981 contrib/win_dib/Makefile \
983 html/images/Makefile \
993 dnl ---------------------------------------------------------------------------
994 dnl Display configuration status
995 dnl ---------------------------------------------------------------------------
998 LOC_MSG([Libtiff is now configured for ${host}])
1000 LOC_MSG([ Installation directory: ${prefix}])
1001 LOC_MSG([ Documentation directory: ${LIBTIFF_DOCDIR}])
1002 LOC_MSG([ C compiler: ${CC} ${CFLAGS}])
1003 LOC_MSG([ C++ compiler: ${CXX} ${CXXFLAGS}])
1004 LOC_MSG([ Enable runtime linker paths: ${HAVE_RPATH}])
1005 LOC_MSG([ Enable linker symbol versioning: ${have_ld_version_script}])
1006 LOC_MSG([ Support Microsoft Document Imaging: ${HAVE_MDI}])
1007 LOC_MSG([ Use win32 IO: ${win32_io_ok}])
1009 LOC_MSG([ Support for internal codecs:])
1010 LOC_MSG([ CCITT Group 3 & 4 algorithms: ${HAVE_CCITT}])
1011 LOC_MSG([ Macintosh PackBits algorithm: ${HAVE_PACKBITS}])
1012 LOC_MSG([ LZW algorithm: ${HAVE_LZW}])
1013 LOC_MSG([ ThunderScan 4-bit RLE algorithm: ${HAVE_THUNDER}])
1014 LOC_MSG([ NeXT 2-bit RLE algorithm: ${HAVE_NEXT}])
1015 LOC_MSG([ LogLuv high dynamic range encoding: ${HAVE_LOGLUV}])
1017 LOC_MSG([ Support for external codecs:])
1018 LOC_MSG([ ZLIB support: ${HAVE_ZLIB}])
1019 LOC_MSG([ Pixar log-format algorithm: ${HAVE_PIXARLOG}])
1020 LOC_MSG([ JPEG support: ${HAVE_JPEG}])
1021 LOC_MSG([ Old JPEG support: ${HAVE_OJPEG}])
1022 LOC_MSG([ JPEG 8/12 bit dual mode: ${HAVE_JPEG12}])
1023 LOC_MSG([ ISO JBIG support: ${HAVE_JBIG}])
1024 LOC_MSG([ LZMA2 support: ${HAVE_LZMA}])
1026 LOC_MSG([ C++ support: ${HAVE_CXX}])
1028 dnl LOC_MSG([ X Athena Widgets support: ${HAVE_XAW}])
1029 LOC_MSG([ OpenGL support: ${HAVE_OPENGL}])