aboutsummaryrefslogtreecommitdiff
path: root/third_party/libtiff/0000-build-config.patch
blob: f66235abfaa7804d08040f6d95efcb3a12faa5a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
diff a/third_party/libtiff/tiffiop.h b/third_party/libtiff/tiffiop.h
--- a/third_party/libtiff/tiffiop.h
+++ b/third_party/libtiff/tiffiop.h
@@ -28,7 +28,7 @@
  * ``Library-private'' definitions.
  */
 
-#include "tif_config.h"
+#include "tiffconf.h"
 
 #ifdef HAVE_FCNTL_H
 # include <fcntl.h>
diff a/third_party/libtiff/tif_jpeg.c b/third_party/libtiff/tif_jpeg.c
--- a/third_party/libtiff/tif_jpeg.c
+++ b/third_party/libtiff/tif_jpeg.c
@@ -110,8 +110,16 @@
 #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
 #endif
 
-#include "jerror.h"
-#include "jpeglib.h"
+#if defined(USE_SYSTEM_LIBJPEG)
+#include <jerror.h>
+#include <jpeglib.h>
+#elif defined(USE_LIBJPEG_TURBO)
+#include "third_party/libjpeg_turbo/jerror.h"
+#include "third_party/libjpeg_turbo/jpeglib.h"
+#else
+#include "third_party/libjpeg/jerror.h"
+#include "third_party/libjpeg/jpeglib.h"
+#endif
 
 /* Do optional compile-time version check */
 #if defined(EXPECTED_JPEG_LIB_VERSION) && !defined(LIBJPEG_12_PATH)
diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h
--- /dev/null
+++ b/third_party/libtiff/tiffconf.h
@@ -0,0 +1,244 @@
+/* libtiff/tiffconf.h.  Generated by configure.  */
+/*
+  Configuration defines for installed libtiff.
+  This file maintained for backward compatibility. Do not use definitions
+  from this file in your programs.
+*/
+#ifndef _TIFFCONF_
+#define _TIFFCONF_
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "build/build_config.h"
+
+//NOTE: The tiff codec requires an ANSI C compiler environment for building and 
+//    presumes an ANSI C environment for use.
+
+# define HAVE_SYS_TYPES_H 1
+# define HAVE_FCNTL_H 1
+
+/* Compatibility stuff. */
+
+/* Define to 1 if you have the <assert.h> header file. */
+#define HAVE_ASSERT_H 1
+
+/* Define as 0 or 1 according to the floating point format suported by the
+   machine */
+#define HAVE_IEEEFP 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have snprintf(). */
+#define HAVE_SNPRINTF 1
+
+/* Define to 1 if you have the <search.h> header file. */
+#if BUILDFLAG(IS_WIN)
+// search.h is always available in VS 2015 and above, and may be
+// available in earlier versions.
+#define HAVE_SEARCH_H 1
+#endif
+
+/* The size of a `int'. */
+/* According typedef int  int32_t; in the fx_system.h*/
+#define SIZEOF_INT 4
+
+#if defined(ARCH_CPU_64_BITS)
+/* The size of `unsigned long', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_LONG 8
+#else
+#define SIZEOF_UNSIGNED_LONG 4
+#endif
+
+/* The size of void*. */
+#ifdef __LP64__
+#define SIZEOF_VOIDP 8
+#else
+#define SIZEOF_VOIDP 4
+#endif
+
+/* Signed 8-bit type */
+#define TIFF_INT8_T signed char
+
+/* Unsigned 8-bit type */
+#define TIFF_UINT8_T unsigned char
+
+/* Signed 16-bit type */
+#define TIFF_INT16_T signed short
+
+/* Unsigned 16-bit type */
+#define TIFF_UINT16_T unsigned short
+
+/* Signed 32-bit type */
+#define TIFF_INT32_T signed int
+
+/* Unsigned 32-bit type */
+#define TIFF_UINT32_T unsigned int
+
+/* Signed 32-bit type formatter */
+#define TIFF_INT32_FORMAT "%d"
+
+/* Unsigned 32-bit type formatter */
+#define TIFF_UINT32_FORMAT "%u"
+
+#ifdef _MSC_VER   // windows
+
+/* Signed 64-bit type formatter */
+#define TIFF_INT64_FORMAT "%I64d"
+
+/* Unsigned 64-bit type formatter */
+#define TIFF_UINT64_FORMAT "%I64u"
+
+/* Signed 64-bit type */
+#define TIFF_INT64_T signed __int64
+
+/* Unsigned 64-bit type */
+#define TIFF_UINT64_T unsigned __int64
+
+#else           // linux/unix
+
+#if defined(ARCH_CPU_64_BITS)
+
+/* Signed 64-bit type formatter */
+#define TIFF_INT64_FORMAT "%ld"
+
+/* Unsigned 64-bit type formatter */
+#define TIFF_UINT64_FORMAT "%lu"
+
+/* Signed 64-bit type */
+#define TIFF_INT64_T signed long
+
+/* Unsigned 64-bit type */
+#define TIFF_UINT64_T unsigned long
+
+#else           // linux/unix 32
+
+/* Signed 64-bit type formatter */
+#define TIFF_INT64_FORMAT "%lld"
+
+/* Unsigned 64-bit type formatter */
+#define TIFF_UINT64_FORMAT "%llu"
+
+/* Signed 64-bit type */
+#define TIFF_INT64_T signed long long
+
+/* Unsigned 64-bit type */
+#define TIFF_UINT64_T unsigned long long
+
+#endif  // define(ARCH_CPU_64_BITS)
+
+#endif
+
+
+/* Signed size type, type formatter, and size of size_t */
+#if defined(ARCH_CPU_64_BITS)
+#define TIFF_SSIZE_T int64_t
+#define TIFF_SSIZE_FORMAT PRId64
+#define SIZEOF_SIZE_T 8
+#else
+#define TIFF_SSIZE_T int32_t
+#define TIFF_SSIZE_FORMAT PRId32
+#define SIZEOF_SIZE_T 4
+#endif
+
+/* Pointer difference type */
+#ifdef _MSC_VER
+#define TIFF_PTRDIFF_T long
+#else
+#define TIFF_PTRDIFF_T ptrdiff_t
+#endif
+
+/* Signed 64-bit type */
+/*#define TIFF_INT64_T signed __int64*/
+
+/* Unsigned 64-bit type */
+/*#define TIFF_UINT64_T unsigned __int64*/
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+# ifndef inline
+#  define inline __inline
+# endif
+#endif
+
+#define lfind _lfind
+
+#define BSDTYPES
+
+/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
+#define HOST_FILLORDER FILLORDER_LSB2MSB
+
+/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
+   (Intel) */
+#if _FX_ENDIAN_ == _FX_BIG_ENDIAN_
+# define HOST_BIGENDIAN 1
+#else
+# define HOST_BIGENDIAN 0
+#endif
+
+/* Support CCITT Group 3 & 4 algorithms */
+#define CCITT_SUPPORT 1
+
+/* Support JPEG compression (requires IJG JPEG library) */
+#define JPEG_SUPPORT 1
+
+/* Support LogLuv high dynamic range encoding */
+#define LOGLUV_SUPPORT 1
+
+/* Support LZW algorithm */
+#define LZW_SUPPORT 1
+
+/* Support NeXT 2-bit RLE algorithm */
+#define NEXT_SUPPORT 1
+
+/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
+   fails with unpatched IJG JPEG library) */
+/* #undef OJPEG_SUPPORT */
+
+/* Support Macintosh PackBits algorithm */
+#define PACKBITS_SUPPORT 1
+
+/* Support Pixar log-format algorithm (requires Zlib) */
+#define PIXARLOG_SUPPORT 1
+
+/* Support ThunderScan 4-bit RLE algorithm */
+#define THUNDER_SUPPORT 1
+
+/* Support Deflate compression */
+/* #undef ZIP_SUPPORT */
+
+/* Support strip chopping (whether or not to convert single-strip uncompressed
+   images to mutiple strips of ~8Kb to reduce memory usage) */
+#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP
+
+/* Enable SubIFD tag (330) support */
+#define SUBIFD_SUPPORT 1
+
+/* Treat extra sample as alpha (default enabled). The RGBA interface will
+   treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
+   packages produce RGBA files but don't mark the alpha properly. */
+#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
+
+/* Pick up YCbCr subsampling info from the JPEG data stream to support files
+   lacking the tag (default enabled). */
+#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
+
+/* Support MS MDI magic number files as TIFF */
+#define MDI_SUPPORT 1
+
+/*
+ * Feature support definitions.
+ * XXX: These macros are obsoleted. Don't use them in your apps!
+ * Macros stays here for backward compatibility and should be always defined.
+ */
+#define COLORIMETRY_SUPPORT
+#define YCBCR_SUPPORT
+#define CMYK_SUPPORT
+#define ICC_SUPPORT
+#define PHOTOSHOP_SUPPORT
+#define IPTC_SUPPORT
+
+#endif /* _TIFFCONF_ */