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 target-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=3
43 LIBTIFF_MINOR_VERSION=8
44 LIBTIFF_MICRO_VERSION=2
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 # This is a special hack for OpenBSD and MirOS systems. The dynamic linker
51 # in OpenBSD uses some special semantics for shared libraries. Their soname
52 # contains only two numbers, major and minor.
53 # See http://bugzilla.remotesensing.org/show_bug.cgi?id=838 for details.
56 LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION:0
59 LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION:$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
63 AC_SUBST(LIBTIFF_MAJOR_VERSION)
64 AC_SUBST(LIBTIFF_MINOR_VERSION)
65 AC_SUBST(LIBTIFF_MICRO_VERSION)
66 AC_SUBST(LIBTIFF_ALPHA_VERSION)
67 AC_SUBST(LIBTIFF_VERSION)
68 AC_SUBST(LIBTIFF_VERSION_INFO)
69 AC_SUBST(LIBTIFF_RELEASE_DATE)
71 dnl Checks for programs.
75 dnl We want warnings. As many warnings as possible.
83 dnl Checks for libraries.
84 AC_CHECK_LIB([c], [main])
86 dnl We don't need to add math library at all targets
88 cygwin* | mingw32* | beos* | darwin*)
91 AC_CHECK_LIB(m,main,,,)
95 dnl Checks for header files.
96 AC_CHECK_HEADERS([assert.h fcntl.h limits.h malloc.h search.h sys/time.h unistd.h])
98 dnl Checks for typedefs, structures, and compiler characteristics.
105 AC_CHECK_SIZEOF(long)
108 dnl Some compilers (IBM VisualAge) has these types defined, so check it here:
109 AC_CHECK_TYPES([int8, int16, int32],,,
112 # include <inttypes.h>
116 dnl Checks for library functions.
117 AC_CHECK_FUNCS([floor isascii memmove memset mmap pow sqrt strchr strrchr strstr strtol])
119 dnl Will use local replacements for unavailable functions
120 AC_REPLACE_FUNCS(getopt)
121 AC_REPLACE_FUNCS(strcasecmp)
122 AC_REPLACE_FUNCS(strtoul)
123 AC_REPLACE_FUNCS(lfind)
125 dnl ---------------------------------------------------------------------------
126 dnl Check the native cpu bit order.
127 dnl ---------------------------------------------------------------------------
128 AC_MSG_CHECKING([native cpu bit order])
129 case "$target_cpu" in
131 HOST_FILLORDER=FILLORDER_LSB2MSB
132 AC_MSG_RESULT([lsb2msb])
135 HOST_FILLORDER=FILLORDER_MSB2LSB
136 AC_MSG_RESULT([msb2lsb])
139 AC_DEFINE_UNQUOTED(HOST_FILLORDER, $HOST_FILLORDER, [Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB)])
141 dnl ---------------------------------------------------------------------------
142 dnl Configure legacy tifconf.h HOST_BIGENDIAN.
143 dnl ---------------------------------------------------------------------------
144 if test "$ac_cv_c_bigendian" = yes ; then
149 AC_DEFINE_UNQUOTED(HOST_BIGENDIAN,$HOST_BIGENDIAN,[Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian (Intel)])
151 dnl ---------------------------------------------------------------------------
152 dnl Make the POSIX.2 features available.
153 dnl ---------------------------------------------------------------------------
155 #AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE, $_POSIX_C_SOURCE, [Define this macro to a positive integer to control which POSIX functionality is made available.])
157 dnl ---------------------------------------------------------------------------
158 dnl Set the floating point format.
159 dnl FIXME: write appropriate test.
160 dnl ---------------------------------------------------------------------------
162 AC_DEFINE_UNQUOTED(HAVE_IEEEFP, $HAVE_IEEEFP, [Define as 0 or 1 according to the floating point format suported by the machine])
164 dnl ---------------------------------------------------------------------------
165 dnl Enable run-time paths to libraries usage.
166 dnl ---------------------------------------------------------------------------
169 AS_HELP_STRING([--enable-rpath],
170 [Enable runtime linker paths (-R libtool option)]),
171 [HAVE_RPATH=$enableval], [HAVE_RPATH=no])
172 AM_CONDITIONAL(HAVE_RPATH, test "$HAVE_RPATH" = "yes")
174 dnl ---------------------------------------------------------------------------
175 dnl Support large files.
176 dnl ---------------------------------------------------------------------------
180 dnl ---------------------------------------------------------------------------
181 dnl Point to path where we should install documentation.
182 dnl ---------------------------------------------------------------------------
184 LIBTIFF_DOCDIR=\${prefix}/share/doc/${PACKAGE}-${LIBTIFF_VERSION}
187 AS_HELP_STRING([--with-docdir=DIR],
188 [directory where documentation should be installed]),,)
189 if test "x$with_docdir" != "x" ; then
190 LIBTIFF_DOCDIR=$with_docdir
193 AC_SUBST(LIBTIFF_DOCDIR)
195 dnl ---------------------------------------------------------------------------
196 dnl Switch on/off internal codecs.
197 dnl ---------------------------------------------------------------------------
200 AS_HELP_STRING([--disable-ccitt],
201 [disable support for CCITT Group 3 & 4 algorithms]),
202 [HAVE_CCITT=$enableval], [HAVE_CCITT=yes])
204 if test "$HAVE_CCITT" = "yes" ; then
205 AC_DEFINE(CCITT_SUPPORT,1,[Support CCITT Group 3 & 4 algorithms])
208 AC_ARG_ENABLE(packbits,
209 AS_HELP_STRING([--disable-packbits],
210 [disable support for Macintosh PackBits algorithm]),
211 [HAVE_PACKBITS=$enableval], [HAVE_PACKBITS=yes])
213 if test "$HAVE_PACKBITS" = "yes" ; then
214 AC_DEFINE(PACKBITS_SUPPORT,1,[Support Macintosh PackBits algorithm])
218 AS_HELP_STRING([--disable-lzw],
219 [disable support for LZW algorithm]),
220 [HAVE_LZW=$enableval], [HAVE_LZW=yes])
222 if test "$HAVE_LZW" = "yes" ; then
223 AC_DEFINE(LZW_SUPPORT,1,[Support LZW algorithm])
226 AC_ARG_ENABLE(thunder,
227 AS_HELP_STRING([--disable-thunder],
228 [disable support for ThunderScan 4-bit RLE algorithm]),
229 [HAVE_THUNDER=$enableval], [HAVE_THUNDER=yes])
231 if test "$HAVE_THUNDER" = "yes" ; then
232 AC_DEFINE(THUNDER_SUPPORT,1,[Support ThunderScan 4-bit RLE algorithm])
238 AS_HELP_STRING([--disable-next],
239 [disable support for NeXT 2-bit RLE algorithm]),
240 [HAVE_NEXT=$enableval], [HAVE_NEXT=yes])
242 if test "$HAVE_NEXT" = "yes" ; then
243 AC_DEFINE(NEXT_SUPPORT,1,[Support NeXT 2-bit RLE algorithm])
246 AC_ARG_ENABLE(logluv,
247 AS_HELP_STRING([--disable-logluv],
248 [disable support for LogLuv high dynamic range encoding]),
249 [HAVE_LOGLUV=$enableval], [HAVE_LOGLUV=yes])
251 if test "$HAVE_LOGLUV" = "yes" ; then
252 AC_DEFINE(LOGLUV_SUPPORT,1,[Support LogLuv high dynamic range encoding])
255 dnl ---------------------------------------------------------------------------
256 dnl Switch on/off support for Microsoft Document Imaging
257 dnl ---------------------------------------------------------------------------
260 AS_HELP_STRING([--disable-mdi],
261 [disable support for Microsoft Document Imaging]),
262 [HAVE_MDI=$enableval], [HAVE_MDI=yes])
264 if test "$HAVE_MDI" = "yes" ; then
265 AC_DEFINE(MDI_SUPPORT,1,[Support Microsoft Document Imaging format])
268 dnl ---------------------------------------------------------------------------
270 dnl ---------------------------------------------------------------------------
275 AS_HELP_STRING([--disable-zlib],
276 [disable Zlib usage (required for Deflate compression, enabled by default)]),,)
277 AC_ARG_WITH(zlib-include-dir,
278 AS_HELP_STRING([--with-zlib-include-dir=DIR],
279 [location of Zlib headers]),,)
280 AC_ARG_WITH(zlib-lib-dir,
281 AS_HELP_STRING([--with-zlib-lib-dir=DIR],
282 [location of Zlib library binary]),,)
284 if test "x$enable_zlib" != "xno" ; then
286 if test "x$with_zlib_lib_dir" != "x" ; then
287 LDFLAGS="-L$with_zlib_lib_dir $LDFLAGS"
290 AC_CHECK_LIB(z, inflateEnd, [zlib_lib=yes], [zlib_lib=no],)
291 if test "$zlib_lib" = "no" -a "x$with_zlib_lib_dir" != "x"; then
292 AC_MSG_ERROR([Zlib library not found at $with_zlib_lib_dir])
295 if test "x$with_zlib_include_dir" != "x" ; then
296 CPPFLAGS="-I$with_zlib_include_dir $CPPFLAGS"
298 AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no])
299 if test "$zlib_h" = "no" -a "x$with_zlib_include_dir" != "x" ; then
300 AC_MSG_ERROR([Zlib headers not found at $with_zlib_include_dir])
303 if test "$zlib_lib" = "yes" -a "$zlib_h" = "yes" ; then
309 if test "$HAVE_ZLIB" = "yes" ; then
310 AC_DEFINE(ZIP_SUPPORT,1,[Support Deflate compression])
313 if test "$HAVE_RPATH" = "yes" -a "x$with_zlib_lib_dir" != "x" ; then
314 LIBDIR="-R $with_zlib_lib_dir $LIBDIR"
319 dnl ---------------------------------------------------------------------------
320 dnl Check for Pixar log-format algorithm.
321 dnl ---------------------------------------------------------------------------
323 AC_ARG_ENABLE(pixarlog,
324 AS_HELP_STRING([--disable-pixarlog],
325 [disable support for Pixar log-format algorithm (requires Zlib)]),
326 [HAVE_PIXARLOG=$enableval], [HAVE_PIXARLOG=yes])
328 if test "$HAVE_ZLIB" = "yes" -a "$HAVE_PIXARLOG" = "yes" ; then
329 AC_DEFINE(PIXARLOG_SUPPORT, 1,
330 [Support Pixar log-format algorithm (requires Zlib)])
335 dnl ---------------------------------------------------------------------------
337 dnl ---------------------------------------------------------------------------
342 AS_HELP_STRING([--disable-jpeg],
343 [disable IJG JPEG library usage (required for JPEG compression, enabled by default)]),,)
344 AC_ARG_WITH(jpeg-include-dir,
345 AS_HELP_STRING([--with-jpeg-include-dir=DIR],
346 [location of IJG JPEG library headers]),,)
347 AC_ARG_WITH(jpeg-lib-dir,
348 AS_HELP_STRING([--with-jpeg-lib-dir=DIR],
349 [location of IJG JPEG library binary]),,)
351 if test "x$enable_jpeg" != "xno" ; then
353 if test "x$with_jpeg_lib_dir" != "x" ; then
354 LDFLAGS="-L$with_jpeg_lib_dir $LDFLAGS"
358 AC_CHECK_LIB(jpeg, jpeg_read_scanlines, [jpeg_lib=yes], [jpeg_lib=no],)
359 if test "$jpeg_lib" = "no" -a "x$with_jpeg_lib_dir" != "x" ; then
360 AC_MSG_ERROR([IJG JPEG library not found at $with_jpeg_lib_dir])
363 if test "x$with_jpeg_include_dir" != "x" ; then
364 CPPFLAGS="-I$with_jpeg_include_dir $CPPFLAGS"
366 AC_CHECK_HEADER(jpeglib.h, [jpeg_h=yes], [jpeg_h=no])
367 if test "$jpeg_h" = "no" -a "x$with_jpeg_include_dir" != "x" ; then
368 AC_MSG_ERROR([IJG JPEG library headers not found at $with_jpeg_include_dir])
371 if test "$jpeg_lib" = "yes" -a "$jpeg_h" = "yes" ; then
377 if test "$HAVE_JPEG" = "yes" ; then
378 AC_DEFINE(JPEG_SUPPORT,1,[Support JPEG compression (requires IJG JPEG library)])
381 if test "$HAVE_RPATH" = "yes" -a "x$with_jpeg_lib_dir" != "x" ; then
382 LIBDIR="-R $with_jpeg_lib_dir $LIBDIR"
387 dnl ---------------------------------------------------------------------------
388 dnl Check for Old JPEG.
389 dnl ---------------------------------------------------------------------------
391 AC_ARG_ENABLE(old-jpeg,
392 AS_HELP_STRING([--enable-old-jpeg],
393 [enable support for Old JPEG compresson (read contrib/ojpeg/README first! Compilation fails with unpatched IJG JPEG library)]),
394 [HAVE_OJPEG=$enableval], [HAVE_OJPEG=no])
396 if test "$HAVE_JPEG" = "yes" -a "$HAVE_OJPEG" = "yes" ; then
397 AC_DEFINE(OJPEG_SUPPORT, 1,
398 [Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation fails with unpatched IJG JPEG library)])
403 dnl ---------------------------------------------------------------------------
405 dnl ---------------------------------------------------------------------------
408 AS_HELP_STRING([--enable-cxx],
409 [enable C++ stream API building (requires C++ compiler)]),
410 [HAVE_CXX=$enableval], [HAVE_CXX=yes])
412 if test "$HAVE_CXX" = "yes" ; then
413 AC_DEFINE(CXX_SUPPORT, 1, [Support C++ stream API (requires C++ compiler)])
418 AM_CONDITIONAL(HAVE_CXX, test "$HAVE_CXX" = "yes")
420 dnl ---------------------------------------------------------------------------
421 dnl Check for OpenGL and GLUT.
422 dnl ---------------------------------------------------------------------------
432 if test "$no_x" != "yes" -a "$no_gl" != "yes" \
433 -a "$no_glu" != "yes" -a "$no_glut" != "yes" ; then
437 AM_CONDITIONAL(HAVE_OPENGL, test "$HAVE_OPENGL" = "yes")
439 dnl ===========================================================================
440 dnl ``Orthogonal Features''
441 dnl ===========================================================================
443 dnl ---------------------------------------------------------------------------
444 dnl Default handling of strip chopping support.
445 dnl ---------------------------------------------------------------------------
447 AC_ARG_ENABLE(strip-chopping,
448 AS_HELP_STRING([--disable-strip-chopping],
449 [disable support for strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)]),
450 [HAVE_STRIPCHOP=$enableval], [HAVE_STRIPCHOP=yes])
451 AC_ARG_WITH(default-strip-size,
452 AS_HELP_STRING([--with-default-strip-size=SIZE],
453 [default size of the strip in bytes (when strip chopping enabled) [[default=8192]]]),,)
455 if test "$HAVE_STRIPCHOP" = "yes" \
456 -a "x$with_default_strip_size" != "xno"; then
457 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)])
459 if test "x$with_default_strip_size" = "x" \
460 -o "x$with_default_strip_size" = "xyes"; then
461 with_default_strip_size="8192"
464 AC_DEFINE_UNQUOTED(STRIP_SIZE_DEFAULT,$with_default_strip_size,[Default size of the strip in bytes (when strip chopping enabled)])
468 dnl ---------------------------------------------------------------------------
469 dnl Default subifd support.
470 dnl ---------------------------------------------------------------------------
471 AC_DEFINE(SUBIFD_SUPPORT,1,[Enable SubIFD tag (330) support])
473 dnl ---------------------------------------------------------------------------
474 dnl Default handling of ASSOCALPHA support.
475 dnl ---------------------------------------------------------------------------
477 AC_ARG_ENABLE(extrasample-as-alpha,
478 AS_HELP_STRING([--disable-extrasample-as-alpha],
479 [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]),
480 [HAVE_EXTRASAMPLE_AS_ALPHA=$enableval],
481 [HAVE_EXTRASAMPLE_AS_ALPHA=yes])
483 if test "$HAVE_EXTRASAMPLE_AS_ALPHA" = "yes" ; then
484 AC_DEFINE(DEFAULT_EXTRASAMPLE_AS_ALPHA, 1,
485 [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.])
488 dnl ---------------------------------------------------------------------------
489 dnl Default handling of YCbCr subsampling support.
490 dnl See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() for details.
491 dnl ---------------------------------------------------------------------------
493 AC_ARG_ENABLE(check-ycbcr-subsampling,
494 AS_HELP_STRING([--disable-check-ycbcr-subsampling],
495 [disable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag]),
496 [CHECK_JPEG_YCBCR_SUBSAMPLING=$enableval],
497 [CHECK_JPEG_YCBCR_SUBSAMPLING=yes])
499 if test "$CHECK_JPEG_YCBCR_SUBSAMPLING" = "yes" ; then
500 AC_DEFINE(CHECK_JPEG_YCBCR_SUBSAMPLING, 1,
501 [Pick up YCbCr subsampling info from the JPEG data stream to support files lacking the tag (default enabled).])
504 dnl ---------------------------------------------------------------------------
508 AC_CONFIG_HEADERS([libtiff/tif_config.h libtiff/tiffconf.h])
510 AC_CONFIG_FILES([Makefile \
512 contrib/acorn/Makefile \
513 contrib/addtiffo/Makefile \
514 contrib/dbs/Makefile \
515 contrib/dbs/xtiff/Makefile \
516 contrib/iptcutil/Makefile \
517 contrib/mac-cw/Makefile \
518 contrib/mac-mpw/Makefile \
519 contrib/mfs/Makefile \
520 contrib/ojpeg/Makefile \
521 contrib/pds/Makefile \
522 contrib/ras/Makefile \
523 contrib/stream/Makefile \
524 contrib/tags/Makefile \
525 contrib/win_dib/Makefile \
527 html/images/Makefile \
536 dnl ---------------------------------------------------------------------------
537 dnl Display configuration status
538 dnl ---------------------------------------------------------------------------
541 LOC_MSG([Libtiff is now configured for ${host}])
543 LOC_MSG([ Installation directory: ${prefix}])
544 LOC_MSG([ Documentation directory: ${LIBTIFF_DOCDIR}])
545 LOC_MSG([ C compiler: ${CC} ${CFLAGS}])
546 LOC_MSG([ C++ compiler: ${CXX} ${CXXFLAGS}])
547 LOC_MSG([ Enable runtime linker paths: ${HAVE_RPATH}])
548 LOC_MSG([ Support Microsoft Document Imaging: ${HAVE_MDI}])
550 LOC_MSG([ Support for internal codecs:])
551 LOC_MSG([ CCITT Group 3 & 4 algorithms: ${HAVE_CCITT}])
552 LOC_MSG([ Macintosh PackBits algorithm: ${HAVE_PACKBITS}])
553 LOC_MSG([ LZW algorithm: ${HAVE_LZW}])
554 LOC_MSG([ ThunderScan 4-bit RLE algorithm: ${HAVE_THUNDER}])
555 LOC_MSG([ NeXT 2-bit RLE algorithm: ${HAVE_NEXT}])
556 LOC_MSG([ LogLuv high dynamic range encoding: ${HAVE_LOGLUV}])
558 LOC_MSG([ Support for external codecs:])
559 LOC_MSG([ ZLIB support: ${HAVE_ZLIB}])
560 LOC_MSG([ Pixar log-format algorithm: ${HAVE_PIXARLOG}])
561 LOC_MSG([ JPEG support: ${HAVE_JPEG}])
562 LOC_MSG([ Old JPEG support: ${HAVE_OJPEG}])
564 LOC_MSG([ C++ support: ${HAVE_CXX}])
566 LOC_MSG([ OpenGL support: ${HAVE_OPENGL}])