From b5587ac2e49b79dc71cfe11bda4ea77a3a3b8392 Mon Sep 17 00:00:00 2001 From: Lee Howard Date: Sun, 14 Jun 2015 22:55:16 +0000 Subject: [PATCH] From Ludolf Holzheid on Bugzilla Bug #2498: Attached is a patch that adds a configure option to select the file I/O style on Windows hosts. It defaults to --enable-win32-io on all windows targets other than Cygwin and to --disable-win32-io on Cygwin, and thus should be backwards-compatible. This allows programs using the Unix file I/O style (such as Netpbm's tifftopnm) to link against libtiff if configured for e.g. MinGW. --- ChangeLog | 4 ++++ configure.ac | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbcfe1d1..434d2fd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-06-14 Lee Howard + * configure: contribution from Ludolf Holzheid on Bugzilla + Bug #2498. Adds an option to select the file I/O style on + Windows hosts. + * libtiff/tif_getimage.c: contribution from Gary Cramblitt on Bugzilla Bug #2409. Correct reading of certain tiled TIFFs. diff --git a/configure.ac b/configure.ac index 7c6459ab..608d41e0 100644 --- a/configure.ac +++ b/configure.ac @@ -841,17 +841,28 @@ dnl this must be after the ogl test, since that looks for windows.h and we dnl test it dnl --------------------------------------------------------------------------- +AC_ARG_ENABLE(win32-io, + AS_HELP_STRING([--disable-win32-io], + [disable Win32 I/O (Windows only, enabled by default except for Cygwin)]),,) + win32_io_ok=no case "${host_os}" in cygwin*) + if test x"$ac_cv_header_windows_h" = xyes -a "x$enable_win32_io" = xyes ; then + win32_io_ok=yes + fi ;; *) - if test x"$ac_cv_header_windows_h" = xyes; then + if test x"$ac_cv_header_windows_h" = xyes -a ! "x$enable_win32_io" = xno ; then win32_io_ok=yes - AC_DEFINE(USE_WIN32_FILEIO,1,[define to use win32 IO system]) fi ;; esac + +if test "$win32_io_ok" = "yes" ; then + AC_DEFINE(USE_WIN32_FILEIO,1,[define to use win32 IO system]) +fi + AM_CONDITIONAL([WIN32_IO], [test "$win32_io_ok" = yes]) dnl ---------------------------------------------------------------------------