]> git.saurik.com Git - wxWidgets.git/blob - src/tiff/configure.ac
Fix compilation with MinGW -std=c++11 option.
[wxWidgets.git] / src / tiff / configure.ac
1 dnl -*- Autoconf -*-
2 dnl Tag Image File Format (TIFF) Software
3 dnl
4 dnl Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
5 dnl
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.
13 dnl
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.
17 dnl
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
23 dnl OF THIS SOFTWARE.
24
25 dnl Process this file with autoconf to produce a configure script.
26
27 AC_PREREQ(2.64)
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)
31 AC_LANG(C)
32
33 dnl Compute the canonical host (run-time) system type variable
34 AC_CANONICAL_HOST
35
36 AM_INIT_AUTOMAKE
37 dnl Do not rebuild generated files every time
38 AM_MAINTAINER_MODE
39
40 dnl Versioning.
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"`
49
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
53 dnl
54 dnl current
55 dnl The most recent interface number that this library implements.
56 dnl revision
57 dnl The implementation number of the current interface.
58 dnl age
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 -
62 dnl age to current.
63 dnl
64 dnl Here are a set of rules to help you update your library version
65 dnl information:
66 dnl
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
76 dnl increment age.
77 dnl 6. If any interfaces have been removed since the last public release,
78 dnl then set age to 0.
79 LIBTIFF_CURRENT=7
80 LIBTIFF_REVISION=0
81 LIBTIFF_AGE=2
82 LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
83
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.
88 #case "$host_os" in
89 # openbsd* | mirbsd*)
90 # LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION:0
91 # ;;
92 # *)
93 # LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION:$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION
94 # ;;
95 #esac
96
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)
104
105 dnl Checks for programs.
106 AC_PROG_CC
107 AM_PROG_CC_C_O
108
109 dnl We want warnings. As many warnings as possible.
110 VL_PROG_CC_WARNINGS()
111
112 AC_PROG_INSTALL
113 AC_PROG_LN_S
114
115
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
129 VERS_1 {
130 global: sym;
131 };
132
133 VERS_2 {
134 global: sym;
135 } VERS_1;
136 EOF
137 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
138 [have_ld_version_script=yes], [have_ld_version_script=no])
139 rm -f conftest.map
140 LDFLAGS="$save_LDFLAGS"
141 AC_MSG_RESULT($have_ld_version_script)
142 fi
143 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
144
145
146 dnl Tests for Windows
147 AC_EXEEXT
148 AC_OBJEXT
149
150 dnl initialize libtool
151 LT_INIT([win32-dll])
152 LT_LANG([C++])
153
154 # Enable support for silent build rules
155 AM_SILENT_RULES
156
157 dnl We don't need to add math library to all targets
158 case "${host_os}" in
159 cygwin* | mingw32* | beos* | darwin*)
160 ;;
161 *)
162 AC_CHECK_LIB(m,sin,,,)
163 ;;
164 esac
165
166 tiff_libs_private=
167 AC_SUBST(tiff_libs_private)
168
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])
171
172 dnl Checks for typedefs, structures, and compiler characteristics.
173 AC_C_CONST
174 AC_C_INLINE
175 AC_C_BIGENDIAN
176 AC_TYPE_OFF_T
177 AC_TYPE_SIZE_T
178 AC_HEADER_TIME
179 AC_STRUCT_TM
180
181 dnl ---------------------------------------------------------------------------
182 dnl Compute sized types for current CPU and compiler options
183 dnl ---------------------------------------------------------------------------
184
185 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
186 AC_CHECK_SIZEOF(signed short)
187
188 # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
189 AC_CHECK_SIZEOF(unsigned short)
190
191 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
192 AC_CHECK_SIZEOF(signed int)
193
194 # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
195 AC_CHECK_SIZEOF(unsigned int)
196
197 # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
198 AC_CHECK_SIZEOF(signed long)
199
200 # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
201 AC_CHECK_SIZEOF(unsigned long)
202
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)
206
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)
211
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 *)
216
217 AC_MSG_CHECKING(for signed 8-bit type)
218 INT8_T='signed char'
219 AC_MSG_RESULT($INT8_T)
220 AC_DEFINE_UNQUOTED(TIFF_INT8_T,$INT8_T,[Signed 8-bit type])
221
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])
226
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])
231
232
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])
237
238 AC_MSG_CHECKING(for signed 32-bit type)
239 INT32_T='none'
240 INT32_FORMAT='none'
241 if test $ac_cv_sizeof_signed_int -eq 4
242 then
243 INT32_T='signed int'
244 INT32_FORMAT='"%d"'
245 elif test $ac_cv_sizeof_signed_long -eq 4
246 then
247 INT32_T='signed long'
248 INT32_FORMAT='"%ld"'
249 fi
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])
253
254 AC_MSG_CHECKING(for unsigned 32-bit type)
255 UINT32_T='none'
256 UINT32_FORMAT='none'
257 if test $ac_cv_sizeof_unsigned_int -eq 4
258 then
259 UINT32_T='unsigned int'
260 UINT32_FORMAT='"%u"'
261 elif test $ac_cv_sizeof_unsigned_long -eq 4
262 then
263 UINT32_T='unsigned long'
264 UINT32_FORMAT='"%lu"'
265 fi
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])
269
270 AC_MSG_CHECKING(for signed 64-bit type)
271 INT64_T='none'
272 INT64_FORMAT='none'
273 if test $ac_cv_sizeof_signed_long -eq 8
274 then
275 INT64_T='signed long'
276 INT64_FORMAT='"%ld"'
277 elif test $ac_cv_sizeof_signed_long_long -eq 8
278 then
279 INT64_T='signed long long'
280 case "${host_os}" in
281 mingw32*)
282 # MinGW32 understands 'long long', but uses printf from WIN32 CRT
283 INT64_FORMAT='"%I64d"'
284 ;;
285 *)
286 INT64_FORMAT='"%lld"'
287 ;;
288 esac
289 fi
290
291
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])
295
296 AC_MSG_CHECKING(for unsigned 64-bit type)
297 UINT64_T='none'
298 UINT64_FORMAT='none'
299 if test $ac_cv_sizeof_unsigned_long -eq 8
300 then
301 UINT64_T='unsigned long'
302 UINT64_FORMAT='"%lu"'
303 elif test $ac_cv_sizeof_unsigned_long_long -eq 8
304 then
305 UINT64_T='unsigned long long'
306 case "${host_os}" in
307 mingw32*)
308 # MinGW32 understands 'unsigned long long', but uses printf from WIN32 CRT
309 UINT64_FORMAT='"%I64u"'
310 ;;
311 *)
312 UINT64_FORMAT='"%llu"'
313 ;;
314 esac
315 fi
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])
319
320 # Determine TIFF equivalent of ssize_t
321 AC_MSG_CHECKING(for signed size type)
322 SSIZE_T='unknown'
323 SSIZE_FORMAT='unknown'
324 if test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_unsigned_char_p
325 then
326 SSIZE_T='signed long'
327 SSIZE_FORMAT='"%ld"'
328 elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_unsigned_char_p
329 then
330 SSIZE_T='signed long long'
331 SSIZE_FORMAT='"%lld"'
332 fi
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])
336
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.
340 PTRDIFF_T='unknown'
341 PTRDIFF_FORMAT='"%ld"'
342 AC_CHECK_TYPE(ptrdiff_t,[PTRDIFF_T=ptrdiff_t])
343 if test $PTRDIFF_T = unknown
344 then
345 PTRDIFF_T=$SSIZE_T
346 PTRDIFF_FORMAT=$SSIZE_FORMAT
347 fi
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])
352
353 dnl Some compilers (IBM VisualAge) has these types defined, so check it here:
354 AC_CHECK_TYPES([int8, int16, int32],,,
355 [
356 #if HAVE_INTTYPES_H
357 # include <inttypes.h>
358 #endif
359 ])
360
361 dnl Checks for library functions.
362 AC_CHECK_FUNCS([floor isascii memmove memset mmap pow setmode sqrt strchr strrchr strstr strtol strtoull])
363
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)
370
371 dnl ---------------------------------------------------------------------------
372 dnl Check the native cpu bit order.
373 dnl ---------------------------------------------------------------------------
374 AC_MSG_CHECKING([native cpu bit order])
375 case "$host_cpu" in
376 i*86*|x86_64*)
377 HOST_FILLORDER=FILLORDER_LSB2MSB
378 AC_MSG_RESULT([lsb2msb])
379 ;;
380 *)
381 HOST_FILLORDER=FILLORDER_MSB2LSB
382 AC_MSG_RESULT([msb2lsb])
383 ;;
384 esac
385 AC_DEFINE_UNQUOTED(HOST_FILLORDER, $HOST_FILLORDER, [Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB)])
386
387 dnl ---------------------------------------------------------------------------
388 dnl Configure legacy tifconf.h HOST_BIGENDIAN.
389 dnl ---------------------------------------------------------------------------
390 if test "$ac_cv_c_bigendian" = yes ; then
391 HOST_BIGENDIAN=1
392 else
393 HOST_BIGENDIAN=0
394 fi
395 AC_DEFINE_UNQUOTED(HOST_BIGENDIAN,$HOST_BIGENDIAN,[Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian (Intel)])
396
397 dnl ---------------------------------------------------------------------------
398 dnl Make the POSIX.2 features available.
399 dnl ---------------------------------------------------------------------------
400 #_POSIX_C_SOURCE=2
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.])
402
403 dnl ---------------------------------------------------------------------------
404 dnl Set the floating point format.
405 dnl FIXME: write appropriate test.
406 dnl ---------------------------------------------------------------------------
407 HAVE_IEEEFP=1
408 AC_DEFINE_UNQUOTED(HAVE_IEEEFP, $HAVE_IEEEFP, [Define as 0 or 1 according to the floating point format suported by the machine])
409
410 dnl ---------------------------------------------------------------------------
411 dnl Enable run-time paths to libraries usage.
412 dnl ---------------------------------------------------------------------------
413
414 AC_ARG_ENABLE(rpath,
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")
419
420 dnl ---------------------------------------------------------------------------
421 dnl Support large files.
422 dnl ---------------------------------------------------------------------------
423
424 AC_SYS_LARGEFILE
425
426 dnl ---------------------------------------------------------------------------
427 dnl Point to path where we should install documentation.
428 dnl ---------------------------------------------------------------------------
429
430 LIBTIFF_DOCDIR=\${prefix}/share/doc/${PACKAGE}-${LIBTIFF_VERSION}
431
432 AC_ARG_WITH(docdir,
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
437 fi
438
439 AC_SUBST(LIBTIFF_DOCDIR)
440
441 dnl ---------------------------------------------------------------------------
442 dnl Switch on/off internal codecs.
443 dnl ---------------------------------------------------------------------------
444
445 AC_ARG_ENABLE(ccitt,
446 AS_HELP_STRING([--disable-ccitt],
447 [disable support for CCITT Group 3 & 4 algorithms]),
448 [HAVE_CCITT=$enableval], [HAVE_CCITT=yes])
449
450 if test "$HAVE_CCITT" = "yes" ; then
451 AC_DEFINE(CCITT_SUPPORT,1,[Support CCITT Group 3 & 4 algorithms])
452 fi
453
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])
458
459 if test "$HAVE_PACKBITS" = "yes" ; then
460 AC_DEFINE(PACKBITS_SUPPORT,1,[Support Macintosh PackBits algorithm])
461 fi
462
463 AC_ARG_ENABLE(lzw,
464 AS_HELP_STRING([--disable-lzw],
465 [disable support for LZW algorithm]),
466 [HAVE_LZW=$enableval], [HAVE_LZW=yes])
467
468 if test "$HAVE_LZW" = "yes" ; then
469 AC_DEFINE(LZW_SUPPORT,1,[Support LZW algorithm])
470 fi
471
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])
476
477 if test "$HAVE_THUNDER" = "yes" ; then
478 AC_DEFINE(THUNDER_SUPPORT,1,[Support ThunderScan 4-bit RLE algorithm])
479 fi
480
481 HAVE_NEXT=yes
482
483 AC_ARG_ENABLE(next,
484 AS_HELP_STRING([--disable-next],
485 [disable support for NeXT 2-bit RLE algorithm]),
486 [HAVE_NEXT=$enableval], [HAVE_NEXT=yes])
487
488 if test "$HAVE_NEXT" = "yes" ; then
489 AC_DEFINE(NEXT_SUPPORT,1,[Support NeXT 2-bit RLE algorithm])
490 fi
491
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])
496
497 if test "$HAVE_LOGLUV" = "yes" ; then
498 AC_DEFINE(LOGLUV_SUPPORT,1,[Support LogLuv high dynamic range encoding])
499 fi
500
501 dnl ---------------------------------------------------------------------------
502 dnl Switch on/off support for Microsoft Document Imaging
503 dnl ---------------------------------------------------------------------------
504
505 AC_ARG_ENABLE(mdi,
506 AS_HELP_STRING([--disable-mdi],
507 [disable support for Microsoft Document Imaging]),
508 [HAVE_MDI=$enableval], [HAVE_MDI=yes])
509
510 if test "$HAVE_MDI" = "yes" ; then
511 AC_DEFINE(MDI_SUPPORT,1,[Support Microsoft Document Imaging format])
512 fi
513
514 dnl ---------------------------------------------------------------------------
515 dnl Check for ZLIB.
516 dnl ---------------------------------------------------------------------------
517
518 HAVE_ZLIB=no
519
520 AC_ARG_ENABLE(zlib,
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]),,)
529
530 if test "x$enable_zlib" != "xno" ; then
531
532 if test "x$with_zlib_lib_dir" != "x" ; then
533 LDFLAGS="-L$with_zlib_lib_dir $LDFLAGS"
534 fi
535
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])
539 fi
540
541 if test "x$with_zlib_include_dir" != "x" ; then
542 CPPFLAGS="-I$with_zlib_include_dir $CPPFLAGS"
543 fi
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])
547 fi
548
549 if test "$zlib_lib" = "yes" -a "$zlib_h" = "yes" ; then
550 HAVE_ZLIB=yes
551 fi
552
553 fi
554
555 if test "$HAVE_ZLIB" = "yes" ; then
556 AC_DEFINE(ZIP_SUPPORT,1,[Support Deflate compression])
557 LIBS="-lz $LIBS"
558 tiff_libs_private="-lz ${tiff_libs_private}"
559
560 if test "$HAVE_RPATH" = "yes" -a "x$with_zlib_lib_dir" != "x" ; then
561 LIBDIR="-R $with_zlib_lib_dir $LIBDIR"
562 fi
563
564 fi
565
566 dnl ---------------------------------------------------------------------------
567 dnl Check for Pixar log-format algorithm.
568 dnl ---------------------------------------------------------------------------
569
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])
574
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)])
578 else
579 HAVE_PIXARLOG=no
580 fi
581
582 dnl ---------------------------------------------------------------------------
583 dnl Check for JPEG.
584 dnl ---------------------------------------------------------------------------
585
586 HAVE_JPEG=no
587
588 AC_ARG_ENABLE(jpeg,
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]),,)
597
598 if test "x$enable_jpeg" != "xno" ; then
599
600 if test "x$with_jpeg_lib_dir" != "x" ; then
601 LDFLAGS="-L$with_jpeg_lib_dir $LDFLAGS"
602
603 fi
604
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])
608 fi
609
610 if test "x$with_jpeg_include_dir" != "x" ; then
611 CPPFLAGS="-I$with_jpeg_include_dir $CPPFLAGS"
612 fi
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])
616 fi
617
618 if test "$jpeg_lib" = "yes" -a "$jpeg_h" = "yes" ; then
619 HAVE_JPEG=yes
620 fi
621
622 fi
623
624 if test "$HAVE_JPEG" = "yes" ; then
625 AC_DEFINE(JPEG_SUPPORT,1,[Support JPEG compression (requires IJG JPEG library)])
626 LIBS="-ljpeg $LIBS"
627 tiff_libs_private="-ljpeg ${tiff_libs_private}"
628
629 if test "$HAVE_RPATH" = "yes" -a "x$with_jpeg_lib_dir" != "x" ; then
630 LIBDIR="-R $with_jpeg_lib_dir $LIBDIR"
631 fi
632
633 fi
634
635 dnl ---------------------------------------------------------------------------
636 dnl Check for Old JPEG.
637 dnl ---------------------------------------------------------------------------
638
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])
643
644 if test "$HAVE_JPEG" = "yes" -a "$HAVE_OJPEG" = "yes" ; then
645 AC_DEFINE(OJPEG_SUPPORT, 1,
646 [Support Old JPEG compresson (read-only)])
647 else
648 HAVE_OJPEG=no
649 fi
650
651 dnl ---------------------------------------------------------------------------
652 dnl Check for JBIG-KIT.
653 dnl ---------------------------------------------------------------------------
654
655 HAVE_JBIG=no
656
657 AC_ARG_ENABLE(jbig,
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]),,)
666
667 if test "x$enable_jbig" != "xno" ; then
668
669 if test "x$with_jbig_lib_dir" != "x" ; then
670 LDFLAGS="-L$with_jbig_lib_dir $LDFLAGS"
671
672 fi
673
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])
677 fi
678
679 if test "x$with_jbig_include_dir" != "x" ; then
680 CPPFLAGS="-I$with_jbig_include_dir $CPPFLAGS"
681 fi
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])
685 fi
686
687 if test "$jbig_lib" = "yes" -a "$jbig_h" = "yes" ; then
688 HAVE_JBIG=yes
689 fi
690
691 fi
692
693 if test "$HAVE_JBIG" = "yes" ; then
694 AC_DEFINE(JBIG_SUPPORT,1,[Support ISO JBIG compression (requires JBIG-KIT library)])
695 LIBS="-ljbig $LIBS"
696 tiff_libs_private="-ljbig ${tiff_libs_private}"
697
698 if test "$HAVE_RPATH" = "yes" -a "x$with_jbig_lib_dir" != "x" ; then
699 LIBDIR="-R $with_jbig_lib_dir $LIBDIR"
700 fi
701
702 # Older versions of jbigkit lack jbg_newlen
703 AC_CHECK_FUNCS([jbg_newlen])
704
705 fi
706
707 dnl ---------------------------------------------------------------------------
708 dnl Check for liblzma2.
709 dnl ---------------------------------------------------------------------------
710
711 HAVE_LZMA=no
712
713 AC_ARG_ENABLE(lzma,
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]),,)
722
723 if test "x$enable_lzma" != "xno" ; then
724
725 if test "x$with_lzma_lib_dir" != "x" ; then
726 LDFLAGS="-L$with_lzma_lib_dir $LDFLAGS"
727 fi
728
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])
732 fi
733
734 if test "x$with_lzma_include_dir" != "x" ; then
735 CPPFLAGS="-I$with_lzma_include_dir $CPPFLAGS"
736 fi
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])
740 fi
741
742 if test "$lzma_lib" = "yes" -a "$lzma_h" = "yes" ; then
743 HAVE_LZMA=yes
744 fi
745
746 fi
747
748 if test "$HAVE_LZMA" = "yes" ; then
749 AC_DEFINE(LZMA_SUPPORT,1,[Support LZMA2 compression])
750 LIBS="-llzma $LIBS"
751 tiff_libs_private="-llzma ${tiff_libs_private}"
752
753 if test "$HAVE_RPATH" = "yes" -a "x$with_lzma_lib_dir" != "x" ; then
754 LIBDIR="-R $with_lzma_lib_dir $LIBDIR"
755 fi
756
757 fi
758
759 dnl ---------------------------------------------------------------------------
760 dnl Should 8/12 bit jpeg mode be enabled?
761 dnl ---------------------------------------------------------------------------
762
763 HAVE_JPEG12=no
764
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]),,)
774
775 if test "x$enable_jpeg12" == "xyes" ; then
776
777 if test "x$with_jpeg12_lib" != "x" ; then
778 LIBS="$with_jpeg12_lib $LIBS"
779 fi
780
781 HAVE_JPEG12=yes
782
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])
786 fi
787 fi
788
789
790 dnl ---------------------------------------------------------------------------
791 dnl Check for C++.
792 dnl ---------------------------------------------------------------------------
793
794 AC_ARG_ENABLE(cxx,
795 AS_HELP_STRING([--enable-cxx],
796 [enable C++ stream API building (requires C++ compiler)]),
797 [HAVE_CXX=$enableval], [HAVE_CXX=yes])
798
799 if test "$HAVE_CXX" = "yes" ; then
800 AC_DEFINE(CXX_SUPPORT, 1, [Support C++ stream API (requires C++ compiler)])
801 else
802 HAVE_CXX=no
803 fi
804
805 AM_CONDITIONAL(HAVE_CXX, test "$HAVE_CXX" = "yes")
806
807 dnl ---------------------------------------------------------------------------
808 dnl Check for OpenGL and GLUT.
809 dnl ---------------------------------------------------------------------------
810
811 HAVE_OPENGL=no
812
813
814 AC_PATH_XTRA
815
816 dnl AX_CHECK_GL sets GL_CFLAGS & GL_LIBS. Also PTHREAD_LIBS,
817 dnl PTHREAD_CFLAGS, & PTHREAD_CC as a side-effect
818 AX_CHECK_GL
819
820 dnl AX_CHECK_GLU sets GLU_CFLAGS & GLU_LIBS
821 AX_CHECK_GLU
822
823 dnl AX_CHECK_GLUT sets GLUT_CFLAGS & GLUT_LIBS
824 AX_CHECK_GLUT
825
826 if test "$no_x" != "yes" -a "$no_gl" != "yes" \
827 -a "$no_glu" != "yes" -a "$no_glut" != "yes" ; then
828 HAVE_OPENGL=yes
829 fi
830
831 AM_CONDITIONAL(HAVE_OPENGL, test "$HAVE_OPENGL" = "yes")
832
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
836 dnl test it
837 dnl ---------------------------------------------------------------------------
838
839 win32_io_ok=no
840 case "${host_os}" in
841 cygwin*)
842 ;;
843 *)
844 if test x"$ac_cv_header_windows_h" = xyes; then
845 win32_io_ok=yes
846 AC_DEFINE(USE_WIN32_FILEIO,1,[define to use win32 IO system])
847 fi
848 ;;
849 esac
850 AM_CONDITIONAL([WIN32_IO], [test "$win32_io_ok" = yes])
851
852 dnl ---------------------------------------------------------------------------
853 dnl Check for X Athena Widgets
854 dnl ---------------------------------------------------------------------------
855
856 dnl HAVE_XAW=no
857
858 dnl ICE_FIND_ATHENA
859
860 dnl if test "$no_xaw" != "yes" ; then
861 dnl HAVE_XAW=yes
862 dnl fi
863
864 dnl AM_CONDITIONAL(HAVE_XAW, test "$HAVE_XAW" = "yes")
865
866 dnl ===========================================================================
867 dnl ``Orthogonal Features''
868 dnl ===========================================================================
869
870 dnl ---------------------------------------------------------------------------
871 dnl Default handling of strip chopping support.
872 dnl ---------------------------------------------------------------------------
873
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]]]),,)
881
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)])
885
886 if test "x$with_default_strip_size" = "x" \
887 -o "x$with_default_strip_size" = "xyes"; then
888 with_default_strip_size="8192"
889 fi
890
891 AC_DEFINE_UNQUOTED(STRIP_SIZE_DEFAULT,$with_default_strip_size,[Default size of the strip in bytes (when strip chopping enabled)])
892
893 fi
894
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
898 dnl libtiff 4.0.
899 dnl ---------------------------------------------------------------------------
900
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])
905
906 if test "$HAVE_DEFER_STRILE_LOAD" = "yes" ; then
907 AC_DEFINE(DEFER_STRILE_LOAD,1,[enable deferred strip/tile offset/size loading (experimental)])
908
909 fi
910
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 ---------------------------------------------------------------------------
916
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])
921
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)])
924
925 fi
926
927 dnl ---------------------------------------------------------------------------
928 dnl Default subifd support.
929 dnl ---------------------------------------------------------------------------
930 AC_DEFINE(SUBIFD_SUPPORT,1,[Enable SubIFD tag (330) support])
931
932 dnl ---------------------------------------------------------------------------
933 dnl Default handling of ASSOCALPHA support.
934 dnl ---------------------------------------------------------------------------
935
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])
941
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.])
945 fi
946
947 dnl ---------------------------------------------------------------------------
948 dnl Default handling of YCbCr subsampling support.
949 dnl See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() for details.
950 dnl ---------------------------------------------------------------------------
951
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])
957
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).])
961 fi
962
963 dnl ---------------------------------------------------------------------------
964
965 AC_SUBST(LIBDIR)
966
967 AC_CONFIG_HEADERS([libtiff/tif_config.h libtiff/tiffconf.h])
968
969 AC_CONFIG_FILES([Makefile \
970 build/Makefile \
971 contrib/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 \
982 html/Makefile \
983 html/images/Makefile \
984 html/man/Makefile \
985 libtiff-4.pc \
986 libtiff/Makefile \
987 man/Makefile \
988 port/Makefile \
989 test/Makefile \
990 tools/Makefile])
991 AC_OUTPUT
992
993 dnl ---------------------------------------------------------------------------
994 dnl Display configuration status
995 dnl ---------------------------------------------------------------------------
996
997 LOC_MSG()
998 LOC_MSG([Libtiff is now configured for ${host}])
999 LOC_MSG()
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}])
1008 LOC_MSG()
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}])
1016 LOC_MSG()
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}])
1025 LOC_MSG()
1026 LOC_MSG([ C++ support: ${HAVE_CXX}])
1027 LOC_MSG()
1028 dnl LOC_MSG([ X Athena Widgets support: ${HAVE_XAW}])
1029 LOC_MSG([ OpenGL support: ${HAVE_OPENGL}])
1030 LOC_MSG()
1031