summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@codelibre.net>2021-02-02 23:29:14 +0000
committerRoger Leigh <rleigh@codelibre.net>2021-02-04 18:08:31 +0000
commitc5820961e65b5dd54777c97c4b2a2347d6515570 (patch)
tree3c2add6326bcd4bc5c074d75fc385d847c1e13fd
parentd7afc8c14f379f1e7dcf91d9c57cb9b2d1f2d926 (diff)
downloadlibtiff-git-c5820961e65b5dd54777c97c4b2a2347d6515570.tar.gz
Align Autoconf tif_config.h and CMake tif_config.cmake.in
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt24
-rw-r--r--configure.ac2
-rw-r--r--libtiff/tif_config.h.cmake.in46
-rw-r--r--libtiff/tif_config.h.in159
-rw-r--r--libtiff/tif_config.vc.h2
-rw-r--r--tools/tiffcrop.c5
7 files changed, 186 insertions, 53 deletions
diff --git a/.gitignore b/.gitignore
index ad4d4e3c..45562baa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,7 +30,6 @@ libtiff/mkg3states
libtiff/stamp-h1
libtiff/stamp-h2
libtiff/tif_config.h
-libtiff/tif_config.h.in
libtiff/tiffconf.h
libtool
m4/libtool.m4
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d058d67d..e3fdbd26 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -214,24 +214,12 @@ check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(unistd.h HAVE_UNISTD_H)
-# Check if sys/time.h and time.h allow use together
-check_c_source_compiles("
-#include <sys/time.h>
-#include <time.h>
-int main(void){return 0;}"
- TIME_WITH_SYS_TIME)
-
-# Check if struct tm is in sys/time.h
-check_c_source_compiles("
-#include <sys/types.h>
-#include <time.h>
-
-int main(void){
- struct tm tm;
- int *p = &tm.tm_sec;
- return !p;
-}"
- TM_IN_SYS_TIME)
+check_symbol_exists(optarg "getopt.h" HAVE_DECL_OPTARG)
+if (HAVE_DECL_OPTARG)
+ set(HAVE_DECL_OPTARG 1)
+else()
+ set(HAVE_DECL_OPTARG 0)
+endif()
# Disable deprecated features to ensure clean build
add_definitions(-DTIFF_DISABLE_DEPRECATED)
diff --git a/configure.ac b/configure.ac
index 0e09fbc3..dcbfbe15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1021,7 +1021,7 @@ dnl ---------------------------------------------------------------------------
AC_SUBST(LIBDIR)
-AC_CONFIG_HEADERS([libtiff/tif_config.h libtiff/tiffconf.h])
+AC_CONFIG_HEADERS([config.h libtiff/tif_config.h libtiff/tiffconf.h])
AC_CONFIG_FILES([Makefile \
build/Makefile \
diff --git a/libtiff/tif_config.h.cmake.in b/libtiff/tif_config.h.cmake.in
index d239a6b7..2b65d243 100644
--- a/libtiff/tif_config.h.cmake.in
+++ b/libtiff/tif_config.h.cmake.in
@@ -1,6 +1,8 @@
/* libtiff/tif_config.h.cmake.in. Not generated, but originated from autoheader. */
/* This file must be kept up-to-date with needed substitutions from libtiff/tif_config.h.in. */
+#include "tiffconf.h"
+
/* Support CCITT Group 3 & 4 algorithms */
#cmakedefine CCITT_SUPPORT 1
@@ -20,9 +22,15 @@
/* Define to 1 if you have the <assert.h> header file. */
#cmakedefine HAVE_ASSERT_H 1
+/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't. */
+#cmakedefine HAVE_DECL_OPTARG 1
+
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H 1
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#cmakedefine HAVE_FSEEKO 1
+
/* Define to 1 if you have the `getopt' function. */
#cmakedefine HAVE_GETOPT 1
@@ -56,15 +64,9 @@
/* Define to 1 if you have the `setmode' function. */
#cmakedefine HAVE_SETMODE 1
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H 1
-
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H 1
-/* Define to 1 if you have the <sys/time.h> header file. */
-#cmakedefine HAVE_SYS_TIME_H 1
-
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H 1
@@ -72,7 +74,7 @@
#cmakedefine HAVE_UNISTD_H 1
/* 8/12 bit libjpeg dual mode enabled */
-#cmakedefine JPEG_DUAL_MODE_8_12 1
+#cmakedefine JPEG_DUAL_MODE_8_12 1 1
/* 12bit libjpeg primary include file with path */
#define LIBJPEG_12_PATH @LIBJPEG_12_PATH@
@@ -80,12 +82,6 @@
/* 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@"
@@ -113,18 +109,19 @@
/* Default size of the strip in bytes (when strip chopping enabled) */
#define STRIP_SIZE_DEFAULT @STRIP_SIZE_DEFAULT@
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-#cmakedefine TM_IN_SYS_TIME 1
-
/* define to use win32 IO system */
#cmakedefine USE_WIN32_FILEIO 1
/* Version number of package */
#define VERSION "@PACKAGE_VERSION@"
+/* Support WEBP compression */
+#cmakedefine WEBP_SUPPORT 1
+
+/* Support ZSTD compression */
+#cmakedefine ZSTD_SUPPORT 1
+
+
/* 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
@@ -137,19 +134,10 @@
# endif
#endif
-/* Number of bits in a file offset, on hosts where this is settable. */
-#define _FILE_OFFSET_BITS @FILE_OFFSET_BITS@
-
#if SIZEOF_SIZE_T == 8
# define TIFF_SSIZE_FORMAT PRId64
-#elif SIZEOF_SIZE_T == 8
+#elif SIZEOF_SIZE_T == 4
# define TIFF_SSIZE_FORMAT PRId32
#else
# error "Unsupported size_t size; please submit a bug report"
#endif
-
-/* Define to `long int' if <sys/types.h> does not define. */
-#undef off_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
diff --git a/libtiff/tif_config.h.in b/libtiff/tif_config.h.in
new file mode 100644
index 00000000..6a543463
--- /dev/null
+++ b/libtiff/tif_config.h.in
@@ -0,0 +1,159 @@
+/* libtiff/tif_config.h.in. Not generated, but originated from autoheader. */
+
+#include "tiffconf.h"
+
+/* Support CCITT Group 3 & 4 algorithms */
+#undef CCITT_SUPPORT
+
+/* Pick up YCbCr subsampling info from the JPEG data stream to support files
+ lacking the tag (default enabled). */
+#undef CHECK_JPEG_YCBCR_SUBSAMPLING
+
+/* enable partial strip reading for large strips (experimental) */
+#undef CHUNKY_STRIP_READ_SUPPORT
+
+/* Support C++ stream API (requires C++ compiler) */
+#undef CXX_SUPPORT
+
+/* enable deferred strip/tile offset/size loading */
+#undef DEFER_STRILE_LOAD
+
+/* Define to 1 if you have the <assert.h> header file. */
+#undef HAVE_ASSERT_H
+
+/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
+ */
+#undef HAVE_DECL_OPTARG
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#undef HAVE_FSEEKO
+
+/* Define to 1 if you have the `getopt' function. */
+#undef HAVE_GETOPT
+
+/* Define to 1 if you have the <GLUT/glut.h> header file. */
+#undef HAVE_GLUT_GLUT_H
+
+/* Define to 1 if you have the <GL/glut.h> header file. */
+#undef HAVE_GL_GLUT_H
+
+/* Define to 1 if you have the <GL/glu.h> header file. */
+#undef HAVE_GL_GLU_H
+
+/* Define to 1 if you have the <GL/gl.h> header file. */
+#undef HAVE_GL_GL_H
+
+/* Define to 1 if you have the <io.h> header file. */
+#undef HAVE_IO_H
+
+/* Define to 1 if you have the `jbg_newlen' function. */
+#undef HAVE_JBG_NEWLEN
+
+/* Define to 1 if you have the `mmap' function. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the <OpenGL/glu.h> header file. */
+#undef HAVE_OPENGL_GLU_H
+
+/* Define to 1 if you have the <OpenGL/gl.h> header file. */
+#undef HAVE_OPENGL_GL_H
+
+/* Define to 1 if you have the `setmode' function. */
+#undef HAVE_SETMODE
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 8/12 bit libjpeg dual mode enabled */
+#undef JPEG_DUAL_MODE_8_12
+
+/* 12bit libjpeg primary include file with path */
+#undef LIBJPEG_12_PATH
+
+/* Support LZMA2 compression */
+#undef LZMA_SUPPORT
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The size of `size_t', as computed by sizeof. */
+#undef SIZEOF_SIZE_T
+
+/* Default size of the strip in bytes (when strip chopping enabled) */
+#undef STRIP_SIZE_DEFAULT
+
+/* define to use win32 IO system */
+#undef USE_WIN32_FILEIO
+
+/* 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
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* 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
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#undef _LARGEFILE_SOURCE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+#if SIZEOF_SIZE_T == 8
+# define TIFF_SSIZE_FORMAT PRId64
+#elif SIZEOF_SIZE_T == 4
+# define TIFF_SSIZE_FORMAT PRId32
+#else
+# error "Unsupported size_t size; please submit a bug report"
+#endif \ No newline at end of file
diff --git a/libtiff/tif_config.vc.h b/libtiff/tif_config.vc.h
index fafc422e..8413c826 100644
--- a/libtiff/tif_config.vc.h
+++ b/libtiff/tif_config.vc.h
@@ -1,6 +1,8 @@
#ifndef _TIF_CONFIG_H_
#define _TIF_CONFIG_H_
+#include "tiffconf.h"
+
/* Define to 1 if you have the <assert.h> header file. */
#define HAVE_ASSERT_H 1
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
index 06a2c148..c793d8e3 100644
--- a/tools/tiffcrop.c
+++ b/tools/tiffcrop.c
@@ -114,6 +114,7 @@ static char tiffcrop_rev_date[] = "12-13-2010";
#include <stdio.h>
#include <stdlib.h>
+#include <stdint.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
@@ -125,10 +126,6 @@ static char tiffcrop_rev_date[] = "12-13-2010";
# include <unistd.h>
#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif