--- patch-configure.orig 2014-01-23 02:40:44.000000000 +0900 +++ patch-configure 2017-04-11 12:50:34.538611000 +0900 @@ -1,5 +1,5 @@ ---- configure.orig 2012-06-06 02:58:38.000000000 +0200 -+++ configure 2013-10-23 14:29:24.000000000 +0200 +--- configure.orig 2012-06-06 09:58:38.000000000 +0900 ++++ configure 2017-04-11 12:39:28.247261000 +0900 @@ -831,7 +831,8 @@ # NB: use ANSI C prototype to weed out non-ANSI compilers. # @@ -168,7 +168,35 @@ { printf( "header_ver=%d lib_ver=%s", TIFFLIB_VERSION, TIFFGetVersion() ); exit(0); -@@ -2568,7 +2604,7 @@ +@@ -2549,10 +2585,11 @@ + header_ver=0 + lib_ver="" + eval `./a.out | \ +- sed -n -e 's/header_ver=\([0-9][0-9]*\) lib_ver=.*Version *\([0-9][0-9]*\.[0-9]\).*/\ +- header_ver=\1;lib_ver=\2/p'` ++ sed -n -e 's/header_ver=\([0-9][0-9]*\) lib_ver=.*Version *\([.0-9][.0-9]*\).*/\ ++ header_ver=\1;lib_ver_full=\2/p'` ++ eval `echo "${lib_ver_full}" | sed -n -e 's/\([0-9][0-9]*\.[0-9][0-9]*\).*/lib_ver=\1/p'` + Note " Found tiffio.h version ${header_ver}" +- Note " Found libtiff version ${lib_ver}" ++ Note " Found libtiff version ${lib_ver_full}(${lib_ver})" + if [ ${header_ver} -ge 19960307 ]; then + case ${lib_ver} in + 3.4) tiff_runlen_t="uint16" +@@ -2563,12 +2600,19 @@ + tiff_offset_t="uint32" + tiff_bytecount_t="uint32" + ;; +- 4.[0]) tiff_runlen_t="uint32" ++ 4.0) case ${lib_ver_full} in ++ 4.0.7) ++ tiff_runlen_t="uint16" ++ ;; ++ *) ++ tiff_runlen_t="uint32" ++ ;; ++ esac + tiff_offset_t="uint64" tiff_bytecount_t="uint64" echo '#define TIFFHeader TIFFHeaderClassic' echo '#define TIFF_VERSION TIFF_VERSION_CLASSIC' @@ -177,7 +205,7 @@ ;; esac fi -@@ -3255,7 +3291,7 @@ +@@ -3255,7 +3299,7 @@ strtoul writev " @@ -186,7 +214,7 @@ for i in $FUNCS; do CheckForFunc $i || { Note "... emulate $i" -@@ -3313,8 +3349,9 @@ +@@ -3313,8 +3357,9 @@ # Verify library is compatible. # cat>t.c<