Imported Upstream version 4.0.10 76/193276/1 upstream/4.0.10
authorjiyong.min <jiyong.min@samsung.com>
Mon, 19 Nov 2018 00:03:54 +0000 (09:03 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Mon, 19 Nov 2018 00:05:08 +0000 (09:05 +0900)
Change-Id: Ib05f6ee8549306f2ff30e21d2deba45af2dfd9f7

262 files changed:
CMakeLists.txt
ChangeLog
HOWTO-RELEASE
Makefile.am
Makefile.in
Makefile.vc
README.md [moved from README with 88% similarity]
README.vms [deleted file]
RELEASE-DATE
SConstruct
TODO
VERSION
aclocal.m4
build/Makefile.in
config/compile
config/config.guess
config/config.sub
config/depcomp
config/install-sh
config/ltmain.sh [changed mode: 0755->0644]
config/missing
config/mkinstalldirs [deleted file]
config/test-driver
configure
configure.ac
configure.com
contrib/Makefile.in
contrib/addtiffo/Makefile.in
contrib/addtiffo/addtiffo.c
contrib/addtiffo/tif_overview.c
contrib/addtiffo/tif_ovrcache.c
contrib/dbs/Makefile.in
contrib/dbs/tiff-bi.c
contrib/dbs/tiff-grayscale.c
contrib/dbs/tiff-palette.c
contrib/dbs/tiff-rgb.c
contrib/dbs/xtiff/Makefile.in
contrib/dbs/xtiff/xtiff.c
contrib/iptcutil/Makefile.in
contrib/iptcutil/iptcutil.c
contrib/mfs/Makefile.in
contrib/pds/Makefile.in
contrib/pds/README
contrib/pds/tif_imageiter.c
contrib/pds/tif_imageiter.h
contrib/pds/tif_pdsdirread.c
contrib/pds/tif_pdsdirwrite.c
contrib/ras/Makefile.in
contrib/ras/tif2ras.c
contrib/stream/Makefile.in
contrib/tags/Makefile.in
contrib/tags/README
contrib/tags/xtif_dir.c
contrib/win_dib/Makefile.in
contrib/win_dib/Makefile.w95
contrib/win_dib/README.tiff2dib
contrib/win_dib/Tiffile.cpp
html/Makefile.am
html/Makefile.in
html/addingtags.html
html/bugs.html
html/build.html
html/images/Makefile.in
html/index.html
html/libtiff.html
html/man/Makefile.in
html/man/TIFFReadDirectory.3tiff.html
html/man/TIFFWriteDirectory.3tiff.html
html/man/TIFFmemory.3tiff.html
html/v3.5.3.html
html/v3.5.7.html
html/v3.6.0.html
html/v3.6.1.html
html/v3.7.2.html
html/v3.7.3.html
html/v4.0.10.html [new file with mode: 0644]
libtiff/CMakeLists.txt
libtiff/Makefile.am
libtiff/Makefile.in
libtiff/Makefile.vc
libtiff/SConstruct
libtiff/mkg3states.c
libtiff/t4.h
libtiff/tif_aux.c
libtiff/tif_close.c
libtiff/tif_codec.c
libtiff/tif_color.c
libtiff/tif_compress.c
libtiff/tif_config.h.cmake.in
libtiff/tif_config.h.in
libtiff/tif_config.wince.h
libtiff/tif_dir.c
libtiff/tif_dir.h
libtiff/tif_dirinfo.c
libtiff/tif_dirread.c
libtiff/tif_dirwrite.c
libtiff/tif_dumpmode.c
libtiff/tif_error.c
libtiff/tif_extension.c
libtiff/tif_fax3.c
libtiff/tif_fax3.h
libtiff/tif_flush.c
libtiff/tif_getimage.c
libtiff/tif_jbig.c
libtiff/tif_jpeg.c
libtiff/tif_luv.c
libtiff/tif_lzma.c
libtiff/tif_lzw.c
libtiff/tif_next.c
libtiff/tif_ojpeg.c
libtiff/tif_open.c
libtiff/tif_packbits.c
libtiff/tif_pixarlog.c
libtiff/tif_predict.c
libtiff/tif_predict.h
libtiff/tif_print.c
libtiff/tif_read.c
libtiff/tif_stream.cxx
libtiff/tif_strip.c
libtiff/tif_swab.c
libtiff/tif_thunder.c
libtiff/tif_tile.c
libtiff/tif_unix.c
libtiff/tif_version.c
libtiff/tif_warning.c
libtiff/tif_webp.c [new file with mode: 0644]
libtiff/tif_win32.c
libtiff/tif_write.c
libtiff/tif_zip.c
libtiff/tif_zstd.c [new file with mode: 0644]
libtiff/tiff.h
libtiff/tiffconf.h.cmake.in
libtiff/tiffconf.h.in
libtiff/tiffconf.vc.h
libtiff/tiffconf.wince.h
libtiff/tiffio.h
libtiff/tiffio.hxx
libtiff/tiffiop.h
libtiff/tiffvers.h
m4/libtool.m4
man/Makefile.in
man/TIFFClose.3tiff
man/TIFFDataWidth.3tiff
man/TIFFError.3tiff
man/TIFFFieldDataType.3tiff
man/TIFFFieldName.3tiff
man/TIFFFieldPassCount.3tiff
man/TIFFFieldReadCount.3tiff
man/TIFFFieldTag.3tiff
man/TIFFFieldWriteCount.3tiff
man/TIFFFlush.3tiff
man/TIFFGetField.3tiff
man/TIFFOpen.3tiff
man/TIFFPrintDirectory.3tiff
man/TIFFRGBAImage.3tiff
man/TIFFReadDirectory.3tiff
man/TIFFReadEncodedStrip.3tiff
man/TIFFReadEncodedTile.3tiff
man/TIFFReadRGBAImage.3tiff
man/TIFFReadRGBAStrip.3tiff
man/TIFFReadRGBATile.3tiff
man/TIFFReadRawStrip.3tiff
man/TIFFReadRawTile.3tiff
man/TIFFReadScanline.3tiff
man/TIFFReadTile.3tiff
man/TIFFSetDirectory.3tiff
man/TIFFSetField.3tiff
man/TIFFWarning.3tiff
man/TIFFWriteDirectory.3tiff
man/TIFFWriteEncodedStrip.3tiff
man/TIFFWriteEncodedTile.3tiff
man/TIFFWriteRawStrip.3tiff
man/TIFFWriteRawTile.3tiff
man/TIFFWriteScanline.3tiff
man/TIFFWriteTile.3tiff
man/TIFFbuffer.3tiff
man/TIFFcodec.3tiff
man/TIFFcolor.3tiff
man/TIFFmemory.3tiff
man/TIFFquery.3tiff
man/TIFFsize.3tiff
man/TIFFstrip.3tiff
man/TIFFswab.3tiff
man/TIFFtile.3tiff
man/fax2ps.1
man/fax2tiff.1
man/libtiff.3tiff
man/pal2rgb.1
man/ppm2tiff.1
man/raw2tiff.1
man/tiff2bw.1
man/tiff2pdf.1
man/tiff2ps.1
man/tiff2rgba.1
man/tiffcmp.1
man/tiffcp.1
man/tiffcrop.1
man/tiffdither.1
man/tiffdump.1
man/tiffgt.1
man/tiffinfo.1
man/tiffmedian.1
man/tiffset.1
man/tiffsplit.1
nmake.opt
port/CMakeLists.txt
port/Makefile.am
port/Makefile.in
port/Makefile.vc
port/_strtol.h [new file with mode: 0644]
port/_strtoul.h [new file with mode: 0644]
port/dummy.c
port/getopt.c
port/lfind.c
port/libport.h
port/strcasecmp.c
port/strtol.c [new file with mode: 0644]
port/strtoll.c [new file with mode: 0644]
port/strtoul.c
port/strtoull.c
test/CMakeLists.txt
test/Makefile.am
test/Makefile.in
test/ascii_tag.c
test/check_tag.c
test/common.sh
test/custom_dir.c
test/images/lzw-single-strip.tiff [new file with mode: 0644]
test/long_tag.c
test/raw_decode.c
test/rewrite_tag.c
test/short_tag.c
test/strip.c
test/strip_rw.c
test/test_arrays.c
test/test_arrays.h
test/tiffcp-lzw-scanline-decode.sh [new file with mode: 0755]
test/tifftest.h
tools/CMakeLists.txt
tools/Makefile.in
tools/Makefile.vc
tools/fax2ps.c
tools/fax2tiff.c
tools/pal2rgb.c
tools/ppm2tiff.c
tools/raw2tiff.c
tools/rgb2ycbcr.c
tools/thumbnail.c
tools/tiff2bw.c
tools/tiff2pdf.c
tools/tiff2ps.c
tools/tiff2rgba.c
tools/tiffcmp.c
tools/tiffcp.c
tools/tiffcrop.c
tools/tiffdither.c
tools/tiffdump.c
tools/tiffgt.c
tools/tiffinfo.c
tools/tiffmedian.c
tools/tiffset.c
tools/tiffsplit.c

index 52b5ae9..845ddf0 100644 (file)
@@ -23,7 +23,7 @@
 # LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
 # OF THIS SOFTWARE.
 
-cmake_minimum_required(VERSION 2.8.9)
+cmake_minimum_required(VERSION 2.8.11) # b/c of use of BUILD_INTERFACE generator expression
 
 # Default policy is from 2.8.9
 cmake_policy(VERSION 2.8.9)
@@ -92,8 +92,9 @@ include(GNUInstallDirs)
 include(CheckCCompilerFlag)
 include(CheckCSourceCompiles)
 include(CheckIncludeFile)
+include(CheckLibraryExists)
 include(CheckTypeSize)
-include(CheckFunctionExists)
+include(CheckSymbolExists)
 enable_testing()
 
 macro(current_date var)
@@ -213,9 +214,6 @@ check_include_file(dlfcn.h     HAVE_DLFCN_H)
 check_include_file(fcntl.h     HAVE_FCNTL_H)
 check_include_file(inttypes.h  HAVE_INTTYPES_H)
 check_include_file(io.h        HAVE_IO_H)
-check_include_file(limits.h    HAVE_LIMITS_H)
-check_include_file(malloc.h    HAVE_MALLOC_H)
-check_include_file(memory.h    HAVE_MEMORY_H)
 check_include_file(search.h    HAVE_SEARCH_H)
 check_include_file(stdint.h    HAVE_STDINT_H)
 check_include_file(string.h    HAVE_STRING_H)
@@ -271,8 +269,6 @@ int main(void){
 
 # Check type sizes
 # NOTE: Could be replaced with C99 <stdint.h>
-check_type_size("signed short" SIZEOF_SIGNED_SHORT)
-check_type_size("unsigned short" SIZEOF_UNSIGNED_SHORT)
 check_type_size("signed int" SIZEOF_SIGNED_INT)
 check_type_size("unsigned int" SIZEOF_UNSIGNED_INT)
 check_type_size("signed long" SIZEOF_SIGNED_LONG)
@@ -388,80 +384,35 @@ endif()
 #              TIFF_SSIZE_T TIFF_SSIZE_FORMAT
 #              TIFF_PTRDIFF_T TIFF_PTRDIFF_FORMAT)
 
-# Nonstandard int types
-check_type_size(INT8 int8)
-set(HAVE_INT8 ${INT8})
-check_type_size(INT16 int16)
-set(HAVE_INT16 ${INT16})
-check_type_size(INT32 int32)
-set(HAVE_INT32 ${INT32})
-
-# Check functions
-set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
-set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${M_LIBRARY})
-check_function_exists(floor HAVE_FLOOR)
-check_function_exists(pow   HAVE_POW)
-check_function_exists(sqrt  HAVE_SQRT)
-set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
-
-check_function_exists(isascii    HAVE_ISASCII)
-check_function_exists(memmove    HAVE_MEMMOVE)
-check_function_exists(memset     HAVE_MEMSET)
-check_function_exists(mmap       HAVE_MMAP)
-check_function_exists(setmode    HAVE_SETMODE)
-check_function_exists(strcasecmp HAVE_STRCASECMP)
-check_function_exists(strchr     HAVE_STRCHR)
-check_function_exists(strrchr    HAVE_STRRCHR)
-check_function_exists(strstr     HAVE_STRSTR)
-check_function_exists(strtol     HAVE_STRTOL)
-check_function_exists(strtol     HAVE_STRTOUL)
-check_function_exists(strtoull   HAVE_STRTOULL)
-check_function_exists(getopt     HAVE_GETOPT)
-check_function_exists(lfind      HAVE_LFIND)
-
-# May be inlined, so check it compiles:
-check_c_source_compiles("
-#include <stdio.h>
-int main(void) {
-  char buf[10];
-  snprintf(buf, 10, \"Test %d\", 1);
-  return 0;
-}"
-  HAVE_SNPRINTF)
+check_symbol_exists(mmap "sys/mman.h" HAVE_MMAP)
+check_symbol_exists(setmode "unistd.h" HAVE_SETMODE)
+check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
+check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)
+check_symbol_exists(strtol "stdlib.h" HAVE_STRTOL)
+check_symbol_exists(strtoll "stdlib.h" HAVE_STRTOLL)
+check_symbol_exists(strtoul "stdlib.h" HAVE_STRTOUL)
+check_symbol_exists(strtoull "stdlib.h" HAVE_STRTOULL)
+check_symbol_exists(getopt "unistd.h" HAVE_GETOPT)
+check_symbol_exists(lfind "search.h" HAVE_LFIND)
 
 if(NOT HAVE_SNPRINTF)
   add_definitions(-DNEED_LIBPORT)
 endif()
 
 # CPU bit order
-set(fillorder FILLORDER_MSB2LSB)
+set(HOST_FILLORDER FILLORDER_MSB2LSB)
 if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i.*86.*" OR
    CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*" OR
    CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64.*")
-  set(fillorder FILLORDER_LSB2MSB)
+  set(HOST_FILLORDER FILLORDER_LSB2MSB)
 endif()
-set(HOST_FILLORDER ${fillorder} CACHE STRING "Native CPU bit order")
-mark_as_advanced(HOST_FILLORDER)
 
 # CPU endianness
 include(TestBigEndian)
-test_big_endian(bigendian)
-if (bigendian)
-  set(bigendian ON)
-else()
-  set(bigendian OFF)
-endif()
-set(HOST_BIG_ENDIAN ${bigendian} CACHE STRING "Native CPU bit order")
-mark_as_advanced(HOST_BIG_ENDIAN)
-if (HOST_BIG_ENDIAN)
-  set(HOST_BIG_ENDIAN 1)
-else()
-  set(HOST_BIG_ENDIAN 0)
-endif()
+test_big_endian(HOST_BIG_ENDIAN)
 
 # IEEE floating point
-set(HAVE_IEEEFP 1 CACHE STRING "IEEE floating point is available")
-mark_as_advanced(HAVE_IEEEFP)
+set(HAVE_IEEEFP 1)
 
 report_values(CMAKE_HOST_SYSTEM_PROCESSOR HOST_FILLORDER
               HOST_BIG_ENDIAN HAVE_IEEEFP)
@@ -560,12 +511,9 @@ else()
   set(JBIG_FOUND FALSE)
 endif()
 
-set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
 set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
 set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR})
-set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARY})
-check_function_exists(jbg_newlen HAVE_JBG_NEWLEN)
-set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
+check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN)
 set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
 
 # liblzma2
@@ -578,6 +526,42 @@ if(LIBLZMA_FOUND)
   set(LZMA_SUPPORT 1)
 endif()
 
+# libzstd
+option(zstd "use libzstd (required for ZSTD compression)" ON)
+if (zstd)
+    find_path(ZSTD_INCLUDE_DIR zstd.h)
+    find_library(ZSTD_LIBRARY NAMES zstd)
+    if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY)
+        check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH)
+        if (ZSTD_RECENT_ENOUGH)
+            set(ZSTD_FOUND TRUE)
+            set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})
+            message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}")
+        else ()
+            message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0")
+        endif ()
+    endif ()
+endif()
+set(ZSTD_SUPPORT 0)
+if(ZSTD_FOUND)
+  set(ZSTD_SUPPORT 1)
+endif()
+
+# libwebp
+option(webp "use libwebp (required for WEBP compression)" ON)
+if (webp)
+    find_path(WEBP_INCLUDE_DIR /webp/decode.h)
+    find_library(WEBP_LIBRARY NAMES webp)
+endif()
+set(WEBP_SUPPORT 0)
+set(WEBP_FOUND FALSE)
+if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY)
+  set(WEBP_SUPPORT 1)
+  set(WEBP_FOUND TRUE)
+  set(WEBP_LIBRARIES ${WEBP_LIBRARY})
+  message(STATUS "Found WEBP library: ${WEBP_LIBRARY}")
+endif()
+
 # 8/12-bit jpeg mode
 option(jpeg12 "enable libjpeg 8/12-bit dual mode (requires separate
 12-bit libjpeg build)" ON)
@@ -621,12 +605,8 @@ set(win32_io FALSE)
 if(WIN32)
   set(win32_io TRUE)
 endif()
-set(USE_WIN32_FILEIO ${win32_io} CACHE BOOL "Use win32 IO system (Microsoft Windows only)")
-if (USE_WIN32_FILEIO)
-  set(USE_WIN32_FILEIO TRUE)
-else()
-  set(USE_WIN32_FILEIO FALSE)
-endif()
+
+set(USE_WIN32_FILEIO ${win32_io})
 
 # Orthogonal features
 
@@ -692,6 +672,12 @@ endif()
 if(LIBLZMA_INCLUDE_DIRS)
   list(APPEND TIFF_INCLUDES ${LIBLZMA_INCLUDE_DIRS})
 endif()
+if(ZSTD_INCLUDE_DIR)
+  list(APPEND TIFF_INCLUDES ${ZSTD_INCLUDE_DIR})
+endif()
+if(WEBP_INCLUDE_DIR)
+  list(APPEND TIFF_INCLUDES ${WEBP_INCLUDE_DIR})
+endif()
 
 # Libraries required by libtiff
 set(TIFF_LIBRARY_DEPS)
@@ -713,6 +699,12 @@ endif()
 if(LIBLZMA_LIBRARIES)
   list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES})
 endif()
+if(ZSTD_LIBRARIES)
+  list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES})
+endif()
+if(WEBP_LIBRARIES)
+  list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES})
+endif()
 
 #report_values(TIFF_INCLUDES TIFF_LIBRARY_DEPS)
 
@@ -756,6 +748,8 @@ message(STATUS "  Old JPEG support:                   ${old-jpeg} (requested) ${
 message(STATUS "  JPEG 8/12 bit dual mode:            ${jpeg12} (requested) ${JPEG12_FOUND} (availability)")
 message(STATUS "  ISO JBIG support:                   ${jbig} (requested) ${JBIG_FOUND} (availability)")
 message(STATUS "  LZMA2 support:                      ${lzma} (requested) ${LIBLZMA_FOUND} (availability)")
+message(STATUS "  ZSTD support:                       ${zstd} (requested) ${ZSTD_FOUND} (availability)")
+message(STATUS "  WEBP support:                       ${webp} (requested) ${WEBP_FOUND} (availability)")
 message(STATUS "")
 message(STATUS "  C++ support:                        ${cxx} (requested) ${CXX_SUPPORT} (availability)")
 message(STATUS "")
index ea8622b..1f50e20 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,698 @@
+2018-11-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       * configure.ac: libtiff 4.0.10 released.
+
+       Change COMPRESSION_ZSTD to 50000 and COMPRESSION_WEBP to 50001.
+
+2018-11-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       Added preliminary release notes for release 4.0.10.
+
+2018-11-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       tiff2pdf: Eliminate compiler warning about snprintf output truncation when formatting pdf_datetime.
+
+2018-11-03  Olivier Paquet  <olivier.paquet@gmail.com>
+
+       Merge branch 'no_tif_platform_console' into 'master'
+       Remove builtin support for GUI warning and error message boxes
+
+       See merge request libtiff/libtiff!24
+
+2018-11-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       tiffcrop.c: Eliminate compiler warning about snprintf output truncation when formatting filenum.
+
+       TWebPVGetField(): Add apparently missing break statement impacting TIFFTAG_WEBP_LOSSLESS.
+
+       Eliminate compiler warnings about duplicate definitions of streq/strneq macros.
+
+       Ignore generated files.
+
+       Remove and ignore files which are a product of autogen.sh.
+
+2018-11-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       Fix TIFFErrorExt() formatting of size_t type for 32-bit compiles.
+
+2018-10-30  Even Rouault  <even.rouault@spatialys.com>
+
+       tiff2bw: avoid null pointer dereference in case of out of memory situation. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2819 / CVE-2018-18661
+
+       tiffio.h: fix comment.
+
+2018-10-26  Even Rouault  <even.rouault@spatialys.com>
+
+       Merge branch 'header2' into 'master'
+       Fix 725279bd: Standalone tif_predict.h: tiff.h should be tiffiop.h
+
+       See merge request libtiff/libtiff!41
+
+2018-10-26  Kurt Schwehr  <schwehr@google.com>
+
+       Fix 725279bd: Standalone tif_predict.h: tiff.h should be tiffiop.h.
+
+2018-10-25  Even Rouault  <even.rouault@spatialys.com>
+
+       Merge branch 'headers' into 'master'
+       Add includes to headers to allow them to stand alone.
+
+       See merge request libtiff/libtiff!40
+
+2018-10-24  Kurt Schwehr  <schwehr@google.com>
+
+       Add includes to headers to allow them to stand alone.
+       This allows compilers that can do header stand alone header parsing
+       to process libtiff.
+
+2018-10-18  Even Rouault  <even.rouault@spatialys.com>
+
+       LZMAPreEncode: emit verbose error if lzma_stream_encoder() fails (typically because not enough memory available)
+
+2018-10-17  Even Rouault  <even.rouault@spatialys.com>
+
+       tif_webp.c: fix previous commit that broke scanline decoding.
+
+       tif_webp.c: fix potential read outside libwebp buffer on corrupted images
+
+2018-10-14  Even Rouault  <even.rouault@spatialys.com>
+
+       Merge branch 'jbig_decode_overflow' into 'master'
+       JBIG: fix potential out-of-bounds write in JBIGDecode()
+
+       See merge request libtiff/libtiff!38
+
+2018-10-14  Even Rouault  <even.rouault@spatialys.com>
+
+       JBIG: fix potential out-of-bounds write in JBIGDecode()
+       JBIGDecode doesn't check if the user provided buffer is large enough
+       to store the JBIG decoded image, which can potentially cause out-of-bounds
+       write in the buffer.
+       This issue was reported and analyzed by Thomas Dullien.
+
+       Also fixes a (harmless) potential use of uninitialized memory when
+       tif->tif_rawsize > tif->tif_rawcc
+
+       And in case libtiff is compiled with CHUNKY_STRIP_READ_SUPPORT, make sure
+       that whole strip data is provided to JBIGDecode()
+
+2018-10-05  Even Rouault  <even.rouault@spatialys.com>
+
+       tif_webp.c: fix scanline reading/writing.
+
+       WEBP codec: initialize nSamples in TWebPSetupDecode() and TWebPSetupEncode()
+
+2018-10-05  Even Rouault  <even.rouault@spatialys.com>
+
+       Merge branch 'tif_webp' into 'master'
+       webp support
+
+       See merge request libtiff/libtiff!32
+
+2018-10-05  Norman Barker  <norman.barker@mapbox.com>
+
+       webp in tiff.
+
+2018-09-17  Even Rouault  <even.rouault@spatialys.com>
+
+       Merge branch 'master' into 'master'
+       fix three potential vulnerabilities.
+
+       See merge request libtiff/libtiff!33
+
+2018-09-08  Young_X  <YangX92@hotmail.com>
+
+       fix out-of-bound read on some tiled images.
+
+       avoid potential int32 overflows in multiply_ms()
+
+       only read/write TIFFTAG_GROUP3OPTIONS or TIFFTAG_GROUP4OPTIONS if compression is COMPRESSION_CCITTFAX3 or COMPRESSION_CCITTFAX4
+
+2018-08-15  Even Rouault  <even.rouault@spatialys.com>
+
+       TIFFSetupStrips(): avoid potential uint32 overflow on 32-bit systems with large number of strips. Probably relates to http://bugzilla.maptools.org/show_bug.cgi?id=2788 / CVE-2018-10779
+
+2018-08-07  Even Rouault  <even.rouault@spatialys.com>
+
+       ZSTD: fix flush issue that can cause endless loop in ZSTDEncode()
+       Fixes https://github.com/OSGeo/gdal/issues/833
+
+2018-08-07  Even Rouault  <even.rouault@spatialys.com>
+
+       Merge branch 'fix_bug_2800' into 'master'
+       Fix libtiff 4.0.8 regression when reading LZW-compressed strips with scanline API
+
+       See merge request libtiff/libtiff!31
+
+2018-08-07  Even Rouault  <even.rouault@spatialys.com>
+
+       Fix libtiff 4.0.8 regression when reading LZW-compressed strips with scanline API
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2800
+
+2018-07-05  Even Rouault  <even.rouault@spatialys.com>
+
+       Add tag and pseudo-tag definitions for ESRI LERC codec (out of tree codec whose source is at https://github.com/OSGeo/gdal/blob/master/gdal/frmts/gtiff/tif_lerc.c)
+
+2018-07-02  Even Rouault  <even.rouault@spatialys.com>
+
+       Fix TIFFTAG_ZSTD_LEVEL pseudo tag value to be > 65536, and the next one in the series
+
+2018-05-25  Stefan Weil  <sw@weilnetz.de>
+
+       Remove builtin support for GUI warning and error message boxes.
+       Now warnings always go to the console by default unless applications
+       define their own warning and error handlers.
+
+       GUI applications (and Windows CE) are required to define such handlers.
+
+2018-05-12  Even Rouault  <even.rouault@spatialys.com>
+
+       LZWDecodeCompat(): fix potential index-out-of-bounds write. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2780 / CVE-2018-8905
+       The fix consists in using the similar code LZWDecode() to validate we
+       don't write outside of the output buffer.
+
+       TIFFFetchNormalTag(): avoid (probably false positive) clang-tidy clang-analyzer-core.NullDereference warnings
+
+       TIFFWriteDirectorySec: avoid assertion. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2795. CVE-2018-10963
+
+2018-05-04  Even Rouault  <even.rouault@spatialys.com>
+
+       tif_color.c: fix code comment.
+
+2018-04-17  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'fuzzer-fix' into 'master'
+       remove a pointless multiplication and a variable that's not necessary
+
+       See merge request libtiff/libtiff!29
+
+2018-04-17  Paul Kehrer  <paul.l.kehrer@gmail.com>
+
+       remove a pointless multiplication and a variable that's not necessary.
+
+2018-04-17  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'ossfuzz' into 'master'
+       move oss-fuzz build script and fuzzer into libtiff tree
+
+       See merge request libtiff/libtiff!28
+
+2018-04-17  Paul Kehrer  <paul.l.kehrer@gmail.com>
+
+       move oss-fuzz build script and fuzzer into libtiff tree.
+
+2018-04-14  Even Rouault  <even.rouault@spatialys.com>
+
+       _TIFFGetMaxColorChannels: update for LOGLUV, ITULAB and ICCLAB that have 3 color channels
+
+2018-04-12  Even Rouault  <even.rouault@spatialys.com>
+
+       Fix MSVC warning.
+
+2018-04-12  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'master' into 'master'
+       Fix NULL pointer dereference in TIFFPrintDirectory (bugzilla 2778/CVE-2018-7456)
+
+       See merge request libtiff/libtiff!27
+
+2018-04-11  Hugo Lefeuvre  <hle@debian.org>
+
+       Fix NULL pointer dereference in TIFFPrintDirectory.
+       The TIFFPrintDirectory function relies on the following assumptions,
+       supposed to be guaranteed by the specification:
+
+       (a) A Transfer Function field is only present if the TIFF file has
+           photometric type < 3.
+
+       (b) If SamplesPerPixel > Color Channels, then the ExtraSamples field
+           has count SamplesPerPixel - (Color Channels) and contains
+           information about supplementary channels.
+
+       While respect of (a) and (b) are essential for the well functioning of
+       TIFFPrintDirectory, no checks are realized neither by the callee nor
+       by TIFFPrintDirectory itself. Hence, following scenarios might happen
+       and trigger the NULL pointer dereference:
+
+       (1) TIFF File of photometric type 4 or more has illegal Transfer
+           Function field.
+
+       (2) TIFF File has photometric type 3 or less and defines a
+           SamplesPerPixel field such that SamplesPerPixel > Color Channels
+           without defining all extra samples in the ExtraSamples fields.
+
+       In this patch, we address both issues with respect of the following
+       principles:
+
+       (A) In the case of (1), the defined transfer table should be printed
+           safely even if it isn't 'legal'. This allows us to avoid expensive
+           checks in TIFFPrintDirectory. Also, it is quite possible that
+           an alternative photometric type would be developed (not part of the
+           standard) and would allow definition of Transfer Table. We want
+           libtiff to be able to handle this scenario out of the box.
+
+       (B) In the case of (2), the transfer table should be printed at its
+           right size, that is if TIFF file has photometric type Palette
+           then the transfer table should have one row and not three, even
+           if two extra samples are declared.
+
+       In order to fulfill (A) we simply add a new 'i < 3' end condition to
+       the broken TIFFPrintDirectory loop. This makes sure that in any case
+       where (b) would be respected but not (a), everything stays fine.
+
+       (B) is fulfilled by the loop condition
+       'i < td->td_samplesperpixel - td->td_extrasamples'. This is enough as
+       long as (b) is respected.
+
+       Naturally, we also make sure (b) is respected. This is done in the
+       TIFFReadDirectory function by making sure any non-color channel is
+       counted in ExtraSamples.
+
+       This commit addresses CVE-2018-7456.
+
+2018-03-27  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'tiffset-long8' into 'master'
+       tiffset: Add support for LONG8, SLONG8 and IFD8 field types
+
+       See merge request libtiff/libtiff!25
+
+2018-03-26  Roger Leigh  <rleigh@codelibre.net>
+
+       port: Clean up NetBSD sources and headers to build standalone.
+
+2018-03-23  Roger Leigh  <rleigh@dundee.ac.uk>
+
+       port: Add strtol, strtoll and strtoull.
+       Also update strtoul.  All use the same implementation from NetBSD libc.
+
+       tiffset: Add support for LONG8, SLONG8 and IFD8 field types.
+
+2018-03-17  Even Rouault  <even.rouault@spatialys.com>
+
+       ChopUpSingleUncompressedStrip: avoid memory exhaustion (CVE-2017-11613)
+       Rework fix done in 3719385a3fac5cfb20b487619a5f08abbf967cf8 to work in more
+       cases like https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6979.
+       Credit to OSS Fuzz
+
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2724
+
+2018-03-13  Even Rouault  <even.rouault@spatialys.com>
+
+       libtiff/tif_luv.c: rewrite loops in a more readable way (to avoid false positive reports like http://bugzilla.maptools.org/show_bug.cgi?id=2779)
+
+2018-03-13  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'avoid_memory_exhaustion_in_ChopUpSingleUncompressedStrip' into 'master'
+       ChopUpSingleUncompressedStrip: avoid memory exhaustion (CVE-2017-11613)
+
+       See merge request libtiff/libtiff!26
+
+2018-03-11  Even Rouault  <even.rouault@spatialys.com>
+
+       ChopUpSingleUncompressedStrip: avoid memory exhaustion (CVE-2017-11613)
+       In ChopUpSingleUncompressedStrip(), if the computed number of strips is big
+       enough and we are in read only mode, validate that the file size is consistent
+       with that number of strips to avoid useless attempts at allocating a lot of
+       memory for the td_stripbytecount and td_stripoffset arrays.
+
+       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2724
+
+2018-03-10  Even Rouault  <even.rouault@spatialys.com>
+
+       Typo fix in comment.
+
+2018-03-03  Even Rouault  <even.rouault@spatialys.com>
+
+       Avoid warning with gcc 8 (partially revert 647b0e8c11ee11896f319b92cf110775f538d75c)
+
+2018-02-25  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'typos' into 'master'
+       Fix some typos
+
+       See merge request libtiff/libtiff!23
+
+2018-02-24  Stefan Weil  <sw@weilnetz.de>
+
+       Fix some typos.
+       Most of them were found by codespell.
+
+2018-02-14  Even Rouault  <even.rouault@spatialys.com>
+
+       Typo fix in comment.
+
+       Merge branch 'zstd'
+
+       Add warning about COMPRESSION_ZSTD not being officialy registered.
+
+2018-02-14  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'bug2772' into 'master'
+       Fix for bug 2772
+
+       See merge request libtiff/libtiff!20
+
+2018-02-12  Nathan Baker  <nathanb@lenovo-chrome.com>
+
+       Fix for bug 2772.
+       It is possible to craft a TIFF document where the IFD list is circular,
+       leading to an infinite loop while traversing the chain. The libtiff
+       directory reader has a failsafe that will break out of this loop after
+       reading 65535 directory entries, but it will continue processing,
+       consuming time and resources to process what is essentially a bogus TIFF
+       document.
+
+       This change fixes the above behavior by breaking out of processing when
+       a TIFF document has >= 65535 directories and terminating with an error.
+
+2018-02-09  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'libtiff-as-subdirectory-fixes' into 'master'
+       Prefer target_include_directories
+
+       See merge request libtiff/libtiff!12
+
+2018-02-06  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'cmake-cleanups' into 'master'
+       Cmake cleanups
+
+       See merge request libtiff/libtiff!11
+
+2018-02-06  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'check-right-cxx-variable' into 'master'
+       Check right cxx variable
+
+       See merge request libtiff/libtiff!19
+
+2018-02-06  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'dont-leak-stream-open' into 'master'
+       Fix a memory leak in TIFFStreamOpen
+
+       See merge request libtiff/libtiff!17
+
+2018-02-06  Ben Boeckel  <ben.boeckel@kitware.com>
+
+       cmake: check CXX_SUPPORT.
+       This variable is set in response to the `cxx` cache variable; use it
+       instead.
+
+2018-02-04  Olivier Paquet  <olivier.paquet@gmail.com>
+
+       Merge branch 'warnings' into 'master'
+       Fix all compiler warnings for default build
+
+       See merge request libtiff/libtiff!16
+
+2018-02-04  Nathan Baker  <elitebadger@gmail.com>
+
+       Fix all compiler warnings for default build.
+
+2018-01-30  Paul Kehrer  <paul.l.kehrer@gmail.com>
+
+       tabs are hard.
+
+2018-01-29  Paul Kehrer  <paul.l.kehrer@gmail.com>
+
+       use hard tabs like the rest of the project.
+
+       Fix a memory leak in TIFFStreamOpen.
+       TIFFStreamOpen allocates a new tiff{o,i}s_data, but if TIFFClientOpen
+       fails then that struct is leaked. Delete it if the returned TIFF * is
+       null.
+
+2018-01-29  Kevin Funk  <kfunk@kde.org>
+
+       Bump minimum required CMake version to v2.8.11.
+       Because we use the BUILD_INTERFACE generator expression
+
+2018-01-27  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'patch-1' into 'master'
+       Update CMakeLists.txt for build fix on Windows
+
+       See merge request libtiff/libtiff!14
+
+2018-01-27  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'patch-2' into 'master'
+       Update tiffgt.c for build fix on Windows
+
+       See merge request libtiff/libtiff!13
+
+2018-01-25  Olivier Paquet  <olivier.paquet@gmail.com>
+
+       Merge branch 'bug2750' into 'master'
+       Add workaround to pal2rgb buffer overflow.
+
+       See merge request libtiff/libtiff!15
+
+2018-01-25  Nathan Baker  <elitebadger@gmail.com>
+
+       Add workaround to pal2rgb buffer overflow.
+
+2018-01-23  Andrea  <andrea@andreaplanet.com>
+
+       Update tiffgt.c for build fix on Windows.
+
+       Update CMakeLists.txt for build fix on Windows.
+
+2018-01-15  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'has-attribute-check' into 'master'
+       tiffiop: use __has_attribute to detect the no_sanitize attribute
+
+       See merge request libtiff/libtiff!10
+
+2018-01-15  Ben Boeckel  <ben.boeckel@kitware.com>
+
+       cmake: avoid setting hard-coded variables in the cache.
+
+       cmake: avoid an unnecessary intermediate variable.
+
+       cmake: avoid an unnecessary intermediate variable.
+
+       cmake: avoid tautological logic.
+
+       cmake: use check_symbol_exists.
+       This accounts for symbols being provided by macros.
+
+       cmake: remove unused configure checks.
+
+2018-01-12  Kevin Funk  <kfunk@kde.org>
+
+       Prefer target_include_directories.
+       When libtiff is included in a super project via a simple
+       `add_subdirectory(libtiff)`, this way the `tiff` library target has all
+       the necessary information to build against it.
+
+       Note: The BUILD_INTERFACE generator expression feature requires at least
+       CMake v2.8.11 if I'm correct.
+
+2018-01-09  Ben Boeckel  <ben.boeckel@kitware.com>
+
+       tiffiop: use __has_attribute to detect the no_sanitize attribute.
+
+2017-12-31  Even Rouault  <even.rouault@spatialys.com>
+
+       man/TIFFquery.3tiff: remove reference to non-existing TIFFReadStrip() function in TIFFIsByteSwapped() documentation. Patch by Eric Piel. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2763
+
+       libtiff/tif_dir.c: _TIFFVGetField(): fix heap out-of-bounds access when requesting TIFFTAG_NUMBEROFINKS on a EXIF directory. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2765. Reported by Google Autofuzz project
+
+       libtiff/tif_print.c: TIFFPrintDirectory(): fix null pointer dereference on corrupted file. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2770
+
+2017-12-21  Even Rouault  <even.rouault@spatialys.com>
+
+       Add libzstd to gitlab-ci.
+
+2017-12-21  Even Rouault  <even.rouault@spatialys.com>
+
+       Add ZSTD compression codec.
+       From https://github.com/facebook/zstd
+       "Zstandard, or zstd as short version, is a fast lossless compression
+       algorithm, targeting real-time compression scenarios at zlib-level
+       and better compression ratios. It's backed by a very fast entropy stage,
+       provided by Huff0 and FSE library."
+
+       We require libzstd >= 1.0.0 so as to be able to use streaming compression
+       and decompression methods.
+
+       The default compression level we have selected is 9 (range goes from 1 to 22),
+       which experimentally offers equivalent or better compression ratio than
+       the default deflate/ZIP level of 6, and much faster compression.
+
+       For example on a 6600x4400 16bit image, tiffcp -c zip runs in 10.7 seconds,
+       while tiffcp -c zstd runs in 5.3 seconds. Decompression time for zip is
+       840 ms, and for zstd 650 ms. File size is 42735936 for zip, and
+       42586822 for zstd. Similar findings on other images.
+
+       On a 25894x16701 16bit image,
+
+                       Compression time     Decompression time     File size
+
+       ZSTD                 35 s                   3.2 s          399 700 498
+       ZIP/Deflate       1m 20 s                   4.9 s          419 622 336
+
+2017-12-10  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'fix_cve-2017-9935' into 'master'
+       Fix CVE-2017-9935
+
+       See merge request libtiff/libtiff!7
+
+2017-12-10  Brian May  <brian@linuxpenguins.xyz>
+
+       tiff2pdf: Fix apparent incorrect type for transfer table.
+       The standard says the transfer table contains unsigned 16 bit values,
+       I have no idea why we refer to them as floats.
+
+2017-12-10  Brian May  <brian@linuxpenguins.xyz>
+
+       tiff2pdf: Fix CVE-2017-9935.
+       Fix for http://bugzilla.maptools.org/show_bug.cgi?id=2704
+
+       This vulnerability - at least for the supplied test case - is because we
+       assume that a tiff will only have one transfer function that is the same
+       for all pages. This is not required by the TIFF standards.
+
+       We than read the transfer function for every page.  Depending on the
+       transfer function, we allocate either 2 or 4 bytes to the XREF buffer.
+       We allocate this memory after we read in the transfer function for the
+       page.
+
+       For the first exploit - POC1, this file has 3 pages. For the first page
+       we allocate 2 extra extra XREF entries. Then for the next page 2 more
+       entries. Then for the last page the transfer function changes and we
+       allocate 4 more entries.
+
+       When we read the file into memory, we assume we have 4 bytes extra for
+       each and every page (as per the last transfer function we read). Which
+       is not correct, we only have 2 bytes extra for the first 2 pages. As a
+       result, we end up writing past the end of the buffer.
+
+       There are also some related issues that this also fixes. For example,
+       TIFFGetField can return uninitalized pointer values, and the logic to
+       detect a N=3 vs N=1 transfer function seemed rather strange.
+
+       It is also strange that we declare the transfer functions to be of type
+       float, when the standard says they are unsigned 16 bit values. This is
+       fixed in another patch.
+
+       This patch will check to ensure that the N value for every transfer
+       function is the same for every page. If this changes, we abort with an
+       error. In theory, we should perhaps check that the transfer function
+       itself is identical for every page, however we don't do that due to the
+       confusion of the type of the data in the transfer function.
+
+2017-12-10  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'undef-warn-fixes' into 'master'
+       Fix a couple of harmless but annoying -Wundef warnings
+
+       See merge request libtiff/libtiff!8
+
+2017-12-07  Vadim Zeitlin  <vadim@zeitlins.org>
+
+       Remove tests for undefined SIZEOF_VOIDP.
+       As configure never uses AC_CHECK_SIZEOF(void*), this symbol is never
+       defined and so it doesn't make sense to test it in the code, this just
+       results in -Wundef warnings if they're enabled.
+
+       Avoid harmless -Wundef warnings for __clang_major__
+       Check that we're using Clang before checking its version.
+
+2017-12-02  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'remove_autogenerated_files' into 'master'
+       Remove autogenerated files
+
+       See merge request libtiff/libtiff!5
+
+2017-12-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       Merge branch 'tif_config_h_includes' into 'master'
+       'tif_config.h' or 'tiffiop.h' must be included before any system header.
+
+       See merge request libtiff/libtiff!6
+
+2017-12-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+
+       'tif_config.h' or 'tiffio.h' must be included before any system header.
+
+2017-12-01  Even Rouault  <even.rouault@spatialys.com>
+
+       .gitignore: add patterns for build from root.
+
+       Remove remaining .cvsignore files.
+
+       Remove autoconf/automake generated files, and add them to .gitignore.
+
+2017-12-01  Olivier Paquet  <olivier.paquet@gmail.com>
+
+       Merge branch 'makedistcheck' into 'master'
+       build/gitlab-ci and build/travis-ci: add a 'make dist' step in autoconf_build()…
+
+       See merge request libtiff/libtiff!4
+
+2017-12-01  Even Rouault  <even.rouault@spatialys.com>
+
+       build/gitlab-ci and build/travis-ci: add a 'make dist' step in autoconf_build() target, to check we are release-ready
+
+2017-12-01  Even Rouault  <even.rouault@mines-paris.org>
+
+       Merge branch 'git_updates' into 'master'
+       CVS to Git updates
+
+       See merge request libtiff/libtiff!2
+
+2017-12-01  Even Rouault  <even.rouault@spatialys.com>
+
+       HOWTO-RELEASE: update to use signed tags.
+
+       README.md: use markdown syntax for hyperlinks.
+
+2017-11-30  Even Rouault  <even.rouault@spatialys.com>
+
+       Add .gitignore.
+
+       Regenerate autoconf files.
+
+       Makefile.am: update to reflect removal of README.vms and README -> README.md
+
+       Remove all $Id and $Headers comments with CVS versions.
+
+       HOWTO-RELEASE: update for git.
+
+       Remove outdated .cvsignore.
+
+       Remove outdated commit script.
+
+       Remove README.vms.
+
+       Rename README as README.md, and update content.
+
+       html/index.html: reflect change from CVS to gitlab.
+
+2017-11-30  Olivier Paquet  <olivier.paquet@gmail.com>
+
+       Merge branch 'test-ci' into 'master'
+       Update CI configuration
+
+       See merge request libtiff/libtiff!1
+
+2017-11-23  Roger Leigh  <rleigh@codelibre.net>
+
+       appveyor: Correct path for git clone and skip artefact archival.
+
+2017-11-22  Roger Leigh  <rleigh@codelibre.net>
+
+       travis-ci: Remove unused matrix exclusion.
+
+       Add gitlab-ci build support.
+
 2017-11-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
 
        * configure.ac: libtiff 4.0.9 released.
 
        * libtiff/tif_jpeg.c: in JPEGFixupTags(), recognize SOF2, SOF9 and SOF10
        markers to avoid emitting a warning (even if, according to the TechNote,
-       there are admitedly unusual/not recommended or even forbidden variants, but
+       there are admittedly unusual/not recommended or even forbidden variants, but
        they do work well with libjpeg for SOF2, and with libjpeg-turbo for SOF2,
        SOF9 and SOF10).
        Define in_color_space and input_components to the right values in
 2012-05-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
 
        * man/TIFFGetField.3tiff: Correct the 'count' field type in the
-       example for how to retreive the value of unsupported tags.
+       example for how to retrieve the value of unsupported tags.
 
 2012-03-30  Frank Warmerdam  <warmerdam@google.com>
 
 
 2010-04-21  Frank Warmerdam  <warmerdam@pobox.com>
 
-       * libtiff/tif_jpeg.c: avoid preparing jpeg tables everytime
+       * libtiff/tif_jpeg.c: avoid preparing jpeg tables every time
        JPEGSetupEncode() is called if the tables already seem to be
        established.  This prevents spurious updates and rewriting of
        directories with jpegtables when doing updates to existing images.
 
        * test/common.sh - start verbose mode after common settings.
 
-       * libtiff/tif_dirinfo.c: Replace lfind() with local equivelent to
+       * libtiff/tif_dirinfo.c: Replace lfind() with local equivalent to
        avoid type mismatches on different platforms.
        http://bugzilla.maptools.org/show_bug.cgi?id=1889
 
 
        * tools/tiffdump.c: When compiling for Microsoft Windows, apply
        consistent (__int64) casting when testing if _lseeki64 has
-       successfully seeked as requested.  This is necessary for large
+       successfully sought as requested.  This is necessary for large
        file support to work since off_t is only 32-bit.
 
 2008-07-29  Frank Warmerdam  <warmerdam@pobox.com>
@@ -4316,7 +5011,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
        * libtiff/tif_getimage.c: replaced usage of TIFFScanlineSize in
        gtStripContig with TIFFNewScanlineSize so as to fix buggy behaviour
        on subsampled images - this ought to get sorted when we feel brave
-       enough to replace TIFFScanlineSize alltogether
+       enough to replace TIFFScanlineSize altogether
 
        * libtiff/tif_ojpeg.c: fixed bug in OJPEGReadSkip
 
@@ -4974,7 +5669,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
 
 2005-06-03  Andrey Kiselev  <dron@ak4719.spb.edu>
 
-       * libtiff/tif_open.c: Replace runtime endianess check with the compile
+       * libtiff/tif_open.c: Replace runtime endianness check with the compile
        time one.
 
        * libtiff/tif_predict.c: Floating point predictor now works on
@@ -6316,7 +7011,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
 2003-11-16  Andrey Kiselev  <dron@ak4719.spb.edu>
 
        * libtiff/{tiff.h, tif_dirinfo.c}: Added support for IFD (13)
-       datatype, intruduced in "Adobe PageMaker TIFF Tech. Notes".
+       datatype, introduced in "Adobe PageMaker TIFF Tech. Notes".
 
 2003-11-15  Frank Warmerdam  <warmerdam@pobox.com>
 
@@ -6627,7 +7322,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
 
        * contrib/ojpeg/{Makefile.in, jdhuff.h, jinclude.h, ojpeg.c, README},
        configure, Makefile.in: Improved libtiff compilation with OJPEG
-       support. Now no need for patching IJG JPEG library, hack requred by
+       support. Now no need for patching IJG JPEG library, hack required by
        libtiff will be compiled and used in-place. Implemented with
        suggestion and help from Bill Allombert, Debian's libjpeg maintainer.
 
@@ -7485,7 +8180,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
        sizes. It fixes two problems:
 
        Without scaling (-S) the fax is now centered on the page size specified
-       with -H and/or -W. Before, fax2ps was using an obscure and practially
+       with -H and/or -W. Before, fax2ps was using an obscure and practically
        useless algorithm to allocate the image relative to Letter sized paper
        which sometime sled to useless whitespace on the paper, while at the
        same time cutting of the faxes printable area at the opposite border.
index ae75011..f2ba5ef 100644 (file)
@@ -24,7 +24,7 @@ Notes on releasing.
 
 1. Commit any unsaved changes. 
 
-2. Create html/vX.X.html and add it to cvs with 'cvs add html/vX.X.html'.
+2. Create html/vX.X.html and add it to git with 'git add html/vX.X.html'.
    Take ChangeLog entries and html-ify in there. 
    Easist thing to do is take html/vX.(X-1).html and use it as a template.
 
@@ -101,19 +101,23 @@ Notes on releasing.
 
 13. In the source tree do
 
-      'cvs commit'.
+      'git commit' and 'git push'
 
-14. In the source tree do
+14. In the source tree, create a signed tag
 
-      cvs tag Release-v4-0-0
+      git tag -s v4.0.0 -m "Create tag for v4.0.0"
 
     (or the appropriate name for the release)
 
+    and push it to "origin" (if "origin" points to the official repository)
+
+      git push origin v4.0.0
+
 15. Copy release packages from the build tree to the
     ftp.remotesensing.org ftp site.
 
       scp tiff-*.tar.gz tiff-*.zip \
-        warmerdam@upload.osgeo.org:/osgeo/download/libtiff
+        bfriesen@upload.osgeo.org:/osgeo/download/libtiff
 
 16. Announce to list, tiff@lists.maptools.org
 
index 418a3b9..d19e58e 100644 (file)
@@ -31,8 +31,7 @@ ACLOCAL_AMFLAGS = -I m4
 docfiles = \
        COPYRIGHT \
        ChangeLog \
-       README \
-       README.vms \
+       README.md \
        RELEASE-DATE \
        TODO \
        VERSION
index c9c0645..6f4a310 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -125,7 +125,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
        $(am__configure_deps) $(dist_doc_DATA) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES = libtiff-4.pc
@@ -193,7 +193,7 @@ am__recursive_targets = \
   $(RECURSIVE_CLEAN_TARGETS) \
   $(am__extra_recursive_targets)
 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-       cscope distdir dist dist-all distcheck
+       cscope distdir distdir-am dist dist-all distcheck
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -219,11 +219,9 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libtiff-4.pc.in \
        $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \
        $(top_srcdir)/config/config.sub \
        $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
-       $(top_srcdir)/config/missing \
-       $(top_srcdir)/config/mkinstalldirs ChangeLog README TODO \
-       config/compile config/config.guess config/config.sub \
-       config/depcomp config/install-sh config/ltmain.sh \
-       config/missing config/mkinstalldirs
+       $(top_srcdir)/config/missing ChangeLog TODO config/compile \
+       config/config.guess config/config.sub config/install-sh \
+       config/ltmain.sh config/missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -419,8 +417,7 @@ ACLOCAL_AMFLAGS = -I m4
 docfiles = \
        COPYRIGHT \
        ChangeLog \
-       README \
-       README.vms \
+       README.md \
        RELEASE-DATE \
        TODO \
        VERSION
@@ -470,8 +467,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
            echo ' $(SHELL) ./config.status'; \
            $(SHELL) ./config.status;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -642,7 +639,10 @@ distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
        -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        $(am__remove_distdir)
        test -d "$(distdir)" || mkdir "$(distdir)"
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -707,7 +707,7 @@ distdir: $(DISTFILES)
          ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
        || chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
        $(am__post_remove_distdir)
 
 dist-bzip2: distdir
@@ -733,7 +733,7 @@ dist-shar: distdir
        @echo WARNING: "Support for shar distribution archives is" \
                       "deprecated." >&2
        @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-       shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+       shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
        $(am__post_remove_distdir)
 dist-zip: distdir
        -rm -f $(distdir).zip
@@ -750,7 +750,7 @@ dist dist-all:
 distcheck: dist
        case '$(DIST_ARCHIVES)' in \
        *.tar.gz*) \
-         GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+         eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
        *.tar.bz2*) \
          bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
        *.tar.lz*) \
@@ -760,7 +760,7 @@ distcheck: dist
        *.tar.Z*) \
          uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
        *.shar.gz*) \
-         GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+         eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
        *.zip*) \
          unzip $(distdir).zip ;;\
        esac
index 2d894c2..6e66c73 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Makefile.vc,v 1.7 2008/01/01 15:53:10 fwarmerdam Exp $
 #
 # Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
 #
similarity index 88%
rename from README
rename to README.md
index 5f30f4e..13dac75 100644 (file)
--- a/README
+++ b/README.md
@@ -1,6 +1,3 @@
-$Header: /cvs/maptools/cvsroot/libtiff/README,v 1.7 2012-02-18 21:53:27 bfriesen Exp $
-
-
 TIFF Software Distribution
 --------------------------
 This file is just a placeholder; all the documentation is now in
@@ -14,7 +11,7 @@ e.g.
 If you don't have an HTML viewer then you can read the HTML source
 or fetch a PostScript version of this documentation from the directory
 
-    ftp://ftp.remotesensing.org/pub/libtiff/
+    http://download.osgeo.org/libtiff/
 
 If you can't hack either of these options then basically what you
 want to do is:
@@ -25,7 +22,17 @@ want to do is:
     # make install
 
 More information, email contacts, and mailing list information can be 
-found online at http://www.remotesensing.org/libtiff/.
+found online at http://www.simplesystems.org/libtiff/
+
+Source code repository
+----------------------
+
+[GitLab](https://gitlab.com/libtiff/libtiff)
+
+Bug database
+------------
+
+[Bugzilla](http://bugzilla.maptools.org/buglist.cgi?product=libtiff)
 
 
 Use and Copyright
diff --git a/README.vms b/README.vms
deleted file mode 100644 (file)
index 44d9663..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Dear OpenVMS user
-to make this library, execute
-$@CONFIGURE
-$@BUILD
-
-Build process should be error and warning free. When process will be finished,
-LIBTIFF$STRATUP.COM file containing all required definitions, will be  created.
-Please call it from system startup procedure or individual user procedure LOGIN.COM
-To link software with libtiff, use TIFF:LIBTIFF.OPT
-
-best regards,
-Alexey Chupahin,   elvis_75@mail.ru
index f5a5ad7..94d1f0c 100644 (file)
@@ -1 +1 @@
-20171118
+20181110
index 682246e..ee87fed 100644 (file)
@@ -1,5 +1,3 @@
-# $Id: SConstruct,v 1.4 2007/02/24 15:03:47 dron Exp $
-
 # Tag Image File Format (TIFF) Software
 #
 # Copyright (C) 2005, Andrey Kiselev <dron@ak4719.spb.edu>
diff --git a/TODO b/TODO
index 2ff8627..ea266aa 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,5 +1,3 @@
-#      $Header: /cvs/libtiff/TODO,v 1.6 2002/10/10 05:28:43 warmerda Exp $
-
 o gif2tiff segaulting on selected images
 o tiffcmp read data by strip/tile instead of scanline
 o YCbCr sampling support
diff --git a/VERSION b/VERSION
index 7919852..2d2d681 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.0.9
+4.0.10
index ca19cba..9299d04 100644 (file)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.15'
+[am__api_version='1.16'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.16.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.16.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -332,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -346,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  AS_CASE([$CONFIG_FILES],
+          [*\'*], [eval set x "$CONFIG_FILES"],
+          [*], [set x $CONFIG_FILES])
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`AS_DIRNAME("$mf")`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`AS_DIRNAME(["$file"])`
-      AS_MKDIR_P([$dirpart/$fdir])
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`AS_DIRNAME(["$am_mf"])`
+    am_filepart=`AS_BASENAME(["$am_mf"])`
+    AM_RUN_LOG([cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles]) || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  Try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).])
+  fi
+  AS_UNSET([am_dirpart])
+  AS_UNSET([am_filepart])
+  AS_UNSET([am_mf])
+  AS_UNSET([am_rc])
+  rm -f conftest-deps.mk
 }
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
@@ -397,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # -----------------------------
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -495,8 +485,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
 # We need awk for the "check" target (and possibly the TAP driver).  The
 # system "awk" is bad on some platforms.
@@ -563,7 +553,7 @@ END
 Aborting the configuration process, to ensure you take notice of the issue.
 
 You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
 
 If you want to complete the configuration process using your problematic
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -605,7 +595,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -626,7 +616,7 @@ if test x"${install_sh+set}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -648,7 +638,7 @@ AC_SUBST([am__leading_dot])])
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -683,7 +673,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 
 # Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -691,49 +681,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 
 # AM_MAKE_INCLUDE()
 # -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
 AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+      ['0:this is the am__doit target'],
+      [AS_CASE([$s],
+          [BSD], [am__include='.include' am__quote='"'],
+          [am__include='include' am__quote=''])])
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -772,7 +755,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -801,7 +784,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -848,7 +831,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -867,7 +850,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -948,7 +931,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1008,7 +991,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1036,7 +1019,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1055,7 +1038,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 69d54d1..92906d4 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -122,7 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -161,7 +161,7 @@ am__recursive_targets = \
   $(RECURSIVE_CLEAN_TARGETS) \
   $(am__extra_recursive_targets)
 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-       distdir
+       distdir distdir-am
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -182,8 +182,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -383,8 +382,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -501,7 +500,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index a85b723..99e5052 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2012-10-14.11; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -255,7 +255,8 @@ EOF
     echo "compile $scriptversion"
     exit $?
     ;;
-  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
     func_cl_wrapper "$@"      # Doesn't return...
     ;;
 esac
@@ -339,9 +340,9 @@ exit $ret
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
index ca2a03c..6c32c86 100755 (executable)
@@ -1,14 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-#   Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2008-01-08'
+timestamp='2014-11-04'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -17,26 +15,22 @@ timestamp='2008-01-08'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 #
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# Please send patches to <config-patches@gnu.org>.
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -56,8 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -139,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+       # If the system lacks a compiler, then just pick glibc.
+       # We could probably try harder.
+       LIBC=gnu
+
+       eval $set_cc_for_build
+       cat <<-EOF > $dummy.c
+       #include <features.h>
+       #if defined(__UCLIBC__)
+       LIBC=uclibc
+       #elif defined(__dietlibc__)
+       LIBC=dietlibc
+       #else
+       LIBC=gnu
+       #endif
+       EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+       ;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
-       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+       # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
        # switched to ELF, *-*-netbsd* would select the old
        # object file format.  This provides both forward
@@ -170,7 +184,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
                eval $set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-                       | grep __ELF__ >/dev/null
+                       | grep -q __ELF__
                then
                    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
                    # Return netbsd for either.  FIX?
@@ -180,7 +194,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                fi
                ;;
            *)
-               os=netbsd
+               os=netbsd
                ;;
        esac
        # The OS release
@@ -201,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
        echo "${machine}-${os}${release}"
        exit ;;
+    *:Bitrig:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+       exit ;;
     *:OpenBSD:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
        echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@@ -223,7 +241,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
                ;;
        *5.*)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
                ;;
        esac
        # According to Compaq, /usr/sbin/psrinfo has been available on
@@ -269,7 +287,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit ;;
+       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+       exitcode=$?
+       trap '' 0
+       exit $exitcode ;;
     Alpha\ *:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # Should we change UNAME_MACHINE based on the output of uname instead
@@ -295,12 +316,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo s390-ibm-zvmoe
        exit ;;
     *:OS400:*:*)
-        echo powerpc-ibm-os400
+       echo powerpc-ibm-os400
        exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
        exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
        echo arm-unknown-riscos
        exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -324,14 +345,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        case `/usr/bin/uname -p` in
            sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
@@ -375,23 +415,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint${UNAME_RELEASE}
        exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+       exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint${UNAME_RELEASE}
        exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-milan-mint${UNAME_RELEASE}
+       exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-hades-mint${UNAME_RELEASE}
+       exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-unknown-mint${UNAME_RELEASE}
+       exit ;;
     m68k:machten:*:*)
        echo m68k-apple-machten${UNAME_RELEASE}
        exit ;;
@@ -461,8 +501,8 @@ EOF
        echo m88k-motorola-sysv3
        exit ;;
     AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
+       # DG/UX returns AViiON for all architectures
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
        then
            if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -475,7 +515,7 @@ EOF
        else
            echo i586-dg-dgux${UNAME_RELEASE}
        fi
-       exit ;;
+       exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
        exit ;;
@@ -532,15 +572,16 @@ EOF
                echo rs6000-ibm-aix3.2
        fi
        exit ;;
-    *:AIX:*:[456])
+    *:AIX:*:[4567])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
        else
                IBM_ARCH=powerpc
        fi
-       if [ -x /usr/bin/oslevel ] ; then
-               IBM_REV=`/usr/bin/oslevel`
+       if [ -x /usr/bin/lslpp ] ; then
+               IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+                          awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
        else
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
@@ -575,52 +616,52 @@ EOF
            9000/[678][0-9][0-9])
                if [ -x /usr/bin/getconf ]; then
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
+                   sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                   case "${sc_cpu_version}" in
+                     523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                     528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                     532)                      # CPU_PA_RISC2_0
+                       case "${sc_kernel_bits}" in
+                         32) HP_ARCH="hppa2.0n" ;;
+                         64) HP_ARCH="hppa2.0w" ;;
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
+                       esac ;;
+                   esac
                fi
                if [ "${HP_ARCH}" = "" ]; then
                    eval $set_cc_for_build
-                   sed 's/^              //' << EOF >$dummy.c
+                   sed 's/^            //' << EOF >$dummy.c
 
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
+               #define _HPUX_SOURCE
+               #include <stdlib.h>
+               #include <unistd.h>
 
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
+               int main ()
+               {
+               #if defined(_SC_KERNEL_BITS)
+                   long bits = sysconf(_SC_KERNEL_BITS);
+               #endif
+                   long cpu  = sysconf (_SC_CPU_VERSION);
 
-                  switch (cpu)
-               {
-               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-               case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-                   switch (bits)
-                       {
-                       case 64: puts ("hppa2.0w"); break;
-                       case 32: puts ("hppa2.0n"); break;
-                       default: puts ("hppa2.0"); break;
-                       } break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-                   puts ("hppa2.0"); break;
-              #endif
-               default: puts ("hppa1.0"); break;
-               }
-                  exit (0);
-              }
+                   switch (cpu)
+                       {
+                       case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+                       case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+                       case CPU_PA_RISC2_0:
+               #if defined(_SC_KERNEL_BITS)
+                           switch (bits)
+                               {
+                               case 64: puts ("hppa2.0w"); break;
+                               case 32: puts ("hppa2.0n"); break;
+                               default: puts ("hppa2.0"); break;
+                               } break;
+               #else  /* !defined(_SC_KERNEL_BITS) */
+                           puts ("hppa2.0"); break;
+               #endif
+                       default: puts ("hppa1.0"); break;
+                       }
+                   exit (0);
+               }
 EOF
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
                    test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -640,7 +681,7 @@ EOF
            # => hppa64-hp-hpux11.23
 
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-               grep __LP64__ >/dev/null
+               grep -q __LP64__
            then
                HP_ARCH="hppa2.0w"
            else
@@ -711,22 +752,22 @@ EOF
        exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
-        exit ;;
+       exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-        exit ;;
+       exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
        echo c34-convex-bsd
-        exit ;;
+       exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
        echo c38-convex-bsd
-        exit ;;
+       exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
-        exit ;;
+       exit ;;
     CRAY*Y-MP:*:*:*)
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit ;;
@@ -750,14 +791,14 @@ EOF
        exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+       FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+       FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+       echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       exit ;;
     5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+       FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+       echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -769,34 +810,39 @@ EOF
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
        exit ;;
     *:FreeBSD:*:*)
-       case ${UNAME_MACHINE} in
-           pc98)
-               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
+       case ${UNAME_PROCESSOR} in
            amd64)
                echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
            *)
-               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+               echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
        esac
        exit ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
        exit ;;
+    *:MINGW64*:*)
+       echo ${UNAME_MACHINE}-pc-mingw64
+       exit ;;
     *:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
        exit ;;
+    *:MSYS*:*)
+       echo ${UNAME_MACHINE}-pc-msys
+       exit ;;
     i*:windows32*:*)
-       # uname -m includes "-pc" on this system.
-       echo ${UNAME_MACHINE}-mingw32
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
        exit ;;
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
        exit ;;
-    *:Interix*:[3456]*)
-       case ${UNAME_MACHINE} in
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
            x86)
                echo i586-pc-interix${UNAME_RELEASE}
                exit ;;
-           EM64T | authenticamd)
+           authenticamd | genuineintel | EM64T)
                echo x86_64-unknown-interix${UNAME_RELEASE}
                exit ;;
            IA64)
@@ -806,6 +852,9 @@ EOF
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
        echo i${UNAME_MACHINE}-pc-mks
        exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-pc-mks
+       exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -826,210 +875,157 @@ EOF
        exit ;;
     *:GNU:*:*)
        # the GNU system
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
        exit ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
-       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
        exit ;;
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
        exit ;;
+    aarch64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    aarch64_be:Linux:*:*)
+       UNAME_MACHINE=aarch64_be
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    alpha:Linux:*:*)
+       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+         EV5)   UNAME_MACHINE=alphaev5 ;;
+         EV56)  UNAME_MACHINE=alphaev56 ;;
+         PCA56) UNAME_MACHINE=alphapca56 ;;
+         PCA57) UNAME_MACHINE=alphapca56 ;;
+         EV6)   UNAME_MACHINE=alphaev6 ;;
+         EV67)  UNAME_MACHINE=alphaev67 ;;
+         EV68*) UNAME_MACHINE=alphaev68 ;;
+       esac
+       objdump --private-headers /bin/sh | grep -q ld.so.1
+       if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     arm*:Linux:*:*)
        eval $set_cc_for_build
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
            | grep -q __ARM_EABI__
        then
-           echo ${UNAME_MACHINE}-unknown-linux-gnu
+           echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        else
-           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+           if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+               | grep -q __ARM_PCS_VFP
+           then
+               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+           else
+               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+           fi
        fi
        exit ;;
     avr32*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     cris:Linux:*:*)
-       echo cris-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
        exit ;;
     crisv32:Linux:*:*)
-       echo crisv32-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
        exit ;;
     frv:Linux:*:*)
-       echo frv-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    hexagon:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    i*86:Linux:*:*)
+       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
        exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
-    mips:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #undef CPU
-       #undef mips
-       #undef mipsel
-       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mipsel
-       #else
-       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips
-       #else
-       CPU=
-       #endif
-       #endif
-EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-           /^CPU/{
-               s: ::g
-               p
-           }'`"
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-       ;;
-    mips64:Linux:*:*)
+    mips:Linux:*:* | mips64:Linux:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
        #undef CPU
-       #undef mips64
-       #undef mips64el
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mips64el
+       CPU=${UNAME_MACHINE}el
        #else
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips64
+       CPU=${UNAME_MACHINE}
        #else
        CPU=
        #endif
        #endif
 EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-           /^CPU/{
-               s: ::g
-               p
-           }'`"
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
        ;;
-    or32:Linux:*:*)
-       echo or32-unknown-linux-gnu
+    openrisc*:Linux:*:*)
+       echo or1k-unknown-linux-${LIBC}
        exit ;;
-    ppc:Linux:*:*)
-       echo powerpc-unknown-linux-gnu
+    or32:Linux:*:* | or1k*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
-    ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-gnu
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-${LIBC}
        exit ;;
-    alpha:Linux:*:*)
-       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-         EV5)   UNAME_MACHINE=alphaev5 ;;
-         EV56)  UNAME_MACHINE=alphaev56 ;;
-         PCA56) UNAME_MACHINE=alphapca56 ;;
-         PCA57) UNAME_MACHINE=alphapca56 ;;
-         EV6)   UNAME_MACHINE=alphaev6 ;;
-         EV67)  UNAME_MACHINE=alphaev67 ;;
-         EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
-       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-${LIBC}
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-gnu ;;
-         PA8*) echo hppa2.0-unknown-linux-gnu ;;
-         *)    echo hppa-unknown-linux-gnu ;;
+         PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+         *)    echo hppa-unknown-linux-${LIBC} ;;
        esac
        exit ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-gnu
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-${LIBC}
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-unknown-linux-${LIBC}
+       exit ;;
+    ppc64le:Linux:*:*)
+       echo powerpc64le-unknown-linux-${LIBC}
+       exit ;;
+    ppcle:Linux:*:*)
+       echo powerpcle-unknown-linux-${LIBC}
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux
+       echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    tile*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     vax:Linux:*:*)
-       echo ${UNAME_MACHINE}-dec-linux-gnu
+       echo ${UNAME_MACHINE}-dec-linux-${LIBC}
        exit ;;
     x86_64:Linux:*:*)
-       echo x86_64-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     xtensa*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
-    i*86:Linux:*:*)
-       # The BFD linker knows what the default object file format is, so
-       # first see if it will tell us. cd to the root directory to prevent
-       # problems with other programs or directories called `ld' in the path.
-       # Set LC_ALL=C to ensure ld outputs messages in English.
-       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
-                        | sed -ne '/supported targets:/!d
-                                   s/[         ][      ]*/ /g
-                                   s/.*supported targets: *//
-                                   s/ .*//
-                                   p'`
-        case "$ld_supported_targets" in
-         elf32-i386)
-               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
-               ;;
-         a.out-i386-linux)
-               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit ;;
-         coff-i386)
-               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit ;;
-         "")
-               # Either a pre-BFD a.out linker (linux-gnuoldld) or
-               # one that does not give us useful --help.
-               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-               exit ;;
-       esac
-       # Determine whether the default compiler is a.out or elf
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #include <features.h>
-       #ifdef __ELF__
-       # ifdef __GLIBC__
-       #  if __GLIBC__ >= 2
-       LIBC=gnu
-       #  else
-       LIBC=gnulibc1
-       #  endif
-       # else
-       LIBC=gnulibc1
-       # endif
-       #else
-       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-       LIBC=gnu
-       #else
-       LIBC=gnuaout
-       #endif
-       #endif
-       #ifdef __dietlibc__
-       LIBC=dietlibc
-       #endif
-EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-           /^LIBC/{
-               s: ::g
-               p
-           }'`"
-       test x"${LIBC}" != x && {
-               echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-               exit
-       }
-       test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
-       ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
        # earlier versions are messed up and put the nodename in both
@@ -1037,11 +1033,11 @@ EOF
        echo i386-sequent-sysv4
        exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
+       # Unixware is an offshoot of SVR4, but it has its own version
+       # number series starting with 2...
+       # I am not positive that other SVR4 systems won't match this,
        # I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
+       # Use sysv4.2uw... so that sysv4* matches it.
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
        exit ;;
     i*86:OS/2:*:*)
@@ -1058,7 +1054,7 @@ EOF
     i*86:syllable:*:*)
        echo ${UNAME_MACHINE}-pc-syllable
        exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
        echo i386-unknown-lynxos${UNAME_RELEASE}
        exit ;;
     i*86:*DOS:*:*)
@@ -1073,7 +1069,7 @@ EOF
        fi
        exit ;;
     i*86:*:5:[678]*)
-       # UnixWare 7.x, OpenUNIX and OpenServer 6.
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
        case `/bin/uname -X | grep "^Machine"` in
            *486*)           UNAME_MACHINE=i486 ;;
            *Pentium)        UNAME_MACHINE=i586 ;;
@@ -1101,10 +1097,13 @@ EOF
        exit ;;
     pc:*:*:*)
        # Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-       echo i386-pc-msdosdjgpp
-        exit ;;
+       # uname -m prints for DJGPP always 'pc', but it prints nothing about
+       # the processor, so we play safe by assuming i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-pc-msdosdjgpp
+       exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
        exit ;;
@@ -1139,8 +1138,18 @@ EOF
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
          && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       test -r /etc/.relid \
+           && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
        echo m68k-unknown-lynxos${UNAME_RELEASE}
        exit ;;
@@ -1153,7 +1162,7 @@ EOF
     rs6000:LynxOS:2.*:*)
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
        exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
        exit ;;
     SM[BE]S:UNIX_SV:*:*)
@@ -1173,10 +1182,10 @@ EOF
                echo ns32k-sni-sysv
        fi
        exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel@ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
+    PENTIUM:*:4.0*:*)  # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                       # says <Richard.M.Bartel@ccMail.Census.GOV>
+       echo i586-unisys-sysv4
+       exit ;;
     *:UNIX_System_V:4*:FTX*)
        # From Gerald Hewes <hewes@openmarket.com>.
        # How about differentiating between stratus architectures? -djm
@@ -1202,11 +1211,11 @@ EOF
        exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
-               echo mips-nec-sysv${UNAME_RELEASE}
+               echo mips-nec-sysv${UNAME_RELEASE}
        else
-               echo mips-unknown-sysv${UNAME_RELEASE}
+               echo mips-unknown-sysv${UNAME_RELEASE}
        fi
-        exit ;;
+       exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
        echo powerpc-be-beos
        exit ;;
@@ -1216,6 +1225,12 @@ EOF
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
        exit ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       exit ;;
+    x86_64:Haiku:*:*)
+       echo x86_64-unknown-haiku
+       exit ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
        exit ;;
@@ -1242,9 +1257,31 @@ EOF
        exit ;;
     *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       case $UNAME_PROCESSOR in
-           unknown) UNAME_PROCESSOR=powerpc ;;
-       esac
+       eval $set_cc_for_build
+       if test "$UNAME_PROCESSOR" = unknown ; then
+           UNAME_PROCESSOR=powerpc
+       fi
+       if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+           if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+               if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                   (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+                   grep IS_64BIT_ARCH >/dev/null
+               then
+                   case $UNAME_PROCESSOR in
+                       i386) UNAME_PROCESSOR=x86_64 ;;
+                       powerpc) UNAME_PROCESSOR=powerpc64 ;;
+                   esac
+               fi
+           fi
+       elif test "$UNAME_PROCESSOR" = i386 ; then
+           # Avoid executing cc on OS X 10.9, as it ships with a stub
+           # that puts up a graphical alert prompting to install
+           # developer tools.  Any system running Mac OS X 10.7 or
+           # later (Darwin 11 and later) is required to have a 64-bit
+           # processor. This is not true of the ARM version of Darwin
+           # that Apple uses in portable devices.
+           UNAME_PROCESSOR=x86_64
+       fi
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
        exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1258,7 +1295,10 @@ EOF
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
+    NEO-?:NONSTOP_KERNEL:*:*)
+       echo neo-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    NSE-*:NONSTOP_KERNEL:*:*)
        echo nse-tandem-nsk${UNAME_RELEASE}
        exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
@@ -1303,13 +1343,13 @@ EOF
        echo pdp10-unknown-its
        exit ;;
     SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
+       echo mips-sei-seiux${UNAME_RELEASE}
        exit ;;
     *:DragonFly:*:*)
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
        exit ;;
     *:*VMS:*:*)
-       UNAME_MACHINE=`(uname -p) 2>/dev/null`
+       UNAME_MACHINE=`(uname -p) 2>/dev/null`
        case "${UNAME_MACHINE}" in
            A*) echo alpha-dec-vms ; exit ;;
            I*) echo ia64-dec-vms ; exit ;;
@@ -1324,158 +1364,13 @@ EOF
     i*86:rdos:*:*)
        echo ${UNAME_MACHINE}-pc-rdos
        exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-          "4"
-#else
-         ""
-#endif
-         ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-       printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-       printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-       { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-       echo c1-convex-bsd
-       exit ;;
-    c2*)
-       if getsysinfo -f scalar_acc
-       then echo c32-convex-bsd
-       else echo c2-convex-bsd
-       fi
-       exit ;;
-    c34*)
-       echo c34-convex-bsd
-       exit ;;
-    c38*)
-       echo c38-convex-bsd
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
        exit ;;
-    c4*)
-       echo c4-convex-bsd
+    x86_64:VMkernel:*:*)
+       echo ${UNAME_MACHINE}-unknown-esx
        exit ;;
-    esac
-fi
+esac
 
 cat >&2 <<EOF
 $0: unable to guess system type
@@ -1484,9 +1379,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 and
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
index 6759825..7ffe373 100755 (executable)
@@ -1,44 +1,40 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-#   Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2008-01-16'
+timestamp='2014-12-03'
 
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Please send patches to <config-patches@gnu.org>.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
 # Otherwise, we print the canonical config type on stdout and succeed.
 
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
 # that are meaningful with *any* GNU software.
@@ -72,8 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -120,12 +115,18 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -148,10 +149,13 @@ case $os in
        -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
        -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis | -knuth | -cray)
+       -apple | -axis | -knuth | -cray | -microblaze*)
                os=
                basic_machine=$1
                ;;
+       -bluegene*)
+               os=-cnk
+               ;;
        -sim | -cisco | -oki | -wec | -winbond)
                os=
                basic_machine=$1
@@ -166,10 +170,10 @@ case $os in
                os=-chorusos
                basic_machine=$1
                ;;
-       -chorusrdb)
-               os=-chorusrdb
+       -chorusrdb)
+               os=-chorusrdb
                basic_machine=$1
-               ;;
+               ;;
        -hiux*)
                os=-hiuxwe2
                ;;
@@ -214,6 +218,12 @@ case $os in
        -isc*)
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
+       -lynx*178)
+               os=-lynxos178
+               ;;
+       -lynx*5)
+               os=-lynxos5
+               ;;
        -lynx*)
                os=-lynxos
                ;;
@@ -238,59 +248,90 @@ case $basic_machine in
        # Some are omitted here because they have special meanings below.
        1750a | 580 \
        | a29k \
+       | aarch64 | aarch64_be \
        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
        | am33_2.0 \
-       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+       | arc | arceb \
+       | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+       | avr | avr32 \
+       | be32 | be64 \
        | bfin \
-       | c4x | clipper \
+       | c4x | c8051 | clipper \
        | d10v | d30v | dlx | dsp16xx \
+       | epiphany \
        | fido | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | hexagon \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
+       | k1om \
+       | le32 | le64 \
+       | lm32 \
        | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | mcore | mep \
+       | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
-       | mips64vr | mips64vrel \
+       | mips64octeon | mips64octeonel \
        | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
        | mips64vr4100 | mips64vr4100el \
        | mips64vr4300 | mips64vr4300el \
        | mips64vr5000 | mips64vr5000el \
        | mips64vr5900 | mips64vr5900el \
        | mipsisa32 | mipsisa32el \
        | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa32r6 | mipsisa32r6el \
        | mipsisa64 | mipsisa64el \
        | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64r6 | mipsisa64r6el \
        | mipsisa64sb1 | mipsisa64sb1el \
        | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipsr5900 | mipsr5900el \
        | mipstx39 | mipstx39el \
        | mn10200 | mn10300 \
+       | moxie \
        | mt \
        | msp430 \
-       | nios | nios2 \
+       | nds32 | nds32le | nds32be \
+       | nios | nios2 | nios2eb | nios2el \
        | ns16k | ns32k \
-       | or32 \
+       | open8 | or1k | or1knd | or32 \
        | pdp10 | pdp11 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | powerpc | powerpc64 | powerpc64le | powerpcle \
        | pyramid \
+       | riscv32 | riscv64 \
+       | rl78 | rx \
        | score \
-       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
        | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
        | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-       | spu | strongarm \
-       | tahoe | thumb | tic4x | tic80 | tron \
-       | v850 | v850e \
+       | spu \
+       | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+       | visium \
        | we32k \
-       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
-       | z8k)
+       | x86 | xc16x | xstormy16 | xtensa \
+       | z8k | z80)
                basic_machine=$basic_machine-unknown
                ;;
-       m6811 | m68hc11 | m6812 | m68hc12)
-               # Motorola 68HC11/12.
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       leon|leon[3-9])
+               basic_machine=sparc-$basic_machine
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
                basic_machine=$basic_machine-unknown
                os=-none
                ;;
@@ -300,6 +341,21 @@ case $basic_machine in
                basic_machine=mt-unknown
                ;;
 
+       strongarm | thumb | xscale)
+               basic_machine=arm-unknown
+               ;;
+       xgate)
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       xscaleeb)
+               basic_machine=armeb-unknown
+               ;;
+
+       xscaleel)
+               basic_machine=armel-unknown
+               ;;
+
        # We use `pc' rather than `unknown'
        # because (1) that's what they normally are, and
        # (2) the word "unknown" tends to confuse beginning users.
@@ -314,64 +370,83 @@ case $basic_machine in
        # Recognize the basic CPU types with company name.
        580-* \
        | a29k-* \
+       | aarch64-* | aarch64_be-* \
        | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
        | avr-* | avr32-* \
+       | be32-* | be64-* \
        | bfin-* | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
-       | clipper-* | craynv-* | cydra-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
+       | c8051-* | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
        | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
        | h8300-* | h8500-* \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | hexagon-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
+       | k1om-* \
+       | le32-* | le64-* \
+       | lm32-* \
        | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | microblaze-* | microblazeel-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
        | mips16-* \
        | mips64-* | mips64el-* \
-       | mips64vr-* | mips64vrel-* \
+       | mips64octeon-* | mips64octeonel-* \
        | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
        | mips64vr4100-* | mips64vr4100el-* \
        | mips64vr4300-* | mips64vr4300el-* \
        | mips64vr5000-* | mips64vr5000el-* \
        | mips64vr5900-* | mips64vr5900el-* \
        | mipsisa32-* | mipsisa32el-* \
        | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa32r6-* | mipsisa32r6el-* \
        | mipsisa64-* | mipsisa64el-* \
        | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64r6-* | mipsisa64r6el-* \
        | mipsisa64sb1-* | mipsisa64sb1el-* \
        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipsr5900-* | mipsr5900el-* \
        | mipstx39-* | mipstx39el-* \
        | mmix-* \
        | mt-* \
        | msp430-* \
-       | nios-* | nios2-* \
+       | nds32-* | nds32le-* | nds32be-* \
+       | nios-* | nios2-* | nios2eb-* | nios2el-* \
        | none-* | np1-* | ns16k-* | ns32k-* \
+       | open8-* \
+       | or1k*-* \
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
        | pyramid-* \
-       | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | rl78-* | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
        | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
-       | tahoe-* | thumb-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+       | tahoe-* \
        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile*-* \
        | tron-* \
-       | v850-* | v850e-* | vax-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+       | vax-* \
+       | visium-* \
        | we32k-* \
-       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* \
        | xstormy16-* | xtensa*-* \
        | ymp-* \
-       | z8k-*)
+       | z8k-* | z80-*)
                ;;
        # Recognize the basic CPU types without company name, with glob match.
        xtensa*)
@@ -393,7 +468,7 @@ case $basic_machine in
                basic_machine=a29k-amd
                os=-udi
                ;;
-       abacus)
+       abacus)
                basic_machine=abacus-unknown
                ;;
        adobe68k)
@@ -439,6 +514,10 @@ case $basic_machine in
                basic_machine=m68k-apollo
                os=-bsd
                ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
        aux)
                basic_machine=m68k-apple
                os=-aux
@@ -455,10 +534,27 @@ case $basic_machine in
                basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
                os=-linux
                ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c54x-*)
+               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c55x-*)
+               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c6x-*)
+               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        c90)
                basic_machine=c90-cray
                os=-unicos
                ;;
+       cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
        convex-c1)
                basic_machine=c1-convex
                os=-bsd
@@ -487,7 +583,7 @@ case $basic_machine in
                basic_machine=craynv-cray
                os=-unicosmp
                ;;
-       cr16)
+       cr16 | cr16-*)
                basic_machine=cr16-unknown
                os=-elf
                ;;
@@ -526,6 +622,10 @@ case $basic_machine in
                basic_machine=m88k-motorola
                os=-sysv3
                ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
        djgpp)
                basic_machine=i586-pc
                os=-msdosdjgpp
@@ -641,7 +741,6 @@ case $basic_machine in
        i370-ibm* | ibm*)
                basic_machine=i370-ibm
                ;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
        i*86v32)
                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
                os=-sysv32
@@ -680,6 +779,9 @@ case $basic_machine in
                basic_machine=m68k-isi
                os=-sysv
                ;;
+       leon-*|leon[3-9]-*)
+               basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+               ;;
        m68knommu)
                basic_machine=m68k-unknown
                os=-linux
@@ -699,8 +801,15 @@ case $basic_machine in
                basic_machine=ns32k-utek
                os=-sysv
                ;;
+       microblaze*)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw64)
+               basic_machine=x86_64-pc
+               os=-mingw64
+               ;;
        mingw32)
-               basic_machine=i386-pc
+               basic_machine=i686-pc
                os=-mingw32
                ;;
        mingw32ce)
@@ -728,6 +837,10 @@ case $basic_machine in
                basic_machine=powerpc-unknown
                os=-morphos
                ;;
+       moxiebox)
+               basic_machine=moxie-unknown
+               os=-moxiebox
+               ;;
        msdos)
                basic_machine=i386-pc
                os=-msdos
@@ -735,10 +848,18 @@ case $basic_machine in
        ms1-*)
                basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
                ;;
+       msys)
+               basic_machine=i686-pc
+               os=-msys
+               ;;
        mvs)
                basic_machine=i370-ibm
                os=-mvs
                ;;
+       nacl)
+               basic_machine=le32-unknown
+               os=-nacl
+               ;;
        ncr3000)
                basic_machine=i486-ncr
                os=-sysv4
@@ -803,6 +924,12 @@ case $basic_machine in
        np1)
                basic_machine=np1-gould
                ;;
+       neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+       nse-tandem)
+               basic_machine=nse-tandem
+               ;;
        nsr-tandem)
                basic_machine=nsr-tandem
                ;;
@@ -885,9 +1012,10 @@ case $basic_machine in
                ;;
        power)  basic_machine=power-ibm
                ;;
-       ppc)    basic_machine=powerpc-unknown
+       ppc | ppcbe)    basic_machine=powerpc-unknown
                ;;
-       ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+       ppc-* | ppcbe-*)
+               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        ppcle | powerpclittle | ppc-le | powerpc-little)
                basic_machine=powerpcle-unknown
@@ -912,7 +1040,11 @@ case $basic_machine in
                basic_machine=i586-unknown
                os=-pw32
                ;;
-       rdos)
+       rdos | rdos64)
+               basic_machine=x86_64-pc
+               os=-rdos
+               ;;
+       rdos32)
                basic_machine=i386-pc
                os=-rdos
                ;;
@@ -981,6 +1113,9 @@ case $basic_machine in
                basic_machine=i860-stratus
                os=-sysv4
                ;;
+       strongarm-* | thumb-*)
+               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        sun2)
                basic_machine=m68000-sun
                ;;
@@ -1037,20 +1172,8 @@ case $basic_machine in
                basic_machine=t90-cray
                os=-unicos
                ;;
-       tic54x | c54x*)
-               basic_machine=tic54x-unknown
-               os=-coff
-               ;;
-       tic55x | c55x*)
-               basic_machine=tic55x-unknown
-               os=-coff
-               ;;
-       tic6x | c6x*)
-               basic_machine=tic6x-unknown
-               os=-coff
-               ;;
        tile*)
-               basic_machine=tile-unknown
+               basic_machine=$basic_machine-unknown
                os=-linux-gnu
                ;;
        tx39)
@@ -1120,6 +1243,9 @@ case $basic_machine in
        xps | xps100)
                basic_machine=xps100-honeywell
                ;;
+       xscale-* | xscalee[bl]-*)
+               basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+               ;;
        ymp)
                basic_machine=ymp-cray
                os=-unicos
@@ -1128,6 +1254,10 @@ case $basic_machine in
                basic_machine=z8k-unknown
                os=-sim
                ;;
+       z80-*-coff)
+               basic_machine=z80-unknown
+               os=-sim
+               ;;
        none)
                basic_machine=none-none
                os=-none
@@ -1166,7 +1296,7 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
        sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@ -1213,9 +1343,12 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+       # First match some system type aliases
+       # that might get confused with valid system types.
        # -solaris* is a basic system type, with this one exception.
+       -auroraux)
+               os=-auroraux
+               ;;
        -solaris1 | -solaris1.*)
                os=`echo $os | sed -e 's|solaris1|sunos4|'`
                ;;
@@ -1236,29 +1369,31 @@ case $os in
        # Each alternative MUST END IN A *, to match a version number.
        # -sysv* is not here because it comes later, after sysvr4.
        -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-             | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
-             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* | -plan9* \
              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* \
+             | -aos* | -aros* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-             | -openbsd* | -solidbsd* \
+             | -bitrig* | -openbsd* | -solidbsd* \
              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
-             | -uxpv* | -beos* | -mpeix* | -udk* \
+             | -chorusos* | -chorusrdb* | -cegcc* \
+             | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+             | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+             | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
              | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1297,7 +1432,7 @@ case $os in
        -opened*)
                os=-openedition
                ;;
-        -os400*)
+       -os400*)
                os=-os400
                ;;
        -wince*)
@@ -1346,7 +1481,7 @@ case $os in
        -sinix*)
                os=-sysv4
                ;;
-        -tpf*)
+       -tpf*)
                os=-tpf
                ;;
        -triton*)
@@ -1382,12 +1517,14 @@ case $os in
        -aros*)
                os=-aros
                ;;
-       -kaos*)
-               os=-kaos
-               ;;
        -zvmoe)
                os=-zvmoe
                ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -nacl*)
+               ;;
        -none)
                ;;
        *)
@@ -1410,10 +1547,10 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-        score-*)
+       score-*)
                os=-elf
                ;;
-        spu-*)
+       spu-*)
                os=-elf
                ;;
        *-acorn)
@@ -1425,8 +1562,23 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
-        c4x-* | tic4x-*)
-               os=-coff
+       c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       c8051-*)
+               os=-elf
+               ;;
+       hexagon-*)
+               os=-elf
+               ;;
+       tic54x-*)
+               os=-coff
+               ;;
+       tic55x-*)
+               os=-coff
+               ;;
+       tic6x-*)
+               os=-coff
                ;;
        # This must come before the *-dec entry.
        pdp10-*)
@@ -1446,14 +1598,11 @@ case $basic_machine in
                ;;
        m68000-sun)
                os=-sunos3
-               # This also exists in the configure program, but was not the
-               # default.
-               # os=-sunos4
                ;;
        m68*-cisco)
                os=-aout
                ;;
-        mep-*)
+       mep-*)
                os=-elf
                ;;
        mips*-cisco)
@@ -1480,7 +1629,7 @@ case $basic_machine in
        *-ibm)
                os=-aix
                ;;
-       *-knuth)
+       *-knuth)
                os=-mmixware
                ;;
        *-wec)
@@ -1585,7 +1734,7 @@ case $basic_machine in
                        -sunos*)
                                vendor=sun
                                ;;
-                       -aix*)
+                       -cnk*|-aix*)
                                vendor=ibm
                                ;;
                        -beos*)
index fc98710..65cbf70 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2013-05-30.07; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -783,9 +783,9 @@ exit 0
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
index 4fbbae7..0b0fdcb 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2006-10-14.15
+scriptversion=2013-12-25.23; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,57 +35,57 @@ scriptversion=2006-10-14.15
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
 # from scratch.
 
+tab='  '
 nl='
 '
-IFS=" ""       $nl"
+IFS=" $tab$nl"
 
-# set DOITPROG to echo to test this script
+# Set DOITPROG to "echo" to test this script.
 
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
 
 # Put in absolute file names if you don't have them in your path;
 # or use environment vars.
 
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
 
-posix_glob=
 posix_mkdir=
 
 # Desired mode of installed file.
 mode=0755
 
+chgrpcmd=
 chmodcmd=$chmodprog
 chowncmd=
-chgrpcmd=
-stripcmd=
+mvcmd=$mvprog
 rmcmd="$rmprog -f"
-mvcmd="$mvprog"
+stripcmd=
+
 src=
 dst=
 dir_arg=
-dstarg=
-no_target_directory=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
 
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    or: $0 [OPTION]... SRCFILES... DIRECTORY
    or: $0 [OPTION]... -t DIRECTORY SRCFILES...
    or: $0 [OPTION]... -d DIRECTORIES...
@@ -95,91 +95,101 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
 In the 4th, create DIRECTORIES.
 
 Options:
--c         (ignored)
--d         create directories instead of installing files.
--g GROUP   $chgrpprog installed files to GROUP.
--m MODE    $chmodprog installed files to MODE.
--o USER    $chownprog installed files to USER.
--s         $stripprog installed files.
--t DIRECTORY  install into DIRECTORY.
--T         report an error if DSTFILE is a directory.
---help     display this help and exit.
---version  display version info and exit.
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
 
 Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
 "
 
 while test $# -ne 0; do
   case $1 in
-    -c) shift
-        continue;;
+    -c) ;;
 
-    -d) dir_arg=true
-        shift
-        continue;;
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-        shift
-        shift
-        continue;;
+        shift;;
 
     --help) echo "$usage"; exit $?;;
 
     -m) mode=$2
-        shift
-        shift
-       case $mode in
-         *' '* | *'    '* | *'
-'*       | *'*'* | *'?'* | *'['*)
-           echo "$0: invalid mode: $mode" >&2
-           exit 1;;
-       esac
-        continue;;
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
 
     -o) chowncmd="$chownprog $2"
-        shift
-        shift
-        continue;;
+        shift;;
 
-    -s) stripcmd=$stripprog
-        shift
-        continue;;
+    -s) stripcmd=$stripprog;;
 
-    -t) dstarg=$2
-       shift
-       shift
-       continue;;
+    -t)
+        is_target_a_directory=always
+        dst_arg=$2
+        # Protect names problematic for 'test' and other utilities.
+        case $dst_arg in
+          -* | [=\(\)!]) dst_arg=./$dst_arg;;
+        esac
+        shift;;
 
-    -T) no_target_directory=true
-       shift
-       continue;;
+    -T) is_target_a_directory=never;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    --)        shift
-       break;;
+    --) shift
+        break;;
 
-    -*)        echo "$0: invalid option: $1" >&2
-       exit 1;;
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
 
     *)  break;;
   esac
+  shift
 done
 
-if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+  if test -n "$dst_arg"; then
+    echo "$0: target directory not allowed when installing a directory." >&2
+    exit 1
+  fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
   # When -d is used, all remaining arguments are directories to create.
   # When -t is used, the destination is already specified.
   # Otherwise, the last argument is the destination.  Remove it from $@.
   for arg
   do
-    if test -n "$dstarg"; then
+    if test -n "$dst_arg"; then
       # $@ is not empty: it contains at least $arg.
-      set fnord "$@" "$dstarg"
+      set fnord "$@" "$dst_arg"
       shift # fnord
     fi
     shift # arg
-    dstarg=$arg
+    dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
   done
 fi
 
@@ -188,13 +198,26 @@ if test $# -eq 0; then
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
 
 if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
+  if test $# -gt 1 || test "$is_target_a_directory" = always; then
+    if test ! -d "$dst_arg"; then
+      echo "$0: $dst_arg: Is not a directory." >&2
+      exit 1
+    fi
+  fi
+fi
+
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
 
   # Set umask so as not to create temps with too-generous modes.
   # However, 'strip' requires both read and write access to temps.
@@ -205,16 +228,16 @@ if test -z "$dir_arg"; then
 
     *[0-7])
       if test -z "$stripcmd"; then
-       u_plus_rw=
+        u_plus_rw=
       else
-       u_plus_rw='% 200'
+        u_plus_rw='% 200'
       fi
       cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
     *)
       if test -z "$stripcmd"; then
-       u_plus_rw=
+        u_plus_rw=
       else
-       u_plus_rw=,u+rw
+        u_plus_rw=,u+rw
       fi
       cp_umask=$mode$u_plus_rw;;
   esac
@@ -222,9 +245,9 @@ fi
 
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
-    -*) src=./$src ;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
@@ -242,55 +265,24 @@ do
       exit 1
     fi
 
-    if test -z "$dstarg"; then
+    if test -z "$dst_arg"; then
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
-    dst=$dstarg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst ;;
-    esac
+    dst=$dst_arg
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-       echo "$0: $dstarg: Is a directory" >&2
-       exit 1
+      if test "$is_target_a_directory" = never; then
+        echo "$0: $dst_arg: Is a directory" >&2
+        exit 1
       fi
       dstdir=$dst
       dst=$dstdir/`basename "$src"`
       dstdir_status=0
     else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-       (dirname "$dst") 2>/dev/null ||
-       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-            X"$dst" : 'X\(//\)[^/]' \| \
-            X"$dst" : 'X\(//\)$' \| \
-            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-       echo X"$dst" |
-           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-                  s//\1/
-                  q
-                }
-                /^X\(\/\/\)[^/].*/{
-                  s//\1/
-                  q
-                }
-                /^X\(\/\/\)$/{
-                  s//\1/
-                  q
-                }
-                /^X\(\/\).*/{
-                  s//\1/
-                  q
-                }
-                s/.*/./; q'
-      `
-
+      dstdir=`dirname "$dst"`
       test -d "$dstdir"
       dstdir_status=$?
     fi
@@ -301,74 +293,74 @@ do
   if test $dstdir_status != 0; then
     case $posix_mkdir in
       '')
-       # Create intermediate dirs using mode 755 as modified by the umask.
-       # This is like FreeBSD 'install' as of 1997-10-28.
-       umask=`umask`
-       case $stripcmd.$umask in
-         # Optimize common cases.
-         *[2367][2367]) mkdir_umask=$umask;;
-         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-         *[0-7])
-           mkdir_umask=`expr $umask + 22 \
-             - $umask % 100 % 40 + $umask % 20 \
-             - $umask % 10 % 4 + $umask % 2
-           `;;
-         *) mkdir_umask=$umask,go-w;;
-       esac
-
-       # With -d, create the new directory with the user-specified mode.
-       # Otherwise, rely on $mkdir_umask.
-       if test -n "$dir_arg"; then
-         mkdir_mode=-m$mode
-       else
-         mkdir_mode=
-       fi
-
-       posix_mkdir=false
-       case $umask in
-         *[123567][0-7][0-7])
-           # POSIX mkdir -p sets u+wx bits regardless of umask, which
-           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-           ;;
-         *)
-           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-           if (umask $mkdir_umask &&
-               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-           then
-             if test -z "$dir_arg" || {
-                  # Check for POSIX incompatibilities with -m.
-                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-                  # other-writeable bit of parent directory when it shouldn't.
-                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
-                  case $ls_ld_tmpdir in
-                    d????-?r-*) different_mode=700;;
-                    d????-?--*) different_mode=755;;
-                    *) false;;
-                  esac &&
-                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-                  }
-                }
-             then posix_mkdir=:
-             fi
-             rmdir "$tmpdir/d" "$tmpdir"
-           else
-             # Remove any dirs left behind by ancient mkdir implementations.
-             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-           fi
-           trap '' 0;;
-       esac;;
+        # Create intermediate dirs using mode 755 as modified by the umask.
+        # This is like FreeBSD 'install' as of 1997-10-28.
+        umask=`umask`
+        case $stripcmd.$umask in
+          # Optimize common cases.
+          *[2367][2367]) mkdir_umask=$umask;;
+          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+          *[0-7])
+            mkdir_umask=`expr $umask + 22 \
+              - $umask % 100 % 40 + $umask % 20 \
+              - $umask % 10 % 4 + $umask % 2
+            `;;
+          *) mkdir_umask=$umask,go-w;;
+        esac
+
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n "$dir_arg"; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+        case $umask in
+          *[123567][0-7][0-7])
+            # POSIX mkdir -p sets u+wx bits regardless of umask, which
+            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+            ;;
+          *)
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            if (umask $mkdir_umask &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+            then
+              if test -z "$dir_arg" || {
+                   # Check for POSIX incompatibilities with -m.
+                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                   # other-writable bit of parent directory when it shouldn't.
+                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                   case $ls_ld_tmpdir in
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &&
+                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir "$tmpdir/d" "$tmpdir"
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+            fi
+            trap '' 0;;
+        esac;;
     esac
 
     if
       $posix_mkdir && (
-       umask $mkdir_umask &&
-       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
       )
     then :
     else
@@ -378,60 +370,51 @@ do
       # directory the slow way, step by step, checking for races as we go.
 
       case $dstdir in
-       /*) prefix=/ ;;
-       -*) prefix=./ ;;
-       *)  prefix= ;;
-      esac
-
-      case $posix_glob in
-        '')
-         if (set -f) 2>/dev/null; then
-           posix_glob=true
-         else
-           posix_glob=false
-         fi ;;
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
       esac
 
       oIFS=$IFS
       IFS=/
-      $posix_glob && set -f
+      set -f
       set fnord $dstdir
       shift
-      $posix_glob && set +f
+      set +f
       IFS=$oIFS
 
       prefixes=
 
       for d
       do
-       test -z "$d" && continue
-
-       prefix=$prefix$d
-       if test -d "$prefix"; then
-         prefixes=
-       else
-         if $posix_mkdir; then
-           (umask=$mkdir_umask &&
-            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-           # Don't fail if two instances are running concurrently.
-           test -d "$prefix" || exit 1
-         else
-           case $prefix in
-             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-             *) qprefix=$prefix;;
-           esac
-           prefixes="$prefixes '$qprefix'"
-         fi
-       fi
-       prefix=$prefix/
+        test X"$d" = X && continue
+
+        prefix=$prefix$d
+        if test -d "$prefix"; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask=$mkdir_umask &&
+             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+            # Don't fail if two instances are running concurrently.
+            test -d "$prefix" || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes="$prefixes '$qprefix'"
+          fi
+        fi
+        prefix=$prefix/
       done
 
       if test -n "$prefixes"; then
-       # Don't fail if two instances are running concurrently.
-       (umask $mkdir_umask &&
-        eval "\$doit_exec \$mkdirprog $prefixes") ||
-         test -d "$dstdir" || exit 1
-       obsolete_mkdir_used=true
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &&
+         eval "\$doit_exec \$mkdirprog $prefixes") ||
+          test -d "$dstdir" || exit 1
+        obsolete_mkdir_used=true
       fi
     fi
   fi
@@ -459,41 +442,51 @@ do
     # ignore errors from any of these, just make sure not to ignore
     # errors from the above "$doit $cpprog $src $dsttmp" command.
     #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
-    # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
-      || {
-          # The rename failed, perhaps because mv can't rename something else
-          # to itself, or perhaps because mv is so ancient that it does not
-          # support -f.
-
-          # Now remove or move aside any old file at destination location.
-          # We try this two ways since rm can't unlink itself on some
-          # systems and the destination file might be busy for other
-          # reasons.  In this case, the final cleanup might fail but the new
-          # file should still install successfully.
-          {
-            if test -f "$dst"; then
-              $doit $rmcmd -f "$dst" 2>/dev/null \
-              || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
-                    && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
-              || {
-                echo "$0: cannot unlink or rename $dst" >&2
-                (exit 1); exit 1
-              }
-            else
-              :
-            fi
-          } &&
-
-          # Now rename the file to the real destination.
-          $doit $mvcmd "$dsttmp" "$dst"
-        }
-    } || exit 1
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
+       set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       set +f &&
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+        # Now remove or move aside any old file at destination location.
+        # We try this two ways since rm can't unlink itself on some
+        # systems and the destination file might be busy for other
+        # reasons.  In this case, the final cleanup might fail but the new
+        # file should still install successfully.
+        {
+          test ! -f "$dst" ||
+          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+          } ||
+          { echo "$0: cannot unlink or rename $dst" >&2
+            (exit 1); exit 1
+          }
+        } &&
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
 
     trap '' 0
   fi
@@ -503,5 +496,6 @@ done
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
old mode 100755 (executable)
new mode 100644 (file)
index 147d758..0f0a2da
@@ -31,7 +31,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.6 Debian-2.4.6-0.1"
+VERSION=2.4.6
 package_revision=2.4.6
 
 
@@ -2073,7 +2073,7 @@ include the following information:
        autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
 
 Report bugs to <bug-libtool@gnu.org>.
-GNU libtool home page: <http://www.gnu.org/s/libtool/>.
+GNU libtool home page: <http://www.gnu.org/software/libtool/>.
 General help using GNU software: <http://www.gnu.org/gethelp/>."
     exit 0
 }
@@ -7272,13 +7272,10 @@ func_mode_link ()
       # -tp=*                Portland pgcc target processor selection
       # --sysroot=*          for sysroot support
       # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-      # -specs=*             GCC specs files
       # -stdlib=*            select c++ std lib with clang
-      # -fsanitize=*         Clang/GCC memory and address sanitizer
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-      -specs=*|-fsanitize=*)
+      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
         func_quote_for_eval "$arg"
        arg=$func_quote_for_eval_result
         func_append compile_command " $arg"
@@ -7571,10 +7568,7 @@ func_mode_link ()
        case $pass in
        dlopen) libs=$dlfiles ;;
        dlpreopen) libs=$dlprefiles ;;
-       link)
-         libs="$deplibs %DEPLIBS%"
-         test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
-         ;;
+       link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
        esac
       fi
       if test lib,dlpreopen = "$linkmode,$pass"; then
@@ -7893,19 +7887,19 @@ func_mode_link ()
            # It is a libtool convenience library, so add in its objects.
            func_append convenience " $ladir/$objdir/$old_library"
            func_append old_convenience " $ladir/$objdir/$old_library"
-           tmp_libs=
-           for deplib in $dependency_libs; do
-             deplibs="$deplib $deplibs"
-             if $opt_preserve_dup_deps; then
-               case "$tmp_libs " in
-               *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-               esac
-             fi
-             func_append tmp_libs " $deplib"
-           done
          elif test prog != "$linkmode" && test lib != "$linkmode"; then
            func_fatal_error "'$lib' is not a convenience library"
          fi
+         tmp_libs=
+         for deplib in $dependency_libs; do
+           deplibs="$deplib $deplibs"
+           if $opt_preserve_dup_deps; then
+             case "$tmp_libs " in
+             *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+             esac
+           fi
+           func_append tmp_libs " $deplib"
+         done
          continue
        fi # $pass = conv
 
@@ -8829,9 +8823,6 @@ func_mode_link ()
            revision=$number_minor
            lt_irix_increment=no
            ;;
-         *)
-           func_fatal_configuration "$modename: unknown library version type '$version_type'"
-           ;;
          esac
          ;;
        no)
index f62bbae..625aeb1 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -101,9 +101,9 @@ else
   exit $st
 fi
 
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
 
 program_details ()
 {
@@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
 exit $st
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff --git a/config/mkinstalldirs b/config/mkinstalldirs
deleted file mode 100755 (executable)
index ef7e16f..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-
-scriptversion=2006-05-11.19
-
-# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain.
-#
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-nl='
-'
-IFS=" ""       $nl"
-errstatus=0
-dirmode=
-
-usage="\
-Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
-
-Create each directory DIR (with mode MODE, if specified), including all
-leading file name components.
-
-Report bugs to <bug-automake@gnu.org>."
-
-# process command line arguments
-while test $# -gt 0 ; do
-  case $1 in
-    -h | --help | --h*)         # -h for help
-      echo "$usage"
-      exit $?
-      ;;
-    -m)                         # -m PERM arg
-      shift
-      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
-      dirmode=$1
-      shift
-      ;;
-    --version)
-      echo "$0 $scriptversion"
-      exit $?
-      ;;
-    --)                         # stop option processing
-      shift
-      break
-      ;;
-    -*)                         # unknown option
-      echo "$usage" 1>&2
-      exit 1
-      ;;
-    *)                          # first non-opt arg
-      break
-      ;;
-  esac
-done
-
-for file
-do
-  if test -d "$file"; then
-    shift
-  else
-    break
-  fi
-done
-
-case $# in
-  0) exit 0 ;;
-esac
-
-# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
-# mkdir -p a/c at the same time, both will detect that a is missing,
-# one will create a, then the other will try to create a and die with
-# a "File exists" error.  This is a problem when calling mkinstalldirs
-# from a parallel make.  We use --version in the probe to restrict
-# ourselves to GNU mkdir, which is thread-safe.
-case $dirmode in
-  '')
-    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-      echo "mkdir -p -- $*"
-      exec mkdir -p -- "$@"
-    else
-      # On NextStep and OpenStep, the `mkdir' command does not
-      # recognize any option.  It will interpret all options as
-      # directories to create, and then abort because `.' already
-      # exists.
-      test -d ./-p && rmdir ./-p
-      test -d ./--version && rmdir ./--version
-    fi
-    ;;
-  *)
-    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
-       test ! -d ./--version; then
-      echo "mkdir -m $dirmode -p -- $*"
-      exec mkdir -m "$dirmode" -p -- "$@"
-    else
-      # Clean up after NextStep and OpenStep mkdir.
-      for d in ./-m ./-p ./--version "./$dirmode";
-      do
-        test -d $d && rmdir $d
-      done
-    fi
-    ;;
-esac
-
-for file
-do
-  case $file in
-    /*) pathcomp=/ ;;
-    *)  pathcomp= ;;
-  esac
-  oIFS=$IFS
-  IFS=/
-  set fnord $file
-  shift
-  IFS=$oIFS
-
-  for d
-  do
-    test "x$d" = x && continue
-
-    pathcomp=$pathcomp$d
-    case $pathcomp in
-      -*) pathcomp=./$pathcomp ;;
-    esac
-
-    if test ! -d "$pathcomp"; then
-      echo "mkdir $pathcomp"
-
-      mkdir "$pathcomp" || lasterr=$?
-
-      if test ! -d "$pathcomp"; then
-       errstatus=$lasterr
-      else
-       if test ! -z "$dirmode"; then
-         echo "chmod $dirmode $pathcomp"
-         lasterr=
-         chmod "$dirmode" "$pathcomp" || lasterr=$?
-
-         if test ! -z "$lasterr"; then
-           errstatus=$lasterr
-         fi
-       fi
-      fi
-    fi
-
-    pathcomp=$pathcomp/
-  done
-done
-
-exit $errstatus
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
index aba4d1d..8e575b0 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
-# test-driver - basic driver script for the 'parallel-tests' mode.
+# test-driver - basic testsuite driver script.
 
-scriptversion=2012-06-27.10; # UTC
+scriptversion=2013-07-13.22; # UTC
 
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2014 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -44,13 +44,12 @@ print_usage ()
 Usage:
   test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
               [--expect-failure={yes|no}] [--color-tests={yes|no}]
-              [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
+              [--enable-hard-errors={yes|no}] [--]
+              TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
 END
 }
 
-# TODO: better error handling in option parsing (in particular, ensure
-# TODO: $log_file, $trs_file and $test_name are defined).
 test_name= # Used for reporting.
 log_file=  # Where to save the output of the test script.
 trs_file=  # Where to save the metadata of the test run.
@@ -69,10 +68,23 @@ while test $# -gt 0; do
   --enable-hard-errors) enable_hard_errors=$2; shift;;
   --) shift; break;;
   -*) usage_error "invalid option: '$1'";;
+   *) break;;
   esac
   shift
 done
 
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file"  = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file"  = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+  usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+  usage_error "missing argument"
+fi
+
 if test $color_tests = yes; then
   # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
   red='\e[0;31m' # Red.
@@ -94,11 +106,14 @@ trap "st=143; $do_exit" 15
 # Test script is run here.
 "$@" >$log_file 2>&1
 estatus=$?
+
 if test $enable_hard_errors = no && test $estatus -eq 99; then
-  estatus=1
+  tweaked_estatus=1
+else
+  tweaked_estatus=$estatus
 fi
 
-case $estatus:$expect_failure in
+case $tweaked_estatus:$expect_failure in
   0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
   0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
   77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
@@ -107,6 +122,12 @@ case $estatus:$expect_failure in
   *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
 esac
 
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
 # Report outcome to console.
 echo "${col}${res}${std}: $test_name"
 
index 4bb7c05..e46c68b 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for LibTIFF Software 4.0.9.
+# Generated by GNU Autoconf 2.69 for LibTIFF Software 4.0.10.
 #
 # Report bugs to <tiff@lists.maptools.org>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='LibTIFF Software'
 PACKAGE_TARNAME='tiff'
-PACKAGE_VERSION='4.0.9'
-PACKAGE_STRING='LibTIFF Software 4.0.9'
+PACKAGE_VERSION='4.0.10'
+PACKAGE_STRING='LibTIFF Software 4.0.10'
 PACKAGE_BUGREPORT='tiff@lists.maptools.org'
 PACKAGE_URL=''
 
@@ -656,6 +656,10 @@ X_CFLAGS
 XMKMF
 HAVE_CXX_FALSE
 HAVE_CXX_TRUE
+HAVE_WEBP_FALSE
+HAVE_WEBP_TRUE
+HAVE_ZSTD_FALSE
+HAVE_ZSTD_TRUE
 HAVE_LZMA_FALSE
 HAVE_LZMA_TRUE
 HAVE_JBIG_FALSE
@@ -708,7 +712,6 @@ am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
-am__quote
 am__include
 DEPDIR
 OBJEXT
@@ -800,7 +803,8 @@ PACKAGE_VERSION
 PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -840,6 +844,12 @@ with_jbig_lib_dir
 enable_lzma
 with_lzma_include_dir
 with_lzma_lib_dir
+enable_zstd
+with_zstd_include_dir
+with_zstd_lib_dir
+enable_webp
+with_webp_include_dir
+with_webp_lib_dir
 enable_jpeg12
 with_jpeg12_include_dir
 with_jpeg12_lib
@@ -1408,7 +1418,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures LibTIFF Software 4.0.9 to adapt to many kinds of systems.
+\`configure' configures LibTIFF Software 4.0.10 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1482,7 +1492,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of LibTIFF Software 4.0.9:";;
+     short | recursive ) echo "Configuration of LibTIFF Software 4.0.10:";;
    esac
   cat <<\_ACEOF
 
@@ -1528,6 +1538,10 @@ Optional Features:
                           compression, enabled by default)
   --disable-lzma          disable liblzma usage (required for LZMA2
                           compression, enabled by default)
+  --disable-zstd          disable libzstd usage (required for zstd
+                          compression, enabled by default)
+  --disable-webp          disable libwebp usage (required for webp
+                          compression, enabled by default)
   --enable-jpeg12         enable libjpeg 8/12bit dual mode
   --enable-cxx            enable C++ stream API building (requires C++
                           compiler)
@@ -1577,6 +1591,12 @@ Optional Packages:
   --with-lzma-include-dir=DIR
                           location of liblzma headers
   --with-lzma-lib-dir=DIR location of liblzma library binary
+  --with-zstd-include-dir=DIR
+                          location of libzstd headers
+  --with-zstd-lib-dir=DIR location of libzstd library binary
+  --with-webp-include-dir=DIR
+                          location of libwebp headers
+  --with-webp-lib-dir=DIR location of libwebp library binary
   --with-jpeg12-include-dir=DIR
                           location of libjpeg 12bit headers
   --with-jpeg12-lib=LIBRARY
@@ -1668,7 +1688,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-LibTIFF Software configure 4.0.9
+LibTIFF Software configure 4.0.10
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2441,7 +2461,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by LibTIFF Software $as_me 4.0.9, which was
+It was created by LibTIFF Software $as_me 4.0.10, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2898,7 +2918,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
-am__api_version='1.15'
+am__api_version='1.16'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -3384,7 +3404,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='tiff'
- VERSION='4.0.9'
+ VERSION='4.0.10'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3414,8 +3434,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
 # We need awk for the "check" target (and possibly the TAP driver).  The
@@ -3551,7 +3571,7 @@ END
 Aborting the configuration process, to ensure you take notice of the issue.
 
 You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
 
 If you want to complete the configuration process using your problematic
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -3588,14 +3608,14 @@ fi
 
 LIBTIFF_MAJOR_VERSION=4
 LIBTIFF_MINOR_VERSION=0
-LIBTIFF_MICRO_VERSION=9
+LIBTIFF_MICRO_VERSION=10
 LIBTIFF_ALPHA_VERSION=
 LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
 LIBTIFF_RELEASE_DATE=`date +"%Y%m%d"`
 
-LIBTIFF_CURRENT=8
+LIBTIFF_CURRENT=9
 LIBTIFF_REVISION=0
-LIBTIFF_AGE=3
+LIBTIFF_AGE=4
 LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
 
 # This is a special hack for OpenBSD and MirOS systems. The dynamic linker
@@ -4470,45 +4490,45 @@ DEPDIR="${am__leading_dot}deps"
 
 ac_config_commands="$ac_config_commands depfiles"
 
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+  case $?:`cat confinc.out 2>/dev/null` in #(
+  '0:this is the am__doit target') :
+    case $s in #(
+  BSD) :
+    am__include='.include' am__quote='"' ;; #(
+  *) :
+    am__include='include' am__quote='' ;;
+esac ;; #(
+  *) :
      ;;
-   esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
 
 # Check whether --enable-dependency-tracking was given.
 if test "${enable_dependency_tracking+set}" = set; then :
@@ -6104,7 +6124,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd* | netbsdelf*-gnu)
+netbsd*)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -10091,9 +10111,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
-  linux* | k*bsd*-gnu | gnu*)
-    link_all_deplibs=no
-    ;;
   esac
 
   ld_shlibs=yes
@@ -10348,7 +10365,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
        wlarc=
@@ -11018,7 +11035,6 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
        if test yes = "$lt_cv_irix_exported_symbol"; then
           archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
        fi
-       link_all_deplibs=no
       else
        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
        archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
@@ -11040,7 +11056,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       esac
       ;;
 
-    netbsd* | netbsdelf*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -15479,7 +15483,7 @@ lt_prog_compiler_static_CXX=
            ;;
        esac
        ;;
-      netbsd* | netbsdelf*-gnu)
+      netbsd*)
        ;;
       *qnx* | *nto*)
         # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -15854,9 +15858,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
       ;;
     esac
     ;;
-  linux* | k*bsd*-gnu | gnu*)
-    link_all_deplibs_CXX=no
-    ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -16988,7 +16977,7 @@ fi
         ;;
 esac
 
-for ac_header in assert.h fcntl.h io.h limits.h malloc.h search.h sys/time.h unistd.h
+for ac_header in assert.h fcntl.h io.h search.h unistd.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -17524,76 +17513,6 @@ _ACEOF
 
 
 
-# Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed short" >&5
-$as_echo_n "checking size of signed short... " >&6; }
-if ${ac_cv_sizeof_signed_short+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed short))" "ac_cv_sizeof_signed_short"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_signed_short" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (signed short)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_signed_short=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_short" >&5
-$as_echo "$ac_cv_sizeof_signed_short" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIGNED_SHORT $ac_cv_sizeof_signed_short
-_ACEOF
-
-
-
-# Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned short" >&5
-$as_echo_n "checking size of unsigned short... " >&6; }
-if ${ac_cv_sizeof_unsigned_short+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned short))" "ac_cv_sizeof_unsigned_short"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_unsigned_short" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (unsigned short)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_unsigned_short=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short" >&5
-$as_echo "$ac_cv_sizeof_unsigned_short" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short
-_ACEOF
-
-
-
 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
@@ -18158,52 +18077,7 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-ac_fn_c_check_type "$LINENO" "int8" "ac_cv_type_int8" "
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-
-"
-if test "x$ac_cv_type_int8" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INT8 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_type "$LINENO" "int16" "ac_cv_type_int16" "
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-
-"
-if test "x$ac_cv_type_int16" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INT16 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_type "$LINENO" "int32" "ac_cv_type_int32" "
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-
-"
-if test "x$ac_cv_type_int32" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INT32 1
-_ACEOF
-
-
-fi
-
-
-for ac_func in floor isascii memmove memset mmap pow setmode snprintf sqrt \
-strchr strrchr strstr strtol strtoul strtoull
+for ac_func in mmap setmode snprintf
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -18258,6 +18132,34 @@ esac
 fi
 
 
+ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol"
+if test "x$ac_cv_func_strtol" = xyes; then :
+  $as_echo "#define HAVE_STRTOL 1" >>confdefs.h
+
+else
+  case " $LIBOBJS " in
+  *" strtol.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS strtol.$ac_objext"
+ ;;
+esac
+
+fi
+
+
+ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll"
+if test "x$ac_cv_func_strtoll" = xyes; then :
+  $as_echo "#define HAVE_STRTOLL 1" >>confdefs.h
+
+else
+  case " $LIBOBJS " in
+  *" strtoll.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS strtoll.$ac_objext"
+ ;;
+esac
+
+fi
+
+
 ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul"
 if test "x$ac_cv_func_strtoul" = xyes; then :
   $as_echo "#define HAVE_STRTOUL 1" >>confdefs.h
 
 
 
+HAVE_ZSTD=no
+
+# Check whether --enable-zstd was given.
+if test "${enable_zstd+set}" = set; then :
+  enableval=$enable_zstd;
+fi
+
+
+# Check whether --with-zstd-include-dir was given.
+if test "${with_zstd_include_dir+set}" = set; then :
+  withval=$with_zstd_include_dir;
+fi
+
+
+# Check whether --with-zstd-lib-dir was given.
+if test "${with_zstd_lib_dir+set}" = set; then :
+  withval=$with_zstd_lib_dir;
+fi
+
+
+if test "x$enable_zstd" != "xno" ; then
+
+  if test "x$with_zstd_lib_dir" != "x" ; then
+    LDFLAGS="-L$with_zstd_lib_dir $LDFLAGS"
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZSTD_decompressStream in -lzstd" >&5
+$as_echo_n "checking for ZSTD_decompressStream in -lzstd... " >&6; }
+if ${ac_cv_lib_zstd_ZSTD_decompressStream+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lzstd  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ZSTD_decompressStream ();
+int
+main ()
+{
+return ZSTD_decompressStream ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_zstd_ZSTD_decompressStream=yes
+else
+  ac_cv_lib_zstd_ZSTD_decompressStream=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_decompressStream" >&5
+$as_echo "$ac_cv_lib_zstd_ZSTD_decompressStream" >&6; }
+if test "x$ac_cv_lib_zstd_ZSTD_decompressStream" = xyes; then :
+  zstd_lib=yes
+else
+  zstd_lib=no
+fi
+
+  if test "$zstd_lib" = "no" -a "x$with_zstd_lib_dir" != "x"; then
+    as_fn_error $? "zstd library not found at $with_zstd_lib_dir" "$LINENO" 5
+  fi
+
+  if test "x$with_zstd_include_dir" != "x" ; then
+    CPPFLAGS="-I$with_zstd_include_dir $CPPFLAGS"
+  fi
+  ac_fn_c_check_header_mongrel "$LINENO" "zstd.h" "ac_cv_header_zstd_h" "$ac_includes_default"
+if test "x$ac_cv_header_zstd_h" = xyes; then :
+  zstd_h=yes
+else
+  zstd_h=no
+fi
+
+
+  if test "$zstd_h" = "no" -a "x$with_zstd_include_dir" != "x" ; then
+    as_fn_error $? "Libzstd headers not found at $with_zstd_include_dir" "$LINENO" 5
+  fi
+
+  if test "$zstd_lib" = "yes" -a "$zstd_h" = "yes" ; then
+    HAVE_ZSTD=yes
+  fi
+
+fi
+
+if test "$HAVE_ZSTD" = "yes" ; then
+
+$as_echo "#define ZSTD_SUPPORT 1" >>confdefs.h
+
+  LIBS="-lzstd $LIBS"
+  tiff_libs_private="-lzstd ${tiff_libs_private}"
+
+  if test "$HAVE_RPATH" = "yes" -a "x$with_zstd_lib_dir" != "x" ; then
+    LIBDIR="-R $with_zstd_lib_dir $LIBDIR"
+  fi
+
+fi
+
+ if test "$HAVE_ZSTD" = 'yes'; then
+  HAVE_ZSTD_TRUE=
+  HAVE_ZSTD_FALSE='#'
+else
+  HAVE_ZSTD_TRUE='#'
+  HAVE_ZSTD_FALSE=
+fi
+
+
+
+HAVE_WEBP=no
+
+# Check whether --enable-webp was given.
+if test "${enable_webp+set}" = set; then :
+  enableval=$enable_webp;
+fi
+
+
+# Check whether --with-webp-include-dir was given.
+if test "${with_webp_include_dir+set}" = set; then :
+  withval=$with_webp_include_dir;
+fi
+
+
+# Check whether --with-webp-lib-dir was given.
+if test "${with_webp_lib_dir+set}" = set; then :
+  withval=$with_webp_lib_dir;
+fi
+
+
+if test "x$enable_webp" != "xno" ; then
+
+  if test "x$with_webp_lib_dir" != "x" ; then
+    LDFLAGS="-L$with_webp_lib_dir $LDFLAGS"
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WebPDecode in -lwebp" >&5
+$as_echo_n "checking for WebPDecode in -lwebp... " >&6; }
+if ${ac_cv_lib_webp_WebPDecode+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lwebp  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char WebPDecode ();
+int
+main ()
+{
+return WebPDecode ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_webp_WebPDecode=yes
+else
+  ac_cv_lib_webp_WebPDecode=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_webp_WebPDecode" >&5
+$as_echo "$ac_cv_lib_webp_WebPDecode" >&6; }
+if test "x$ac_cv_lib_webp_WebPDecode" = xyes; then :
+  webp_lib=yes
+else
+  webp_lib=no
+fi
+
+  if test "$webp_lib" = "no" -a "x$with_webp_lib_dir" != "x"; then
+    as_fn_error $? "webp library not found at $with_webp_lib_dir" "$LINENO" 5
+  fi
+
+  if test "x$with_webp_include_dir" != "x" ; then
+    CPPFLAGS="-I$with_webp_include_dir $CPPFLAGS"
+  fi
+  ac_fn_c_check_header_mongrel "$LINENO" "webp/decode.h" "ac_cv_header_webp_decode_h" "$ac_includes_default"
+if test "x$ac_cv_header_webp_decode_h" = xyes; then :
+  webp_h=yes
+else
+  webp_h=no
+fi
+
+
+  if test "$webp_h" = "no" -a "x$with_webp_include_dir" != "x" ; then
+    as_fn_error $? "Libwebp headers not found at $with_webp_include_dir" "$LINENO" 5
+  fi
+
+  if test "$webp_lib" = "yes" -a "$webp_h" = "yes" ; then
+    HAVE_WEBP=yes
+  fi
+
+fi
+
+if test "$HAVE_WEBP" = "yes" ; then
+
+$as_echo "#define WEBP_SUPPORT 1" >>confdefs.h
+
+  LIBS="-lwebp $LIBS"
+  tiff_libs_private="-lwebp ${tiff_libs_private}"
+
+  if test "$HAVE_RPATH" = "yes" -a "x$with_webp_lib_dir" != "x" ; then
+    LIBDIR="-R $with_webp_lib_dir $LIBDIR"
+  fi
+
+fi
+
+ if test "$HAVE_WEBP" = 'yes'; then
+  HAVE_WEBP_TRUE=
+  HAVE_WEBP_FALSE='#'
+else
+  HAVE_WEBP_TRUE='#'
+  HAVE_WEBP_FALSE=
+fi
+
+
+
 HAVE_JPEG12=no
 
 # Check whether --enable-jpeg12 was given.
@@ -21122,6 +21256,14 @@ if test -z "${HAVE_LZMA_TRUE}" && test -z "${HAVE_LZMA_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_LZMA\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${HAVE_ZSTD_TRUE}" && test -z "${HAVE_ZSTD_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_ZSTD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_WEBP_TRUE}" && test -z "${HAVE_WEBP_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_WEBP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HAVE_CXX_TRUE}" && test -z "${HAVE_CXX_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_CXX\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -21531,7 +21673,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by LibTIFF Software $as_me 4.0.9, which was
+This file was extended by LibTIFF Software $as_me 4.0.10, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21597,7 +21739,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-LibTIFF Software config.status 4.0.9
+LibTIFF Software config.status 4.0.10
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -21716,7 +21858,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
 # INIT-COMMANDS
 #
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
 
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -22734,29 +22876,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  case $CONFIG_FILES in #(
+  *\'*) :
+    eval set x "$CONFIG_FILES" ;; #(
+  *) :
+    set x $CONFIG_FILES ;; #(
+  *) :
+     ;;
+esac
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$mf" : 'X\(//\)[^/]' \| \
-        X"$mf" : 'X\(//\)$' \| \
-        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$am_mf" : 'X\(//\)[^/]' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -22774,53 +22922,48 @@ $as_echo X"$mf" |
            q
          }
          s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$file" : 'X\(//\)[^/]' \| \
-        X"$file" : 'X\(//\)$' \| \
-        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
+    am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
            s//\1/
            q
          }
-         /^X\(\/\/\)$/{
+         /^X\/\(\/\/\)$/{
            s//\1/
            q
          }
-         /^X\(\/\).*/{
+         /^X\/\(\/\).*/{
            s//\1/
            q
          }
          s/.*/./; q'`
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    { echo "$as_me:$LINENO: cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles" >&5
+   (cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  Try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+  { am_dirpart=; unset am_dirpart;}
+  { am_filepart=; unset am_filepart;}
+  { am_mf=; unset am_mf;}
+  { am_rc=; unset am_rc;}
+  rm -f conftest-deps.mk
 }
  ;;
     "libtool":C)
@@ -23604,6 +23747,8 @@ echo "  Old JPEG support:                   ${HAVE_OJPEG}"
 echo "  JPEG 8/12 bit dual mode:            ${HAVE_JPEG12}"
 echo "  ISO JBIG support:                   ${HAVE_JBIG}"
 echo "  LZMA2 support:                      ${HAVE_LZMA}"
+echo "  ZSTD support:                       ${HAVE_ZSTD}"
+echo "  WEBP support:                       ${HAVE_WEBP}"
 echo ""
 echo "  C++ support:                        ${HAVE_CXX}"
 echo ""
index 0dd32b7..c7b02e2 100644 (file)
@@ -25,7 +25,7 @@ dnl OF THIS SOFTWARE.
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.64)
-AC_INIT([LibTIFF Software],[4.0.9],[tiff@lists.maptools.org],[tiff])
+AC_INIT([LibTIFF Software],[4.0.10],[tiff@lists.maptools.org],[tiff])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(m4)
 AC_LANG(C)
@@ -41,7 +41,7 @@ dnl Versioning.
 dnl Don't fill the ALPHA_VERSION field, if not applicable.
 LIBTIFF_MAJOR_VERSION=4
 LIBTIFF_MINOR_VERSION=0
-LIBTIFF_MICRO_VERSION=9
+LIBTIFF_MICRO_VERSION=10
 LIBTIFF_ALPHA_VERSION=
 LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
 dnl This will be used with the 'make release' target
@@ -76,9 +76,9 @@ dnl  5. If any interfaces have been added since the last public release, then
 dnl     increment age.
 dnl  6. If any interfaces have been removed since the last public release,
 dnl     then set age to 0.                                
-LIBTIFF_CURRENT=8
+LIBTIFF_CURRENT=9
 LIBTIFF_REVISION=0
-LIBTIFF_AGE=3
+LIBTIFF_AGE=4
 LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
 
 # This is a special hack for OpenBSD and MirOS systems. The dynamic linker
@@ -174,7 +174,7 @@ case "${host_os}" in
 esac
 
 dnl Checks for header files.
-AC_CHECK_HEADERS([assert.h fcntl.h io.h limits.h malloc.h search.h sys/time.h unistd.h])
+AC_CHECK_HEADERS([assert.h fcntl.h io.h search.h unistd.h])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -196,12 +196,6 @@ dnl ---------------------------------------------------------------------------
 dnl Compute sized types for current CPU and compiler options
 dnl ---------------------------------------------------------------------------
 
-# Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
-AC_CHECK_SIZEOF(signed short)
-
-# Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
-AC_CHECK_SIZEOF(unsigned short)
-
 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
 AC_CHECK_SIZEOF(signed int)
 
@@ -412,22 +406,15 @@ AC_MSG_RESULT($PTRDIFF_T)
 AC_DEFINE_UNQUOTED(TIFF_PTRDIFF_T,$PTRDIFF_T,[Pointer difference type])
 AC_DEFINE_UNQUOTED(TIFF_PTRDIFF_FORMAT,$PTRDIFF_FORMAT,[Pointer difference type formatter])
 
-dnl Some compilers (IBM VisualAge) has these types defined, so check it here:
-AC_CHECK_TYPES([int8, int16, int32],,,
-[
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-])
-
 dnl Checks for library functions.
-AC_CHECK_FUNCS([floor isascii memmove memset mmap pow setmode snprintf sqrt \
-strchr strrchr strstr strtol strtoul strtoull])
+AC_CHECK_FUNCS([mmap setmode snprintf])
 
 dnl Will use local replacements for unavailable functions
 AC_REPLACE_FUNCS(getopt)
 AC_REPLACE_FUNCS(snprintf)
 AC_REPLACE_FUNCS(strcasecmp)
+AC_REPLACE_FUNCS(strtol)
+AC_REPLACE_FUNCS(strtoll)
 AC_REPLACE_FUNCS(strtoul)
 AC_REPLACE_FUNCS(strtoull)
 AC_REPLACE_FUNCS(lfind)
@@ -827,6 +814,114 @@ fi
 AM_CONDITIONAL(HAVE_LZMA, test "$HAVE_LZMA" = 'yes')
 
 dnl ---------------------------------------------------------------------------
+dnl Check for libzstd.
+dnl ---------------------------------------------------------------------------
+
+HAVE_ZSTD=no
+
+AC_ARG_ENABLE(zstd,
+             AS_HELP_STRING([--disable-zstd],
+                            [disable libzstd usage (required for zstd compression, enabled by default)]),,)
+AC_ARG_WITH(zstd-include-dir,
+           AS_HELP_STRING([--with-zstd-include-dir=DIR],
+                          [location of libzstd headers]),,)
+AC_ARG_WITH(zstd-lib-dir,
+           AS_HELP_STRING([--with-zstd-lib-dir=DIR],
+                          [location of libzstd library binary]),,)
+
+if test "x$enable_zstd" != "xno" ; then
+
+  if test "x$with_zstd_lib_dir" != "x" ; then
+    LDFLAGS="-L$with_zstd_lib_dir $LDFLAGS"
+  fi
+  
+  AC_CHECK_LIB(zstd, ZSTD_decompressStream, [zstd_lib=yes], [zstd_lib=no],)
+  if test "$zstd_lib" = "no" -a "x$with_zstd_lib_dir" != "x"; then
+    AC_MSG_ERROR([zstd library not found at $with_zstd_lib_dir])
+  fi
+    
+  if test "x$with_zstd_include_dir" != "x" ; then
+    CPPFLAGS="-I$with_zstd_include_dir $CPPFLAGS"
+  fi
+  AC_CHECK_HEADER(zstd.h, [zstd_h=yes], [zstd_h=no])
+  if test "$zstd_h" = "no" -a "x$with_zstd_include_dir" != "x" ; then
+    AC_MSG_ERROR([Libzstd headers not found at $with_zstd_include_dir])
+  fi
+
+  if test "$zstd_lib" = "yes" -a "$zstd_h" = "yes" ; then
+    HAVE_ZSTD=yes
+  fi
+
+fi
+
+if test "$HAVE_ZSTD" = "yes" ; then
+  AC_DEFINE(ZSTD_SUPPORT,1,[Support zstd compression])
+  LIBS="-lzstd $LIBS"
+  tiff_libs_private="-lzstd ${tiff_libs_private}"
+
+  if test "$HAVE_RPATH" = "yes" -a "x$with_zstd_lib_dir" != "x" ; then
+    LIBDIR="-R $with_zstd_lib_dir $LIBDIR"
+  fi
+
+fi
+
+AM_CONDITIONAL(HAVE_ZSTD, test "$HAVE_ZSTD" = 'yes')
+
+dnl ---------------------------------------------------------------------------
+dnl Check for libwebp.
+dnl ---------------------------------------------------------------------------
+
+HAVE_WEBP=no
+
+AC_ARG_ENABLE(webp,
+             AS_HELP_STRING([--disable-webp],
+                            [disable libwebp usage (required for webp compression, enabled by default)]),,)
+AC_ARG_WITH(webp-include-dir,
+           AS_HELP_STRING([--with-webp-include-dir=DIR],
+                          [location of libwebp headers]),,)
+AC_ARG_WITH(webp-lib-dir,
+           AS_HELP_STRING([--with-webp-lib-dir=DIR],
+                          [location of libwebp library binary]),,)
+
+if test "x$enable_webp" != "xno" ; then
+
+  if test "x$with_webp_lib_dir" != "x" ; then
+    LDFLAGS="-L$with_webp_lib_dir $LDFLAGS"
+  fi
+  
+  AC_CHECK_LIB(webp, WebPDecode, [webp_lib=yes], [webp_lib=no],)
+  if test "$webp_lib" = "no" -a "x$with_webp_lib_dir" != "x"; then
+    AC_MSG_ERROR([webp library not found at $with_webp_lib_dir])
+  fi
+    
+  if test "x$with_webp_include_dir" != "x" ; then
+    CPPFLAGS="-I$with_webp_include_dir $CPPFLAGS"
+  fi
+  AC_CHECK_HEADER(webp/decode.h, [webp_h=yes], [webp_h=no])
+  if test "$webp_h" = "no" -a "x$with_webp_include_dir" != "x" ; then
+    AC_MSG_ERROR([Libwebp headers not found at $with_webp_include_dir])
+  fi
+
+  if test "$webp_lib" = "yes" -a "$webp_h" = "yes" ; then
+    HAVE_WEBP=yes
+  fi
+
+fi
+
+if test "$HAVE_WEBP" = "yes" ; then
+  AC_DEFINE(WEBP_SUPPORT,1,[Support webp compression])
+  LIBS="-lwebp $LIBS"
+  tiff_libs_private="-lwebp ${tiff_libs_private}"
+
+  if test "$HAVE_RPATH" = "yes" -a "x$with_webp_lib_dir" != "x" ; then
+    LIBDIR="-R $with_webp_lib_dir $LIBDIR"
+  fi
+
+fi
+
+AM_CONDITIONAL(HAVE_WEBP, test "$HAVE_WEBP" = 'yes')
+
+dnl ---------------------------------------------------------------------------
 dnl Should 8/12 bit jpeg mode be enabled?
 dnl ---------------------------------------------------------------------------
 
@@ -1103,6 +1198,8 @@ LOC_MSG([  Old JPEG support:                   ${HAVE_OJPEG}])
 LOC_MSG([  JPEG 8/12 bit dual mode:            ${HAVE_JPEG12}])
 LOC_MSG([  ISO JBIG support:                   ${HAVE_JBIG}])
 LOC_MSG([  LZMA2 support:                      ${HAVE_LZMA}])
+LOC_MSG([  ZSTD support:                       ${HAVE_ZSTD}])
+LOC_MSG([  WEBP support:                       ${HAVE_WEBP}])
 LOC_MSG()
 LOC_MSG([  C++ support:                        ${HAVE_CXX}])
 LOC_MSG()
index 2267517..a306442 100644 (file)
@@ -1,4 +1,3 @@
-$! $Id: configure.com,v 1.3 2012-07-29 15:45:29 tgl Exp $
 $!
 $! OpenVMS configure procedure for libtiff
 $! (c) Alexey Chupahin  22-NOV-2007
index 1d1d029..c4d5cd6 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -160,7 +160,7 @@ am__recursive_targets = \
   $(RECURSIVE_CLEAN_TARGETS) \
   $(am__extra_recursive_targets)
 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-       distdir
+       distdir distdir-am
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -181,8 +181,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -382,8 +381,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -500,7 +499,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index 24c604e..abe4c02 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -123,7 +123,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -151,7 +151,9 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/addtiffo.Po \
+       ./$(DEPDIR)/tif_overview.Po ./$(DEPDIR)/tif_ovrcache.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -198,7 +200,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
-       $(top_srcdir)/config/mkinstalldirs README
+       README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -378,8 +380,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -410,9 +412,15 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addtiffo.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_overview.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_ovrcache.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addtiffo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_overview.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_ovrcache.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -493,7 +501,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -563,7 +574,9 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
        mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/addtiffo.Po
+       -rm -f ./$(DEPDIR)/tif_overview.Po
+       -rm -f ./$(DEPDIR)/tif_ovrcache.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -609,7 +622,9 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/addtiffo.Po
+       -rm -f ./$(DEPDIR)/tif_overview.Po
+       -rm -f ./$(DEPDIR)/tif_ovrcache.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -630,9 +645,9 @@ uninstall-am:
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-       clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
-       ctags-am distclean distclean-compile distclean-generic \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
        distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-data \
        install-data-am install-dvi install-dvi-am install-exec \
index 7bc3f44..e1d7062 100644 (file)
@@ -1,6 +1,4 @@
 /******************************************************************************
- * $Id: addtiffo.c,v 1.8 2015-05-30 20:30:27 bfriesen Exp $
- *
  * Project:  GeoTIFF Overview Builder
  * Purpose:  Mainline for building overviews in a TIFF file.
  * Author:   Frank Warmerdam, warmerdam@pobox.com
index c61ffbb..03b3573 100644 (file)
@@ -65,6 +65,8 @@
 #  define MAX(a,b)      ((a>b) ? a : b)
 #endif
 
+#define TIFF_DIR_MAX  65534
+
 void TIFFBuildOverviews( TIFF *, int, int *, int, const char *,
                          int (*)(double,void*), void * );
 
@@ -91,6 +93,7 @@ uint32 TIFF_WriteOverview( TIFF *hTIFF, uint32 nXSize, uint32 nYSize,
 {
     toff_t     nBaseDirOffset;
     toff_t     nOffset;
+    tdir_t     iNumDir;
 
     (void) bUseSubIFDs;
 
@@ -147,7 +150,16 @@ uint32 TIFF_WriteOverview( TIFF *hTIFF, uint32 nXSize, uint32 nYSize,
         return 0;
 
     TIFFWriteDirectory( hTIFF );
-    TIFFSetDirectory( hTIFF, (tdir_t) (TIFFNumberOfDirectories(hTIFF)-1) );
+    iNumDir = TIFFNumberOfDirectories(hTIFF);
+    if( iNumDir > TIFF_DIR_MAX )
+    {
+        TIFFErrorExt( TIFFClientdata(hTIFF),
+                      "TIFF_WriteOverview",
+                      "File `%s' has too many directories.\n",
+                      TIFFFileName(hTIFF) );
+        exit(-1);
+    }
+    TIFFSetDirectory( hTIFF, (tdir_t) (iNumDir - 1) );
 
     nOffset = TIFFCurrentDirOffset( hTIFF );
 
index 171527b..67a8812 100644 (file)
@@ -1,6 +1,4 @@
 /******************************************************************************
- * $Id: tif_ovrcache.c,v 1.11 2015-05-29 03:08:19 bfriesen Exp $
- *
  * Project:  TIFF Overview Builder
  * Purpose:  Library functions to maintain two rows of tiles or two strips
  *           of data for output overviews as an output cache. 
index e3503e1..38a1383 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -124,7 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -160,7 +160,10 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/tiff-bi.Po \
+       ./$(DEPDIR)/tiff-grayscale.Po ./$(DEPDIR)/tiff-palette.Po \
+       ./$(DEPDIR)/tiff-rgb.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -204,7 +207,7 @@ am__recursive_targets = \
   $(RECURSIVE_CLEAN_TARGETS) \
   $(am__extra_recursive_targets)
 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-       distdir
+       distdir distdir-am
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -226,7 +229,7 @@ ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
-       $(top_srcdir)/config/mkinstalldirs README
+       README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -437,8 +440,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -481,10 +484,16 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-bi.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-grayscale.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-palette.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-rgb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-bi.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-grayscale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-palette.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-rgb.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -612,7 +621,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -708,7 +720,10 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
        mostlyclean-am
 
 distclean: distclean-recursive
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/tiff-bi.Po
+       -rm -f ./$(DEPDIR)/tiff-grayscale.Po
+       -rm -f ./$(DEPDIR)/tiff-palette.Po
+       -rm -f ./$(DEPDIR)/tiff-rgb.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -754,7 +769,10 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/tiff-bi.Po
+       -rm -f ./$(DEPDIR)/tiff-grayscale.Po
+       -rm -f ./$(DEPDIR)/tiff-palette.Po
+       -rm -f ./$(DEPDIR)/tiff-rgb.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -775,8 +793,8 @@ uninstall-am:
 
 .MAKE: $(am__recursive_targets) install-am install-strip
 
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
-       check-am clean clean-generic clean-libtool \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+       am--depfiles check check-am clean clean-generic clean-libtool \
        clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
        distclean-compile distclean-generic distclean-libtool \
        distclean-tags distdir dvi dvi-am html html-am info info-am \
index 33f05c7..db0e8c8 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiff-bi.c,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */
-
 /*
  * tiff-bi.c -- create a Class B (bilevel) TIFF file
  *
index 00b229f..92c7b90 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiff-grayscale.c,v 1.6 2010-06-08 18:55:15 bfriesen Exp $ */
-
 /*
  * tiff-grayscale.c -- create a Class G (grayscale) TIFF file
  *      with a gray response curve in linear optical density
index 3d9e862..7b3d433 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiff-palette.c,v 1.5 2010-06-08 18:55:15 bfriesen Exp $ */
-
 /*
  * tiff-palette.c -- create a Class P (palette) TIFF file
  *
index bf90499..d14ed00 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiff-rgb.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */
-
 /*
  * tiff-rgb.c -- create a 24-bit Class R (rgb) TIFF file
  *
index 08993c4..6159486 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -124,7 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -149,8 +149,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -327,8 +326,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -352,7 +351,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index 97e4ffe..bc10b67 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: xtiff.c,v 1.4 2013-05-02 14:44:29 tgl Exp $
- *
  * xtiff - view a TIFF file in an X window
  *
  * Dan Sears
index 0ee5ad3..790bb6c 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -123,7 +123,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -150,7 +150,8 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/iptcutil.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -197,7 +198,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
-       $(top_srcdir)/config/mkinstalldirs README
+       README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -378,8 +379,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -410,7 +411,13 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iptcutil.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iptcutil.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -491,7 +498,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -561,7 +571,7 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
        mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/iptcutil.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -607,7 +617,7 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/iptcutil.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -628,9 +638,9 @@ uninstall-am:
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-       clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
-       ctags-am distclean distclean-compile distclean-generic \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
        distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-data \
        install-data-am install-dvi install-dvi-am install-exec \
index c359df8..621716d 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: iptcutil.c,v 1.11 2015-06-21 01:09:09 bfriesen Exp $ */
-
 #include "tif_config.h"
 
 #include <stdio.h>
@@ -784,7 +782,7 @@ int sindex(char ch,char *string)
   char *cp;
   for(cp=string;*cp;++cp)
     if(ch==*cp)
-      return (int)(cp-string); /* return postion of character */
+      return (int)(cp-string); /* return position of character */
   return -1;                   /* eol ... no match found */
 }
 
@@ -928,6 +926,7 @@ int tokenizer(unsigned inflag,char *token,int tokmax,char *line,
             {
            case IN_WHITE:
              _p_state=IN_TOKEN; /* switch states */
+          /* Fall through */
 
            case IN_TOKEN:               /* these 2 are     */
            case IN_QUOTE:               /*  identical here */
index 0a3b840..201e700 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -322,8 +321,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -347,7 +346,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index 29e48aa..e4c4651 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -325,8 +324,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -350,7 +349,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index b9abc6b..a36b054 100644 (file)
@@ -30,7 +30,7 @@ Your ReadRGBA() routine works well for reading many different formats
 (TILED, STIP, compressed or not, etc.) of the most basic types of data
 (RGB, 8-bit greyscale, 8-bit colormapped) into an SGI-style data array,
 and serves as a good template for users with other needs. I used it as
-an exmaple of how to make an iterator which, rather than fill a data
+an example of how to make an iterator which, rather than fill a data
 array, calls an arbitrary user-supplied callback function for each
 "chunk" of data - that "chunk" might be a strip or a tile, and might
 have one sample-per-pixel or two, and might be 8-bit data or 16-bit or
index e025dc5..243cfd6 100644 (file)
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_imageiter.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1991-1996 Sam Leffler
  * Copyright (c) 1991-1996 Silicon Graphics, Inc.
@@ -116,7 +114,7 @@ TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024])
                TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Missing required \"Colormap\" tag");
            return (0);
        }
-       /* fall thru... */
+       /* fall through... */
     case PHOTOMETRIC_MINISWHITE:
     case PHOTOMETRIC_MINISBLACK:
 /* This should work now so skip the check - BSR
@@ -183,7 +181,7 @@ TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024])
     case ORIENTATION_LEFTBOT:  /* XXX */
        TIFFWarning(TIFFFileName(tif), "using bottom-left orientation");
        img->orientation = ORIENTATION_BOTLEFT;
-       /* fall thru... */
+       /* fall through... */
     case ORIENTATION_BOTLEFT:
        break;
     case ORIENTATION_TOPRIGHT:
@@ -192,7 +190,7 @@ TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024])
     default:
        TIFFWarning(TIFFFileName(tif), "using top-left orientation");
        img->orientation = ORIENTATION_TOPLEFT;
-       /* fall thru... */
+       /* fall through... */
     case ORIENTATION_TOPLEFT:
        break;
     }
index e7dbe46..4f4fd27 100644 (file)
@@ -44,7 +44,7 @@ struct _TIFFImageIter {
        uint16  samplesperpixel;                /* image samples/pixel */
        uint16  orientation;                    /* image orientation */
        uint16  photometric;                    /* image photometric interp */
-       uint16* redcmap;                        /* colormap pallete */
+       uint16* redcmap;                        /* colormap palette */
        uint16* greencmap;
        uint16* bluecmap;
                                                /* get image data routine */
index 37e513a..cc6231d 100644 (file)
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_pdsdirread.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1988-1996 Sam Leffler
  * Copyright (c) 1991-1996 Silicon Graphics, Inc.
@@ -194,7 +192,7 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset,
         * the fields to check type and tag information,
         * and to extract info required to size data
         * structures.  A second pass is made afterwards
-        * to read in everthing not taken in the first pass.
+        * to read in everything not taken in the first pass.
         */
        td = &tif->tif_dir;
        
@@ -827,7 +825,7 @@ TIFFFetchNormalSubTag(TIFF* tif, TIFFDirEntry* dp, const TIFFFieldInfo* fip,
                                break;
                          }
                        }
-                       /* fall thru... */
+                       /* fall through... */
                case TIFF_LONG:
                case TIFF_SLONG:
                        { uint32 v32 =
index 3c632da..a670bda 100644 (file)
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_pdsdirwrite.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */
-
 /* When writing data to TIFF files, it is often useful to store application-
    specific data in a private TIFF directory so that the tags don't need to
    be registered and won't conflict with other people's user-defined tags.
index 67075ac..0028f09 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -323,8 +322,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -348,7 +347,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index e1c321d..79db104 100644 (file)
@@ -1,6 +1,3 @@
-#ifndef lint
-static char id[] = "$Id: tif2ras.c,v 1.3 2010-06-08 18:55:15 bfriesen Exp $"; 
-#endif
 /*-
  * tif2ras.c - Converts from a Tagged Image File Format image to a Sun Raster.
  *
index a7e314c..481faa8 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -323,8 +322,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -348,7 +347,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index ec8302c..0b53ed7 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs README
+am__DIST_COMMON = $(srcdir)/Makefile.in README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -326,8 +325,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -351,7 +350,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index 73c6c21..3220b7b 100644 (file)
@@ -2,7 +2,7 @@
 NOTE:  Sept/2004 
 
 The following described approach to managing tag extensions has been
-mostly superceeded since libtiff 3.6.0.  The described approach requires
+mostly superseded since libtiff 3.6.0.  The described approach requires
 internal knowledge of the libtiff API and tends to be very fragile 
 in the face of libtiff upgrades.  
 
index e67a6ab..3529552 100644 (file)
@@ -269,7 +269,7 @@ _XTIFFDefaultDirectory(TIFF *tif)
                 * Install into TIFF structure.
                 */
                TIFFMEMBER(tif,clientdir) = (tidata_t)xt;
-               tif->tif_flags |= XTIFF_INITIALIZED; /* dont do this again! */
+               tif->tif_flags |= XTIFF_INITIALIZED; /* don't do this again! */
        }
        
        /* set up our own defaults */
index 4780578..7663106 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -146,8 +146,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -325,8 +324,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -350,7 +349,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index 3f461ef..3f15e83 100644 (file)
@@ -1,5 +1,3 @@
-#      $Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.w95,v 1.2 1994/11/28
-06:13:31 sam Exp $
 #
 # Tag Image File Format Library
 #
index 3e6075f..ff70ca1 100644 (file)
@@ -40,7 +40,7 @@ it contain the function LoadTIFFinDIB that load
 a TIFF file and build a memory DIB with it and return the 
 HANDLE (HDIB) of the memory bloc containing this DIB.
 Since DIB is the "natural" bitmap format for Windows 3.1, 95 and NT,
-this function sould be usefull for some Windows 95 (or NT) developer.
+this function should be useful for some Windows 95 (or NT) developer.
 
 
 Sorry for my approximate english ...
index 9d958b1..2f7965d 100644 (file)
@@ -360,7 +360,7 @@ setorientation(TIFFRGBAImage* img, uint32 h)
     case ORIENTATION_LEFTBOT:   /* XXX */
     TIFFWarning(TIFFFileName(tif), "using bottom-left orientation");
     img->orientation = ORIENTATION_BOTLEFT;
-    /* fall thru... */
+    /* fall through... */
     case ORIENTATION_BOTLEFT:
     y = 0;
     break;
@@ -370,7 +370,7 @@ setorientation(TIFFRGBAImage* img, uint32 h)
     default:
     TIFFWarning(TIFFFileName(tif), "using top-left orientation");
     img->orientation = ORIENTATION_TOPLEFT;
-    /* fall thru... */
+    /* fall through... */
     case ORIENTATION_TOPLEFT:
     y = h-1;
     break;
index 12193df..c3ef845 100644 (file)
@@ -86,7 +86,8 @@ docfiles = \
        v4.0.6.html \
        v4.0.7.html \
        v4.0.8.html \
-       v4.0.9.html
+       v4.0.9.html \
+       v4.0.10.html
 
 dist_doc_DATA = $(docfiles)
 
index 4c0c8e3..80cc51b 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -124,7 +124,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \
        $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -192,7 +192,7 @@ am__recursive_targets = \
   $(RECURSIVE_CLEAN_TARGETS) \
   $(am__extra_recursive_targets)
 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-       distdir
+       distdir distdir-am
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -213,8 +213,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -449,7 +448,8 @@ docfiles = \
        v4.0.6.html \
        v4.0.7.html \
        v4.0.8.html \
-       v4.0.9.html
+       v4.0.9.html \
+       v4.0.10.html
 
 dist_doc_DATA = $(docfiles)
 SUBDIRS = images man
@@ -476,8 +476,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -615,7 +615,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index 4e89205..c61a262 100644 (file)
@@ -12,7 +12,7 @@ Defining New TIFF Tags
 </H1>
 
 Libtiff has built-in knowledge of all the standard TIFF tags, as
-well as extentions.  The following describes how to add knowledge of
+well as extensions.  The following describes how to add knowledge of
 new tags as builtins to libtiff, or how to application specific tags can
 be used by applications without modifying libtiff. 
 <p>
@@ -113,7 +113,7 @@ their own tags to store information outside the core TIFF specification.
 This is done by calling TIFFMergeFieldInfo() with one or more TIFFFieldInfos. 
 <p>
 
-The libgeotiff library provides geospatial information extentions within
+The libgeotiff library provides geospatial information extensions within
 a TIFF file.  First, a set of TIFFFieldInfo's is prepared with information
 on the new tags:<p>
 
index 07fc78b..643c3c6 100644 (file)
@@ -22,7 +22,7 @@ If you think you've discovered a bug, please first check to see if it is
 already known by looking at the list of already reported bugs.  You can do so 
 by visiting the buglist at 
 <A HREF=http://bugzilla.maptools.org/buglist.cgi?product=libtiff>http://bugzilla.maptools.org/buglist.cgi?product=libtiff</A>.  Also verify that 
-the problem is still reproducable with the current development software 
+the problem is still reproducible with the current development software
 from CVS. 
 <P>
 If you'd like to enter a new bug, you can do so at
index f52b096..77fbc40 100644 (file)
@@ -689,7 +689,7 @@ libtiff/uvcode.h                LogL/LogLuv codec-specific definitions
 libtiff/version.h               version string (generated by Makefile)
 libtiff/tif_apple.c             Apple-related OS support
 libtiff/tif_atari.c             Atari-related OS support
-libtiff/tif_aux.c               auxilary directory-related functions
+libtiff/tif_aux.c               auxiliary directory-related functions
 libtiff/tif_close.c             close an open TIFF file
 libtiff/tif_codec.c             configuration table of builtin codecs
 libtiff/tif_compress.c          compression scheme support
index 80b74bf..234a29a 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -123,7 +123,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \
        $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -177,8 +177,7 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(docdir)"
 DATA = $(dist_doc_DATA)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -370,8 +369,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -416,7 +415,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index 1c5a3ec..aadadae 100644 (file)
@@ -24,7 +24,7 @@
     </tr>
     <tr>
       <th>Latest Stable Release</th>
-      <td><a href="v4.0.9.html">v4.0.9</a></td>
+      <td><a href="v4.0.10.html">v4.0.10</a></td>
     </tr>
     <tr>
       <th>Master Download Site</th>
         before asking questions.</td>
     </tr>
     <tr>
-      <th>Anonymous CVS</th>
-      <td><tt>export CVSROOT=:pserver:cvsanon@cvs.maptools.org:/cvs/maptools/cvsroot<br>
-       cvs login</tt><br>
-       (use empty password)<br>
-       <tt>cvs checkout libtiff<br></tt>
-       to get the stable libtiff code or<br>
-       <tt>cvs checkout -r branch-3-9 libtiff</tt><br>
-       to get the previous stable branch supporting the 3.9.X release series.</td>
+      <th>git repository</th>
+      <td><tt><a href="https://gitlab.com/libtiff/libtiff">https://gitlab.com/libtiff/libtiff</a></td>
     </tr>
   </table>
   <hr>
   </ul>
   <hr>
   <p>
-    Last updated  $Date: 2017-11-07 02:00:06 $.
+    Last updated  2017-11-30
   </p>
 </body>
 </html>
index b1de7a2..9da85e3 100644 (file)
@@ -97,7 +97,7 @@
     information.
     The library include file <tt>&lt;tiffio.h&gt;</tt> contains a C pre-processor
     define <tt>TIFFLIB_VERSION</tt> that can be used to check library
-    version compatiblity at compile time.
+    version compatibility at compile time.
   </p>
   <hr>
   <h2 id="typedefs">Library Datatypes</h2>
index eb99fd1..c435bad 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -123,7 +123,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \
        $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -177,8 +177,7 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(docdir)"
 DATA = $(dist_doc_DATA)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
-       $(top_srcdir)/config/mkinstalldirs
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -426,8 +425,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -472,7 +471,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index 1e32f7c..5e4004d 100644 (file)
@@ -151,23 +151,23 @@ specification. This error is not fatal.</big></p>
 unknown tag was encountered in the directory; the library
 ignores all such tags.</big></p>
 <!-- INDENTATION -->
-<p><big><b>TIFF directory is missing requred
+<p><big><b>TIFF directory is missing required
 &quot;ImageLength&quot; field</b>. The image violates the
 specification by not having a necessary field. There is no
 way for the library to recover from this error.</big></p>
 <!-- INDENTATION -->
-<p><big><b>TIFF directory is missing requred
+<p><big><b>TIFF directory is missing required
 &quot;PlanarConfig&quot; field</b>. The image violates the
 specification by not having a necessary field. There is no
 way for the library to recover from this error.</big></p>
 <!-- INDENTATION -->
-<p><big><b>TIFF directory is missing requred
+<p><big><b>TIFF directory is missing required
 &quot;StripOffsets&quot; field</b>. The image has multiple
 strips, but is missing the tag that specifies the file
 offset to each strip of data. There is no way for the
 library to recover from this error.</big></p>
 <!-- INDENTATION -->
-<p><big><b>TIFF directory is missing requred
+<p><big><b>TIFF directory is missing required
 &quot;TileOffsets&quot; field</b>. The image has multiple
 tiles, but is missing the tag that specifies the file offset
 to each tile of data. There is no way for the library to
index 9aff8c4..6483aa6 100644 (file)
@@ -69,7 +69,7 @@ have an established location in the file. It will rewrite
 the directory, but instead of place it at it&rsquo;s old
 location (as <i>TIFFWriteDirectory</i> would) it will place
 them at the end of the file, correcting the pointer from the
-preceeding directory or file header to point to it&rsquo;s
+preceding directory or file header to point to it&rsquo;s
 new location. This is particularly important in cases where
 the size of the directory and pointed to data has grown, so
 it won&rsquo;t fit in the space available at the old
index 39fa789..283be9b 100644 (file)
@@ -76,7 +76,7 @@ another memory location using <i>_TIFFmemcpy</i>, or
 compared for equality using <i>_TIFFmemcmp</i>. These
 routines conform to the equivalent <small>ANSI</small> C
 routines: <i>memset</i>, <i>memcpy</i>, and <i>memcmp</i>,
-repsectively.</p>
+respectively.</p>
 </td>
 </table>
 <a name="DIAGNOSTICS"></a>
index 78f4698..67da683 100644 (file)
@@ -49,7 +49,7 @@ From <A HREF=http://burnallgifs.org>Burn All GIF's Day</a>:
 Unisys license to use LZW in free software that complies with the Open
 Source Definition</em>
 <P>
-Unfortunatly, the removal of LZW compression means that saved image size has
+Unfortunately, the removal of LZW compression means that saved image size has
 grown dramatically.  Without a change in the TIFF spec to support
 another lossless compression format, this is unavoidable.
 <P>
index 96f4791..d4285a8 100644 (file)
@@ -200,7 +200,7 @@ that corrects behaviour for non-Letter paper
 sizes. (Bug 35) It fixes two problems:
 <br>
        Without scaling (-S) the fax is now centered on the page size specified
-       with -H and/or -W. Before, fax2ps was using an obscure and practially
+       with -H and/or -W. Before, fax2ps was using an obscure and practically
        useless algorithm to allocate the image relative to Letter sized paper
        which sometime sled to useless whitespace on the paper, while at the
        same time cutting of the faxes printable area at the opposite border.
index c53cd15..affbe09 100644 (file)
@@ -64,12 +64,12 @@ TIFFDirectory structure would changing, breaking any dynamically linked
 software that used the private data structures.<p>
 
 Also, any tag not recognised
-by libtiff would not be read and accessable to applications without some
+by libtiff would not be read and accessible to applications without some
 fairly complicated work on the applications part to pre-register the tags
 as exemplified by the support for "Geo"TIFF tags by libgeotiff layered on
 libtiff.  <p>
 
-Amoung other things this approach required the extension code
+Among other things this approach required the extension code
 to access the private libtiff structures ... which made the higher level
 non-libtiff code be locked into a specific version of libtiff at compile time.
 This caused no end of bug reports!<p>
index 3d6d838..3e4e3fb 100644 (file)
@@ -116,7 +116,7 @@ Patch supplied by Ross Finlayson.
 it was done in 3.6.0).
 
 <li> libtiff/{tiff.h, tif_dirinfo.c}: Added support for IFD (13) datatype,
-intruduced in "Adobe PageMaker TIFF Technical Notes".
+introduced in "Adobe PageMaker TIFF Technical Notes".
 
 <li> libtiff/{tif_color.c, tif_getimage.c, tiffio.h}: New color space
 conversion code: CIE L*a*b* 1976 images now supported by the TIFFRGBAImage
index 45347b7..1fa4cc8 100644 (file)
@@ -46,7 +46,7 @@ The following information is located here:
 
 <UL>
 
-       <li> Maintainance release. Many bugfixes in the build environment
+       <li> Maintenance release. Many bugfixes in the build environment
        and compatibility improvements.
 
 </UL>
index 28981ae..771e190 100644 (file)
@@ -45,7 +45,7 @@ The following information is located here:
 <A NAME="highlights"><B><FONT SIZE=+3>M</FONT>AJOR CHANGES:</B></A>
 
 <UL>
-       <li> Replace runtime endianess check with the compile time one.
+       <li> Replace runtime endianness check with the compile time one.
 
        <li> Added support for the new predictor type (floating point
        predictor), defined at the TIFF Technical Note 3.
diff --git a/html/v4.0.10.html b/html/v4.0.10.html
new file mode 100644 (file)
index 0000000..f1b6b00
--- /dev/null
@@ -0,0 +1,326 @@
+<HTML>
+<HEAD>
+<TITLE>
+        Changes in TIFF v4.0.10
+</TITLE>
+<STYLE>
+table, th, td {
+    border: 1px solid black;
+    border-collapse: collapse;
+}
+th, td {
+    padding: 8pt;
+    text-align: center;
+}
+th {
+    text-align: center;
+}
+td {
+    text-align: center;
+}
+
+ul li {
+    padding: 3pt;
+}
+
+ul.a {
+    list-style-type: circle;
+}
+
+ul.b {
+    list-style-type: square;
+}
+
+ol.c {
+    list-style-type: upper-roman;
+}
+
+ol.d {
+    list-style-type: lower-alpha;
+}
+
+</STYLE>
+</HEAD>
+
+<BODY BGCOLOR=white>
+<FONT FACE="Helvetica, Arial, Sans">
+
+<BASEFONT SIZE=4>
+<B><FONT SIZE=+3>T</FONT>IFF <FONT SIZE=+2>C</FONT>HANGE <FONT SIZE=+2>I</FONT>NFORMATION</B>
+<BASEFONT SIZE=3>
+
+<UL>
+<HR SIZE=4 WIDTH=65% ALIGN=left>
+<B>Current Version</B>: v4.0.10<BR>
+<B>Previous Version</B>: <A HREF=v4.0.9.html>v4.0.9</a><BR>
+<B>Master FTP Site</B>: <A HREF="ftp://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff</A><BR>
+<B>Master HTTP Site #1</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+http://www.simplesystems.org/libtiff/</a><BR>
+<B>Master HTTP Site #2</B>: <A HREF="http://libtiff.maptools.org/">
+http://libtiff.maptools.org/</a>
+<HR SIZE=4 WIDTH=65% ALIGN=left>
+</UL>
+
+<P>
+This document describes the changes made to the software between the
+<I>previous</I> and <I>current</I> versions (see above).  If you don't
+find something listed here, then it was not done in this timeframe, or
+it was not considered important enough to be mentioned.  The following
+information is located here:
+<UL>
+<LI><A HREF="#highlights">Major Changes</A>
+<LI><A HREF="#configure">Changes in the software configuration</A>
+<LI><A HREF="#libtiff">Changes in libtiff</A>
+<LI><A HREF="#tools">Changes in the tools</A>
+<LI><A HREF="#contrib">Changes in the contrib area</A>
+</UL>
+<p>
+<P><HR WIDTH=65% ALIGN=left>
+
+<!--------------------------------------------------------------------------->
+
+<A NAME="highlights"><B><FONT SIZE=+3>M</FONT>AJOR CHANGES:</B></A>
+
+<UL>
+
+  <LI> The libtiff source repository is changed from CVS to Git and the master libtiff source repository is now at <A HREF="https://gitlab.com/libtiff/libtiff">Gitlab</A>.  This is the first release to be made from the new Git repository.</LI>
+
+</UL>
+
+
+<P><HR WIDTH=65% ALIGN=left>
+<!--------------------------------------------------------------------------->
+
+<A NAME="configure"><B><FONT SIZE=+3>C</FONT>HANGES IN THE SOFTWARE CONFIGURATION:</B></A>
+
+<UL>
+
+  <LI>Minimum CMake version is now v2.8.11 for the CMake-based build.</LI>
+
+  <LI>Libwebp will be automatically detected and used by configure/cmake if present.
+
+  <LI>Libzstd will be automatically detected and used by configure/cmake if present.
+
+
+</UL>
+
+<P><HR WIDTH=65% ALIGN=left>
+
+<!--------------------------------------------------------------------------->
+
+<A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A>
+
+<UL>
+
+  <LI>
+    <P>Added ZSTD compression codec.
+    <A HREF="https://github.com/facebook/zstd">Zstandard<A> or zstd as
+    short version, is a fast lossless compression algorithm, targeting
+    real-time compression scenarios at zlib-level and better
+    compression ratios. It's backed by a very fast entropy stage,
+    provided by Huff0 and FSE library.</P>
+
+    <P>We require libzstd >= 1.0.0 so as to be able to use streaming
+    compression and decompression methods.</P>
+
+    <P>The default compression level we have selected is 9 (range goes
+    from 1 to 22), which experimentally offers equivalent or better
+    compression ratio than the default deflate/ZIP level of 6, and
+    much faster compression.</P>
+
+    <P>For example on a 6600x4400 16bit image, tiffcp -c zip runs in
+    10.7 seconds, while tiffcp -c zstd runs in 5.3
+    seconds. Decompression time for zip is 840 ms, and for zstd 650
+    ms. File size is 42735936 for zip, and 42586822 for zstd. Similar
+    findings on other images.</P>
+
+    <P>On a 25894x16701 16bit image,</P>
+
+    <TABLE>
+      <TR><TH>Compressor</TH>   <TH>Compression time</TH>   <TH>Decompression time</TH>   <TH>File size</TH></TR>
+
+      <TR><TD>ZSTD</TD>         <TD>35 s</TD>               <TD>3.2 s</TD>                <TD>399 700 498</TD></TR>
+      <TR><TD>ZIP/Deflate</TD>  <TD>1m 20 s</TD>            <TD>4.9 s </TD>               <TD>419 622 336</TD></TR>
+    </TABLE>
+
+    <P>Please note that COMPRESSION_ZSTD is self-assigned the id 50000
+    by the libtiff project and is not officially registered with Adobe
+    since Adobe's registration function is defunct.</P>
+  </LI>
+
+  <LI><P>Added WebP compression codec.
+
+    <A HREF="https://developers.google.com/speed/webp/">WebP</A> is
+    a high performance compressor intended for photos as commonly used
+    on the Web.  The WebP encoder is not designed for huge images, but
+    serves very well for compressing strips and tiles in TIFF as long
+    as the strips or tiles do not exceed the capability of the
+    encoder.</P>
+
+    <P>As a test of compression performance metrics, GraphicsMagick
+    was used on an extremely high quality 8-bit TIFF image from a
+    Hasselblad H4D-200MS camera with pixel dimensions of
+    16352x12264. The image was re-encoded with 1024x1024 tiles and
+    various compression algorithms, using default settings for each
+    algorithm.  Based on this test, the compression and decompression
+    performance (in iterations per second), the resulting file size,
+    and the calculated total PSNR are provided here.  It can be seen
+    that WebP provided excellent encode and decode performance, and
+    the compressed file size was very small:</P>
+
+    <TABLE>
+      <caption>Compressor Relative Performance</caption>
+      <TR><TH>Compressor</TH> <TH>Compression</TH>   <TH>Decompression</TH> <TH>File size</TH>  <TH>PSNR</TH></TR>
+
+
+      <TR><TD>None</TD>       <TD>0.536 iter/s</TD>  <TD>1.506 iter/s</TD>  <TD>576.03MiB</TD>    <TD>Inf</TD></TR>
+      <TR><TD>LZW</TD>        <TD>0.105 iter/s</TD>  <TD>0.266 iter/s</TD>  <TD>270.68MiB</TD>    <TD>Inf</TD></TR>
+      <TR><TD>ZStd</TD>       <TD>0.020 iter/s</TD>  <TD>0.518 iter/s</TD>  <TD>238.42MiB</TD>    <TD>Inf</TD></TR>
+      <TR><TD>LZMA</TD>       <TD>0.009 iter/s</TD>  <TD>0.056 iter/s</TD>  <TD>247.61MiB</TD>    <TD>Inf</TD></TR>
+      <TR><TD>ZIP</TD>        <TD>0.009 iter/s</TD>  <TD>0.301 iter/s</TD>  <TD>247.88MiB</TD>    <TD>Inf</TD></TR>
+      <TR><TD>JPEG</TD>       <TD>0.446 iter/s</TD>  <TD>0.760 iter/s</TD>  <TD>18.59MiB</TD>     <TD>39.00</TD></TR>
+      <TR><TD>WebP</TD>       <TD>0.019 iter/s</TD>  <TD>0.330 iter/s</TD>  <TD>9.38MiB</TD>      <TD>37.78</TD></TR>
+
+    </TABLE>
+
+    <P>Please note that COMPRESSION_WEBP is self-assigned the id 50001
+    by the libtiff project and is not officially registered with Adobe
+    since Adobe's registration function is defunct.</P>
+
+  </LI>
+
+  <LI>TIFFPrintDirectory(): fix null pointer dereference on corrupted
+  file. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2770">Bug
+  2770 - NULL Pointer Dereference in tiffinfo.c with crafted TIFF
+  image</A>.</LI>
+
+  <LI>_TIFFVGetField(): fix heap out-of-bounds access when requesting
+  TIFFTAG_NUMBEROFINKS on a EXIF
+  directory. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2765">Bug
+  2765 - Heap Out-Of-Bounds Memory Access - 68122422</A>. Reported by
+  Google Autofuzz project</LI>
+
+  <LI>Fix a memory leak in TIFFStreamOpen. TIFFStreamOpen allocates a
+  new tiff{o,i}s_data, but if TIFFClientOpen fails then that struct is
+  leaked.</LI>
+
+  <LI><P>Fix for bug 2772. It is possible to craft a TIFF document where
+  the IFD list is circular, leading to an infinite loop while
+  traversing the chain. The libtiff directory reader has a failsafe
+  that will break out of this loop after reading 65535 directory
+  entries, but it will continue processing, consuming time and
+  resources to process what is essentially a bogus TIFFdocument.</P>
+
+  <P>This change fixes the above behavior by breaking out of processing
+  when a TIFF document has >= 65535 directories and terminating with an
+  error.</P></LI>
+
+  <LI>ChopUpSingleUncompressedStrip: avoid memory exhaustion
+  (CVE-2017-11613).  In ChopUpSingleUncompressedStrip(), if the
+  computed number of strips is big enough and we are in read only
+  mode, validate that the file size is consistent with that number of
+  strips to avoid useless attempts at allocating a lot of memory for
+  the td_stripbytecount and td_stripoffset
+  arrays. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2724">Bug
+  2724 - memory exhaustion in ChopUpSingleUncompressedStrip</A></LI>
+
+  <LI>Port code: Add strtol, strtoll and strtoull. Also update
+  strtoul.  All use the same implementation from NetBSD libc.</LI>
+
+  <LI>Fix for CVE-2018-7456 "NULL pointer dereference in
+  TIFFPrintDirectory".</LI>
+
+  <LI>TIFFWriteDirectorySec: avoid
+  assertion. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2795">Bug
+  2795 - There is a reachable assertion abort in function
+  TIFFWriteDirectorySec() of libtiff 4.0.9. A crafted input will lead
+  to remote denial of attack. (CVE-2018-10963)</A>.</LI>
+
+  <LI>LZWDecodeCompat(): fix potential index-out-of-bounds
+  write. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2780">Bug
+  2780 - A heap-buffer-overflow in function LZWDecodeCompat in
+  libtiff4.0.9 (CVE-2018-8905)</A>. The fix consists in using the
+  similar code as LZWDecode() to validate we don't write outside of
+  the output buffer.</LI>
+
+  <LI><P>Remove builtin support for GUI warning and error message
+  boxes. Now warnings always go to the console by default unless
+  applications define their own warning and error handlers.</P>
+
+  <P>GUI applications (and Windows CE) are required to define such handlers.</P></LI>
+
+  <LI>Add tag and pseudo-tag definitions for ESRI LERC codec (out of
+  tree codec whose source is
+  at <A HREF="https://github.com/OSGeo/gdal/blob/master/gdal/frmts/gtiff/tif_lerc.c">
+      https://github.com/OSGeo/gdal/blob/master/gdal/frmts/gtiff/tif_lerc.c</A>).</LI>
+
+  <LI>Fix libtiff 4.0.8 regression when reading LZW-compressed strips with scanline API
+        Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2800">
+      Bug 2800 - Regression: Opening a tiff file with v4.0.9 gives an error with LZWDecode</A>.</LI>
+
+  <LI>TIFFSetupStrips(): avoid potential uint32 overflow on 32-bit
+  systems with large number of strips.  Probably relates
+  to <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2788">Bug
+  2788 - Heap Buffer Overflow in TIFFWriteScanline of tif_write.c
+  (CVE-2018-10779)</A></LI>
+
+  <LI>Fix out-of-bound read on some tiled images.</LI>
+
+  <LI>Avoid potential int32 overflows in multiply_ms().</LI>
+
+  <LI>Only read/write TIFFTAG_GROUP3OPTIONS or TIFFTAG_GROUP4OPTIONS
+  if compression is COMPRESSION_CCITTFAX3 or
+  COMPRESSION_CCITTFAX4.</LI>
+
+  <LI>JBIG: fix potential out-of-bounds write in JBIGDecode(). Also
+  fix a (harmless) potential use of uninitialized memory when
+  tif->tif_rawsize > tif->tif_rawcc. In case libtiff is compiled with
+  CHUNKY_STRIP_READ_SUPPORT, make sure that whole strip data is
+  provided to JBIGDecode().</LI>
+
+  <LI>LZMAPreEncode: emit verbose error if lzma_stream_encoder() fails
+  (typically because not enough memory available)</LI>
+
+
+</UL>
+
+<P><HR WIDTH=65% ALIGN=left>
+
+<!-------------------------------------------------------------------------->
+
+<A NAME="tools"><B><FONT SIZE=+3>C</FONT>HANGES IN THE TOOLS:</B></A>
+
+<UL>
+
+  <LI>tiff2pdf: Fix
+  CVE-2017-9935, <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2704">Bug
+  2704 - There is a heap based buffer overflow in the tiff2pdf tool of
+  the libtiff library. A crafted TIFF document can lead to a heap
+  based buffer overflow resulting in multiple damages.</A>.</LI>
+
+  <LI>pal2rgb: Add workaround to pal2rgb buffer overflow.</LI>
+
+  <LI>tiffset: Add support for LONG8, SLONG8 and IFD8 field types</LI>
+
+  <LI>tiff2bw: avoid null pointer dereference in case of out of memory
+  situation. Fixes <A HREF="http://bugzilla.maptools.org/show_bug.cgi?id=2819">Bug
+  2819 - There is a NULL pointer dereference at function LZWDecode in
+  libtiff 4.0.9 (CVE-2018-18661)</A></LI>
+
+</UL>
+
+<P><HR WIDTH=65% ALIGN=left>
+
+<!--------------------------------------------------------------------------->
+
+<A NAME="contrib"><B><FONT SIZE=+3>C</FONT>HANGES IN THE CONTRIB AREA:</B></A>
+
+<UL>
+
+  <LI> None</LI>
+
+</UL>
+
+</BODY>
+</HTML>
index 087dfa9..1cf1b75 100644 (file)
@@ -93,8 +93,10 @@ set(tiff_SOURCES
   tif_tile.c
   tif_version.c
   tif_warning.c
+  tif_webp.c
   tif_write.c
-  tif_zip.c)
+  tif_zip.c
+  tif_zstd.c)
 
 set(tiffxx_HEADERS
   tiffio.hxx)
@@ -110,12 +112,14 @@ else()
   list(APPEND tiff_SOURCES tif_unix.c)
 endif()
 
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
-                    ${CMAKE_CURRENT_BINARY_DIR}
-                    ${TIFF_INCLUDES})
-
 add_library(tiff ${tiff_SOURCES} ${tiff_HEADERS} ${nodist_tiff_HEADERS}
             ${tiff_port_SOURCES} libtiff.def)
+target_include_directories(tiff
+    PUBLIC
+        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+        $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
+        ${TIFF_INCLUDES}
+)
 target_link_libraries(tiff ${TIFF_LIBRARY_DEPS})
 set_target_properties(tiff PROPERTIES SOVERSION ${SO_COMPATVERSION})
 if(NOT CYGWIN)
@@ -138,7 +142,7 @@ install(TARGETS tiff
 install(FILES ${tiff_HEADERS} ${nodist_tiff_HEADERS}
         DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
 
-if(cxx)
+if(CXX_SUPPORT)
   add_library(tiffxx ${tiffxx_SOURCES} ${tiffxx_HEADERS})
   target_link_libraries(tiffxx tiff)
   set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})
index 9cbc5b1..14a250a 100644 (file)
@@ -98,8 +98,10 @@ libtiff_la_SOURCES = \
        tif_tile.c \
        tif_version.c \
        tif_warning.c \
+       tif_webp.c \
        tif_write.c \
-       tif_zip.c
+       tif_zip.c \
+       tif_zstd.c
 
 libtiffxx_la_SOURCES = \
        tif_stream.cxx
index 62fb7bc..a593fc2 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -136,10 +136,11 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__libtiffinclude_HEADERS_DIST) \
        $(noinst_HEADERS) $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = tif_config.h tiffconf.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -180,8 +181,8 @@ am__libtiff_la_SOURCES_DIST = tif_aux.c tif_close.c tif_codec.c \
        tif_lzma.c tif_lzw.c tif_next.c tif_ojpeg.c tif_open.c \
        tif_packbits.c tif_pixarlog.c tif_predict.c tif_print.c \
        tif_read.c tif_strip.c tif_swab.c tif_thunder.c tif_tile.c \
-       tif_version.c tif_warning.c tif_write.c tif_zip.c tif_win32.c \
-       tif_unix.c
+       tif_version.c tif_warning.c tif_webp.c tif_write.c tif_zip.c \
+       tif_zstd.c tif_win32.c tif_unix.c
 @WIN32_IO_TRUE@am__objects_1 = tif_win32.lo
 @WIN32_IO_FALSE@am__objects_2 = tif_unix.lo
 am_libtiff_la_OBJECTS = tif_aux.lo tif_close.lo tif_codec.lo \
@@ -193,7 +194,8 @@ am_libtiff_la_OBJECTS = tif_aux.lo tif_close.lo tif_codec.lo \
        tif_open.lo tif_packbits.lo tif_pixarlog.lo tif_predict.lo \
        tif_print.lo tif_read.lo tif_strip.lo tif_swab.lo \
        tif_thunder.lo tif_tile.lo tif_version.lo tif_warning.lo \
-       tif_write.lo tif_zip.lo $(am__objects_1) $(am__objects_2)
+       tif_webp.lo tif_write.lo tif_zip.lo tif_zstd.lo \
+       $(am__objects_1) $(am__objects_2)
 libtiff_la_OBJECTS = $(am_libtiff_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -208,7 +210,6 @@ libtiffxx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
        $(CXXFLAGS) $(libtiffxx_la_LDFLAGS) $(LDFLAGS) -o $@
 @HAVE_CXX_TRUE@am_libtiffxx_la_rpath = -rpath $(libdir)
-PROGRAMS = $(noinst_PROGRAMS)
 am_mkg3states_OBJECTS = mkg3states.$(OBJEXT)
 mkg3states_OBJECTS = $(am_mkg3states_OBJECTS)
 mkg3states_DEPENDENCIES = $(LIBPORT)
@@ -226,7 +227,30 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/mkg3states.Po \
+       ./$(DEPDIR)/tif_aux.Plo ./$(DEPDIR)/tif_close.Plo \
+       ./$(DEPDIR)/tif_codec.Plo ./$(DEPDIR)/tif_color.Plo \
+       ./$(DEPDIR)/tif_compress.Plo ./$(DEPDIR)/tif_dir.Plo \
+       ./$(DEPDIR)/tif_dirinfo.Plo ./$(DEPDIR)/tif_dirread.Plo \
+       ./$(DEPDIR)/tif_dirwrite.Plo ./$(DEPDIR)/tif_dumpmode.Plo \
+       ./$(DEPDIR)/tif_error.Plo ./$(DEPDIR)/tif_extension.Plo \
+       ./$(DEPDIR)/tif_fax3.Plo ./$(DEPDIR)/tif_fax3sm.Plo \
+       ./$(DEPDIR)/tif_flush.Plo ./$(DEPDIR)/tif_getimage.Plo \
+       ./$(DEPDIR)/tif_jbig.Plo ./$(DEPDIR)/tif_jpeg.Plo \
+       ./$(DEPDIR)/tif_jpeg_12.Plo ./$(DEPDIR)/tif_luv.Plo \
+       ./$(DEPDIR)/tif_lzma.Plo ./$(DEPDIR)/tif_lzw.Plo \
+       ./$(DEPDIR)/tif_next.Plo ./$(DEPDIR)/tif_ojpeg.Plo \
+       ./$(DEPDIR)/tif_open.Plo ./$(DEPDIR)/tif_packbits.Plo \
+       ./$(DEPDIR)/tif_pixarlog.Plo ./$(DEPDIR)/tif_predict.Plo \
+       ./$(DEPDIR)/tif_print.Plo ./$(DEPDIR)/tif_read.Plo \
+       ./$(DEPDIR)/tif_stream.Plo ./$(DEPDIR)/tif_strip.Plo \
+       ./$(DEPDIR)/tif_swab.Plo ./$(DEPDIR)/tif_thunder.Plo \
+       ./$(DEPDIR)/tif_tile.Plo ./$(DEPDIR)/tif_unix.Plo \
+       ./$(DEPDIR)/tif_version.Plo ./$(DEPDIR)/tif_warning.Plo \
+       ./$(DEPDIR)/tif_webp.Plo ./$(DEPDIR)/tif_win32.Plo \
+       ./$(DEPDIR)/tif_write.Plo ./$(DEPDIR)/tif_zip.Plo \
+       ./$(DEPDIR)/tif_zstd.Plo
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -298,8 +322,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/tif_config.h.in \
-       $(srcdir)/tiffconf.h.in $(top_srcdir)/config/depcomp \
-       $(top_srcdir)/config/mkinstalldirs
+       $(srcdir)/tiffconf.h.in $(top_srcdir)/config/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -476,8 +499,8 @@ libtiff_la_SOURCES = tif_aux.c tif_close.c tif_codec.c tif_color.c \
        tif_next.c tif_ojpeg.c tif_open.c tif_packbits.c \
        tif_pixarlog.c tif_predict.c tif_print.c tif_read.c \
        tif_strip.c tif_swab.c tif_thunder.c tif_tile.c tif_version.c \
-       tif_warning.c tif_write.c tif_zip.c $(am__append_3) \
-       $(am__append_5)
+       tif_warning.c tif_webp.c tif_write.c tif_zip.c tif_zstd.c \
+       $(am__append_3) $(am__append_5)
 libtiffxx_la_SOURCES = \
        tif_stream.cxx
 
@@ -513,8 +536,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -549,6 +572,15 @@ stamp-h2: $(srcdir)/tiffconf.h.in $(top_builddir)/config.status
 distclean-hdr:
        -rm -f tif_config.h stamp-h1 tiffconf.h stamp-h2
 
+clean-noinstPROGRAMS:
+       @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
        @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
@@ -590,15 +622,6 @@ libtiff.la: $(libtiff_la_OBJECTS) $(libtiff_la_DEPENDENCIES) $(EXTRA_libtiff_la_
 libtiffxx.la: $(libtiffxx_la_OBJECTS) $(libtiffxx_la_DEPENDENCIES) $(EXTRA_libtiffxx_la_DEPENDENCIES) 
        $(AM_V_CXXLD)$(libtiffxx_la_LINK) $(am_libtiffxx_la_rpath) $(libtiffxx_la_OBJECTS) $(libtiffxx_la_LIBADD) $(LIBS)
 
-clean-noinstPROGRAMS:
-       @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
-       echo " rm -f" $$list; \
-       rm -f $$list || exit $$?; \
-       test -n "$(EXEEXT)" || exit 0; \
-       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-       echo " rm -f" $$list; \
-       rm -f $$list
-
 mkg3states$(EXEEXT): $(mkg3states_OBJECTS) $(mkg3states_DEPENDENCIES) $(EXTRA_mkg3states_DEPENDENCIES) 
        @rm -f mkg3states$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(mkg3states_OBJECTS) $(mkg3states_LDADD) $(LIBS)
@@ -609,48 +632,56 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkg3states.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_aux.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_close.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_codec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_color.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_compress.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dir.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirinfo.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirread.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirwrite.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dumpmode.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_error.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_extension.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_fax3.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_fax3sm.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_flush.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_getimage.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jbig.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg_12.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_luv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzma.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzw.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_next.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_ojpeg.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_open.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_packbits.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_pixarlog.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_predict.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_print.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_read.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_stream.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_strip.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_swab.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_thunder.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_tile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_version.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_warning.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_win32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_write.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_zip.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkg3states.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_aux.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_close.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_codec.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_color.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_compress.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dir.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirinfo.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirread.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirwrite.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dumpmode.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_error.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_extension.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_fax3.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_fax3sm.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_flush.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_getimage.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jbig.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg_12.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_luv.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzma.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzw.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_next.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_ojpeg.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_open.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_packbits.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_pixarlog.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_predict.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_print.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_read.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_stream.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_strip.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_swab.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_thunder.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_tile.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_unix.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_version.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_warning.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_webp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_win32.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_write.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_zip.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_zstd.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -794,7 +825,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -826,7 +860,7 @@ distdir: $(DISTFILES)
        done
 check-am: all-am
 check: check-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) tif_config.h \
+all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(HEADERS) tif_config.h \
                tiffconf.h
 installdirs:
        for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libtiffincludedir)" "$(DESTDIR)$(libtiffincludedir)"; do \
@@ -868,7 +902,50 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
        clean-noinstPROGRAMS mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/mkg3states.Po
+       -rm -f ./$(DEPDIR)/tif_aux.Plo
+       -rm -f ./$(DEPDIR)/tif_close.Plo
+       -rm -f ./$(DEPDIR)/tif_codec.Plo
+       -rm -f ./$(DEPDIR)/tif_color.Plo
+       -rm -f ./$(DEPDIR)/tif_compress.Plo
+       -rm -f ./$(DEPDIR)/tif_dir.Plo
+       -rm -f ./$(DEPDIR)/tif_dirinfo.Plo
+       -rm -f ./$(DEPDIR)/tif_dirread.Plo
+       -rm -f ./$(DEPDIR)/tif_dirwrite.Plo
+       -rm -f ./$(DEPDIR)/tif_dumpmode.Plo
+       -rm -f ./$(DEPDIR)/tif_error.Plo
+       -rm -f ./$(DEPDIR)/tif_extension.Plo
+       -rm -f ./$(DEPDIR)/tif_fax3.Plo
+       -rm -f ./$(DEPDIR)/tif_fax3sm.Plo
+       -rm -f ./$(DEPDIR)/tif_flush.Plo
+       -rm -f ./$(DEPDIR)/tif_getimage.Plo
+       -rm -f ./$(DEPDIR)/tif_jbig.Plo
+       -rm -f ./$(DEPDIR)/tif_jpeg.Plo
+       -rm -f ./$(DEPDIR)/tif_jpeg_12.Plo
+       -rm -f ./$(DEPDIR)/tif_luv.Plo
+       -rm -f ./$(DEPDIR)/tif_lzma.Plo
+       -rm -f ./$(DEPDIR)/tif_lzw.Plo
+       -rm -f ./$(DEPDIR)/tif_next.Plo
+       -rm -f ./$(DEPDIR)/tif_ojpeg.Plo
+       -rm -f ./$(DEPDIR)/tif_open.Plo
+       -rm -f ./$(DEPDIR)/tif_packbits.Plo
+       -rm -f ./$(DEPDIR)/tif_pixarlog.Plo
+       -rm -f ./$(DEPDIR)/tif_predict.Plo
+       -rm -f ./$(DEPDIR)/tif_print.Plo
+       -rm -f ./$(DEPDIR)/tif_read.Plo
+       -rm -f ./$(DEPDIR)/tif_stream.Plo
+       -rm -f ./$(DEPDIR)/tif_strip.Plo
+       -rm -f ./$(DEPDIR)/tif_swab.Plo
+       -rm -f ./$(DEPDIR)/tif_thunder.Plo
+       -rm -f ./$(DEPDIR)/tif_tile.Plo
+       -rm -f ./$(DEPDIR)/tif_unix.Plo
+       -rm -f ./$(DEPDIR)/tif_version.Plo
+       -rm -f ./$(DEPDIR)/tif_warning.Plo
+       -rm -f ./$(DEPDIR)/tif_webp.Plo
+       -rm -f ./$(DEPDIR)/tif_win32.Plo
+       -rm -f ./$(DEPDIR)/tif_write.Plo
+       -rm -f ./$(DEPDIR)/tif_zip.Plo
+       -rm -f ./$(DEPDIR)/tif_zstd.Plo
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-hdr distclean-tags
@@ -915,7 +992,50 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/mkg3states.Po
+       -rm -f ./$(DEPDIR)/tif_aux.Plo
+       -rm -f ./$(DEPDIR)/tif_close.Plo
+       -rm -f ./$(DEPDIR)/tif_codec.Plo
+       -rm -f ./$(DEPDIR)/tif_color.Plo
+       -rm -f ./$(DEPDIR)/tif_compress.Plo
+       -rm -f ./$(DEPDIR)/tif_dir.Plo
+       -rm -f ./$(DEPDIR)/tif_dirinfo.Plo
+       -rm -f ./$(DEPDIR)/tif_dirread.Plo
+       -rm -f ./$(DEPDIR)/tif_dirwrite.Plo
+       -rm -f ./$(DEPDIR)/tif_dumpmode.Plo
+       -rm -f ./$(DEPDIR)/tif_error.Plo
+       -rm -f ./$(DEPDIR)/tif_extension.Plo
+       -rm -f ./$(DEPDIR)/tif_fax3.Plo
+       -rm -f ./$(DEPDIR)/tif_fax3sm.Plo
+       -rm -f ./$(DEPDIR)/tif_flush.Plo
+       -rm -f ./$(DEPDIR)/tif_getimage.Plo
+       -rm -f ./$(DEPDIR)/tif_jbig.Plo
+       -rm -f ./$(DEPDIR)/tif_jpeg.Plo
+       -rm -f ./$(DEPDIR)/tif_jpeg_12.Plo
+       -rm -f ./$(DEPDIR)/tif_luv.Plo
+       -rm -f ./$(DEPDIR)/tif_lzma.Plo
+       -rm -f ./$(DEPDIR)/tif_lzw.Plo
+       -rm -f ./$(DEPDIR)/tif_next.Plo
+       -rm -f ./$(DEPDIR)/tif_ojpeg.Plo
+       -rm -f ./$(DEPDIR)/tif_open.Plo
+       -rm -f ./$(DEPDIR)/tif_packbits.Plo
+       -rm -f ./$(DEPDIR)/tif_pixarlog.Plo
+       -rm -f ./$(DEPDIR)/tif_predict.Plo
+       -rm -f ./$(DEPDIR)/tif_print.Plo
+       -rm -f ./$(DEPDIR)/tif_read.Plo
+       -rm -f ./$(DEPDIR)/tif_stream.Plo
+       -rm -f ./$(DEPDIR)/tif_strip.Plo
+       -rm -f ./$(DEPDIR)/tif_swab.Plo
+       -rm -f ./$(DEPDIR)/tif_thunder.Plo
+       -rm -f ./$(DEPDIR)/tif_tile.Plo
+       -rm -f ./$(DEPDIR)/tif_unix.Plo
+       -rm -f ./$(DEPDIR)/tif_version.Plo
+       -rm -f ./$(DEPDIR)/tif_warning.Plo
+       -rm -f ./$(DEPDIR)/tif_webp.Plo
+       -rm -f ./$(DEPDIR)/tif_win32.Plo
+       -rm -f ./$(DEPDIR)/tif_write.Plo
+       -rm -f ./$(DEPDIR)/tif_zip.Plo
+       -rm -f ./$(DEPDIR)/tif_zstd.Plo
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -937,16 +1057,17 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-libtiffincludeHEADERS \
 
 .MAKE: all install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-       clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \
-       cscopelist-am ctags ctags-am distclean distclean-compile \
-       distclean-generic distclean-hdr distclean-libtool \
-       distclean-tags distdir dvi dvi-am html html-am info info-am \
-       install install-am install-data install-data-am install-dvi \
-       install-dvi-am install-exec install-exec-am install-html \
-       install-html-am install-info install-info-am \
-       install-libLTLIBRARIES install-libtiffincludeHEADERS \
-       install-man install-nodist_libtiffincludeHEADERS install-pdf \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-generic clean-libLTLIBRARIES clean-libtool \
+       clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+       distclean-compile distclean-generic distclean-hdr \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-html install-html-am install-info \
+       install-info-am install-libLTLIBRARIES \
+       install-libtiffincludeHEADERS install-man \
+       install-nodist_libtiffincludeHEADERS install-pdf \
        install-pdf-am install-ps install-ps-am install-strip \
        installcheck installcheck-am installdirs maintainer-clean \
        maintainer-clean-generic mostlyclean mostlyclean-compile \
index b730915..5aac331 100644 (file)
@@ -1,5 +1,3 @@
-# $Id: Makefile.vc,v 1.23 2015-08-19 02:31:04 bfriesen Exp $
-#
 # Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
 #
 # Permission to use, copy, modify, distribute, and sell this software and 
index cb6a7cc..af3daac 100644 (file)
@@ -1,5 +1,3 @@
-# $Id: SConstruct,v 1.4 2007/02/24 15:03:50 dron Exp $
-
 # Tag Image File Format (TIFF) Software
 #
 # Copyright (C) 2005, Andrey Kiselev <dron@ak4719.spb.edu>
index 16ad3c2..54fc059 100644 (file)
@@ -1,5 +1,3 @@
-/* "$Id: mkg3states.c,v 1.12 2015-06-21 01:09:09 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1991-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index b908f54..fb0951a 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: t4.h,v 1.3 2010-03-10 18:56:48 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 10b8d00..4ece162 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_aux.c,v 1.31 2017-11-17 20:21:00 erouault Exp $ */
-
 /*
  * Copyright (c) 1991-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index a0cb661..e4228df 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_close.c,v 1.21 2016-01-23 21:20:34 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 7cb46f6..b6c04f0 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_codec.c,v 1.17 2015-08-19 02:31:04 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -72,6 +70,12 @@ static int NotConfigured(TIFF*, int);
 #ifndef LZMA_SUPPORT
 #define TIFFInitLZMA NotConfigured
 #endif
+#ifndef ZSTD_SUPPORT
+#define TIFFInitZSTD NotConfigured
+#endif
+#ifndef WEBP_SUPPORT
+#define TIFFInitWebP NotConfigured
+#endif
 
 /*
  * Compression schemes statically built into the library.
@@ -99,6 +103,8 @@ TIFFCodec _TIFFBuiltinCODECS[] = {
     { "SGILog",                COMPRESSION_SGILOG,     TIFFInitSGILog },
     { "SGILog24",      COMPRESSION_SGILOG24,   TIFFInitSGILog },
     { "LZMA",          COMPRESSION_LZMA,       TIFFInitLZMA },
+    { "ZSTD",          COMPRESSION_ZSTD,       TIFFInitZSTD },
+    { "WEBP",          COMPRESSION_WEBP,       TIFFInitWebP },
     { NULL,             0,                      NULL }
 };
 
index 71cafcd..8fae40e 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_color.c,v 1.24 2017-05-29 10:12:54 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -168,7 +166,7 @@ TIFFCIELabToRGBInit(TIFFCIELabToRGB* cielab,
 }
 
 /* 
- * Convert color value from the YCbCr space to CIE XYZ.
+ * Convert color value from the YCbCr space to RGB.
  * The colorspace conversion algorithm comes from the IJG v5a code;
  * see below for more information on how it works.
  */
index b571d19..8130ef0 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_compress.c,v 1.25 2016-10-25 20:04:22 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index de0f3a3..2414460 100644 (file)
@@ -26,9 +26,6 @@
 /* Define to 1 if you have the <fcntl.h> header file. */
 #cmakedefine HAVE_FCNTL_H 1
 
-/* Define to 1 if you have the `floor' function. */
-#cmakedefine HAVE_FLOOR 1
-
 /* Define to 1 if you have the `getopt' function. */
 #cmakedefine HAVE_GETOPT 1
 
 /* Define to 1 if you have the <io.h> header file. */
 #cmakedefine HAVE_IO_H 1
 
-/* Define to 1 if you have the `isascii' function. */
-#cmakedefine HAVE_ISASCII 1
-
 /* Define to 1 if you have the `jbg_newlen' function. */
 #cmakedefine HAVE_JBG_NEWLEN 1
 
 /* Define to 1 if you have the `lfind' function. */
 #cmakedefine HAVE_LFIND 1
 
-/* Define to 1 if you have the <limits.h> header file. */
-#cmakedefine HAVE_LIMITS_H 1
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#cmakedefine HAVE_MALLOC_H 1
-
-/* Define to 1 if you have the `memmove' function. */
-#cmakedefine HAVE_MEMMOVE 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#cmakedefine HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `memset' function. */
-#cmakedefine HAVE_MEMSET 1
-
 /* Define to 1 if you have the `mmap' function. */
 #cmakedefine HAVE_MMAP 1
 
@@ -83,9 +62,6 @@
 /* Define to 1 if you have the <OpenGL/gl.h> header file. */
 #cmakedefine HAVE_OPENGL_GL_H 1
 
-/* Define to 1 if you have the `pow' function. */
-#cmakedefine HAVE_POW 1
-
 /* Define to 1 if you have the <search.h> header file. */
 #cmakedefine HAVE_SEARCH_H 1
 
 /* Define to 1 if you have the `snprintf' function. */
 #cmakedefine HAVE_SNPRINTF 1
 
-/* Define to 1 if you have the `sqrt' function. */
-#cmakedefine HAVE_SQRT 1
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #cmakedefine HAVE_STDINT_H 1
 
 /* Define to 1 if you have the `strcasecmp' function. */
 #cmakedefine HAVE_STRCASECMP 1
 
-/* Define to 1 if you have the `strchr' function. */
-#cmakedefine HAVE_STRCHR 1
-
 /* Define to 1 if you have the <strings.h> header file. */
 #cmakedefine HAVE_STRINGS_H 1
 
 /* Define to 1 if you have the <string.h> header file. */
 #cmakedefine HAVE_STRING_H 1
 
-/* Define to 1 if you have the `strrchr' function. */
-#cmakedefine HAVE_STRRCHR 1
-
-/* Define to 1 if you have the `strstr' function. */
-#cmakedefine HAVE_STRSTR 1
-
 /* Define to 1 if you have the `strtol' function. */
 #cmakedefine HAVE_STRTOL 1
 
+/* Define to 1 if you have the `strtoll' function. */
+#cmakedefine HAVE_STRTOLL 1
+
 /* Define to 1 if you have the `strtoul' function. */
 #cmakedefine HAVE_STRTOUL 1
 
 /* Support LZMA2 compression */
 #cmakedefine LZMA_SUPPORT 1
 
+/* Support ZSTD compression */
+#cmakedefine ZSTD_SUPPORT 1
+
+/* Support WEBP compression */
+#cmakedefine WEBP_SUPPORT 1
+
 /* Name of package */
 #define PACKAGE "@PACKAGE_NAME@"
 
 /* The size of `signed long long', as computed by sizeof. */
 #define SIZEOF_SIGNED_LONG_LONG @SIZEOF_SIGNED_LONG_LONG@
 
-/* The size of `signed short', as computed by sizeof. */
-#define SIZEOF_SIGNED_SHORT @SIZEOF_SIGNED_SHORT@
-
 /* The size of `unsigned char *', as computed by sizeof. */
 #define SIZEOF_UNSIGNED_CHAR_P @SIZEOF_UNSIGNED_CHAR_P@
 
index a4b2e60..eae07aa 100644 (file)
@@ -37,9 +37,6 @@
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
-/* Define to 1 if you have the `floor' function. */
-#undef HAVE_FLOOR
-
 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
 #undef HAVE_FSEEKO
 
    machine */
 #undef HAVE_IEEEFP
 
-/* Define to 1 if the system has the type `int16'. */
-#undef HAVE_INT16
-
-/* Define to 1 if the system has the type `int32'. */
-#undef HAVE_INT32
-
-/* Define to 1 if the system has the type `int8'. */
-#undef HAVE_INT8
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
 /* Define to 1 if you have the <io.h> header file. */
 #undef HAVE_IO_H
 
-/* Define to 1 if you have the `isascii' function. */
-#undef HAVE_ISASCII
-
 /* Define to 1 if you have the `jbg_newlen' function. */
 #undef HAVE_JBG_NEWLEN
 
 /* Define to 1 if you have the `lfind' function. */
 #undef HAVE_LFIND
 
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
 /* Define to 1 if you have the `mmap' function. */
 #undef HAVE_MMAP
 
 /* Define to 1 if you have the <OpenGL/gl.h> header file. */
 #undef HAVE_OPENGL_GL_H
 
-/* Define to 1 if you have the `pow' function. */
-#undef HAVE_POW
-
 /* Define if you have POSIX threads libraries and header files. */
 #undef HAVE_PTHREAD
 
 /* Define to 1 if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
-/* Define to 1 if you have the `sqrt' function. */
-#undef HAVE_SQRT
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
 /* Define to 1 if you have the `strcasecmp' function. */
 #undef HAVE_STRCASECMP
 
-/* Define to 1 if you have the `strchr' function. */
-#undef HAVE_STRCHR
-
 /* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H
 
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
-/* Define to 1 if you have the `strrchr' function. */
-#undef HAVE_STRRCHR
-
-/* Define to 1 if you have the `strstr' function. */
-#undef HAVE_STRSTR
-
 /* Define to 1 if you have the `strtol' function. */
 #undef HAVE_STRTOL
 
+/* Define to 1 if you have the `strtoll' function. */
+#undef HAVE_STRTOLL
+
 /* Define to 1 if you have the `strtoul' function. */
 #undef HAVE_STRTOUL
 
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
 /* The size of `signed long long', as computed by sizeof. */
 #undef SIZEOF_SIGNED_LONG_LONG
 
-/* The size of `signed short', as computed by sizeof. */
-#undef SIZEOF_SIGNED_SHORT
-
 /* The size of `size_t', as computed by sizeof. */
 #undef SIZEOF_SIZE_T
 
 /* The size of `unsigned long long', as computed by sizeof. */
 #undef SIZEOF_UNSIGNED_LONG_LONG
 
-/* The size of `unsigned short', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_SHORT
-
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
 /* Version number of package */
 #undef VERSION
 
+/* Support webp compression */
+#undef WEBP_SUPPORT
+
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
 #if defined AC_APPLE_UNIVERSAL_BUILD
 /* Support Deflate compression */
 #undef ZIP_SUPPORT
 
+/* Support zstd compression */
+#undef ZSTD_SUPPORT
+
 /* Enable large inode numbers on Mac OS X 10.5.  */
 #ifndef _DARWIN_USE_64_BIT_INODE
 # define _DARWIN_USE_64_BIT_INODE 1
index 94e92bb..e85e2e6 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_config.wince.h,v 1.3 2010-03-10 18:56:48 bfriesen Exp $ */
-
 /*
  * TIFF library configuration header for Windows CE platform.
  */
index f00f808..6f0b487 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_dir.c,v 1.131 2017-07-11 21:38:04 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -863,14 +861,24 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
        const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY);
        if( fip == NULL ) /* cannot happen since TIFFGetField() already checks it */
            return 0;
+
+       /*
+        * We want to force the custom code to be used for custom
+        * fields even if the tag happens to match a well known 
+        * one - important for reinterpreted handling of standard
+        * tag values in custom directories (i.e. EXIF) 
+        */
+       if (fip->field_bit == FIELD_CUSTOM) {
+               standard_tag = 0;
+       }
        
-        if( tag == TIFFTAG_NUMBEROFINKS )
+        if( standard_tag == TIFFTAG_NUMBEROFINKS )
         {
             int i;
             for (i = 0; i < td->td_customValueCount; i++) {
                 uint16 val;
                 TIFFTagValue *tv = td->td_customValues + i;
-                if (tv->info->field_tag != tag)
+                if (tv->info->field_tag != standard_tag)
                     continue;
                 if( tv->value == NULL )
                     return 0;
@@ -892,16 +900,6 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
             return 0;
         }
 
-       /*
-        * We want to force the custom code to be used for custom
-        * fields even if the tag happens to match a well known 
-        * one - important for reinterpreted handling of standard
-        * tag values in custom directories (i.e. EXIF) 
-        */
-       if (fip->field_bit == FIELD_CUSTOM) {
-               standard_tag = 0;
-       }
-
        switch (standard_tag) {
                case TIFFTAG_SUBFILETYPE:
                        *va_arg(ap, uint32*) = td->td_subfiletype;
@@ -1067,6 +1065,9 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
                        if (td->td_samplesperpixel - td->td_extrasamples > 1) {
                                *va_arg(ap, uint16**) = td->td_transferfunction[1];
                                *va_arg(ap, uint16**) = td->td_transferfunction[2];
+                       } else {
+                               *va_arg(ap, uint16**) = NULL;
+                               *va_arg(ap, uint16**) = NULL;
                        }
                        break;
                case TIFFTAG_REFERENCEBLACKWHITE:
index 5a38076..b2f5e69 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_dir.h,v 1.55 2017-06-01 12:44:04 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 
 #ifndef _TIFFDIR_
 #define        _TIFFDIR_
+
+#include "tiff.h"
+#include "tiffio.h"
+
 /*
  * ``Library-private'' Directory-related Definitions.
  */
index 4904f54..e1f6b23 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_dirinfo.c,v 1.127 2017-06-01 12:44:04 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -979,6 +977,8 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
            case TIFFTAG_CONSECUTIVEBADFAXLINES:
            case TIFFTAG_GROUP3OPTIONS:
            case TIFFTAG_GROUP4OPTIONS:
+           /* LERC */
+           case TIFFTAG_LERC_PARAMETERS:
                break;
            default:
                return 1;
@@ -1054,7 +1054,18 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
                if (tag == TIFFTAG_PREDICTOR)
                    return 1;
                break;
-
+           case COMPRESSION_ZSTD:
+               if (tag == TIFFTAG_PREDICTOR)
+                   return 1;
+               break;
+           case COMPRESSION_LERC:
+               if (tag == TIFFTAG_LERC_PARAMETERS)
+                   return 1;
+               break;
+                 case COMPRESSION_WEBP:
+               if (tag == TIFFTAG_PREDICTOR)
+                               return 1;
+               break;
        }
        return 0;
 }
index 5e62e81..e80a3b1 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_dirread.c,v 1.218 2017-09-09 21:44:42 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -167,6 +165,7 @@ static int TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uin
 static int TIFFFetchSubjectDistance(TIFF*, TIFFDirEntry*);
 static void ChopUpSingleUncompressedStrip(TIFF*);
 static uint64 TIFFReadUInt64(const uint8 *value);
+static int _TIFFGetMaxColorChannels(uint16 photometric);
 
 static int _TIFFFillStrilesInternal( TIFF *tif, int loadStripByteCount );
 
@@ -776,7 +775,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF* tif, TIFFDirEntry* di
 static enum TIFFReadDirEntryErr TIFFReadDirEntryDataAndRealloc(
                     TIFF* tif, uint64 offset, tmsize_t size, void** pdest)
 {
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
         tmsize_t threshold = INITIAL_THRESHOLD;
 #endif
         tmsize_t already_read = 0;
@@ -797,7 +796,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryDataAndRealloc(
             void* new_dest;
             tmsize_t bytes_read;
             tmsize_t to_read = size - already_read;
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
             if( to_read >= threshold && threshold < MAX_THRESHOLD )
             {
                 to_read = threshold;
@@ -3507,6 +3506,35 @@ static void TIFFReadDirEntryOutputErr(TIFF* tif, enum TIFFReadDirEntryErr err, c
 }
 
 /*
+ * Return the maximum number of color channels specified for a given photometric
+ * type. 0 is returned if photometric type isn't supported or no default value
+ * is defined by the specification.
+ */
+static int _TIFFGetMaxColorChannels( uint16 photometric )
+{
+    switch (photometric) {
+       case PHOTOMETRIC_PALETTE:
+       case PHOTOMETRIC_MINISWHITE:
+       case PHOTOMETRIC_MINISBLACK:
+            return 1;
+       case PHOTOMETRIC_YCBCR:
+       case PHOTOMETRIC_RGB:
+       case PHOTOMETRIC_CIELAB:
+       case PHOTOMETRIC_LOGLUV:
+       case PHOTOMETRIC_ITULAB:
+       case PHOTOMETRIC_ICCLAB:
+            return 3;
+       case PHOTOMETRIC_SEPARATED:
+       case PHOTOMETRIC_MASK:
+            return 4;
+       case PHOTOMETRIC_LOGL:
+       case PHOTOMETRIC_CFA:
+       default:
+            return 0;
+    }
+}
+
+/*
  * Read the next TIFF directory from a file and convert it to the internal
  * format. We read directories sequentially.
  */
@@ -3522,6 +3550,7 @@ TIFFReadDirectory(TIFF* tif)
        uint32 fii=FAILED_FII;
         toff_t nextdiroff;
     int bitspersample_read = FALSE;
+        int color_channels;
 
        tif->tif_diroff=tif->tif_nextdiroff;
        if (!TIFFCheckDirOffset(tif,tif->tif_nextdiroff))
@@ -4026,6 +4055,37 @@ TIFFReadDirectory(TIFF* tif)
                        }
                }
        }
+
+       /*
+        * Make sure all non-color channels are extrasamples.
+        * If it's not the case, define them as such.
+        */
+        color_channels = _TIFFGetMaxColorChannels(tif->tif_dir.td_photometric);
+        if (color_channels && tif->tif_dir.td_samplesperpixel - tif->tif_dir.td_extrasamples > color_channels) {
+                uint16 old_extrasamples;
+                uint16 *new_sampleinfo;
+
+                TIFFWarningExt(tif->tif_clientdata,module, "Sum of Photometric type-related "
+                    "color channels and ExtraSamples doesn't match SamplesPerPixel. "
+                    "Defining non-color channels as ExtraSamples.");
+
+                old_extrasamples = tif->tif_dir.td_extrasamples;
+                tif->tif_dir.td_extrasamples = (uint16) (tif->tif_dir.td_samplesperpixel - color_channels);
+
+                // sampleinfo should contain information relative to these new extra samples
+                new_sampleinfo = (uint16*) _TIFFcalloc(tif->tif_dir.td_extrasamples, sizeof(uint16));
+                if (!new_sampleinfo) {
+                    TIFFErrorExt(tif->tif_clientdata, module, "Failed to allocate memory for "
+                                "temporary new sampleinfo array (%d 16 bit elements)",
+                                tif->tif_dir.td_extrasamples);
+                    goto bad;
+                }
+
+                memcpy(new_sampleinfo, tif->tif_dir.td_sampleinfo, old_extrasamples * sizeof(uint16));
+                _TIFFsetShortArray(&tif->tif_dir.td_sampleinfo, new_sampleinfo, tif->tif_dir.td_extrasamples);
+                _TIFFfree(new_sampleinfo);
+        }
+
        /*
         * Verify Palette image has a Colormap.
         */
@@ -4881,17 +4941,18 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
                                err=TIFFReadDirEntryByteArray(tif,dp,&data);
                                if (err==TIFFReadDirEntryErrOk)
                                {
-                                       uint8* ma;
-                                       uint32 mb;
+                                       uint32 mb = 0;
                                        int n;
-                                       ma=data;
-                                       mb=0;
-                                       while (mb<(uint32)dp->tdir_count)
+                                       if (data != NULL)
                                        {
-                                               if (*ma==0)
-                                                       break;
-                                               ma++;
-                                               mb++;
+                                           uint8* ma = data;
+                                           while (mb<(uint32)dp->tdir_count)
+                                           {
+                                                   if (*ma==0)
+                                                           break;
+                                                   ma++;
+                                                   mb++;
+                                           }
                                        }
                                        if (mb+1<(uint32)dp->tdir_count)
                                                TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" contains null byte in value; value incorrectly truncated during reading due to implementation limitations",fip->field_name);
@@ -5141,11 +5202,11 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
                                        if (err==TIFFReadDirEntryErrOk)
                                        {
                                                int m;
-                        if( dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
-                        {
-                            TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
-                            data[dp->tdir_count-1] = '\0';
-                        }
+                                               if( data != 0 && dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
+                                               {
+                                                   TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
+                                                   data[dp->tdir_count-1] = '\0';
+                                               }
                                                m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data);
                                                if (data!=0)
                                                        _TIFFfree(data);
@@ -5318,11 +5379,11 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
                                if (err==TIFFReadDirEntryErrOk)
                                {
                                        int m;
-                    if( dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
-                    {
-                        TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
-                        data[dp->tdir_count-1] = '\0';
-                    }
+                                       if( data != 0 && dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
+                                       {
+                                           TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
+                                            data[dp->tdir_count-1] = '\0';
+                                       }
                                        m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
                                        if (data!=0)
                                                _TIFFfree(data);
@@ -5698,6 +5759,16 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
         if( nstrips == 0 )
             return;
 
+        /* If we are going to allocate a lot of memory, make sure that the */
+        /* file is as big as needed */
+        if( tif->tif_mode == O_RDONLY &&
+            nstrips > 1000000 &&
+            (offset >= TIFFGetFileSize(tif) ||
+             stripbytes > (TIFFGetFileSize(tif) - offset) / (nstrips - 1)) )
+        {
+            return;
+        }
+
        newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
                                "for chopped \"StripByteCounts\" array");
        newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
index c68d6d2..c15a28d 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_dirwrite.c,v 1.89 2017-08-23 13:33:42 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -697,8 +695,11 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
                                                                }
                                                                break;
                                                        default:
-                                                               assert(0);   /* we should never get here */
-                                                               break;
+                                                               TIFFErrorExt(tif->tif_clientdata,module,
+                                                                           "Cannot write tag %d (%s)",
+                                                                           TIFFFieldTag(o),
+                                                                            o->field_name ? o->field_name : "unknown");
+                                                               goto bad;
                                                }
                                        }
                                }
index a6a94c0..4a0b07f 100644 (file)
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dumpmode.c,v 1.15 2015-12-12 18:04:26 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 47516b4..651168f 100644 (file)
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_error.c,v 1.6 2017-07-04 12:54:42 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 39fab4c..87d3cfc 100644 (file)
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_extension.c,v 1.8 2015-12-06 11:13:43 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 5fd5141..d11c968 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_fax3.c,v 1.81 2017-06-18 10:31:50 erouault Exp $ */
-
 /*
  * Copyright (c) 1990-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 8a43505..abadcd9 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_fax3.h,v 1.13 2016-12-14 18:36:27 faxguy Exp $ */
-
 /*
  * Copyright (c) 1990-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index fd14e4c..881fac5 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_flush.c,v 1.9 2010-03-31 06:40:10 fwarmerdam Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index fc554cc..6a9d5a7 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_getimage.c,v 1.114 2017-11-17 20:21:00 erouault Exp $ */
-
 /*
  * Copyright (c) 1991-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 7a14dd9..7ffe885 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_jbig.c,v 1.16 2017-06-26 15:20:00 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -53,17 +51,18 @@ static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
        struct jbg_dec_state decoder;
        int decodeStatus = 0;
        unsigned char* pImage = NULL;
-       (void) size, (void) s;
+       unsigned long decodedSize;
+       (void) s;
 
        if (isFillOrder(tif, tif->tif_dir.td_fillorder))
        {
-               TIFFReverseBits(tif->tif_rawdata, tif->tif_rawdatasize);
+               TIFFReverseBits(tif->tif_rawcp, tif->tif_rawcc);
        }
 
        jbg_dec_init(&decoder);
 
 #if defined(HAVE_JBG_NEWLEN)
-       jbg_newlen(tif->tif_rawdata, (size_t)tif->tif_rawdatasize);
+       jbg_newlen(tif->tif_rawcp, (size_t)tif->tif_rawcc);
        /*
         * I do not check the return status of jbg_newlen because even if this
         * function fails it does not necessarily mean that decoding the image
@@ -76,8 +75,8 @@ static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
         */
 #endif /* HAVE_JBG_NEWLEN */
 
-       decodeStatus = jbg_dec_in(&decoder, (unsigned char*)tif->tif_rawdata,
-                                 (size_t)tif->tif_rawdatasize, NULL);
+       decodeStatus = jbg_dec_in(&decoder, (unsigned char*)tif->tif_rawcp,
+                                 (size_t)tif->tif_rawcc, NULL);
        if (JBG_EOK != decodeStatus)
        {
                /*
@@ -98,9 +97,28 @@ static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
                return 0;
        }
 
+       decodedSize = jbg_dec_getsize(&decoder);
+       if( (tmsize_t)decodedSize < size )
+       {
+           TIFFWarningExt(tif->tif_clientdata, "JBIG",
+                          "Only decoded %lu bytes, whereas %lu requested",
+                          decodedSize, (unsigned long)size);
+       }
+       else if( (tmsize_t)decodedSize > size )
+       {
+           TIFFErrorExt(tif->tif_clientdata, "JBIG",
+                        "Decoded %lu bytes, whereas %lu were requested",
+                        decodedSize, (unsigned long)size);
+           jbg_dec_free(&decoder);
+           return 0;
+       }
        pImage = jbg_dec_getimage(&decoder, 0);
-       _TIFFmemcpy(buffer, pImage, jbg_dec_getsize(&decoder));
+       _TIFFmemcpy(buffer, pImage, decodedSize);
        jbg_dec_free(&decoder);
+
+        tif->tif_rawcp += tif->tif_rawcc;
+        tif->tif_rawcc = 0;
+
        return 1;
 }
 
index 0fbdb35..f2ddc33 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_jpeg.c,v 1.134 2017-10-17 19:04:47 erouault Exp $ */
-
 /*
  * Copyright (c) 1994-1997 Sam Leffler
  * Copyright (c) 1994-1997 Silicon Graphics, Inc.
@@ -27,9 +25,9 @@
 #define WIN32_LEAN_AND_MEAN
 #define VC_EXTRALEAN
 
+#include "tiffiop.h"
 #include <stdlib.h>
 
-#include "tiffiop.h"
 #ifdef JPEG_SUPPORT
 
 /*
@@ -76,7 +74,7 @@ int TIFFJPEGIsFullStripRequired_12(TIFF* tif);
    "JPEGLib: JPEG parameter struct mismatch: library thinks size is 432,
    caller expects 464"
 
-   For such users we wil fix the problem here. See install.doc file from
+   For such users we will fix the problem here. See install.doc file from
    the JPEG library distribution for details.
 */
 
index 4b25244..aa35ea0 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_luv.c,v 1.49 2017-07-24 12:47:30 erouault Exp $ */
-
 /*
  * Copyright (c) 1997 Greg Ward Larson
  * Copyright (c) 1997 Silicon Graphics, Inc.
@@ -215,7 +213,7 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
        bp = (unsigned char*) tif->tif_rawcp;
        cc = tif->tif_rawcc;
        /* get each byte string */
-       for (shft = 2*8; (shft -= 8) >= 0; ) {
+       for (shft = 8; shft >= 0; shft -=8) {
                for (i = 0; i < npixels && cc > 0; ) {
                        if (*bp >= 128) {               /* run */
                                if( cc < 2 )
@@ -349,7 +347,7 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
        bp = (unsigned char*) tif->tif_rawcp;
        cc = tif->tif_rawcc;
        /* get each byte string */
-       for (shft = 4*8; (shft -= 8) >= 0; ) {
+       for (shft = 24; shft >= 0; shft -=8) {
                for (i = 0; i < npixels && cc > 0; ) {
                        if (*bp >= 128) {               /* run */
                                if( cc < 2 )
@@ -467,7 +465,7 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
        /* compress each byte string */
        op = tif->tif_rawcp;
        occ = tif->tif_rawdatasize - tif->tif_rawcc;
-       for (shft = 2*8; (shft -= 8) >= 0; )
+       for (shft = 8; shft >= 0; shft -=8) {
                for (i = 0; i < npixels; i += rc) {
                        if (occ < 4) {
                                tif->tif_rawcp = op;
@@ -522,6 +520,7 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
                        } else
                                rc = 0;
                }
+       }
        tif->tif_rawcp = op;
        tif->tif_rawcc = tif->tif_rawdatasize - occ;
 
@@ -618,7 +617,7 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
        /* compress each byte string */
        op = tif->tif_rawcp;
        occ = tif->tif_rawdatasize - tif->tif_rawcc;
-       for (shft = 4*8; (shft -= 8) >= 0; )
+       for (shft = 24; shft >= 0; shft -=8) {
                for (i = 0; i < npixels; i += rc) {
                        if (occ < 4) {
                                tif->tif_rawcp = op;
@@ -673,6 +672,7 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
                        } else
                                rc = 0;
                }
+       }
        tif->tif_rawcp = op;
        tif->tif_rawcc = tif->tif_rawdatasize - occ;
 
index 80fc394..3f6096b 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_lzma.c,v 1.6 2016-09-17 09:18:59 erouault Exp $ */
-
 /*
  * Copyright (c) 2010, Andrey Kiselev <dron@ak4719.spb.edu>
  *
@@ -249,6 +247,7 @@ LZMAPreEncode(TIFF* tif, uint16 s)
 {
        static const char module[] = "LZMAPreEncode";
        LZMAState *sp = EncoderState(tif);
+       lzma_ret ret;
 
        (void) s;
        assert(sp != NULL);
@@ -262,7 +261,13 @@ LZMAPreEncode(TIFF* tif, uint16 s)
                             "Liblzma cannot deal with buffers this size");
                return 0;
        }
-       return (lzma_stream_encoder(&sp->stream, sp->filters, sp->check) == LZMA_OK);
+       ret = lzma_stream_encoder(&sp->stream, sp->filters, sp->check);
+       if (ret != LZMA_OK) {
+               TIFFErrorExt(tif->tif_clientdata, module,
+                       "Error in lzma_stream_encoder(): %s", LZMAStrerror(ret));
+               return 0;
+       }
+       return 1;
 }
 
 /*
index bc8f9c8..ac685dd 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_lzw.c,v 1.57 2017-07-11 10:54:29 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -135,6 +133,7 @@ typedef struct {
        long    dec_restart;            /* restart count */
 #ifdef LZW_CHECKEOS
        uint64  dec_bitsleft;           /* available bits in raw data */
+       tmsize_t old_tif_rawcc;         /* value of tif_rawcc at the end of the previous TIFLZWDecode() call */
 #endif
        decodeFunc dec_decode;          /* regular or backwards compatible */
        code_t* dec_codep;              /* current recognized code */
@@ -320,6 +319,7 @@ LZWPreDecode(TIFF* tif, uint16 s)
        sp->dec_nbitsmask = MAXCODE(BITS_MIN);
 #ifdef LZW_CHECKEOS
        sp->dec_bitsleft = 0;
+        sp->old_tif_rawcc = 0;
 #endif
        sp->dec_free_entp = sp->dec_codetab + CODE_FIRST;
        /*
@@ -427,7 +427,7 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
 
        bp = (unsigned char *)tif->tif_rawcp;
 #ifdef LZW_CHECKEOS
-       sp->dec_bitsleft = (((uint64)tif->tif_rawcc) << 3);
+       sp->dec_bitsleft += (((uint64)tif->tif_rawcc - sp->old_tif_rawcc) << 3);
 #endif
        nbits = sp->lzw_nbits;
        nextdata = sp->lzw_nextdata;
@@ -555,6 +555,9 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
 
        tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp );
        tif->tif_rawcp = (uint8*) bp;
+#ifdef LZW_CHECKEOS
+       sp->old_tif_rawcc = tif->tif_rawcc;
+#endif
        sp->lzw_nbits = (unsigned short) nbits;
        sp->lzw_nextdata = nextdata;
        sp->lzw_nextbits = nextbits;
@@ -604,6 +607,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
        char *tp;
        unsigned char *bp;
        int code, nbits;
+       int len;
        long nextbits, nextdata, nbitsmask;
        code_t *codep, *free_entp, *maxcodep, *oldcodep;
 
@@ -657,7 +661,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
 
        bp = (unsigned char *)tif->tif_rawcp;
 #ifdef LZW_CHECKEOS
-       sp->dec_bitsleft = (((uint64)tif->tif_rawcc) << 3);
+       sp->dec_bitsleft += (((uint64)tif->tif_rawcc - sp->old_tif_rawcc) << 3);
 #endif
        nbits = sp->lzw_nbits;
        nextdata = sp->lzw_nextdata;
@@ -755,13 +759,18 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
                                }  while (--occ);
                                break;
                        }
-                       assert(occ >= codep->length);
-                       op += codep->length;
-                       occ -= codep->length;
-                       tp = op;
+                       len = codep->length;
+                       tp = op + len;
                        do {
-                               *--tp = codep->value;
-                       } while( (codep = codep->next) != NULL );
+                               int t;
+                               --tp;
+                               t = codep->value;
+                               codep = codep->next;
+                               *tp = (char)t;
+                       } while (codep && tp > op);
+                       assert(occ >= len);
+                       op += len;
+                       occ -= len;
                } else {
                        *op++ = (char)code;
                        occ--;
@@ -770,6 +779,9 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
 
        tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp );
        tif->tif_rawcp = (uint8*) bp;
+#ifdef LZW_CHECKEOS
+       sp->old_tif_rawcc = tif->tif_rawcc;
+#endif
        sp->lzw_nbits = (unsigned short)nbits;
        sp->lzw_nextdata = nextdata;
        sp->lzw_nextbits = nextbits;
index 0821178..0ba61ae 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_next.c,v 1.19 2016-09-04 21:32:56 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 92ed1fa..27385d8 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_ojpeg.c,v 1.69 2017-04-27 17:29:26 erouault Exp $ */
-
 /* WARNING: The type of JPEG encapsulation defined by the TIFF Version 6.0
    specification is now totally obsolete and deprecated for new applications and
    images. This file was was created solely in order to read unconverted images
index a7279e1..c574c45 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_open.c,v 1.48 2016-11-20 22:29:47 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 18904b0..a8f29e8 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_packbits.c,v 1.26 2017-05-14 02:26:07 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 979858d..7438d69 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_pixarlog.c,v 1.54 2017-07-10 10:40:28 erouault Exp $ */
-
 /*
  * Copyright (c) 1996-1997 Sam Leffler
  * Copyright (c) 1996 Pixar
index 9ae1f57..b775663 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_predict.c,v 1.44 2017-06-18 10:31:50 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 6c68e21..a326b9b 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_predict.h,v 1.9 2016-10-31 17:24:26 erouault Exp $ */
-
 /*
  * Copyright (c) 1995-1997 Sam Leffler
  * Copyright (c) 1995-1997 Silicon Graphics, Inc.
 
 #ifndef _TIFFPREDICT_
 #define        _TIFFPREDICT_
+
+#include "tiffio.h"
+#include "tiffiop.h"
+
 /*
  * ``Library-private'' Support for the Predictor Tag
  */
index 24d4b98..1d86adb 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_print.c,v 1.65 2016-11-20 22:31:22 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -546,7 +544,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
                                uint16 i;
                                fprintf(fd, "    %2ld: %5u",
                                    l, td->td_transferfunction[0][l]);
-                               for (i = 1; i < td->td_samplesperpixel; i++)
+                               for (i = 1; i < td->td_samplesperpixel - td->td_extrasamples && i < 3; i++)
                                        fprintf(fd, " %5u",
                                            td->td_transferfunction[i][l]);
                                fputc('\n', fd);
@@ -667,13 +665,13 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
 #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
                        fprintf(fd, "    %3lu: [%8I64u, %8I64u]\n",
                            (unsigned long) s,
-                           (unsigned __int64) td->td_stripoffset[s],
-                           (unsigned __int64) td->td_stripbytecount[s]);
+                           td->td_stripoffset ? (unsigned __int64) td->td_stripoffset[s] : 0,
+                           td->td_stripbytecount ? (unsigned __int64) td->td_stripbytecount[s] : 0);
 #else
                        fprintf(fd, "    %3lu: [%8llu, %8llu]\n",
                            (unsigned long) s,
-                           (unsigned long long) td->td_stripoffset[s],
-                           (unsigned long long) td->td_stripbytecount[s]);
+                           td->td_stripoffset ? (unsigned long long) td->td_stripoffset[s] : 0,
+                           td->td_stripbytecount ? (unsigned long long) td->td_stripbytecount[s] : 0);
 #endif
        }
 }
index 2ba985a..e63810c 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_read.c,v 1.66 2017-11-17 20:21:00 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -58,7 +56,7 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
                                int is_strip, uint32 strip_or_tile,
                                const char* module )
 {
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
         tmsize_t threshold = INITIAL_THRESHOLD;
 #endif
         tmsize_t already_read = 0;
@@ -73,7 +71,7 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
         {
             tmsize_t bytes_read;
             tmsize_t to_read = size - already_read;
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
             if( to_read >= threshold && threshold < MAX_THRESHOLD &&
                 already_read + to_read + rawdata_offset > tif->tif_rawdatasize )
             {
@@ -348,6 +346,13 @@ TIFFSeek(TIFF* tif, uint32 row, uint16 sample )
             return 0;
         whole_strip = tif->tif_dir.td_stripbytecount[strip] < 10
                 || isMapped(tif);
+        if( td->td_compression == COMPRESSION_LERC ||
+            td->td_compression == COMPRESSION_JBIG )
+        {
+            /* Ideally plugins should have a way to declare they don't support
+             * chunk strip */
+            whole_strip = 1;
+        }
 #else
         whole_strip = 1;
 #endif
index ecca1fd..7f640a9 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_stream.cxx,v 1.13 2015-05-28 01:50:22 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1988-1996 Sam Leffler
  * Copyright (c) 1991-1996 Silicon Graphics, Inc.
@@ -375,6 +373,9 @@ _tiffStreamOpen(const char* name, const char* mode, void *fd)
                                _tiffosSizeProc,
                                _tiffDummyMapProc,
                                 _tiffDummyUnmapProc);
+               if (!tif) {
+                       delete data;
+               }
        } else {
                tiffis_data     *data = new tiffis_data;
                data->stream = reinterpret_cast<istream *>(fd);
@@ -389,6 +390,9 @@ _tiffStreamOpen(const char* name, const char* mode, void *fd)
                                _tiffisSizeProc,
                                _tiffDummyMapProc,
                                 _tiffDummyUnmapProc);
+               if (!tif) {
+                       delete data;
+               }
        }
 
        return (tif);
index 6e9f2ef..5b76fba 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_strip.c,v 1.38 2016-12-03 11:02:15 erouault Exp $ */
-
 /*
  * Copyright (c) 1991-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 4b2e5f1..b174ba6 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_swab.c,v 1.15 2017-06-08 16:39:50 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 183199d..2388dbb 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_thunder.c,v 1.13 2016-09-04 21:32:56 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 388e168..58fe935 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_tile.c,v 1.24 2015-06-07 22:35:40 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1991-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 80c437c..874f1fe 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_unix.c,v 1.28 2017-01-11 19:02:49 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index f92c843..60875bb 100644 (file)
@@ -1,4 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_version.c,v 1.3 2010-03-10 18:56:49 bfriesen Exp $ */
 /*
  * Copyright (c) 1992-1997 Sam Leffler
  * Copyright (c) 1992-1997 Silicon Graphics, Inc.
index dc79f14..c482785 100644 (file)
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_warning.c,v 1.4 2017-07-04 12:54:42 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/libtiff/tif_webp.c b/libtiff/tif_webp.c
new file mode 100644 (file)
index 0000000..a002f48
--- /dev/null
@@ -0,0 +1,684 @@
+/*
+* Copyright (c) 2018, Mapbox
+* Author: <norman.barker at mapbox.com>
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee, provided
+* that (i) the above copyright notices and this permission notice appear in
+* all copies of the software and related documentation, and (ii) the names of
+* Sam Leffler and Silicon Graphics may not be used in any advertising or
+* publicity relating to the software without the specific, prior written
+* permission of Sam Leffler and Silicon Graphics.
+*
+* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+*
+* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+* OF THIS SOFTWARE.
+*/
+
+#include "tiffiop.h"
+#ifdef WEBP_SUPPORT
+/*
+ * TIFF Library.
+ *
+ * WEBP Compression Support
+ *
+ */
+
+#include "webp/decode.h"
+#include "webp/encode.h"
+
+#include <stdio.h>
+
+#define LSTATE_INIT_DECODE 0x01
+#define LSTATE_INIT_ENCODE 0x02
+/*
+ * State block for each open TIFF
+ * file using WEBP compression/decompression.
+ */
+typedef struct {
+  uint16           nSamples;               /* number of samples per pixel */
+  
+  int              lossless;               /* lossy/lossless compression */
+  int              quality_level;          /* compression level */
+  WebPPicture      sPicture;               /* WebP Picture */
+  WebPConfig       sEncoderConfig;         /* WebP encoder config */
+  uint8*           pBuffer;                /* buffer to hold raw data on encoding */
+  unsigned int     buffer_offset;          /* current offset into the buffer */
+  unsigned int     buffer_size;
+  
+  WebPIDecoder*    psDecoder;              /* WebPIDecoder */
+  WebPDecBuffer    sDecBuffer;             /* Decoder buffer */
+  int              last_y;                 /* Last row decoded */
+  
+  int              state;                  /* state flags */
+  
+       TIFFVGetMethod   vgetparent;             /* super-class method */
+       TIFFVSetMethod   vsetparent;             /* super-class method */
+} WebPState;
+
+#define LState(tif)            ((WebPState*) (tif)->tif_data)
+#define DecoderState(tif)       LState(tif)
+#define EncoderState(tif)       LState(tif)
+
+static int TWebPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
+static int TWebPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s);
+
+static
+int TWebPDatasetWriter(const uint8_t* data, size_t data_size,
+                      const WebPPicture* const picture)
+{
+  static const char module[] = "TWebPDatasetWriter";
+  TIFF* tif = (TIFF*)(picture->custom_ptr);
+  
+  if ( (tif->tif_rawcc + (tmsize_t)data_size) > tif->tif_rawdatasize ) {
+    TIFFErrorExt(tif->tif_clientdata, module,
+                 "Buffer too small by " TIFF_SIZE_FORMAT " bytes.",
+                 (size_t) (tif->tif_rawcc + data_size - tif->tif_rawdatasize));
+    return 0;
+  } else {
+    _TIFFmemcpy(tif->tif_rawcp, data, data_size);
+    tif->tif_rawcc += data_size;
+    tif->tif_rawcp += data_size;
+    return 1;    
+  }
+}
+
+/*
+ * Encode a chunk of pixels.
+ */
+static int
+TWebPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+{
+  static const char module[] = "TWebPEncode";
+  WebPState *sp = EncoderState(tif);
+  (void) s;
+
+  assert(sp != NULL);
+  assert(sp->state == LSTATE_INIT_ENCODE);
+    
+  if( (uint64)sp->buffer_offset +
+                            (uint64)cc > sp->buffer_size )
+  {
+      TIFFErrorExt(tif->tif_clientdata, module,
+                   "Too many bytes to be written");
+      return 0;
+  }
+
+  memcpy(sp->pBuffer + sp->buffer_offset,
+         bp, cc);
+  sp->buffer_offset += (unsigned)cc;
+
+  return 1;
+  
+}
+
+static int
+TWebPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+{
+  static const char module[] = "WebPDecode";
+  VP8StatusCode status = VP8_STATUS_OK;
+  WebPState *sp = DecoderState(tif);
+  (void) s;  
+
+  assert(sp != NULL);
+  assert(sp->state == LSTATE_INIT_DECODE);
+  
+  if (occ % sp->sDecBuffer.u.RGBA.stride)
+  {
+    TIFFErrorExt(tif->tif_clientdata, module,
+                 "Fractional scanlines cannot be read");
+    return 0;
+  }
+
+  status = WebPIAppend(sp->psDecoder, tif->tif_rawcp, tif->tif_rawcc);
+
+  if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) {
+    if (status == VP8_STATUS_INVALID_PARAM) {
+       TIFFErrorExt(tif->tif_clientdata, module,
+         "Invalid parameter used.");      
+    } else if (status == VP8_STATUS_OUT_OF_MEMORY) {
+      TIFFErrorExt(tif->tif_clientdata, module,
+        "Out of memory.");         
+    } else {
+      TIFFErrorExt(tif->tif_clientdata, module,
+        "Unrecognized error.");   
+    }
+    return 0;
+  } else {
+    int current_y, stride;
+    uint8_t* buf;
+
+    /* Returns the RGB/A image decoded so far */
+    buf = WebPIDecGetRGB(sp->psDecoder, &current_y, NULL, NULL, &stride);
+    
+    if ((buf != NULL) &&
+        (occ <= stride * (current_y - sp->last_y))) {
+      memcpy(op,   
+         buf + (sp->last_y * stride),
+         occ);
+
+      tif->tif_rawcp += tif->tif_rawcc;
+      tif->tif_rawcc = 0;
+      sp->last_y += occ / sp->sDecBuffer.u.RGBA.stride;
+      return 1;
+    } else {
+      TIFFErrorExt(tif->tif_clientdata, module, "Unable to decode WebP data."); 
+      return 0;
+    }
+  }
+}
+
+static int
+TWebPFixupTags(TIFF* tif)
+{
+  (void) tif;
+  if (tif->tif_dir.td_planarconfig != PLANARCONFIG_CONTIG) {
+    static const char module[] = "TWebPFixupTags";
+    TIFFErrorExt(tif->tif_clientdata, module,
+      "TIFF WEBP requires data to be stored contiguously in RGB e.g. RGBRGBRGB "
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+      "or RGBARGBARGBA"
+#endif
+    );
+    return 0;
+  }
+  return 1;
+}
+
+static int
+TWebPSetupDecode(TIFF* tif)
+{
+  static const char module[] = "WebPSetupDecode";
+  uint16 nBitsPerSample = tif->tif_dir.td_bitspersample;
+  uint16 sampleFormat = tif->tif_dir.td_sampleformat;
+
+  WebPState* sp = DecoderState(tif);
+  assert(sp != NULL);
+
+  sp->nSamples = tif->tif_dir.td_samplesperpixel;
+
+  /* check band count */
+  if ( sp->nSamples != 3
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+    && sp->nSamples != 4
+#endif
+  )
+  {
+    TIFFErrorExt(tif->tif_clientdata, module,
+      "WEBP driver doesn't support %d bands. Must be 3 (RGB) "
+  #if WEBP_ENCODER_ABI_VERSION >= 0x0100
+      "or 4 (RGBA) "
+  #endif
+    "bands.",
+    sp->nSamples );
+    return 0;
+  }
+
+  /* check bits per sample and data type */
+  if ((nBitsPerSample != 8) && (sampleFormat != 1)) {
+    TIFFErrorExt(tif->tif_clientdata, module,
+                "WEBP driver requires 8 bit unsigned data");
+    return 0;
+  }
+  
+  /* if we were last encoding, terminate this mode */
+  if (sp->state & LSTATE_INIT_ENCODE) {
+      WebPPictureFree(&sp->sPicture);
+      if (sp->pBuffer != NULL) {
+        _TIFFfree(sp->pBuffer);
+        sp->pBuffer = NULL;
+      }
+      sp->buffer_offset = 0;
+      sp->state = 0;
+  }
+
+  sp->state |= LSTATE_INIT_DECODE;
+
+  return 1;
+}
+
+/*
+* Setup state for decoding a strip.
+*/
+static int
+TWebPPreDecode(TIFF* tif, uint16 s)
+{
+  static const char module[] = "TWebPPreDecode";
+  uint32 segment_width, segment_height;
+  WebPState* sp = DecoderState(tif);
+  TIFFDirectory* td = &tif->tif_dir;
+  (void) s;
+  assert(sp != NULL);
+  
+  if (isTiled(tif)) {
+    segment_width = td->td_tilewidth;
+    segment_height = td->td_tilelength;
+  } else {
+    segment_width = td->td_imagewidth;
+    segment_height = td->td_imagelength - tif->tif_row;
+    if (segment_height > td->td_rowsperstrip)
+      segment_height = td->td_rowsperstrip;
+  }
+
+  if( (sp->state & LSTATE_INIT_DECODE) == 0 )
+      tif->tif_setupdecode(tif);
+      
+  if (sp->psDecoder != NULL) {
+    WebPIDelete(sp->psDecoder);
+    WebPFreeDecBuffer(&sp->sDecBuffer);
+    sp->psDecoder = NULL;
+  }
+
+  sp->last_y = 0;
+  
+  WebPInitDecBuffer(&sp->sDecBuffer);
+  
+  sp->sDecBuffer.is_external_memory = 0;
+  sp->sDecBuffer.width = segment_width;
+  sp->sDecBuffer.height = segment_height;
+  sp->sDecBuffer.u.RGBA.stride = segment_width * sp->nSamples;
+  sp->sDecBuffer.u.RGBA.size = segment_width * sp->nSamples * segment_height;
+  
+  if (sp->nSamples > 3) {
+    sp->sDecBuffer.colorspace = MODE_RGBA;
+  } else {
+    sp->sDecBuffer.colorspace = MODE_RGB;
+  }
+  
+  sp->psDecoder = WebPINewDecoder(&sp->sDecBuffer);
+  
+  if (sp->psDecoder == NULL) {
+    TIFFErrorExt(tif->tif_clientdata, module,
+                "Unable to allocate WebP decoder.");
+    return 0;
+  }
+  
+  return 1;
+}
+
+static int
+TWebPSetupEncode(TIFF* tif)
+{
+  static const char module[] = "WebPSetupEncode";
+  uint16 nBitsPerSample = tif->tif_dir.td_bitspersample;
+  uint16 sampleFormat = tif->tif_dir.td_sampleformat;
+  
+  WebPState* sp = EncoderState(tif);
+  assert(sp != NULL);
+
+  sp->nSamples = tif->tif_dir.td_samplesperpixel;
+
+  /* check band count */
+  if ( sp->nSamples != 3
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+    && sp->nSamples != 4
+#endif
+  )
+  {
+    TIFFErrorExt(tif->tif_clientdata, module,
+      "WEBP driver doesn't support %d bands. Must be 3 (RGB) "
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+      "or 4 (RGBA) "
+#endif
+    "bands.",
+    sp->nSamples );
+    return 0;
+  }
+  
+  /* check bits per sample and data type */
+  if ((nBitsPerSample != 8) && (sampleFormat != 1)) {
+    TIFFErrorExt(tif->tif_clientdata, module,
+                "WEBP driver requires 8 bit unsigned data");
+    return 0;
+  }
+  
+  if (sp->state & LSTATE_INIT_DECODE) {
+    WebPIDelete(sp->psDecoder);
+    WebPFreeDecBuffer(&sp->sDecBuffer);
+    sp->psDecoder = NULL;
+    sp->last_y = 0;
+    sp->state = 0;
+  }
+
+  sp->state |= LSTATE_INIT_ENCODE;
+
+  if (!WebPConfigInitInternal(&sp->sEncoderConfig, WEBP_PRESET_DEFAULT,
+                              sp->quality_level,
+                              WEBP_ENCODER_ABI_VERSION)) {
+    TIFFErrorExt(tif->tif_clientdata, module,
+      "Error creating WebP encoder configuration.");
+    return 0;
+  }
+
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+  sp->sEncoderConfig.lossless = sp->lossless;
+#endif
+
+  if (!WebPValidateConfig(&sp->sEncoderConfig)) {
+    TIFFErrorExt(tif->tif_clientdata, module,
+      "Error with WebP encoder configuration.");
+    return 0;
+  }
+
+  if (!WebPPictureInit(&sp->sPicture)) {
+    TIFFErrorExt(tif->tif_clientdata, module,
+        "Error initializing WebP picture.");
+    return 0;
+  }
+
+  return 1;
+}
+
+/*
+* Reset encoding state at the start of a strip.
+*/
+static int
+TWebPPreEncode(TIFF* tif, uint16 s)
+{
+  static const char module[] = "TWebPPreEncode";
+  uint32 segment_width, segment_height;
+  WebPState *sp = EncoderState(tif);
+  TIFFDirectory* td = &tif->tif_dir;
+
+  (void) s;
+
+  assert(sp != NULL);
+  if( sp->state != LSTATE_INIT_ENCODE )
+    tif->tif_setupencode(tif);
+
+  /*
+   * Set encoding parameters for this strip/tile.
+   */
+  if (isTiled(tif)) {
+    segment_width = td->td_tilewidth;
+    segment_height = td->td_tilelength;
+  } else {
+    segment_width = td->td_imagewidth;
+    segment_height = td->td_imagelength - tif->tif_row;
+    if (segment_height > td->td_rowsperstrip)
+      segment_height = td->td_rowsperstrip;
+  }
+
+  if( segment_width > 16383 || segment_height > 16383 ) {
+      TIFFErrorExt(tif->tif_clientdata, module, 
+                   "WEBP maximum image dimensions are 16383 x 16383.");
+      return 0;
+  }
+
+  /* set up buffer for raw data */
+  /* given above check and that nSamples <= 4, buffer_size is <= 1 GB */
+  sp->buffer_size = segment_width * segment_height * sp->nSamples;
+  sp->pBuffer = _TIFFmalloc(sp->buffer_size);
+  if( !sp->pBuffer) {
+      TIFFErrorExt(tif->tif_clientdata, module, "Cannot allocate buffer");
+      return 0;
+  }
+  sp->buffer_offset = 0;
+
+  sp->sPicture.width = segment_width;
+  sp->sPicture.height = segment_height;
+  sp->sPicture.writer = TWebPDatasetWriter;
+  sp->sPicture.custom_ptr = tif;
+
+  return 1;
+}
+
+/*
+* Finish off an encoded strip by flushing it.
+*/
+static int
+TWebPPostEncode(TIFF* tif)
+{
+  static const char module[] = "WebPPostEncode";
+  int64_t stride;
+  WebPState *sp = EncoderState(tif);
+  assert(sp != NULL);
+
+  assert(sp->state == LSTATE_INIT_ENCODE);
+
+  stride = (int64_t)sp->sPicture.width * sp->nSamples;
+
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+  if (sp->nSamples == 4) {
+      if (!WebPPictureImportRGBA(&sp->sPicture, sp->pBuffer, (int)stride)) {
+          TIFFErrorExt(tif->tif_clientdata, module,
+                    "WebPPictureImportRGBA() failed" );
+          return 0;
+      }
+  }
+  else
+#endif
+  if (!WebPPictureImportRGB(&sp->sPicture, sp->pBuffer, (int)stride)) {
+      TIFFErrorExt(tif->tif_clientdata, module,
+                    "WebPPictureImportRGB() failed");
+      return 0;
+  }
+
+  if (!WebPEncode(&sp->sEncoderConfig, &sp->sPicture)) {
+
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+    const char* pszErrorMsg = NULL;
+    switch(sp->sPicture.error_code) {
+    case VP8_ENC_ERROR_OUT_OF_MEMORY:
+        pszErrorMsg = "Out of memory"; break;
+    case VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY:
+        pszErrorMsg = "Out of memory while flushing bits"; break;
+    case VP8_ENC_ERROR_NULL_PARAMETER:
+        pszErrorMsg = "A pointer parameter is NULL"; break;
+    case VP8_ENC_ERROR_INVALID_CONFIGURATION:
+        pszErrorMsg = "Configuration is invalid"; break;
+    case VP8_ENC_ERROR_BAD_DIMENSION:
+        pszErrorMsg = "Picture has invalid width/height"; break;
+    case VP8_ENC_ERROR_PARTITION0_OVERFLOW:
+        pszErrorMsg = "Partition is bigger than 512k. Try using less "
+            "SEGMENTS, or increase PARTITION_LIMIT value";
+        break;
+    case VP8_ENC_ERROR_PARTITION_OVERFLOW:
+        pszErrorMsg = "Partition is bigger than 16M";
+        break;
+    case VP8_ENC_ERROR_BAD_WRITE:
+        pszErrorMsg = "Error while fludshing bytes"; break;
+    case VP8_ENC_ERROR_FILE_TOO_BIG:
+        pszErrorMsg = "File is bigger than 4G"; break;
+    case VP8_ENC_ERROR_USER_ABORT:
+        pszErrorMsg = "User interrupted";
+        break;
+    default:
+        TIFFErrorExt(tif->tif_clientdata, module,
+                "WebPEncode returned an unknown error code: %d",
+                sp->sPicture.error_code);
+        pszErrorMsg = "Unknown WebP error type.";
+        break;
+    }
+    TIFFErrorExt(tif->tif_clientdata, module,
+             "WebPEncode() failed : %s", pszErrorMsg);
+#else
+    TIFFErrorExt(tif->tif_clientdata, module,
+             "Error in WebPEncode()");
+#endif
+    return 0;
+  }
+
+  sp->sPicture.custom_ptr = NULL;
+
+  if (!TIFFFlushData1(tif))
+  {
+    TIFFErrorExt(tif->tif_clientdata, module,
+      "Error flushing TIFF WebP encoder.");
+    return 0;
+  }
+
+  return 1;
+}
+
+static void
+TWebPCleanup(TIFF* tif)
+{
+  WebPState* sp = LState(tif);
+
+  assert(sp != 0);
+
+  tif->tif_tagmethods.vgetfield = sp->vgetparent;
+  tif->tif_tagmethods.vsetfield = sp->vsetparent;
+
+  if (sp->state & LSTATE_INIT_ENCODE) {
+    WebPPictureFree(&sp->sPicture);
+  }
+
+  if (sp->psDecoder != NULL) {
+    WebPIDelete(sp->psDecoder);
+    WebPFreeDecBuffer(&sp->sDecBuffer);
+    sp->psDecoder = NULL;
+    sp->last_y = 0;
+  }
+  
+  if (sp->pBuffer != NULL) {
+    _TIFFfree(sp->pBuffer);
+    sp->pBuffer = NULL;
+  }
+
+  if (tif->tif_data) {
+    _TIFFfree(tif->tif_data);
+    tif->tif_data = NULL;
+  }
+  
+  _TIFFSetDefaultCompressionState(tif);
+}
+
+static int
+TWebPVSetField(TIFF* tif, uint32 tag, va_list ap)
+{
+       static const char module[] = "WebPVSetField";
+  WebPState* sp = LState(tif);
+
+  switch (tag) {
+  case TIFFTAG_WEBP_LEVEL:
+    sp->quality_level = (int) va_arg(ap, int);
+    if( sp->quality_level <= 0 ||
+        sp->quality_level > 100.0f ) {
+      TIFFWarningExt(tif->tif_clientdata, module,
+                     "WEBP_LEVEL should be between 1 and 100");
+    }
+    return 1;
+  case TIFFTAG_WEBP_LOSSLESS:
+    #if WEBP_ENCODER_ABI_VERSION >= 0x0100
+    sp->lossless = va_arg(ap, int);
+    return 1;
+    #else
+      TIFFErrorExt(tif->tif_clientdata, module,
+                  "Need to upgrade WEBP driver, this version doesn't support "
+                  "lossless compression.");
+      return 0;
+    #endif 
+  default:
+    return (*sp->vsetparent)(tif, tag, ap);
+  }
+  /*NOTREACHED*/
+}
+
+static int
+TWebPVGetField(TIFF* tif, uint32 tag, va_list ap)
+{
+  WebPState* sp = LState(tif);
+
+  switch (tag) {
+  case TIFFTAG_WEBP_LEVEL:
+    *va_arg(ap, int*) = sp->quality_level;
+    break;
+  case TIFFTAG_WEBP_LOSSLESS:
+    *va_arg(ap, int*) = sp->lossless;
+    break;
+  default:
+    return (*sp->vgetparent)(tif, tag, ap);
+  }
+  return 1;
+}
+
+static const TIFFField TWebPFields[] = {
+  { TIFFTAG_WEBP_LEVEL, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT,
+    TIFF_SETGET_UNDEFINED,
+    FIELD_PSEUDO, TRUE, FALSE, "WEBP quality", NULL },
+  { TIFFTAG_WEBP_LOSSLESS, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT,
+    TIFF_SETGET_UNDEFINED,
+    FIELD_PSEUDO, TRUE, FALSE, "WEBP lossless/lossy", NULL
+  },
+};
+
+int
+TIFFInitWebP(TIFF* tif, int scheme)
+{
+  static const char module[] = "TIFFInitWebP";
+  WebPState* sp;
+
+  assert( scheme == COMPRESSION_WEBP );
+
+  /*
+  * Merge codec-specific tag information.
+  */
+  if ( !_TIFFMergeFields(tif, TWebPFields, TIFFArrayCount(TWebPFields)) ) {
+    TIFFErrorExt(tif->tif_clientdata, module,
+                "Merging WebP codec-specific tags failed");
+    return 0;
+  }
+
+  /*
+  * Allocate state block so tag methods have storage to record values.
+  */
+  tif->tif_data = (uint8*) _TIFFmalloc(sizeof(WebPState));
+  if (tif->tif_data == NULL)
+    goto bad;
+  sp = LState(tif);
+
+  /*
+  * Override parent get/set field methods.
+  */
+  sp->vgetparent = tif->tif_tagmethods.vgetfield;
+  tif->tif_tagmethods.vgetfield = TWebPVGetField;      /* hook for codec tags */
+  sp->vsetparent = tif->tif_tagmethods.vsetfield;
+  tif->tif_tagmethods.vsetfield = TWebPVSetField;      /* hook for codec tags */
+
+  /* Default values for codec-specific fields */
+  sp->quality_level = 75.0f;           /* default comp. level */
+  sp->lossless = 0; /* default to false */
+  sp->state = 0;
+  sp->nSamples = 0;
+  sp->psDecoder = NULL;
+  sp->last_y = 0;
+  
+  sp->buffer_offset = 0;
+  sp->pBuffer = NULL;
+
+  /*
+  * Install codec methods.
+  * Notes:
+  * encoderow is not supported
+  */
+  tif->tif_fixuptags = TWebPFixupTags;
+  tif->tif_setupdecode = TWebPSetupDecode;
+  tif->tif_predecode = TWebPPreDecode;
+  tif->tif_decoderow = TWebPDecode;
+  tif->tif_decodestrip = TWebPDecode;
+  tif->tif_decodetile = TWebPDecode;
+  tif->tif_setupencode = TWebPSetupEncode;
+  tif->tif_preencode = TWebPPreEncode;
+  tif->tif_postencode = TWebPPostEncode;
+  tif->tif_encoderow = TWebPEncode;
+  tif->tif_encodestrip = TWebPEncode;
+  tif->tif_encodetile = TWebPEncode;
+  tif->tif_cleanup = TWebPCleanup;
+
+  return 1;
+bad:
+  TIFFErrorExt(tif->tif_clientdata, module,
+            "No space for WebP state block");
+  return 0;
+}
+
+#endif /* WEBP_SUPPORT */
index 090baed..088880e 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_win32.c,v 1.42 2017-01-11 19:02:49 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -407,60 +405,21 @@ _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c)
 static void
 Win32WarningHandler(const char* module, const char* fmt, va_list ap)
 {
-#ifndef TIF_PLATFORM_CONSOLE
-       LPTSTR szTitle;
-       LPTSTR szTmp;
-       LPCTSTR szTitleText = "%s Warning";
-       LPCTSTR szDefaultModule = "LIBTIFF";
-       LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module;
-        SIZE_T nBufSize = (strlen(szTmpModule) +
-                        strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char);
-
-       if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL)
-               return;
-       sprintf(szTitle, szTitleText, szTmpModule);
-       szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char);
-       vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap);
-       MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION);
-       LocalFree(szTitle);
-
-       return;
-#else
        if (module != NULL)
                fprintf(stderr, "%s: ", module);
        fprintf(stderr, "Warning, ");
        vfprintf(stderr, fmt, ap);
        fprintf(stderr, ".\n");
-#endif        
 }
 TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler;
 
 static void
 Win32ErrorHandler(const char* module, const char* fmt, va_list ap)
 {
-#ifndef TIF_PLATFORM_CONSOLE
-       LPTSTR szTitle;
-       LPTSTR szTmp;
-       LPCTSTR szTitleText = "%s Error";
-       LPCTSTR szDefaultModule = "LIBTIFF";
-       LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module;
-        SIZE_T nBufSize = (strlen(szTmpModule) +
-                        strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char);
-
-       if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL)
-               return;
-       sprintf(szTitle, szTitleText, szTmpModule);
-       szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char);
-       vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap);
-       MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONEXCLAMATION);
-       LocalFree(szTitle);
-       return;
-#else
        if (module != NULL)
                fprintf(stderr, "%s: ", module);
        vfprintf(stderr, fmt, ap);
        fprintf(stderr, ".\n");
-#endif        
 }
 TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler;
 
index 4c216ec..a31ecd1 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_write.c,v 1.46 2016-12-03 21:57:44 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -540,9 +538,11 @@ TIFFSetupStrips(TIFF* tif)
        if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
                td->td_stripsperimage /= td->td_samplesperpixel;
        td->td_stripoffset = (uint64 *)
-           _TIFFmalloc(td->td_nstrips * sizeof (uint64));
+            _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64),
+                             "for \"StripOffsets\" array");
        td->td_stripbytecount = (uint64 *)
-           _TIFFmalloc(td->td_nstrips * sizeof (uint64));
+            _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64),
+                             "for \"StripByteCounts\" array");
        if (td->td_stripoffset == NULL || td->td_stripbytecount == NULL)
                return (0);
        /*
index 42943fb..9d4bceb 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tif_zip.c,v 1.37 2017-05-10 15:21:16 erouault Exp $ */
-
 /*
  * Copyright (c) 1995-1997 Sam Leffler
  * Copyright (c) 1995-1997 Silicon Graphics, Inc.
diff --git a/libtiff/tif_zstd.c b/libtiff/tif_zstd.c
new file mode 100644 (file)
index 0000000..21c935e
--- /dev/null
@@ -0,0 +1,440 @@
+/*
+* Copyright (c) 2017, Planet Labs
+* Author: <even.rouault at spatialys.com>
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee, provided
+* that (i) the above copyright notices and this permission notice appear in
+* all copies of the software and related documentation, and (ii) the names of
+* Sam Leffler and Silicon Graphics may not be used in any advertising or
+* publicity relating to the software without the specific, prior written
+* permission of Sam Leffler and Silicon Graphics.
+*
+* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+*
+* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+* OF THIS SOFTWARE.
+*/
+
+#include "tiffiop.h"
+#ifdef ZSTD_SUPPORT
+/*
+* TIFF Library.
+*
+* ZSTD Compression Support
+*
+*/
+
+#include "tif_predict.h"
+#include "zstd.h"
+
+#include <stdio.h>
+
+/*
+* State block for each open TIFF file using ZSTD compression/decompression.
+*/
+typedef struct {
+        TIFFPredictorState predict;
+        ZSTD_DStream*   dstream;
+        ZSTD_CStream*   cstream;
+        int             compression_level;      /* compression level */
+        ZSTD_outBuffer  out_buffer;
+        int             state;                  /* state flags */
+#define LSTATE_INIT_DECODE 0x01
+#define LSTATE_INIT_ENCODE 0x02
+
+        TIFFVGetMethod  vgetparent;            /* super-class method */
+        TIFFVSetMethod  vsetparent;            /* super-class method */
+} ZSTDState;
+
+#define LState(tif)             ((ZSTDState*) (tif)->tif_data)
+#define DecoderState(tif)       LState(tif)
+#define EncoderState(tif)       LState(tif)
+
+static int ZSTDEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
+static int ZSTDDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s);
+
+static int
+ZSTDFixupTags(TIFF* tif)
+{
+        (void) tif;
+        return 1;
+}
+
+static int
+ZSTDSetupDecode(TIFF* tif)
+{
+        ZSTDState* sp = DecoderState(tif);
+
+        assert(sp != NULL);
+
+        /* if we were last encoding, terminate this mode */
+        if (sp->state & LSTATE_INIT_ENCODE) {
+            ZSTD_freeCStream(sp->cstream);
+            sp->cstream = NULL;
+            sp->state = 0;
+        }
+
+        sp->state |= LSTATE_INIT_DECODE;
+        return 1;
+}
+
+/*
+* Setup state for decoding a strip.
+*/
+static int
+ZSTDPreDecode(TIFF* tif, uint16 s)
+{
+        static const char module[] = "ZSTDPreDecode";
+        ZSTDState* sp = DecoderState(tif);
+        size_t zstd_ret;
+
+        (void) s;
+        assert(sp != NULL);
+
+        if( (sp->state & LSTATE_INIT_DECODE) == 0 )
+            tif->tif_setupdecode(tif);
+
+        if( sp->dstream )
+        {
+            ZSTD_freeDStream(sp->dstream);
+            sp->dstream = NULL;
+        }
+
+        sp->dstream = ZSTD_createDStream();
+        if( sp->dstream == NULL ) {
+            TIFFErrorExt(tif->tif_clientdata, module,
+                         "Cannot allocate decompression stream");
+            return 0;
+        }
+        zstd_ret = ZSTD_initDStream(sp->dstream);
+        if( ZSTD_isError(zstd_ret) ) {
+            TIFFErrorExt(tif->tif_clientdata, module,
+                         "Error in ZSTD_initDStream(): %s",
+                         ZSTD_getErrorName(zstd_ret));
+            return 0;
+        }
+
+        return 1;
+}
+
+static int
+ZSTDDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+{
+        static const char module[] = "ZSTDDecode";
+        ZSTDState* sp = DecoderState(tif);
+        ZSTD_inBuffer   in_buffer;
+        ZSTD_outBuffer  out_buffer;
+        size_t          zstd_ret;
+
+        (void) s;
+        assert(sp != NULL);
+        assert(sp->state == LSTATE_INIT_DECODE);
+
+        in_buffer.src = tif->tif_rawcp;
+        in_buffer.size = (size_t) tif->tif_rawcc;
+        in_buffer.pos = 0;
+
+        out_buffer.dst = op;
+        out_buffer.size = (size_t) occ;
+        out_buffer.pos = 0;
+
+        do {
+                zstd_ret = ZSTD_decompressStream(sp->dstream, &out_buffer,
+                                                 &in_buffer);
+                if( ZSTD_isError(zstd_ret) ) {
+                    TIFFErrorExt(tif->tif_clientdata, module,
+                                "Error in ZSTD_decompressStream(): %s",
+                                ZSTD_getErrorName(zstd_ret));
+                    return 0;
+                }
+        } while( zstd_ret != 0 &&
+                 in_buffer.pos < in_buffer.size &&
+                 out_buffer.pos < out_buffer.size );
+
+        if (out_buffer.pos < (size_t)occ) {
+                TIFFErrorExt(tif->tif_clientdata, module,
+                    "Not enough data at scanline %lu (short %lu bytes)",
+                    (unsigned long) tif->tif_row,
+                    (unsigned long) (size_t)occ - out_buffer.pos);
+                return 0;
+        }
+
+        tif->tif_rawcp += in_buffer.pos;
+        tif->tif_rawcc -= in_buffer.pos;
+
+        return 1;
+}
+
+static int
+ZSTDSetupEncode(TIFF* tif)
+{
+        ZSTDState* sp = EncoderState(tif);
+
+        assert(sp != NULL);
+        if (sp->state & LSTATE_INIT_DECODE) {
+                ZSTD_freeDStream(sp->dstream);
+                sp->dstream = NULL;
+                sp->state = 0;
+        }
+
+        sp->state |= LSTATE_INIT_ENCODE;
+        return 1;
+}
+
+/*
+* Reset encoding state at the start of a strip.
+*/
+static int
+ZSTDPreEncode(TIFF* tif, uint16 s)
+{
+        static const char module[] = "ZSTDPreEncode";
+        ZSTDState *sp = EncoderState(tif);
+        size_t zstd_ret;
+
+        (void) s;
+        assert(sp != NULL);
+        if( sp->state != LSTATE_INIT_ENCODE )
+            tif->tif_setupencode(tif);
+
+        if (sp->cstream) {
+            ZSTD_freeCStream(sp->cstream);
+            sp->cstream = NULL;
+        }
+        sp->cstream = ZSTD_createCStream();
+        if( sp->cstream == NULL ) {
+            TIFFErrorExt(tif->tif_clientdata, module,
+                         "Cannot allocate compression stream");
+            return 0;
+        }
+
+        zstd_ret = ZSTD_initCStream(sp->cstream, sp->compression_level);
+        if( ZSTD_isError(zstd_ret) ) {
+            TIFFErrorExt(tif->tif_clientdata, module,
+                         "Error in ZSTD_initCStream(): %s",
+                         ZSTD_getErrorName(zstd_ret));
+            return 0;
+        }
+
+        sp->out_buffer.dst = tif->tif_rawdata;
+        sp->out_buffer.size = (size_t)tif->tif_rawdatasize;
+        sp->out_buffer.pos = 0;
+
+        return 1;
+}
+
+/*
+* Encode a chunk of pixels.
+*/
+static int
+ZSTDEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+{
+        static const char module[] = "ZSTDEncode";
+        ZSTDState *sp = EncoderState(tif);
+        ZSTD_inBuffer   in_buffer;
+        size_t          zstd_ret;
+
+        assert(sp != NULL);
+        assert(sp->state == LSTATE_INIT_ENCODE);
+
+        (void) s;
+
+        in_buffer.src = bp;
+        in_buffer.size = (size_t)cc;
+        in_buffer.pos = 0;
+
+        do {
+                zstd_ret = ZSTD_compressStream(sp->cstream, &sp->out_buffer,
+                                               &in_buffer);
+                if( ZSTD_isError(zstd_ret) ) {
+                    TIFFErrorExt(tif->tif_clientdata, module,
+                                "Error in ZSTD_compressStream(): %s",
+                                ZSTD_getErrorName(zstd_ret));
+                    return 0;
+                }
+                if( sp->out_buffer.pos == sp->out_buffer.size ) {
+                        tif->tif_rawcc = tif->tif_rawdatasize;
+                        TIFFFlushData1(tif);
+                        sp->out_buffer.dst = tif->tif_rawcp;
+                        sp->out_buffer.pos = 0;
+                }
+        } while( in_buffer.pos < in_buffer.size );
+
+        return 1;
+}
+
+/*
+* Finish off an encoded strip by flushing it.
+*/
+static int
+ZSTDPostEncode(TIFF* tif)
+{
+        static const char module[] = "ZSTDPostEncode";
+        ZSTDState *sp = EncoderState(tif);
+        size_t          zstd_ret;
+
+        do {
+                zstd_ret = ZSTD_endStream(sp->cstream, &sp->out_buffer);
+                if( ZSTD_isError(zstd_ret) ) {
+                    TIFFErrorExt(tif->tif_clientdata, module,
+                                "Error in ZSTD_endStream(): %s",
+                                ZSTD_getErrorName(zstd_ret));
+                    return 0;
+                }
+                if( sp->out_buffer.pos > 0 ) {
+                        tif->tif_rawcc = sp->out_buffer.pos;
+                        TIFFFlushData1(tif);
+                        sp->out_buffer.dst = tif->tif_rawcp;
+                        sp->out_buffer.pos = 0;
+                }
+        } while (zstd_ret != 0);
+        return 1;
+}
+
+static void
+ZSTDCleanup(TIFF* tif)
+{
+        ZSTDState* sp = LState(tif);
+
+        assert(sp != 0);
+
+        (void)TIFFPredictorCleanup(tif);
+
+        tif->tif_tagmethods.vgetfield = sp->vgetparent;
+        tif->tif_tagmethods.vsetfield = sp->vsetparent;
+
+        if (sp->dstream) {
+            ZSTD_freeDStream(sp->dstream);
+            sp->dstream = NULL;
+        }
+        if (sp->cstream) {
+            ZSTD_freeCStream(sp->cstream);
+            sp->cstream = NULL;
+        }
+        _TIFFfree(sp);
+        tif->tif_data = NULL;
+
+        _TIFFSetDefaultCompressionState(tif);
+}
+
+static int
+ZSTDVSetField(TIFF* tif, uint32 tag, va_list ap)
+{
+       static const char module[] = "ZSTDVSetField";
+        ZSTDState* sp = LState(tif);
+
+        switch (tag) {
+        case TIFFTAG_ZSTD_LEVEL:
+                sp->compression_level = (int) va_arg(ap, int);
+                if( sp->compression_level <= 0 ||
+                    sp->compression_level > ZSTD_maxCLevel() )
+                {
+                    TIFFWarningExt(tif->tif_clientdata, module,
+                                   "ZSTD_LEVEL should be between 1 and %d",
+                                   ZSTD_maxCLevel());
+                }
+                return 1;
+        default:
+                return (*sp->vsetparent)(tif, tag, ap);
+        }
+        /*NOTREACHED*/
+}
+
+static int
+ZSTDVGetField(TIFF* tif, uint32 tag, va_list ap)
+{
+        ZSTDState* sp = LState(tif);
+
+        switch (tag) {
+        case TIFFTAG_ZSTD_LEVEL:
+                *va_arg(ap, int*) = sp->compression_level;
+                break;
+        default:
+                return (*sp->vgetparent)(tif, tag, ap);
+        }
+        return 1;
+}
+
+static const TIFFField ZSTDFields[] = {
+        { TIFFTAG_ZSTD_LEVEL, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT,
+          TIFF_SETGET_UNDEFINED,
+          FIELD_PSEUDO, TRUE, FALSE, "ZSTD compression_level", NULL },
+};
+
+int
+TIFFInitZSTD(TIFF* tif, int scheme)
+{
+        static const char module[] = "TIFFInitZSTD";
+        ZSTDState* sp;
+
+        assert( scheme == COMPRESSION_ZSTD );
+
+        /*
+        * Merge codec-specific tag information.
+        */
+        if (!_TIFFMergeFields(tif, ZSTDFields, TIFFArrayCount(ZSTDFields))) {
+                TIFFErrorExt(tif->tif_clientdata, module,
+                            "Merging ZSTD codec-specific tags failed");
+                return 0;
+        }
+
+        /*
+        * Allocate state block so tag methods have storage to record values.
+        */
+        tif->tif_data = (uint8*) _TIFFmalloc(sizeof(ZSTDState));
+        if (tif->tif_data == NULL)
+                goto bad;
+        sp = LState(tif);
+
+        /*
+        * Override parent get/set field methods.
+        */
+        sp->vgetparent = tif->tif_tagmethods.vgetfield;
+        tif->tif_tagmethods.vgetfield = ZSTDVGetField; /* hook for codec tags */
+        sp->vsetparent = tif->tif_tagmethods.vsetfield;
+        tif->tif_tagmethods.vsetfield = ZSTDVSetField; /* hook for codec tags */
+
+        /* Default values for codec-specific fields */
+        sp->compression_level = 9;             /* default comp. level */
+        sp->state = 0;
+        sp->dstream = 0;
+        sp->cstream = 0;
+        sp->out_buffer.dst = NULL;
+        sp->out_buffer.size = 0;
+        sp->out_buffer.pos = 0;
+
+        /*
+        * Install codec methods.
+        */
+        tif->tif_fixuptags = ZSTDFixupTags;
+        tif->tif_setupdecode = ZSTDSetupDecode;
+        tif->tif_predecode = ZSTDPreDecode;
+        tif->tif_decoderow = ZSTDDecode;
+        tif->tif_decodestrip = ZSTDDecode;
+        tif->tif_decodetile = ZSTDDecode;
+        tif->tif_setupencode = ZSTDSetupEncode;
+        tif->tif_preencode = ZSTDPreEncode;
+        tif->tif_postencode = ZSTDPostEncode;
+        tif->tif_encoderow = ZSTDEncode;
+        tif->tif_encodestrip = ZSTDEncode;
+        tif->tif_encodetile = ZSTDEncode;
+        tif->tif_cleanup = ZSTDCleanup;
+        /*
+        * Setup predictor setup.
+        */
+        (void) TIFFPredictorInit(tif);
+        return 1;
+bad:
+        TIFFErrorExt(tif->tif_clientdata, module,
+                    "No space for ZSTD state block");
+        return 0;
+}
+#endif /* ZSTD_SUPPORT */
+
+/* vim: set ts=8 sts=8 sw=8 noet: */
index fb39634..5b0a0c9 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiff.h,v 1.70 2016-01-23 21:20:34 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -189,7 +187,11 @@ typedef enum {
 #define     COMPRESSION_SGILOG         34676   /* SGI Log Luminance RLE */
 #define     COMPRESSION_SGILOG24       34677   /* SGI Log 24-bit packed */
 #define     COMPRESSION_JP2000          34712   /* Leadtools JPEG2000 */
+#define     COMPRESSION_LERC            34887   /* ESRI Lerc codec: https://github.com/Esri/lerc */
+/* compression codes 34887-34889 are reserved for ESRI */
 #define            COMPRESSION_LZMA            34925   /* LZMA2 */
+#define            COMPRESSION_ZSTD            50000   /* ZSTD: WARNING not registered in Adobe-maintained registry */
+#define            COMPRESSION_WEBP            50001   /* WEBP: WARNING not registered in Adobe-maintained registry */
 #define        TIFFTAG_PHOTOMETRIC             262     /* photometric interpretation */
 #define            PHOTOMETRIC_MINISWHITE      0       /* min value is white */
 #define            PHOTOMETRIC_MINISBLACK      1       /* min value is black */
@@ -450,6 +452,8 @@ typedef enum {
 /* tag 34929 is a private tag registered to FedEx */
 #define        TIFFTAG_FEDEX_EDR               34929   /* unknown use */
 #define TIFFTAG_INTEROPERABILITYIFD    40965   /* Pointer to Interoperability private directory */
+/* tags 50674 to 50677 are reserved for ESRI */
+#define TIFFTAG_LERC_PARAMETERS         50674   /* Stores LERC version and additional compression method */
 /* Adobe Digital Negative (DNG) format tags */
 #define TIFFTAG_DNGVERSION             50706   /* &DNG version number */
 #define TIFFTAG_DNGBACKWARDVERSION     50707   /* &DNG compatibility version */
@@ -603,6 +607,16 @@ typedef enum {
 #define TIFFTAG_PERSAMPLE       65563  /* interface for per sample tags */
 #define     PERSAMPLE_MERGED        0  /* present as a single value */
 #define     PERSAMPLE_MULTI         1  /* present as multiple values */
+#define TIFFTAG_ZSTD_LEVEL      65564    /* ZSTD compression level */
+#define TIFFTAG_LERC_VERSION            65565 /* LERC version */
+#define     LERC_VERSION_2_4            4
+#define TIFFTAG_LERC_ADD_COMPRESSION    65566 /* LERC additional compression */
+#define     LERC_ADD_COMPRESSION_NONE    0
+#define     LERC_ADD_COMPRESSION_DEFLATE 1
+#define     LERC_ADD_COMPRESSION_ZSTD    2
+#define TIFFTAG_LERC_MAXZERROR          65567    /* LERC maximum error */
+#define TIFFTAG_WEBP_LEVEL               65568 /* WebP compression level: WARNING not registered in Adobe-maintained registry */
+#define TIFFTAG_WEBP_LOSSLESS          65569   /* WebP lossless/lossy : WARNING not registered in Adobe-maintained registry */
 
 /*
  * EXIF tags
index de8a807..59542f1 100644 (file)
 /* Pointer difference type */
 #define TIFF_PTRDIFF_T @TIFF_PTRDIFF_T@
 
-/* Define to 1 if the system has the type `int16'. */
-#cmakedefine HAVE_INT16 1
-
-/* Define to 1 if the system has the type `int32'. */
-#cmakedefine HAVE_INT32 1
-
-/* Define to 1 if the system has the type `int8'. */
-#cmakedefine HAVE_INT8 1
-
 /* Compatibility stuff. */
 
 /* Define as 0 or 1 according to the floating point format suported by the
index 6da9c5a..5de30c9 100644 (file)
 /* Pointer difference type */
 #undef TIFF_PTRDIFF_T
 
-/* Define to 1 if the system has the type `int16'. */
-#undef HAVE_INT16
-
-/* Define to 1 if the system has the type `int32'. */
-#undef HAVE_INT32
-
-/* Define to 1 if the system has the type `int8'. */
-#undef HAVE_INT8
-
 /* Compatibility stuff. */
 
 /* Define as 0 or 1 according to the floating point format suported by the
index c8c6c65..fb37a75 100644 (file)
@@ -7,15 +7,6 @@
 #ifndef _TIFFCONF_
 #define _TIFFCONF_
 
-/* Define to 1 if the system has the type `int16'. */
-/* #undef HAVE_INT16 */
-
-/* Define to 1 if the system has the type `int32'. */
-/* #undef HAVE_INT32 */
-
-/* Define to 1 if the system has the type `int8'. */
-/* #undef HAVE_INT8 */
-
 /* The size of a `int', as computed by sizeof. */
 #define SIZEOF_INT 4
 
index 2ef3958..013b096 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffconf.wince.h,v 1.3 2010-03-10 18:56:49 bfriesen Exp $ */
-
 /*
  * Windows CE platform tiffconf.wince.h
  * Created by Mateusz Loskot (mateusz@loskot.net)
 #ifndef _TIFFCONF_
 #define _TIFFCONF_
 
-/* Define to 1 if the system has the type `int16'. */
-/* #undef HAVE_INT16 */
-
-/* Define to 1 if the system has the type `int32'. */
-/* #undef HAVE_INT32 */
-
-/* Define to 1 if the system has the type `int8'. */
-/* #undef HAVE_INT8 */
-
 /* The size of a `int', as computed by sizeof. */
 #define SIZEOF_INT 4
 
index ef61b5c..31c2e67 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffio.h,v 1.94 2017-01-11 19:02:49 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -52,7 +50,7 @@ typedef struct tiff TIFF;
  *     promoted type (i.e. one of int, unsigned int, pointer,
  *     or double) and because we defined pseudo-tags that are
  *     outside the range of legal Aldus-assigned tags.
- * NB: tsize_t is int32 and not uint32 because some functions
+ * NB: tsize_t is signed and not unsigned because some functions
  *     return -1.
  * NB: toff_t is not off_t for many reasons; TIFFs max out at
  *     32-bit file offsets, and BigTIFF maxes out at 64-bit
index ed994f1..df2cbbc 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffio.hxx,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -33,6 +31,7 @@
 
 #include <iostream>
 #include "tiff.h"
+#include "tiffio.h"
 
 extern TIFF* TIFFStreamOpen(const char*, std::ostream *);
 extern TIFF* TIFFStreamOpen(const char*, std::istream *);
index daa291c..186c291 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffiop.h,v 1.95 2017-09-07 14:02:52 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -72,6 +70,7 @@ extern int snprintf(char* str, size_t size, const char* format, ...);
 #endif
 
 #define    streq(a,b)      (strcmp(a,b) == 0)
+#define    strneq(a,b,n)   (strncmp(a,b,n) == 0)
 
 #ifndef TRUE
 #define        TRUE    1
@@ -314,11 +313,15 @@ typedef size_t TIFFIOSize_t;
 #define _TIFF_off_t off_t
 #endif
 
-#if __clang_major__ >= 4 || (__clang_major__ == 3 && __clang_minor__ >= 8)
+#if defined(__has_attribute) && defined(__clang__)
+#if __has_attribute(no_sanitize)
 #define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW __attribute__((no_sanitize("unsigned-integer-overflow")))
 #else
 #define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
 #endif
+#else
+#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
+#endif
 
 
 #if defined(__cplusplus)
@@ -424,6 +427,12 @@ extern int TIFFInitSGILog(TIFF*, int);
 #ifdef LZMA_SUPPORT
 extern int TIFFInitLZMA(TIFF*, int);
 #endif
+#ifdef ZSTD_SUPPORT
+extern int TIFFInitZSTD(TIFF*, int);
+#endif
+#ifdef WEBP_SUPPORT
+extern int TIFFInitWebP(TIFF*, int);
+#endif
 #ifdef VMS
 extern const TIFFCodec _TIFFBuiltinCODECS[];
 #else
index 7c41574..403d61b 100644 (file)
@@ -1,4 +1,4 @@
-#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.9\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
+#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.10\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
 /*
  * This define can be used in code that requires
  * compilation-related definitions specific to a
@@ -6,4 +6,4 @@
  * version checking should be done based on the
  * string returned by TIFFGetVersion.
  */
-#define TIFFLIB_VERSION 20171118
+#define TIFFLIB_VERSION 20181110
index 10ab284..a3bc337 100644 (file)
@@ -2887,18 +2887,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -3558,7 +3546,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd* | netbsdelf*-gnu)
+netbsd*)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -4436,7 +4424,7 @@ m4_if([$1], [CXX], [
            ;;
        esac
        ;;
-      netbsd* | netbsdelf*-gnu)
+      netbsd*)
        ;;
       *qnx* | *nto*)
         # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4948,9 +4936,6 @@ m4_if([$1], [CXX], [
       ;;
     esac
     ;;
-  linux* | k*bsd*-gnu | gnu*)
-    _LT_TAGVAR(link_all_deplibs, $1)=no
-    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
@@ -5013,9 +4998,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
   openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
-  linux* | k*bsd*-gnu | gnu*)
-    _LT_TAGVAR(link_all_deplibs, $1)=no
-    ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5270,7 +5252,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
        wlarc=
@@ -5791,7 +5773,6 @@ _LT_EOF
        if test yes = "$lt_cv_irix_exported_symbol"; then
           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
        fi
-       _LT_TAGVAR(link_all_deplibs, $1)=no
       else
        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
@@ -5813,7 +5794,7 @@ _LT_EOF
       esac
       ;;
 
-    netbsd* | netbsdelf*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
index 212905b..f5c9bf0 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -179,7 +179,7 @@ NROFF = nroff
 MANS = $(dist_man1_MANS) $(dist_man3_MANS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 am__DIST_COMMON = $(dist_man1_MANS) $(dist_man3_MANS) \
-       $(srcdir)/Makefile.in $(top_srcdir)/config/mkinstalldirs
+       $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -419,8 +419,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -526,7 +526,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index a6a7d82..fc64ccc 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFClose.3tiff,v 1.4 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index af67777..efcd39d 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFDataWidth.3tiff,v 1.4 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2002, Andrey Kiselev <dron@ak4719.spb.edu>
 .\"
index 6924c7f..5d0c219 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFError.3tiff,v 1.3 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 4fb1e2c..6049f59 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldDataType.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
index 0f49c33..47d9ad8 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldName.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
index 07324f8..ff14c52 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldPassCount.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
index 88d67fd..b6a4546 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldReadCount.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
index f94f1be..3d1e83d 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldTag.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
index 68a3b04..f80290f 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFieldWriteCount.3tiff,v 1.2 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
 .\"
index 27520da..c46a2a3 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFFlush.3tiff,v 1.3 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 528019e..c2fd025 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFGetField.3tiff,v 1.8 2017-06-30 17:40:02 erouault Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index f420931..5a6e96b 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFOpen.3tiff,v 1.2 2005-07-01 12:36:22 dron Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 437b09e..c208f04 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFPrintDirectory.3tiff,v 1.1 2004-11-11 14:39:16 dron Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 86c9368..fe6064f 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFRGBAImage.3tiff,v 1.3 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index e13586f..c178c42 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFReadDirectory.3tiff,v 1.4 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index afde8e7..7122946 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFReadEncodedStrip.3tiff,v 1.3 2016-09-25 20:05:49 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 99d3e45..6f8d649 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFReadEncodedTile.3tiff,v 1.4 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 7373e2a..920fc37 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFReadRGBAImage.3tiff,v 1.5 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index db889a0..3160412 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFReadRGBAStrip.3tiff,v 1.4 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 5cb7655..5b9b4bf 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFReadRGBATile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 6fe326b..6d411df 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFReadRawStrip.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 2844573..9c60888 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFReadRawTile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 2d9c85a..ca4b836 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFReadScanline.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index f1107dc..cf0f21d 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFReadTile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 0f109f6..734c015 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFSetDirectory.3tiff,v 1.4 2017-06-30 17:40:02 erouault Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 695a199..df2a5ea 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFSetField.3tiff,v 1.7 2017-06-30 17:40:02 erouault Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 0d302ed..9a4d909 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFWarning.3tiff,v 1.4 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 9f0d249..e7b84b6 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFWriteDirectory.3tiff,v 1.4 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index a31f6e0..dc410e4 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFWriteEncodedStrip.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 476cbbb..d94f4d0 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFWriteEncodedTile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 8d145a0..784a6e0 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFWriteRawStrip.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 78b23ed..f3334b8 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFWriteRawTile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index a2691b5..a51cec5 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFWriteScanline.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 3755fc7..a670025 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFWriteTile.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index edda2db..2011170 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFbuffer.3tiff,v 1.3 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1995 Sam Leffler
 .\" Copyright (c) 1995 Silicon Graphics, Inc.
index 6c480c4..aa3a8c6 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFcodec.3tiff,v 1.4 2016-09-25 20:05:50 bfriesen Exp $
 .\"
 .\" Copyright (c) 1995 Sam Leffler
 .\" Copyright (c) 1995 Silicon Graphics, Inc.
index 987ac9d..1d2bb2b 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFcolor.3tiff,v 1.5 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 2003, Andrey Kiselev <dron@ak4719.spb.edu>
 .\"
index 6c4412d..70a8212 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFmemory.3tiff,v 1.3 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1995 Sam Leffler
 .\" Copyright (c) 1995 Silicon Graphics, Inc.
@@ -78,7 +77,7 @@ C routines:
 .IR memcpy ,
 and
 .IR memcmp ,
-repsectively.
+respectively.
 .SH DIAGNOSTICS
 None.
 .SH "SEE ALSO"
index 8bddc88..4d95f5f 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFquery.3tiff,v 1.1 2004-11-11 14:39:16 dron Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -114,7 +113,7 @@ returned if the image data is organized in strips.
 .IR TIFFIsByteSwapped
 returns a non-zero value if the image data was in a different byte-order than
 the host machine. Zero is returned if the TIFF file and local host byte-orders
-are the same.  Note that TIFFReadTile(), TIFFReadStrip() and
+are the same.  Note that TIFFReadTile(), TIFFReadEncodedStrip() and
 TIFFReadScanline() functions already normally perform byte swapping to local
 host order if needed.
 .PP
index 4b90a59..5fbc6bc 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFsize.3tiff,v 1.3 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index da59b0e..eb38318 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFstrip.3tiff,v 1.3 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1992-1997 Sam Leffler
 .\" Copyright (c) 1992-1997 Silicon Graphics, Inc.
index 2294156..3d7a47b 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFswab.3tiff,v 1.3 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 5bdbe55..10310a0 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: TIFFtile.3tiff,v 1.3 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index f82e252..7aeea4f 100644 (file)
@@ -1,4 +1,3 @@
-.\"    $Id: fax2ps.1,v 1.5 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 7ce4ffe..97144c9 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: fax2tiff.1,v 1.8 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1990-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 924d17a..3efe162 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: libtiff.3tiff,v 1.5 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 428f93a..772b4a7 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: pal2rgb.1,v 1.4 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1990-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 2c940fb..12e58e2 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: ppm2tiff.1,v 1.6 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1991-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 184a5d1..f45569d 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: raw2tiff.1,v 1.8 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1990-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 182ebbe..4fe9942 100644 (file)
@@ -1,4 +1,3 @@
-.\"    $Id: tiff2bw.1,v 1.4 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index de80599..9301133 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiff2pdf.1,v 1.8 2016-09-25 20:05:51 bfriesen Exp $
 .\" 
 .\"  Copyright (c) 2003 Ross Finlayson
 .\" 
index e3b57ec..5e2b9a8 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiff2ps.1,v 1.12 2016-09-25 20:05:51 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index f0af0a1..d9c9baa 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiff2rgba.1,v 1.5 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 3d111a4..ee83a74 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiffcmp.1,v 1.7 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index fee4639..0545686 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiffcp.1,v 1.14 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 3fa6bb6..5bd0097 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiffcrop.1,v 1.8 2016-09-25 20:05:52 bfriesen Exp $
 .\" tiffcrop -- a port of tiffcp.c extended to include extended processing of images
 .\" 
 .\" Original code:
index d5214ce..56725b2 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiffdither.1,v 1.6 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1990-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index a5eeccd..07b08e3 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiffdump.1,v 1.6 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 5303101..6ef6209 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiffgt.1,v 1.5 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 89637bb..64958a6 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiffinfo.1,v 1.3 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 428ca9a..b10ba79 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiffmedian.1,v 1.4 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1990-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index d7c48fa..513c756 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiffset.1,v 1.7 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1988-1997 Sam Leffler
 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
index f01b3f4..fe309f4 100644 (file)
@@ -1,4 +1,3 @@
-.\" $Id: tiffsplit.1,v 1.7 2016-09-25 20:05:52 bfriesen Exp $
 .\"
 .\" Copyright (c) 1992-1997 Sam Leffler
 .\" Copyright (c) 1992-1997 Silicon Graphics, Inc.
index ec45e77..ae54467 100644 (file)
--- a/nmake.opt
+++ b/nmake.opt
@@ -1,4 +1,3 @@
-# $Id: nmake.opt,v 1.20 2017-10-10 14:39:43 erouault Exp $
 #
 # Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
 #
 ###### Edit the following lines to choose a feature set you need. #######
 #
 
-# 
-# Select WINMODE_CONSOLE to build a library which reports errors to stderr, or
-# WINMODE_WINDOWED to build such that errors are reported via MessageBox().
-#
-WINMODE_CONSOLE = 1
-#WINMODE_WINDOWED = 1
-
 #
 # Comment out the following lines to disable internal codecs.
 #
@@ -160,13 +152,6 @@ DLLNAME    = libtiff.dll
 # Set the native cpu bit order
 EXTRAFLAGS     = -DFILLODER_LSB2MSB $(EXTRAFLAGS)
 
-!IFDEF WINMODE_WINDOWED
-EXTRAFLAGS     = -DTIF_PLATFORM_WINDOWED $(EXTRAFLAGS)
-LIBS           = user32.lib $(LIBS)
-!ELSE
-EXTRAFLAGS     = -DTIF_PLATFORM_CONSOLE $(EXTRAFLAGS)
-!ENDIF
-
 # Codec stuff
 !IFDEF CCITT_SUPPORT
 EXTRAFLAGS     = -DCCITT_SUPPORT $(EXTRAFLAGS)
index 8b221d1..b7eb3a2 100644 (file)
@@ -28,6 +28,8 @@ set(port_optional_SOURCES
   getopt.c
   lfind.c
   strcasecmp.c
+  strtol.c
+  strtoll.c
   strtoul.c
   strtoull.c)
 
@@ -45,6 +47,12 @@ endif()
 if(NOT HAVE_STRCASECMP)
   list(APPEND port_USED_FILES strcasecmp.c)
 endif()
+if(NOT HAVE_STRTOL)
+  list(APPEND port_USED_FILES strtol.c)
+endif()
+if(NOT HAVE_STRTOLL)
+  list(APPEND port_USED_FILES strtoll.c)
+endif()
 if(NOT HAVE_STRTOUL)
   list(APPEND port_USED_FILES strtoul.c)
 endif()
index 4d6e11d..250479f 100644 (file)
@@ -27,7 +27,9 @@ EXTRA_DIST = \
        CMakeLists.txt \
        Makefile.vc \
        libport.h \
-       snprintf.c
+       snprintf.c \
+       _strtol.h \
+       _strtoul.h
 
 noinst_LTLIBRARIES     = libport.la
 libport_la_SOURCES     = dummy.c libport.h
index 55e09e6..72e192b 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -122,7 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -149,7 +149,12 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = $(DEPDIR)/getopt.Plo $(DEPDIR)/lfind.Plo \
+       $(DEPDIR)/snprintf.Plo $(DEPDIR)/strcasecmp.Plo \
+       $(DEPDIR)/strtol.Plo $(DEPDIR)/strtoll.Plo \
+       $(DEPDIR)/strtoul.Plo $(DEPDIR)/strtoull.Plo \
+       ./$(DEPDIR)/dummy.Plo
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -196,8 +201,8 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
-       $(top_srcdir)/config/mkinstalldirs getopt.c lfind.c snprintf.c \
-       strcasecmp.c strtoul.c strtoull.c
+       getopt.c lfind.c snprintf.c strcasecmp.c strtol.c strtoll.c \
+       strtoul.c strtoull.c
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -351,7 +356,9 @@ EXTRA_DIST = \
        CMakeLists.txt \
        Makefile.vc \
        libport.h \
-       snprintf.c
+       snprintf.c \
+       _strtol.h \
+       _strtoul.h
 
 noinst_LTLIBRARIES = libport.la
 libport_la_SOURCES = dummy.c libport.h
@@ -377,8 +384,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -410,13 +417,21 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lfind.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/snprintf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoul.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoull.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lfind.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/snprintf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtol.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoll.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoul.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoull.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -497,7 +512,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -567,7 +585,15 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
        mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf $(DEPDIR) ./$(DEPDIR)
+               -rm -f $(DEPDIR)/getopt.Plo
+       -rm -f $(DEPDIR)/lfind.Plo
+       -rm -f $(DEPDIR)/snprintf.Plo
+       -rm -f $(DEPDIR)/strcasecmp.Plo
+       -rm -f $(DEPDIR)/strtol.Plo
+       -rm -f $(DEPDIR)/strtoll.Plo
+       -rm -f $(DEPDIR)/strtoul.Plo
+       -rm -f $(DEPDIR)/strtoull.Plo
+       -rm -f ./$(DEPDIR)/dummy.Plo
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -613,7 +639,15 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf $(DEPDIR) ./$(DEPDIR)
+               -rm -f $(DEPDIR)/getopt.Plo
+       -rm -f $(DEPDIR)/lfind.Plo
+       -rm -f $(DEPDIR)/snprintf.Plo
+       -rm -f $(DEPDIR)/strcasecmp.Plo
+       -rm -f $(DEPDIR)/strtol.Plo
+       -rm -f $(DEPDIR)/strtoll.Plo
+       -rm -f $(DEPDIR)/strtoul.Plo
+       -rm -f $(DEPDIR)/strtoull.Plo
+       -rm -f ./$(DEPDIR)/dummy.Plo
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -634,16 +668,16 @@ uninstall-am:
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-       clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
-       ctags-am distclean distclean-compile distclean-generic \
-       distclean-libtool distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-data \
-       install-data-am install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-man install-pdf install-pdf-am \
-       install-ps install-ps-am install-strip installcheck \
-       installcheck-am installdirs maintainer-clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-generic clean-libtool clean-noinstLTLIBRARIES \
+       cscopelist-am ctags ctags-am distclean distclean-compile \
+       distclean-generic distclean-libtool distclean-tags distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
        maintainer-clean-generic mostlyclean mostlyclean-compile \
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags tags-am uninstall uninstall-am
index bde4804..992d269 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Makefile.vc,v 1.5 2015-08-19 02:31:04 bfriesen Exp $
 #
 # Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
 #
diff --git a/port/_strtol.h b/port/_strtol.h
new file mode 100644 (file)
index 0000000..73a1006
--- /dev/null
@@ -0,0 +1,160 @@
+/* $NetBSD: _strtol.h,v 1.11 2017/07/06 21:08:44 joerg Exp $ */
+
+/*-
+ * Copyright (c) 1990, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Original version ID:
+ * NetBSD: src/lib/libc/locale/_wcstol.h,v 1.2 2003/08/07 16:43:03 agc Exp
+ */
+
+#include <assert.h>
+
+/*
+ * function template for strtol, strtoll and strtoimax.
+ *
+ * parameters:
+ *     _FUNCNAME : function name
+ *      __INT     : return type
+ *      __INT_MIN : lower limit of the return type
+ *      __INT_MAX : upper limit of the return type
+ */
+__INT
+_FUNCNAME(const char *nptr, char **endptr, int base)
+{
+       const char *s;
+       __INT acc, cutoff;
+       unsigned char c;
+       int i, neg, any, cutlim;
+
+       assert(nptr != NULL);
+       /* endptr may be NULL */
+
+       /* check base value */
+       if (base && (base < 2 || base > 36)) {
+               errno = EINVAL;
+               if (endptr != NULL)
+                       /* LINTED interface specification */
+                       *endptr = (char *)(nptr);
+               return 0;
+       }
+
+       /*
+        * Skip white space and pick up leading +/- sign if any.
+        * If base is 0, allow 0x for hex and 0 for octal, else
+        * assume decimal; if base is already 16, allow 0x.
+        */
+       s = nptr;
+       do {
+               c = *s++;
+       } while (isspace(c));
+       if (c == '-') {
+               neg = 1;
+               c = *s++;
+       } else {
+               neg = 0;
+               if (c == '+')
+                       c = *s++;
+       }
+       if ((base == 0 || base == 16) &&
+           c == '0' && (*s == 'x' || *s == 'X') &&
+           ((s[1] >= '0' && s[1] <= '9') ||
+            (s[1] >= 'a' && s[1] <= 'f') ||
+            (s[1] >= 'A' && s[1] <= 'F'))) {
+               c = s[1];
+               s += 2;
+               base = 16;
+       } else if (base == 0)
+               base = (c == '0' ? 8 : 10);
+
+       /*
+        * Compute the cutoff value between legal numbers and illegal
+        * numbers.  That is the largest legal value, divided by the
+        * base.  An input number that is greater than this value, if
+        * followed by a legal input character, is too big.  One that
+        * is equal to this value may be valid or not; the limit
+        * between valid and invalid numbers is then based on the last
+        * digit.  For instance, if the range for longs is
+        * [-2147483648..2147483647] and the input base is 10,
+        * cutoff will be set to 214748364 and cutlim to either
+        * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated
+        * a value > 214748364, or equal but the next digit is > 7 (or 8),
+        * the number is too big, and we will return a range error.
+        *
+        * Set any if any `digits' consumed; make it negative to indicate
+        * overflow.
+        */
+       cutoff = (__INT)(neg ? __INT_MIN : __INT_MAX);
+       cutlim = (int)(cutoff % base);
+       cutoff /= base;
+       if (neg) {
+               if (cutlim > 0) {
+                       cutlim -= base;
+                       cutoff += 1;
+               }
+               cutlim = -cutlim;
+       }
+       for (acc = 0, any = 0;; c = *s++) {
+               if (c >= '0' && c <= '9')
+                       i = c - '0';
+               else if (c >= 'a' && c <= 'z')
+                       i = (c - 'a') + 10;
+               else if (c >= 'A' && c <= 'Z')
+                       i = (c - 'A') + 10;
+               else
+                       break;
+               if (i >= base)
+                       break;
+               if (any < 0)
+                       continue;
+               if (neg) {
+                       if (acc < cutoff || (acc == cutoff && i > cutlim)) {
+                               acc = __INT_MIN;
+                               any = -1;
+                               errno = ERANGE;
+                       } else {
+                               any = 1;
+                               acc *= base;
+                               acc -= i;
+                       }
+               } else {
+                       if (acc > cutoff || (acc == cutoff && i > cutlim)) {
+                               acc = __INT_MAX;
+                               any = -1;
+                               errno = ERANGE;
+                       } else {
+                               any = 1;
+                               acc *= base;
+                               acc += i;
+                       }
+               }
+       }
+       if (endptr != NULL)
+               /* LINTED interface specification */
+               *endptr = (char *)(any ? s - 1 : nptr);
+       return(acc);
+}
diff --git a/port/_strtoul.h b/port/_strtoul.h
new file mode 100644 (file)
index 0000000..5cb6216
--- /dev/null
@@ -0,0 +1,127 @@
+/* $NetBSD: _strtoul.h,v 1.11 2017/07/06 21:08:44 joerg Exp $ */
+
+/*-
+ * Copyright (c) 1990, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Original version ID:
+ * NetBSD: src/lib/libc/locale/_wcstoul.h,v 1.2 2003/08/07 16:43:03 agc Exp
+ */
+
+#include <assert.h>
+
+/*
+ * function template for strtoul, strtoull and strtoumax.
+ *
+ * parameters:
+ *     _FUNCNAME  : function name
+ *      __UINT     : return type
+ *      __UINT_MAX : upper limit of the return type
+ */
+__UINT
+_FUNCNAME(const char *nptr, char **endptr, int base)
+{
+       const char *s;
+       __UINT acc, cutoff;
+       unsigned char c;
+       int i, neg, any, cutlim;
+
+       assert(nptr != NULL);
+       /* endptr may be NULL */
+
+       /* check base value */
+       if (base && (base < 2 || base > 36)) {
+               errno = EINVAL;
+               if (endptr != NULL)
+                       /* LINTED interface specification */
+                       *endptr = (char *)(nptr);
+               return 0;
+       }
+
+       /*
+        * Skip white space and pick up leading +/- sign if any.
+        * If base is 0, allow 0x for hex and 0 for octal, else
+        * assume decimal; if base is already 16, allow 0x.
+        */
+       s = nptr;
+       do {
+               c = *s++;
+       } while (isspace(c));
+       if (c == '-') {
+               neg = 1;
+               c = *s++;
+       } else {
+               neg = 0;
+               if (c == '+')
+                       c = *s++;
+       }
+       if ((base == 0 || base == 16) &&
+           c == '0' && (*s == 'x' || *s == 'X') &&
+           ((s[1] >= '0' && s[1] <= '9') ||
+            (s[1] >= 'a' && s[1] <= 'f') ||
+            (s[1] >= 'A' && s[1] <= 'F'))) {
+               c = s[1];
+               s += 2;
+               base = 16;
+       } else if (base == 0)
+               base = (c == '0' ? 8 : 10);
+
+       /*
+        * See strtol for comments as to the logic used.
+        */
+       cutoff = ((__UINT)__UINT_MAX / (__UINT)base);
+       cutlim = (int)((__UINT)__UINT_MAX % (__UINT)base);
+       for (acc = 0, any = 0;; c = *s++) {
+               if (c >= '0' && c <= '9')
+                       i = c - '0';
+               else if (c >= 'a' && c <= 'z')
+                       i = (c - 'a') + 10;
+               else if (c >= 'A' && c <= 'Z')
+                       i = (c - 'A') + 10;
+               else
+                       break;
+               if (i >= base)
+                       break;
+               if (any < 0)
+                       continue;
+               if (acc > cutoff || (acc == cutoff && i > cutlim)) {
+                       acc = __UINT_MAX;
+                       any = -1;
+                       errno = ERANGE;
+               } else {
+                       any = 1;
+                       acc *= (__UINT)base;
+                       acc += i;
+               }
+       }
+       if (neg && any > 0)
+               acc = -acc;
+       if (endptr != NULL)
+               /* LINTED interface specification */
+               *endptr = (char *)(any ? s - 1 : nptr);
+       return(acc);
+}
index 46f93bc..346a07e 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: dummy.c,v 1.3 2007/03/21 14:54:16 dron Exp $ */
-
 /*
  * Dummy function, just to be ensure that the library always will be created.
  */
index 6eff8ee..c7bdb11 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: getopt.c,v 1.3 2009-01-22 20:53:07 fwarmerdam Exp $ */
-
 /*
  * Copyright (c) 1987, 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
index 64b261c..00ab649 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: lfind.c,v 1.4 2007/01/15 18:40:39 mloskot Exp $ */
-
 /*
  * Copyright (c) 1989, 1993
  *     The Regents of the University of California.  All rights reserved.
index d9b0421..ff26263 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: libport.h,v 1.5 2015-08-19 02:31:04 bfriesen Exp $ */
-
 /*
  * Copyright (c) 2009 Frank Warmerdam
  *
@@ -38,9 +36,18 @@ int strcasecmp(const char *s1, const char *s2);
 #  define HAVE_GETOPT 1
 #endif
 
-#if 0
+#if HAVE_STRTOL
+long strtol(const char *nptr, char **endptr, int base);
+#endif
+#if HAVE_STRTOLL
+long long strtoll(const char *nptr, char **endptr, int base);
+#endif
+#if HAVE_STRTOUL
 unsigned long strtoul(const char *nptr, char **endptr, int base);
 #endif
+#if HAVE_STRTOULL
+unsigned long long strtoull(const char *nptr, char **endptr, int base);
+#endif
 
 #if 0
 void *
index de7e423..65e2b41 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: strcasecmp.c,v 1.4 2015-06-21 01:09:09 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1987, 1993
  *     The Regents of the University of California.  All rights reserved.
diff --git a/port/strtol.c b/port/strtol.c
new file mode 100644 (file)
index 0000000..a355dde
--- /dev/null
@@ -0,0 +1,45 @@
+/* $NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
+ * Copyright (c) 2003 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if 0
+__RCSID("$NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $");
+#endif
+
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#define        _FUNCNAME       strtol
+#define        __INT           long
+#define        __INT_MIN       LONG_MIN
+#define        __INT_MAX       LONG_MAX
+
+#include "_strtol.h"
diff --git a/port/strtoll.c b/port/strtoll.c
new file mode 100644 (file)
index 0000000..4784b09
--- /dev/null
@@ -0,0 +1,44 @@
+/* $NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
+ * Copyright (c) 2003 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if 0
+__RCSID("$NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $");
+#endif
+
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#define        _FUNCNAME       strtoll
+#define        __INT           long long
+#define        __INT_MIN       LLONG_MIN
+#define        __INT_MAX       LLONG_MAX
+
+#include "_strtol.h"
index f7a9a1a..dbd44f1 100644 (file)
@@ -1,8 +1,9 @@
-/* $Id: strtoul.c,v 1.2 2005/07/07 16:34:06 dron Exp $ */
+/* $NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $ */
 
-/*
- * Copyright (c) 1990, 1993
- *     The Regents of the University of California.  All rights reserved.
+/*-
+ * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
+ * Copyright (c) 2003 Citrus Project,
+ * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  */
 
 #if 0
-static char sccsid[] = "@(#)strtoul.c  8.1 (Berkeley) 6/4/93";
-__RCSID("$NetBSD: strtoul.c,v 1.16 2003/08/07 16:43:45 agc Exp $");
+__RCSID("$NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $");
 #endif
 
+#include <assert.h>
 #include <ctype.h>
 #include <errno.h>
 #include <limits.h>
 #include <stdlib.h>
 
-/*
- * Convert a string to an unsigned long integer.
- *
- * Ignores `locale' stuff.  Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-unsigned long
-strtoul(const char *nptr, char **endptr, int base)
-{
-       const char *s;
-       unsigned long acc, cutoff;
-       int c;
-       int neg, any, cutlim;
-
-       /*
-        * See strtol for comments as to the logic used.
-        */
-       s = nptr;
-       do {
-               c = (unsigned char) *s++;
-       } while (isspace(c));
-       if (c == '-') {
-               neg = 1;
-               c = *s++;
-       } else {
-               neg = 0;
-               if (c == '+')
-                       c = *s++;
-       }
-       if ((base == 0 || base == 16) &&
-           c == '0' && (*s == 'x' || *s == 'X')) {
-               c = s[1];
-               s += 2;
-               base = 16;
-       }
-       if (base == 0)
-               base = c == '0' ? 8 : 10;
+#define        _FUNCNAME       strtoul
+#define        __UINT          unsigned long int
+#define        __UINT_MAX      ULONG_MAX
 
-       cutoff = ULONG_MAX / (unsigned long)base;
-       cutlim = (int)(ULONG_MAX % (unsigned long)base);
-       for (acc = 0, any = 0;; c = (unsigned char) *s++) {
-               if (isdigit(c))
-                       c -= '0';
-               else if (isalpha(c))
-                       c -= isupper(c) ? 'A' - 10 : 'a' - 10;
-               else
-                       break;
-               if (c >= base)
-                       break;
-               if (any < 0)
-                       continue;
-               if (acc > cutoff || (acc == cutoff && c > cutlim)) {
-                       any = -1;
-                       acc = ULONG_MAX;
-                       errno = ERANGE;
-               } else {
-                       any = 1;
-                       acc *= (unsigned long)base;
-                       acc += c;
-               }
-       }
-       if (neg && any > 0)
-               acc = -acc;
-       if (endptr != 0)
-               /* LINTED interface specification */
-               *endptr = (char *)(any ? s - 1 : nptr);
-       return (acc);
-}
+#include "_strtoul.h"
index fb7739c..91e4ddf 100644 (file)
@@ -1,6 +1,9 @@
+/* $NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $ */
+
 /*-
- * Copyright (c) 1992, 1993
- *     The Regents of the University of California.  All rights reserved.
+ * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
+ * Copyright (c) 2003 Citrus Project,
+ * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  * SUCH DAMAGE.
  */
 
-#include <limits.h>
-#include <errno.h>
+#if 0
+__RCSID("$NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $");
+#endif
+
+#include <assert.h>
 #include <ctype.h>
+#include <errno.h>
+#include <limits.h>
 #include <stdlib.h>
 
-/*
- * Convert a string to an unsigned long long integer.
- *
- * Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-unsigned long long
-strtoull(const char *nptr, char **endptr, int base)
-{
-       const char *s;
-       unsigned long long acc;
-       char c;
-       unsigned long long cutoff;
-       int neg, any, cutlim;
-
-       /*
-        * See strtoq for comments as to the logic used.
-        */
-       s = nptr;
-       do {
-               c = *s++;
-       } while (isspace((unsigned char)c));
-       if (c == '-') {
-               neg = 1;
-               c = *s++;
-       } else {
-               neg = 0;
-               if (c == '+')
-                       c = *s++;
-       }
-       if ((base == 0 || base == 16) &&
-           c == '0' && (*s == 'x' || *s == 'X') &&
-           ((s[1] >= '0' && s[1] <= '9') ||
-           (s[1] >= 'A' && s[1] <= 'F') ||
-           (s[1] >= 'a' && s[1] <= 'f'))) {
-               c = s[1];
-               s += 2;
-               base = 16;
-       }
-       if (base == 0)
-               base = c == '0' ? 8 : 10;
-       acc = any = 0;
-       if (base < 2 || base > 36)
-               goto noconv;
+#define        _FUNCNAME       strtoull
+#define        __UINT          unsigned long long int
+#define        __UINT_MAX      ULLONG_MAX
 
-       cutoff = ULLONG_MAX / base;
-       cutlim = ULLONG_MAX % base;
-       for ( ; ; c = *s++) {
-               if (c >= '0' && c <= '9')
-                       c -= '0';
-               else if (c >= 'A' && c <= 'Z')
-                       c -= 'A' - 10;
-               else if (c >= 'a' && c <= 'z')
-                       c -= 'a' - 10;
-               else
-                       break;
-               if (c >= base)
-                       break;
-               if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
-                       any = -1;
-               else {
-                       any = 1;
-                       acc *= base;
-                       acc += c;
-               }
-       }
-       if (any < 0) {
-               acc = ULLONG_MAX;
-               errno = ERANGE;
-       } else if (!any) {
-noconv:
-               errno = EINVAL;
-       } else if (neg)
-               acc = -acc;
-       if (endptr != NULL)
-               *endptr = (char *)(any ? s - 1 : nptr);
-       return (acc);
-}
+#include "_strtoul.h"
index 912be19..266e3fc 100644 (file)
@@ -44,6 +44,7 @@ set(TESTSCRIPTS
     tiffcp-logluv.sh
     tiffcp-thumbnail.sh
     tiffcp-lzw-compat.sh
+    tiffcp-lzw-scanline-decode.sh
     tiffdump.sh
     tiffinfo.sh
     tiffcp-split.sh
@@ -120,7 +121,8 @@ set(TIFFIMAGES
     images/rgb-3c-16b.tiff
     images/rgb-3c-8b.tiff
     images/quad-tile.jpg.tiff
-    images/quad-lzw-compat.tiff)
+    images/quad-lzw-compat.tiff
+    images/lzw-single-strip.tiff)
 
 set(BMPIMAGES
     images/palette-1c-8b.bmp
@@ -335,6 +337,7 @@ add_convert_test(tiffcp   g32d       "-c g3:2d"      "images/miniswhite-1c-1b.ti
 add_convert_test(tiffcp   g32dfill   "-c g3:2d:fill" "images/miniswhite-1c-1b.tiff" FALSE)
 add_convert_test(tiffcp   g4         "-c g4"         "images/miniswhite-1c-1b.tiff" FALSE)
 add_convert_test(tiffcp   none       "-c none"       "images/quad-lzw-compat.tiff" FALSE)
+add_convert_test(tiffcp   noner1     "-c none -r 1"  "images/lzw-single-strip.tiff" FALSE)
 add_convert_test_multi(tiffcp tiffcp "" logluv "-c none" "-c sgilog" ""
                        "images/logluv-3c-16b.tiff"    FALSE)
 add_convert_test_multi(tiffcp thumbnail "" thumbnail "g3:1d" "" ""
index 2052487..52a3fa4 100644 (file)
@@ -79,6 +79,7 @@ TESTSCRIPTS = \
        tiffcp-logluv.sh \
        tiffcp-thumbnail.sh \
        tiffcp-lzw-compat.sh \
+       tiffcp-lzw-scanline-decode.sh \
        tiffdump.sh \
        tiffinfo.sh \
        tiffcp-split.sh \
@@ -158,7 +159,8 @@ TIFFIMAGES = \
        images/rgb-3c-16b.tiff \
        images/rgb-3c-8b.tiff \
        images/quad-tile.jpg.tiff \
-       images/quad-lzw-compat.tiff
+       images/quad-lzw-compat.tiff \
+       images/lzw-single-strip.tiff
 
 PNMIMAGES = \
        images/minisblack-1c-8b.pgm \
index 15c0147..ab94d06 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -128,7 +128,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
        $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -174,7 +174,13 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/ascii_tag.Po \
+       ./$(DEPDIR)/check_tag.Po ./$(DEPDIR)/custom_dir.Po \
+       ./$(DEPDIR)/long_tag.Po ./$(DEPDIR)/raw_decode.Po \
+       ./$(DEPDIR)/rewrite_tag.Po ./$(DEPDIR)/short_tag.Po \
+       ./$(DEPDIR)/strip.Po ./$(DEPDIR)/strip_rw.Po \
+       ./$(DEPDIR)/test_arrays.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -414,9 +420,10 @@ am__EXEEXT_3 = ppm2tiff_pbm.sh ppm2tiff_pgm.sh ppm2tiff_ppm.sh \
        tiffcp-g3.sh tiffcp-g3-1d.sh tiffcp-g3-1d-fill.sh \
        tiffcp-g3-2d.sh tiffcp-g3-2d-fill.sh tiffcp-g4.sh \
        tiffcp-logluv.sh tiffcp-thumbnail.sh tiffcp-lzw-compat.sh \
-       tiffdump.sh tiffinfo.sh tiffcp-split.sh tiffcp-split-join.sh \
-       tiff2ps-PS1.sh tiff2ps-PS2.sh tiff2ps-PS3.sh tiff2ps-EPS1.sh \
-       tiff2pdf.sh tiffcrop-doubleflip-logluv-3c-16b.sh \
+       tiffcp-lzw-scanline-decode.sh tiffdump.sh tiffinfo.sh \
+       tiffcp-split.sh tiffcp-split-join.sh tiff2ps-PS1.sh \
+       tiff2ps-PS2.sh tiff2ps-PS3.sh tiff2ps-EPS1.sh tiff2pdf.sh \
+       tiffcrop-doubleflip-logluv-3c-16b.sh \
        tiffcrop-doubleflip-minisblack-1c-16b.sh \
        tiffcrop-doubleflip-minisblack-1c-8b.sh \
        tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh \
@@ -479,7 +486,6 @@ TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
        $(TEST_LOG_FLAGS)
 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
-       $(top_srcdir)/config/mkinstalldirs \
        $(top_srcdir)/config/test-driver
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
@@ -672,6 +678,7 @@ TESTSCRIPTS = \
        tiffcp-logluv.sh \
        tiffcp-thumbnail.sh \
        tiffcp-lzw-compat.sh \
+       tiffcp-lzw-scanline-decode.sh \
        tiffdump.sh \
        tiffinfo.sh \
        tiffcp-split.sh \
@@ -752,7 +759,8 @@ TIFFIMAGES = \
        images/rgb-3c-16b.tiff \
        images/rgb-3c-8b.tiff \
        images/quad-tile.jpg.tiff \
-       images/quad-lzw-compat.tiff
+       images/quad-lzw-compat.tiff \
+       images/lzw-single-strip.tiff
 
 PNMIMAGES = \
        images/minisblack-1c-8b.pgm \
@@ -805,8 +813,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -861,16 +869,22 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_tag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_tag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/custom_dir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/long_tag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw_decode.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rewrite_tag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/short_tag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strip.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strip_rw.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_arrays.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_tag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_tag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/custom_dir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/long_tag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw_decode.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rewrite_tag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/short_tag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strip.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strip_rw.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_arrays.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -1071,7 +1085,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
        fi;                                                             \
        $$success || exit 1
 
-check-TESTS:
+check-TESTS: $(check_PROGRAMS)
        @list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
        @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
        @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@@ -1225,6 +1239,13 @@ tiffcp-lzw-compat.sh.log: tiffcp-lzw-compat.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+tiffcp-lzw-scanline-decode.sh.log: tiffcp-lzw-scanline-decode.sh
+       @p='tiffcp-lzw-scanline-decode.sh'; \
+       b='tiffcp-lzw-scanline-decode.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 tiffdump.sh.log: tiffdump.sh
        @p='tiffdump.sh'; \
        b='tiffdump.sh'; \
@@ -1681,7 +1702,10 @@ tiff2rgba-quad-tile.jpg.sh.log: tiff2rgba-quad-tile.jpg.sh
 @am__EXEEXT_TRUE@      $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
 @am__EXEEXT_TRUE@      "$$tst" $(AM_TESTS_FD_REDIRECT)
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -1757,7 +1781,16 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
        mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/ascii_tag.Po
+       -rm -f ./$(DEPDIR)/check_tag.Po
+       -rm -f ./$(DEPDIR)/custom_dir.Po
+       -rm -f ./$(DEPDIR)/long_tag.Po
+       -rm -f ./$(DEPDIR)/raw_decode.Po
+       -rm -f ./$(DEPDIR)/rewrite_tag.Po
+       -rm -f ./$(DEPDIR)/short_tag.Po
+       -rm -f ./$(DEPDIR)/strip.Po
+       -rm -f ./$(DEPDIR)/strip_rw.Po
+       -rm -f ./$(DEPDIR)/test_arrays.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -1803,7 +1836,16 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/ascii_tag.Po
+       -rm -f ./$(DEPDIR)/check_tag.Po
+       -rm -f ./$(DEPDIR)/custom_dir.Po
+       -rm -f ./$(DEPDIR)/long_tag.Po
+       -rm -f ./$(DEPDIR)/raw_decode.Po
+       -rm -f ./$(DEPDIR)/rewrite_tag.Po
+       -rm -f ./$(DEPDIR)/short_tag.Po
+       -rm -f ./$(DEPDIR)/strip.Po
+       -rm -f ./$(DEPDIR)/strip_rw.Po
+       -rm -f ./$(DEPDIR)/test_arrays.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -1824,16 +1866,16 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
-       clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
-       ctags ctags-am distclean distclean-compile distclean-generic \
-       distclean-libtool distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-data \
-       install-data-am install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-man install-pdf install-pdf-am \
-       install-ps install-ps-am install-strip installcheck \
-       installcheck-am installdirs maintainer-clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
+       check-am clean clean-checkPROGRAMS clean-generic clean-libtool \
+       cscopelist-am ctags ctags-am distclean distclean-compile \
+       distclean-generic distclean-libtool distclean-tags distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
        maintainer-clean-generic mostlyclean mostlyclean-compile \
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        recheck tags tags-am uninstall uninstall-am
index 6337900..9a56d31 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: ascii_tag.c,v 1.8 2013-12-17 14:41:57 bfriesen Exp $ */
-
 /*
  * Copyright (c) 2004, Andrey Kiselev  <dron@ak4719.spb.edu>
  *
index 4301180..5750d68 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: check_tag.c,v 1.3 2008/04/15 14:19:37 dron Exp $ */
-
 /*
  * Copyright (c) 2004, Andrey Kiselev  <dron@ak4719.spb.edu>
  *
index 6b1380d..42c3873 100644 (file)
@@ -41,6 +41,7 @@ IMG_RGB_3C_16B=${IMAGES}/rgb-3c-16b.tiff
 IMG_RGB_3C_8B=${IMAGES}/rgb-3c-8b.tiff
 IMG_MINISBLACK_2C_8B_ALPHA=${IMAGES}/minisblack-2c-8b-alpha.tiff
 IMG_QUAD_LZW_COMPAT=${IMAGES}/quad-lzw-compat.tiff
+IMG_LZW_SINGLE_STROP=${IMAGES}/lzw-single-strip.tiff
 
 IMG_MINISWHITE_1C_1B_PBM=${IMAGES}/miniswhite-1c-1b.pbm
 IMG_MINISBLACK_1C_8B_PGM=${IMAGES}/minisblack-1c-8b.pgm
index acf55ce..3b3ad27 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: custom_dir.c,v 1.3 2013-12-17 14:41:58 bfriesen Exp $ */
-
 /*
  * Copyright (c) 2012, Frank Warmerdam <warmerdam@pobox.com>
  *
diff --git a/test/images/lzw-single-strip.tiff b/test/images/lzw-single-strip.tiff
new file mode 100644 (file)
index 0000000..0ac27c6
Binary files /dev/null and b/test/images/lzw-single-strip.tiff differ
index ab1440a..4bfdf80 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: long_tag.c,v 1.5 2013-12-17 14:41:58 bfriesen Exp $ */
-
 /*
  * Copyright (c) 2004, Andrey Kiselev  <dron@ak4719.spb.edu>
  *
index f81aa05..a2fca03 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: raw_decode.c,v 1.7 2015-08-16 20:08:21 bfriesen Exp $ */
-
 /*
  * Copyright (c) 2012, Frank Warmerdam <warmerdam@pobox.com>
  *
index 5db3e4b..2a366f7 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: rewrite_tag.c,v 1.9 2015-08-23 14:23:00 bfriesen Exp $ */
-
 /*
  * Copyright (c) 2007, Frank Warmerdam <warmerdam@pobox.com>
  *
index efc7da5..75e7f5d 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: short_tag.c,v 1.9 2013-12-17 14:41:58 bfriesen Exp $ */
-
 /*
  * Copyright (c) 2004, Andrey Kiselev  <dron@ak4719.spb.edu>
  *
index 5942226..f2cb773 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: strip.c,v 1.5 2013-12-17 14:41:58 bfriesen Exp $ */
-
 /*
  * Copyright (c) 2004, Andrey Kiselev  <dron@ak4719.spb.edu>
  *
index 5247c0b..bcf7d73 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: strip_rw.c,v 1.6 2008/03/28 01:42:07 bfriesen Exp $ */
-
 /*
  * Copyright (c) 2004, Andrey Kiselev  <dron@ak4719.spb.edu>
  *
index 8376766..226e9d0 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: test_arrays.c,v 1.3 2006/03/23 14:54:02 dron Exp $ */
-
 /*
  * Copyright (c) 2004, Andrey Kiselev  <dron@ak4719.spb.edu>
  *
index 5131b23..62e1d33 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: test_arrays.h,v 1.3 2006/03/23 14:54:02 dron Exp $ */
-
 /*
  * Copyright (c) 2004, Andrey Kiselev  <dron@ak4719.spb.edu>
  *
diff --git a/test/tiffcp-lzw-scanline-decode.sh b/test/tiffcp-lzw-scanline-decode.sh
new file mode 100755 (executable)
index 0000000..11654d1
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+# Basic sanity check for tiffcp with LZW decompression
+#
+. ${srcdir:-.}/common.sh
+f_test_convert "${TIFFCP} -c none -r 1" "${IMG_LZW_SINGLE_STROP}" "o-tiffcp-lzw-scanline-decode.tiff"
\ No newline at end of file
index 3305206..391b0f6 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tifftest.h,v 1.1 2008/04/15 14:18:36 dron Exp $ */
-
 /*
  * Copyright (c) 2008, Andrey Kiselev  <dron@ak4719.spb.edu>
  *
index 331f83c..886d454 100644 (file)
@@ -118,7 +118,7 @@ if(HAVE_OPENGL)
   endif()
 
   add_executable(tiffgt tiffgt.c)
-  target_link_libraries(tiffgt tiff ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES})
+  target_link_libraries(tiffgt tiff port ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES})
 
   install(TARGETS tiffgt
           RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}")
index d7d5604..7ec4ed6 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -132,7 +132,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
        $(top_builddir)/libtiff/tiffconf.h
 CONFIG_CLEAN_FILES =
@@ -226,7 +226,18 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/fax2ps.Po ./$(DEPDIR)/fax2tiff.Po \
+       ./$(DEPDIR)/pal2rgb.Po ./$(DEPDIR)/ppm2tiff.Po \
+       ./$(DEPDIR)/raw2tiff.Po ./$(DEPDIR)/rgb2ycbcr.Po \
+       ./$(DEPDIR)/thumbnail.Po ./$(DEPDIR)/tiff2bw.Po \
+       ./$(DEPDIR)/tiff2pdf.Po ./$(DEPDIR)/tiff2ps.Po \
+       ./$(DEPDIR)/tiff2rgba.Po ./$(DEPDIR)/tiffcmp.Po \
+       ./$(DEPDIR)/tiffcp.Po ./$(DEPDIR)/tiffcrop.Po \
+       ./$(DEPDIR)/tiffdither.Po ./$(DEPDIR)/tiffdump.Po \
+       ./$(DEPDIR)/tiffgt-tiffgt.Po ./$(DEPDIR)/tiffinfo.Po \
+       ./$(DEPDIR)/tiffmedian.Po ./$(DEPDIR)/tiffset.Po \
+       ./$(DEPDIR)/tiffsplit.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -285,8 +296,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
-       $(top_srcdir)/config/mkinstalldirs
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -508,8 +518,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -669,27 +679,33 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax2ps.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax2tiff.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pal2rgb.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppm2tiff.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw2tiff.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rgb2ycbcr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thumbnail.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2bw.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2pdf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2ps.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2rgba.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcmp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcrop.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffdither.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffdump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffgt-tiffgt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffinfo.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffmedian.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffset.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffsplit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax2ps.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax2tiff.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pal2rgb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppm2tiff.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw2tiff.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rgb2ycbcr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thumbnail.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2bw.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2pdf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2ps.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2rgba.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcrop.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffdither.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffdump.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffgt-tiffgt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffinfo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffmedian.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffsplit.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -784,7 +800,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -858,7 +877,27 @@ clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
        clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/fax2ps.Po
+       -rm -f ./$(DEPDIR)/fax2tiff.Po
+       -rm -f ./$(DEPDIR)/pal2rgb.Po
+       -rm -f ./$(DEPDIR)/ppm2tiff.Po
+       -rm -f ./$(DEPDIR)/raw2tiff.Po
+       -rm -f ./$(DEPDIR)/rgb2ycbcr.Po
+       -rm -f ./$(DEPDIR)/thumbnail.Po
+       -rm -f ./$(DEPDIR)/tiff2bw.Po
+       -rm -f ./$(DEPDIR)/tiff2pdf.Po
+       -rm -f ./$(DEPDIR)/tiff2ps.Po
+       -rm -f ./$(DEPDIR)/tiff2rgba.Po
+       -rm -f ./$(DEPDIR)/tiffcmp.Po
+       -rm -f ./$(DEPDIR)/tiffcp.Po
+       -rm -f ./$(DEPDIR)/tiffcrop.Po
+       -rm -f ./$(DEPDIR)/tiffdither.Po
+       -rm -f ./$(DEPDIR)/tiffdump.Po
+       -rm -f ./$(DEPDIR)/tiffgt-tiffgt.Po
+       -rm -f ./$(DEPDIR)/tiffinfo.Po
+       -rm -f ./$(DEPDIR)/tiffmedian.Po
+       -rm -f ./$(DEPDIR)/tiffset.Po
+       -rm -f ./$(DEPDIR)/tiffsplit.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -904,7 +943,27 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/fax2ps.Po
+       -rm -f ./$(DEPDIR)/fax2tiff.Po
+       -rm -f ./$(DEPDIR)/pal2rgb.Po
+       -rm -f ./$(DEPDIR)/ppm2tiff.Po
+       -rm -f ./$(DEPDIR)/raw2tiff.Po
+       -rm -f ./$(DEPDIR)/rgb2ycbcr.Po
+       -rm -f ./$(DEPDIR)/thumbnail.Po
+       -rm -f ./$(DEPDIR)/tiff2bw.Po
+       -rm -f ./$(DEPDIR)/tiff2pdf.Po
+       -rm -f ./$(DEPDIR)/tiff2ps.Po
+       -rm -f ./$(DEPDIR)/tiff2rgba.Po
+       -rm -f ./$(DEPDIR)/tiffcmp.Po
+       -rm -f ./$(DEPDIR)/tiffcp.Po
+       -rm -f ./$(DEPDIR)/tiffcrop.Po
+       -rm -f ./$(DEPDIR)/tiffdither.Po
+       -rm -f ./$(DEPDIR)/tiffdump.Po
+       -rm -f ./$(DEPDIR)/tiffgt-tiffgt.Po
+       -rm -f ./$(DEPDIR)/tiffinfo.Po
+       -rm -f ./$(DEPDIR)/tiffmedian.Po
+       -rm -f ./$(DEPDIR)/tiffset.Po
+       -rm -f ./$(DEPDIR)/tiffsplit.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -925,7 +984,7 @@ uninstall-am: uninstall-binPROGRAMS
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
        clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
        clean-libtool cscopelist-am ctags ctags-am distclean \
        distclean-compile distclean-generic distclean-libtool \
index 646c767..453db43 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Makefile.vc,v 1.16 2016-06-05 19:54:03 bfriesen Exp $
 #
 # Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
 #
index c495331..274b29e 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: fax2ps.c,v 1.31 2015-09-06 18:24:27 bfriesen Exp $" */
-
 /*
  * Copyright (c) 1991-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index f23374e..2098b2a 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: fax2tiff.c,v 1.28 2017-10-29 18:28:45 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1990-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 7a57800..01d8502 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: pal2rgb.c,v 1.15 2015-06-21 01:09:10 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -184,8 +182,21 @@ main(int argc, char* argv[])
        { unsigned char *ibuf, *obuf;
          register unsigned char* pp;
          register uint32 x;
-         ibuf = (unsigned char*)_TIFFmalloc(TIFFScanlineSize(in));
-         obuf = (unsigned char*)_TIFFmalloc(TIFFScanlineSize(out));
+         tmsize_t tss_in = TIFFScanlineSize(in);
+         tmsize_t tss_out = TIFFScanlineSize(out);
+         if (tss_out / tss_in < 3) {
+               /*
+                * BUG 2750: The following code does not know about chroma
+                * subsampling of JPEG data. It assumes that the output buffer is 3x
+                * the length of the input buffer due to exploding the palette into
+                * RGB tuples. If this assumption is incorrect, it could lead to a
+                * buffer overflow. Go ahead and fail now to prevent that.
+                */
+               fprintf(stderr, "Could not determine correct image size for output. Exiting.\n");
+               return -1;
+      }
+         ibuf = (unsigned char*)_TIFFmalloc(tss_in);
+         obuf = (unsigned char*)_TIFFmalloc(tss_out);
          switch (config) {
          case PLANARCONFIG_CONTIG:
                for (row = 0; row < imagelength; row++) {
@@ -391,7 +402,23 @@ cpTags(TIFF* in, TIFF* out)
 {
     struct cpTag *p;
     for (p = tags; p < &tags[NTAGS]; p++)
-       cpTag(in, out, p->tag, p->count, p->type);
+    {
+        if( p->tag == TIFFTAG_GROUP3OPTIONS )
+        {
+            uint16 compression;
+            if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
+                    compression != COMPRESSION_CCITTFAX3 )
+                continue;
+        }
+        if( p->tag == TIFFTAG_GROUP4OPTIONS )
+        {
+            uint16 compression;
+            if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
+                    compression != COMPRESSION_CCITTFAX4 )
+                continue;
+        }
+        cpTag(in, out, p->tag, p->count, p->type);
+    }
 }
 #undef NTAGS
 
index 91415e9..c2d5925 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: ppm2tiff.c,v 1.19 2015-06-21 01:09:10 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1991-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -72,15 +70,16 @@ BadPPM(char* file)
        exit(-2);
 }
 
+
+#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
+#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
+
 static tmsize_t
 multiply_ms(tmsize_t m1, tmsize_t m2)
 {
-       tmsize_t bytes = m1 * m2;
-
-       if (m1 && bytes / m1 != m2)
-               bytes = 0;
-
-       return bytes;
+        if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 )
+            return 0;
+        return m1 * m2;
 }
 
 int
index 083e9ee..f502408 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: raw2tiff.c,v 1.29 2017-01-14 13:12:33 erouault Exp $
- *
+/*
  * Project:  libtiff tools
  * Purpose:  Convert raw byte sequences in TIFF images
  * Author:   Andrey Kiselev, dron@ak4719.spb.edu
index 7a9d705..cf5f956 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: rgb2ycbcr.c,v 1.17 2016-08-15 21:26:56 erouault Exp $ */
-
 /*
  * Copyright (c) 1991-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index ab6a1d2..3d1adc7 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: thumbnail.c,v 1.21 2015-06-21 01:09:10 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1994-1997 Sam Leffler
  * Copyright (c) 1994-1997 Silicon Graphics, Inc.
@@ -527,15 +525,15 @@ setrow(uint8* row, uint32 nrows, const uint8* rows[])
            default:
                for (i = fw; i > 8; i--)
                    acc += bits[*src++];
-               /* fall thru... */
-           case 8: acc += bits[*src++];
-           case 7: acc += bits[*src++];
-           case 6: acc += bits[*src++];
-           case 5: acc += bits[*src++];
-           case 4: acc += bits[*src++];
-           case 3: acc += bits[*src++];
-           case 2: acc += bits[*src++];
-           case 1: acc += bits[*src++];
+               /* fall through... */
+           case 8: acc += bits[*src++]; /* fall through */
+           case 7: acc += bits[*src++]; /* fall through */
+           case 6: acc += bits[*src++]; /* fall through */
+           case 5: acc += bits[*src++]; /* fall through */
+           case 4: acc += bits[*src++]; /* fall through */
+           case 3: acc += bits[*src++]; /* fall through */
+           case 2: acc += bits[*src++]; /* fall through */
+           case 1: acc += bits[*src++]; /* fall through */
            case 0: break;
            }
            acc += bits[*src & mask1];
index dad54af..dbc697b 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiff2bw.c,v 1.21 2017-11-01 13:41:58 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -40,9 +38,7 @@
 #endif
 
 #include "tiffio.h"
-
-#define        streq(a,b)      (strcmp((a),(b)) == 0)
-#define        strneq(a,b,n)   (strncmp(a,b,n) == 0)
+#include "tiffiop.h"
 
 /* x% weighting -> fraction of full color */
 #define        PCT(x)  (((x)*256+50)/100)
@@ -223,6 +219,11 @@ main(int argc, char* argv[])
        TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing);
        TIFFSetField(out, TIFFTAG_SOFTWARE, "tiff2bw");
        outbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
+        if( !outbuf )
+        {
+            fprintf(stderr, "Out of memory\n");
+            goto tiff2bw_error;
+        }
        TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,
            TIFFDefaultStripSize(out, rowsperstrip));
 
@@ -246,6 +247,11 @@ main(int argc, char* argv[])
 #undef CVT
                }
                inbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
+                if( !inbuf )
+                {
+                    fprintf(stderr, "Out of memory\n");
+                    goto tiff2bw_error;
+                }
                for (row = 0; row < h; row++) {
                        if (TIFFReadScanline(in, inbuf, row, 0) < 0)
                                break;
@@ -256,6 +262,11 @@ main(int argc, char* argv[])
                break;
        case pack(PHOTOMETRIC_RGB, PLANARCONFIG_CONTIG):
                inbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
+                if( !inbuf )
+                {
+                    fprintf(stderr, "Out of memory\n");
+                    goto tiff2bw_error;
+                }
                for (row = 0; row < h; row++) {
                        if (TIFFReadScanline(in, inbuf, row, 0) < 0)
                                break;
@@ -265,8 +276,16 @@ main(int argc, char* argv[])
                }
                break;
        case pack(PHOTOMETRIC_RGB, PLANARCONFIG_SEPARATE):
+        {
+                tmsize_t inbufsize;
                rowsize = TIFFScanlineSize(in);
-               inbuf = (unsigned char *)_TIFFmalloc(3*rowsize);
+                inbufsize = TIFFSafeMultiply(tmsize_t, 3, rowsize);
+               inbuf = (unsigned char *)_TIFFmalloc(inbufsize);
+                if( !inbuf )
+                {
+                    fprintf(stderr, "Out of memory\n");
+                    goto tiff2bw_error;
+                }
                for (row = 0; row < h; row++) {
                        for (s = 0; s < 3; s++)
                                if (TIFFReadScanline(in,
@@ -278,6 +297,7 @@ main(int argc, char* argv[])
                                break;
                }
                break;
+        }
        }
 #undef pack
         if (inbuf)
@@ -452,7 +472,23 @@ cpTags(TIFF* in, TIFF* out)
 {
     struct cpTag *p;
     for (p = tags; p < &tags[NTAGS]; p++)
-       cpTag(in, out, p->tag, p->count, p->type);
+    {
+        if( p->tag == TIFFTAG_GROUP3OPTIONS )
+        {
+            uint16 compression;
+            if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
+                    compression != COMPRESSION_CCITTFAX3 )
+                continue;
+        }
+        if( p->tag == TIFFTAG_GROUP4OPTIONS )
+        {
+            uint16 compression;
+            if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
+                    compression != COMPRESSION_CCITTFAX4 )
+                continue;
+        }
+        cpTag(in, out, p->tag, p->count, p->type);
+    }
 }
 #undef NTAGS
 
index 454befb..13f693d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: tiff2pdf.c,v 1.103 2017-10-29 18:50:41 bfriesen Exp $
+/*
  *
  * tiff2pdf - converts a TIFF image to a PDF document
  *
@@ -68,6 +68,8 @@ extern int getopt(int, char**, char*);
 
 #define PS_UNIT_SIZE   72.0F
 
+#define TIFF_DIR_MAX    65534
+
 /* This type is of PDF color spaces. */
 typedef enum {
        T2P_CS_BILEVEL = 0x01,  /* Bilevel, black and white */
@@ -237,7 +239,7 @@ typedef struct {
        float tiff_whitechromaticities[2];
        float tiff_primarychromaticities[6];
        float tiff_referenceblackwhite[2];
-       float* tiff_transferfunction[3];
+       uint16* tiff_transferfunction[3];
        int pdf_image_interpolate;      /* 0 (default) : do not interpolate,
                                           1 : interpolate */
        uint16 tiff_transferfunctioncount;
@@ -1047,8 +1049,18 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
        uint16 pagen=0;
        uint16 paged=0;
        uint16 xuint16=0;
+       uint16 tiff_transferfunctioncount=0;
+       uint16* tiff_transferfunction[3];
 
        directorycount=TIFFNumberOfDirectories(input);
+       if(directorycount > TIFF_DIR_MAX) {
+               TIFFError(
+                       TIFF2PDF_MODULE,
+                       "TIFF contains too many directories, %s",
+                       TIFFFileName(input));
+               t2p->t2p_error = T2P_ERR_ERROR;
+               return;
+       }
        t2p->tiff_pages = (T2P_PAGE*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,directorycount,sizeof(T2P_PAGE)));
        if(t2p->tiff_pages==NULL){
                TIFFError(
@@ -1147,26 +1159,48 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
                 }
 #endif
                if (TIFFGetField(input, TIFFTAG_TRANSFERFUNCTION,
-                                 &(t2p->tiff_transferfunction[0]),
-                                 &(t2p->tiff_transferfunction[1]),
-                                 &(t2p->tiff_transferfunction[2]))) {
-                       if((t2p->tiff_transferfunction[1] != (float*) NULL) &&
-                           (t2p->tiff_transferfunction[2] != (float*) NULL) &&
-                           (t2p->tiff_transferfunction[1] !=
-                            t2p->tiff_transferfunction[0])) {
-                               t2p->tiff_transferfunctioncount = 3;
-                               t2p->tiff_pages[i].page_extra += 4;
-                               t2p->pdf_xrefcount += 4;
-                       } else {
-                               t2p->tiff_transferfunctioncount = 1;
-                               t2p->tiff_pages[i].page_extra += 2;
-                               t2p->pdf_xrefcount += 2;
-                       }
-                       if(t2p->pdf_minorversion < 2)
-                               t2p->pdf_minorversion = 2;
+                                 &(tiff_transferfunction[0]),
+                                 &(tiff_transferfunction[1]),
+                                 &(tiff_transferfunction[2]))) {
+
+                        if((tiff_transferfunction[1] != (uint16*) NULL) &&
+                           (tiff_transferfunction[2] != (uint16*) NULL)
+                          ) {
+                            tiff_transferfunctioncount=3;
+                        } else {
+                            tiff_transferfunctioncount=1;
+                        }
                 } else {
-                       t2p->tiff_transferfunctioncount=0;
+                       tiff_transferfunctioncount=0;
                }
+
+                if (i > 0){
+                    if (tiff_transferfunctioncount != t2p->tiff_transferfunctioncount){
+                        TIFFError(
+                            TIFF2PDF_MODULE,
+                            "Different transfer function on page %d",
+                            i);
+                        t2p->t2p_error = T2P_ERR_ERROR;
+                        return;
+                    }
+                }
+
+                t2p->tiff_transferfunctioncount = tiff_transferfunctioncount;
+                t2p->tiff_transferfunction[0] = tiff_transferfunction[0];
+                t2p->tiff_transferfunction[1] = tiff_transferfunction[1];
+                t2p->tiff_transferfunction[2] = tiff_transferfunction[2];
+                if(tiff_transferfunctioncount == 3){
+                        t2p->tiff_pages[i].page_extra += 4;
+                        t2p->pdf_xrefcount += 4;
+                        if(t2p->pdf_minorversion < 2)
+                                t2p->pdf_minorversion = 2;
+                } else if (tiff_transferfunctioncount == 1){
+                        t2p->tiff_pages[i].page_extra += 2;
+                        t2p->pdf_xrefcount += 2;
+                        if(t2p->pdf_minorversion < 2)
+                                t2p->pdf_minorversion = 2;
+                }
+
                if( TIFFGetField(
                        input, 
                        TIFFTAG_ICCPROFILE, 
@@ -1827,10 +1861,9 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
                         &(t2p->tiff_transferfunction[0]),
                         &(t2p->tiff_transferfunction[1]),
                         &(t2p->tiff_transferfunction[2]))) {
-               if((t2p->tiff_transferfunction[1] != (float*) NULL) &&
-                   (t2p->tiff_transferfunction[2] != (float*) NULL) &&
-                   (t2p->tiff_transferfunction[1] !=
-                    t2p->tiff_transferfunction[0])) {
+               if((t2p->tiff_transferfunction[1] != (uint16*) NULL) &&
+                   (t2p->tiff_transferfunction[2] != (uint16*) NULL)
+                  ) {
                        t2p->tiff_transferfunctioncount=3;
                } else {
                        t2p->tiff_transferfunctioncount=1;
@@ -3713,12 +3746,13 @@ tsize_t
 t2p_sample_rgbaa_to_rgb(tdata_t data, uint32 samplecount)
 {
        uint32 i;
-       
-    /* For the 3 first samples, there is overlapping between souce and
-       destination, so use memmove().
-       See http://bugzilla.maptools.org/show_bug.cgi?id=2577 */
-    for(i = 0; i < 3 && i < samplecount; i++)
-        memmove((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
+
+       /* For the 3 first samples, there is overlap between source and
+        * destination, so use memmove().
+        * See http://bugzilla.maptools.org/show_bug.cgi?id=2577
+        */
+       for(i = 0; i < 3 && i < samplecount; i++)
+               memmove((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
        for(; i < samplecount; i++)
                memcpy((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
 
@@ -4217,13 +4251,13 @@ void t2p_pdf_currenttime(T2P* t2p)
 
        currenttime = localtime(&timenow);
        snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
-                "D:%.4d%.2d%.2d%.2d%.2d%.2d",
-                (currenttime->tm_year + 1900) % 65536,
-                (currenttime->tm_mon + 1) % 256,
-                (currenttime->tm_mday) % 256,
-                (currenttime->tm_hour) % 256,
-                (currenttime->tm_min) % 256,
-                (currenttime->tm_sec) % 256);
+                "D:%.4u%.2u%.2u%.2u%.2u%.2u",
+                TIFFmin((unsigned) currenttime->tm_year + 1900U,9999U),
+                TIFFmin((unsigned) currenttime->tm_mon + 1U,12U),   /* 0-11 + 1 */
+                TIFFmin((unsigned) currenttime->tm_mday,31U),       /* 1-31 */
+                TIFFmin((unsigned) currenttime->tm_hour,23U),       /* 0-23 */
+                TIFFmin((unsigned) currenttime->tm_min,59U),        /* 0-59 */
+                TIFFmin((unsigned) (currenttime->tm_sec),60U));     /* 0-60 */
 
        return;
 }
index f1f0b37..d8d3da3 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiff2ps.c,v 1.56 2017-04-27 15:46:22 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -63,7 +61,7 @@
  *    if not specified on the command line.
  *    Add new command line option to specify document creator
  *    as an alterntive to the string "tiff2ps" following model
- *    of patch submitted by Thomas Jarosch for specifiying a
+ *    of patch submitted by Thomas Jarosch for specifying a
  *    document title which is also supported now.
  *
  * 2009-Feb-11
@@ -73,7 +71,7 @@
  *    or landscape) if -h or -w is specified. Rotation is in
  *    degrees counterclockwise since that is how Postscript does
  *    it. The auto opption rotates the image 90 degrees ccw to
- *    produce landscape if that is a better fit than portait.
+ *    produce landscape if that is a better fit than portrait.
  *
  *    Cleaned up code in TIFF2PS and broke into smaller functions
  *    to simplify rotations.
@@ -520,7 +518,7 @@ checkImage(TIFF* tif)
                            "PhotometricInterpretation=YCbCr");
                        return (0);
                }
-               /* fall thru... */
+               /* fall through... */
        case PHOTOMETRIC_RGB:
                if (alpha && bitspersample != 8) {
                        TIFFError(filename,
@@ -528,7 +526,7 @@ checkImage(TIFF* tif)
                            bitspersample);
                        return (0);
                }
-               /* fall thru... */
+               /* fall through... */
        case PHOTOMETRIC_SEPARATED:
        case PHOTOMETRIC_PALETTE:
        case PHOTOMETRIC_MINISBLACK:
@@ -552,7 +550,7 @@ checkImage(TIFF* tif)
                bitspersample = 8;
                break;
        case PHOTOMETRIC_CIELAB:
-               /* fall thru... */
+               /* fall through... */
        default:
                TIFFError(filename,
                    "Can not handle image with PhotometricInterpretation=%d",
index 4de96ae..2eb6f6c 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiff2rgba.c,v 1.22 2016-08-15 20:06:41 erouault Exp $ */
-
 /*
  * Copyright (c) 1991-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 1a008a3..299847d 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffcmp.c,v 1.18 2015-06-21 01:09:10 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -438,7 +436,8 @@ PrintIntDiff(uint32 row, int sample, uint32 pix, uint32 w1, uint32 w2)
            {
                int32 mask1, mask2, s;
 
-               mask1 =  ~((-1) << bitspersample);
+        /* mask1 should have the n lowest bits set, where n == bitspersample */
+        mask1 = ((int32)1 << bitspersample) - 1;
                s = (8 - bitspersample);
                mask2 = mask1 << s;
                for (; mask2 && pix < imagewidth;
index 489459a..2f406e2 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffcp.c,v 1.61 2017-01-11 19:26:14 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -391,6 +389,12 @@ processCompressOptions(char* opt)
        } else if (strneq(opt, "lzma", 4)) {
                processZIPOptions(opt);
                defcompression = COMPRESSION_LZMA;
+       } else if (strneq(opt, "zstd", 4)) {
+               processZIPOptions(opt);
+               defcompression = COMPRESSION_ZSTD;
+       } else if (strneq(opt, "webp", 4)) {
+               processZIPOptions(opt);
+               defcompression = COMPRESSION_WEBP;
        } else if (strneq(opt, "jbig", 4)) {
                defcompression = COMPRESSION_JBIG;
        } else if (strneq(opt, "sgilog", 6)) {
@@ -429,6 +433,8 @@ char* stuff[] = {
 " -c lzw[:opts]   compress output with Lempel-Ziv & Welch encoding",
 " -c zip[:opts]   compress output with deflate encoding",
 " -c lzma[:opts]  compress output with LZMA2 encoding",
+" -c zstd[:opts]  compress output with ZSTD encoding",
+" -c webp[:opts]  compress output with WEBP encoding",
 " -c jpeg[:opts]  compress output with JPEG encoding",
 " -c jbig         compress output with ISO JBIG encoding",
 " -c packbits     compress output with packbits encoding",
@@ -448,7 +454,7 @@ char* stuff[] = {
 " r               output color image as RGB rather than YCbCr",
 "For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality",
 "",
-"LZW, Deflate (ZIP) and LZMA2 options:",
+"LZW, Deflate (ZIP), LZMA2, ZSTD and WEBP options:",
 " #               set predictor value",
 " p#              set compression level (preset)",
 "For example, -c lzw:2 to get LZW-encoded data with horizontal differencing,",
@@ -655,7 +661,7 @@ tiffcp(TIFF* in, TIFF* out)
                case ORIENTATION_RIGHTBOT:      /* XXX */
                        TIFFWarning(TIFFFileName(in), "using bottom-left orientation");
                        orientation = ORIENTATION_BOTLEFT;
-               /* fall thru... */
+               /* fall through... */
                case ORIENTATION_LEFTBOT:       /* XXX */
                case ORIENTATION_BOTLEFT:
                        break;
@@ -664,7 +670,7 @@ tiffcp(TIFF* in, TIFF* out)
                default:
                        TIFFWarning(TIFFFileName(in), "using top-left orientation");
                        orientation = ORIENTATION_TOPLEFT;
-               /* fall thru... */
+               /* fall through... */
                case ORIENTATION_LEFTTOP:       /* XXX */
                case ORIENTATION_TOPLEFT:
                        break;
@@ -733,6 +739,8 @@ tiffcp(TIFF* in, TIFF* out)
                case COMPRESSION_ADOBE_DEFLATE:
                case COMPRESSION_DEFLATE:
                 case COMPRESSION_LZMA:
+                case COMPRESSION_ZSTD:
+                                                               case COMPRESSION_WEBP:
                        if (predictor != (uint16)-1)
                                TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
                        else
@@ -743,6 +751,15 @@ tiffcp(TIFF* in, TIFF* out)
                                         TIFFSetField(out, TIFFTAG_ZIPQUALITY, preset);
                                else if (compression == COMPRESSION_LZMA)
                                        TIFFSetField(out, TIFFTAG_LZMAPRESET, preset);
+                               else if (compression == COMPRESSION_ZSTD)
+                                       TIFFSetField(out, TIFFTAG_ZSTD_LEVEL, preset);
+                               else if (compression == COMPRESSION_WEBP) {
+                                       if (preset == 100) {
+                                               TIFFSetField(out, TIFFTAG_WEBP_LOSSLESS, TRUE);
+                                       } else {
+                                               TIFFSetField(out, TIFFTAG_WEBP_LEVEL, preset);                                          
+                                       }
+                               }
                         }
                        break;
                case COMPRESSION_CCITTFAX3:
index c69177e..ac38ec3 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffcrop.c,v 1.50 2017-01-11 12:51:59 erouault Exp $ */
-
 /* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of
  * the image data through additional options listed below
  *
@@ -27,7 +25,7 @@
  * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE
  * OR PERFORMANCE OF THIS SOFTWARE.
  *
- * Some portions of the current code are derived from tiffcp, primarly in 
+ * Some portions of the current code are derived from tiffcp, primarily in 
  * the areas of lowlevel reading and writing of TAGS, scanlines and tiles though
  * some of the original functions have been extended to support arbitrary bit
  * depths. These functions are presented at the top of this file.
@@ -150,11 +148,6 @@ extern int getopt(int argc, char * const argv[], const char *optstring);
 
 #define TIFF_UINT32_MAX     0xFFFFFFFFU
 
-#ifndef streq
-#define        streq(a,b)      (strcmp((a),(b)) == 0)
-#endif
-#define        strneq(a,b,n)   (strncmp((a),(b),(n)) == 0)
-
 #define        TRUE    1
 #define        FALSE   0
 
@@ -217,6 +210,8 @@ extern int getopt(int argc, char * const argv[], const char *optstring);
 #define DUMP_TEXT   1
 #define DUMP_RAW    2
 
+#define TIFF_DIR_MAX  65534
+
 /* Offsets into buffer for margins and fixed width and length segments */
 struct offset {
   uint32  tmargin;
@@ -1685,7 +1680,7 @@ void  process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
                  *defconfig = PLANARCONFIG_CONTIG;
                else
                  {
-                 TIFFError ("Unkown planar configuration", "%s", optarg);
+                 TIFFError ("Unknown planar configuration", "%s", optarg);
                   TIFFError ("For valid options type", "tiffcrop -h");
                   exit (-1);
                   }
@@ -2114,7 +2109,7 @@ update_output_file (TIFF **tiffout, char *mode, int autoindex,
   {
   static int findex = 0;    /* file sequence indicator */
   char  *sep;
-  char   filenum[16];
+  char   filenum[18];
   char   export_ext[16];
   char   exportname[PATH_MAX];
 
@@ -2129,7 +2124,7 @@ update_output_file (TIFF **tiffout, char *mode, int autoindex,
   memset (exportname, '\0', PATH_MAX);
 
   /* Leave room for page number portion of the new filename */
-  strncpy (exportname, outname, PATH_MAX - 16);
+  strncpy (exportname, outname, PATH_MAX - sizeof(filenum));
   if (*tiffout == NULL)   /* This is a new export file */
     {
     if (autoindex)
@@ -2151,9 +2146,9 @@ update_output_file (TIFF **tiffout, char *mode, int autoindex,
         return 1;
         }
 
-      snprintf(filenum, sizeof(filenum), "-%03d%s", findex, export_ext);
-      filenum[14] = '\0';
-      strncat (exportname, filenum, 15);
+      snprintf(filenum, sizeof(filenum), "-%03d%.5s", findex, export_ext);
+      filenum[sizeof(filenum)-1] = '\0';
+      strncat (exportname, filenum, sizeof(filenum)-1);
       }
     exportname[PATH_MAX - 1] = '\0';
 
@@ -2212,8 +2207,9 @@ main(int argc, char* argv[])
   unsigned int  total_pages  = 0;
   unsigned int  total_images = 0;
   unsigned int  end_of_input = FALSE;
-  int    seg, length;
-  char   temp_filename[PATH_MAX + 1];
+  int    seg;
+  size_t length;
+  char   temp_filename[PATH_MAX + 16]; /* Extra space keeps the compiler from complaining */
 
   little_endian = *((unsigned char *)&little_endian) & '1';
 
@@ -2233,7 +2229,7 @@ main(int argc, char* argv[])
     pageNum = -1;
   else
     total_images = 0;
-  /* read multiple input files and write to output file(s) */
+  /* Read multiple input files and write to output file(s) */
   while (optind < argc - 1)
     {
     in = TIFFOpen (argv[optind], "r");
@@ -2241,7 +2237,14 @@ main(int argc, char* argv[])
       return (-3);
 
     /* If only one input file is specified, we can use directory count */
-    total_images = TIFFNumberOfDirectories(in); 
+    total_images = TIFFNumberOfDirectories(in);
+    if (total_images > TIFF_DIR_MAX)
+      {
+      TIFFError (TIFFFileName(in), "File contains too many directories");
+      if (out != NULL)
+        (void) TIFFClose(out);
+      return (1);
+      }
     if (image_count == 0)
       {
       dirnum = 0;
@@ -2305,8 +2308,8 @@ main(int argc, char* argv[])
           if (dump.infile != NULL)
             fclose (dump.infile);
 
-          /* dump.infilename is guaranteed to be NUL termimated and have 20 bytes 
-             fewer than PATH_MAX */ 
+          /* dump.infilename is guaranteed to be NUL terminated and have 20 bytes
+             fewer than PATH_MAX */
           snprintf(temp_filename, sizeof(temp_filename), "%s-read-%03d.%s",
                   dump.infilename, dump_images,
                   (dump.format == DUMP_TEXT) ? "txt" : "raw");
@@ -2324,7 +2327,7 @@ main(int argc, char* argv[])
           if (dump.outfile != NULL)
             fclose (dump.outfile);
 
-          /* dump.outfilename is guaranteed to be NUL termimated and have 20 bytes 
+          /* dump.outfilename is guaranteed to be NUL terminated and have 20 bytes
              fewer than PATH_MAX */ 
           snprintf(temp_filename, sizeof(temp_filename), "%s-write-%03d.%s",
                   dump.outfilename, dump_images,
@@ -6774,12 +6777,12 @@ extractImageSection(struct image_data *image, struct pageseg *section,
 #endif
 
       bytebuff1 = bytebuff2 = 0;
-      if (shift1 == 0) /* the region is byte and sample alligned */
+      if (shift1 == 0) /* the region is byte and sample aligned */
         {
        _TIFFmemcpy (sect_buff + dst_offset, src_buff + offset1, full_bytes);
 
 #ifdef DEVELMODE
-       TIFFError ("", "        Alligned data src offset1: %8d, Dst offset: %8d\n", offset1, dst_offset); 
+       TIFFError ("", "        Aligned data src offset1: %8d, Dst offset: %8d\n", offset1, dst_offset); 
        sprintf(&bitarray[18], "\n");
        sprintf(&bitarray[19], "\t");
         for (j = 20, k = 7; j < 28; j++, k--)
@@ -7722,7 +7725,7 @@ createCroppedImage(struct image_data *image, struct crop_mask *crop,
  * original code assumes we are always copying all samples.
  * Use of global variables for config, compression and others
  * should be replaced by addition to the crop_mask struct (which
- * will be renamed to proc_opts indicating that is controlls
+ * will be renamed to proc_opts indicating that is controls
  * user supplied processing options, not just cropping) and 
  * then passed in as an argument.
  */
@@ -8417,7 +8420,7 @@ rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width,
   ibuff = *ibuff_ptr;
   switch (rotation)
     {
-    case 180: if ((bps % 8) == 0) /* byte alligned data */
+    case 180: if ((bps % 8) == 0) /* byte aligned data */
                 { 
                 src = ibuff;
                 pix_offset = (spp * bps) / 8;
@@ -9057,8 +9060,9 @@ mirrorImage(uint16 spp, uint16 bps, uint16 mirror, uint32 width, uint32 length,
                _TIFFfree(line_buff);
              if (mirror == MIRROR_VERT)
                break;
+             /* Fall through */
     case MIRROR_HORIZ :
-              if ((bps % 8) == 0) /* byte alligned data */
+              if ((bps % 8) == 0) /* byte aligned data */
                 { 
                 for (row = 0; row < length; row++)
                   {
@@ -9203,7 +9207,7 @@ invertImage(uint16 photometric, uint16 spp, uint16 bps, uint32 width, uint32 len
                bytebuff2 = 4 - (uint8)(*src & 48  >> 4);
                bytebuff3 = 4 - (uint8)(*src & 12  >> 2);
                bytebuff4 = 4 - (uint8)(*src & 3);
-               *src = (bytebuff1 << 6) || (bytebuff2 << 4) || (bytebuff3 << 2) || bytebuff4;
+               *src = (bytebuff1 << 6) | (bytebuff2 << 4) | (bytebuff3 << 2) | bytebuff4;
                 src++;
                 }
             break;
index 247553c..3fd7f81 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffdither.c,v 1.16 2015-06-21 01:09:11 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 3de0062..ab48e52 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffdump.c,v 1.35 2016-11-19 15:42:46 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
index 35a23cc..5991d30 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffgt.c,v 1.15 2015-09-06 20:42:20 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#if HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #ifdef HAVE_OPENGL_GL_H
 # include <OpenGL/gl.h>
 #else
+# ifdef _WIN32
+#  include <windows.h>
+# endif
 # include <GL/gl.h>
 #endif
 #ifdef HAVE_GLUT_GLUT_H
index 4d58055..049e3a3 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffinfo.c,v 1.26 2016-12-03 14:18:49 erouault Exp $ */
-
 /*
  * Copyright (c) 1988-1997 Sam Leffler
  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -86,7 +84,7 @@ main(int argc, char* argv[])
                        break;
                case 'd':
                        showdata++;
-                       /* fall thru... */
+                       /* fall through... */
                case 'D':
                        readdata++;
                        break;
index f0c892e..bd0d156 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffmedian.c,v 1.13 2015-06-21 01:09:11 bfriesen Exp $ */
-
 /*
  * Apply median cut on an image.
  *
index 894c9f1..7ecc401 100644 (file)
@@ -1,6 +1,4 @@
 /******************************************************************************
- * $Id: tiffset.c,v 1.19 2017-10-01 17:38:12 erouault Exp $
- *
  * Project:  libtiff tools
  * Purpose:  Mainline for setting metadata in existing TIFF files.
  * Author:   Frank Warmerdam, warmerdam@pobox.com
@@ -29,6 +27,7 @@
  ******************************************************************************
  */
 
+#include "tif_config.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -189,6 +188,9 @@ main(int argc, char* argv[])
                                     size = 4;
                                     break;
 
+                                case TIFF_LONG8:
+                                case TIFF_SLONG8:
+                                case TIFF_IFD8:
                                 case TIFF_DOUBLE:
                                     size = 8;
                                     break;
@@ -225,7 +227,16 @@ main(int argc, char* argv[])
                             case TIFF_SLONG:
                             case TIFF_IFD:
                                 for (i = 0; i < wc; i++)
-                                    ((uint32 *)array)[i] = atol(argv[arg_index+i]);
+                                    ((int32 *)array)[i] = atol(argv[arg_index+i]);
+                                break;
+                            case TIFF_LONG8:
+                                for (i = 0; i < wc; i++)
+                                    ((uint64 *)array)[i] = strtoll(argv[arg_index+i], (char **)NULL, 10);
+                                break;
+                            case TIFF_SLONG8:
+                            case TIFF_IFD8:
+                                for (i = 0; i < wc; i++)
+                                    ((int64 *)array)[i] = strtoll(argv[arg_index+i], (char **)NULL, 10);
                                 break;
                             case TIFF_DOUBLE:
                                 for (i = 0; i < wc; i++)
@@ -276,6 +287,12 @@ main(int argc, char* argv[])
                                 ret = TIFFSetField(tiff, TIFFFieldTag(fip),
                                                    atol(argv[arg_index++]));
                                 break;
+                            case TIFF_LONG8:
+                            case TIFF_SLONG8:
+                            case TIFF_IFD8:
+                                ret = TIFFSetField(tiff, TIFFFieldTag(fip),
+                                                   strtoll(argv[arg_index++], (char **)NULL, 10));
+                                break;
                             case TIFF_DOUBLE:
                                 ret = TIFFSetField(tiff, TIFFFieldTag(fip),
                                                    atof(argv[arg_index++]));
index c4fa247..c9e3a78 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: tiffsplit.c,v 1.23 2015-05-28 13:10:26 bfriesen Exp $ */
-
 /*
  * Copyright (c) 1992-1997 Sam Leffler
  * Copyright (c) 1992-1997 Silicon Graphics, Inc.