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
283
284
|
--- configure.in 2005-09-21 02:56:09.000000000 -0500
+++ configure.in 2006-01-09 22:57:14.000000000 -0600
@@ -98,133 +98,164 @@
#
# Checks for libpng
#
-AC_MSG_CHECKING(for libpng)
- if test -z "$PNG_LIBS"; then
- AC_CHECK_LIB(png, png_read_info,
- [AC_CHECK_HEADER(png.h,
- png_ok=yes,
- png_ok=no)],
- AC_MSG_ERROR(*** PNG library (libpng) not found ***), -lz -lm)
- if test "$png_ok" = yes; then
- AC_MSG_CHECKING([for png_structp in png.h])
- AC_TRY_COMPILE([#include <png.h>],
- [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
- png_ok=yes,
- png_ok=no)
- AC_MSG_RESULT($png_ok)
- if test "$png_ok" = yes; then
- PNG_LIBS='-lpng -lz'
- else
- AC_MSG_ERROR(*** PNG library (libpng) is too old ***)
- fi
- else
- AC_MSG_ERROR(*** PNG header file not found ***)
- fi
- fi
-AC_SUBST(PNG_LIBS)
+AC_ARG_ENABLE([png],
+ [AC_HELP_STRING([--disable-png],[disable support for png])],,
+ [enable_png=yes])
+
+if test x$enable_png = xyes ; then
+ AC_MSG_CHECKING(PNG Support)
+ AC_MSG_RESULT()
+
+ AC_CHECK_LIB(png, png_read_info,
+ [AC_CHECK_HEADER(png.h,,[AC_MSG_ERROR([*** PNG headers not found ***])])],
+ [AC_MSG_ERROR([*** PNG library not found ***])])
+
+ AC_MSG_CHECKING([for png_structp in png.h])
+ AC_TRY_COMPILE([#include <png.h>],
+ [png_struct pp; png_infop info; png_colorp cmap;png_create_read_struct;],,
+ [AC_MSG_ERROR([*** PNG library (libpng) is too old ***])])
+
+ PNG_LIBS='-lpng -lm -lz'
+ AC_SUBST(PNG_LIBS)
+
+ HAVE_PNG=yes
+else
+ HAVE_PNG=no
+fi
#
# Checks for libjpeg
#
-jpeg_ok=no
-AC_MSG_CHECKING(for libjpeg)
- if test -z "$JPEG_LIBS"; then
- AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
- [AC_CHECK_HEADER(jpeglib.h,
- jpeg_ok=yes,
- jpeg_ok=no)],
- AC_MSG_WARN([*** Internal jpegtran will not be built (JPEG library not found) ***]), -lm)
- if test "$jpeg_ok" = yes; then
- JPEG_LIBS='-ljpeg'
- AC_DEFINE(HAVE_LIBJPEG, 1, [Have libjpeg])
- AC_CHECK_LIB(jpeg, jpeg_simple_progression,
- AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1,
- [Define to 1 if jpeglib supports progressive JPEG.]),
- AC_MSG_WARN(JPEG library does not support progressive saving.))
- else
- AC_MSG_WARN([*** Internal jpegtran will not be built (JPEG library not found) ***])
- fi
- fi
-AC_SUBST(JPEG_LIBS)
+AC_ARG_ENABLE([jpeg],
+ [AC_HELP_STRING([--disable-jpeg],[disable support for jpeg])],,
+ [enable_jpeg=yes])
+
+if test x$enable_jpeg = xyes ; then
+ AC_MSG_CHECKING(JPEG Support)
+ AC_MSG_RESULT()
+
+ AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
+ [AC_CHECK_HEADER(jpeglib.h,,[AC_MSG_ERROR([*** JPEG headers not found ***])])],
+ [AC_MSG_ERROR([*** JPEG library not found ***])])
+
+ AC_CHECK_LIB(jpeg, jpeg_simple_progression,
+ [AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1, [Define to 1 if libjpeg supports progressive JPEG.])],
+ [AC_MSG_WARN(JPEG library does not support progressive saving.)])
+
+ JPEG_LIBS='-ljpeg -lm -lz'
+ AC_SUBST(JPEG_LIBS)
+
+ HAVE_JPEG=yes
+else
+ HAVE_JPEG=no
+fi
#
# Checks for libtiff
#
-tiff_ok=no
-AC_MSG_CHECKING(for libtiff)
- if test -z "$TIFF_LIBS"; then
- AC_CHECK_LIB(tiff, TIFFWriteScanline,
- [AC_CHECK_HEADER(tiffio.h,
- tiff_ok=yes,
- tiff_ok=no)],
- AC_MSG_WARN([*** (TIFF library not found) ***]), -lm -lz)
- if test "$tiff_ok" = yes; then
- TIFF_LIBS='-ltiff -ljpeg -lz'
- AC_DEFINE(HAVE_LIBTIFF, 1, [Have libtiff])
- else
- AC_MSG_WARN([*** (TIFF library not found) ***])
- fi
- fi
-AC_SUBST(TIFF_LIBS)
+AC_ARG_ENABLE([tiff],
+ [AC_HELP_STRING([--disable-tiff],[disable support for tiff])],,
+ [enable_tiff=yes])
+
+if test x$enable_tiff = xyes ; then
+ AC_MSG_CHECKING(TIFF Support)
+ AC_MSG_RESULT()
+ AC_CHECK_LIB(tiff, TIFFWriteScanline,
+ [AC_CHECK_HEADER(tiffio.h,,[AC_MSG_ERROR([*** TIFF headers not found ***])])],
+ [AC_MSG_ERROR([*** TIFF library not found ***])])
+
+ AC_DEFINE(HAVE_LIBTIFF, 1, [Define to 1 if libtiff support is included])
+
+ TIFF_LIBS='-ltiff -lm -lz'
+ AC_SUBST(TIFF_LIBS)
+
+ HAVE_TIFF=yes
+else
+ HAVE_TIFF=no
+fi
#
# Checks for Xft/XRender
#
-have_render=false
-RENDER_LIBS=""
-AC_CHECK_LIB(Xrender, XRenderFindFormat,
- have_render=true,:,-lXext $GTHUMB_LIBS)
-if $have_render ; then
- RENDER_LIBS="-lXrender -lXext"
- AC_DEFINE(HAVE_RENDER, 1, [Have Xft/XRender])
+
+AC_ARG_ENABLE([render],
+ [AC_HELP_STRING([--disable-render],[disable support for Xrender])],,
+ [enable_render=yes])
+
+if test x$enable_render = xyes ; then
+ AC_MSG_CHECKING(Xrender Support)
+ AC_MSG_RESULT()
+
+ AC_CHECK_LIB(Xrender, XRenderFindFormat,,,[-lXext $GTHUMB_LIBS])
+
+ AC_DEFINE(HAVE_RENDER, 1, [Define to 1 if Xft/XRender support is included])
+
+ RENDER_LIBS='-lXrender -lXext'
+ AC_SUBST(RENDER_LIBS)
+
+ HAVE_RENDER=yes
+else
+ HAVE_RENDER=no
fi
-AC_SUBST(RENDER_LIBS)
#
# Checks for libexif
#
-AC_MSG_CHECKING(for libexif)
-have_libexif=no
-EXIF_LIBS=""
-EXIF_CFLAGS=""
-if pkg-config --atleast-version=$LIBEXIF_REQUIRED libexif; then
- have_libexif="yes (0.6.x)"
- EXIF_LIBS=`pkg-config --libs libexif`
- EXIF_CFLAGS=`pkg-config --cflags libexif`
- AC_DEFINE(HAVE_LIBEXIF, 1, [Have libexif])
-elif pkg-config --atleast-version=$LIBEXIF_0_5_REQUIRED libexif; then
- have_libexif="yes (0.5.x)"
- EXIF_LIBS=`pkg-config --libs libexif`
- EXIF_CFLAGS=`pkg-config --cflags libexif`
- AC_DEFINE(HAVE_LIBEXIF, 1, [Have libexif])
- AC_DEFINE(HAVE_LIBEXIF_0_5, 1, [Have libexif 0.5.x])
-fi
-AC_MSG_RESULT($have_libexif)
-AC_SUBST(EXIF_LIBS)
-AC_SUBST(EXIF_CFLAGS)
+
+AC_ARG_ENABLE([exif],
+ [AC_HELP_STRING([--disable-exif],[disable support for libexif])],,
+ [enable_exif=yes])
+
+if test x$enable_exif = xyes ; then
+ AC_MSG_CHECKING(EXIF Support)
+ AC_MSG_RESULT()
+
+ PKG_CHECK_MODULES(EXIF, libexif >= $LIBEXIF_REQUIRED,,
+ [PKG_CHECK_MODULES(EXIF, libexif >= $LIBEXIF_0_5_REQUIRED,
+ [AC_DEFINE(HAVE_LIBEXIF_0_5, 1, [Using libexif 0.5])],
+ [AC_MSG_ERROR([*** libexif not found ***])]
+ )
+ ])
+
+ AC_DEFINE(HAVE_LIBEXIF, 1, [Define to 1 if we have libexif support])
+
+ AC_SUBST(EXIF_LIBS)
+ AC_SUBST(EXIF_CFLAGS)
+
+ HAVE_EXIF=yes
+else
+ HAVE_EXIF=no
+fi
#
# Checks for libgphoto2
#
-AC_MSG_CHECKING(for libgphoto2)
-have_libgphoto=no
-LIBGPHOTO_LIBS=""
-LIBGPHOTO_CFLAGS=""
-if pkg-config --atleast-version=$LIBGPHOTO_REQUIRED libgphoto2; then
- have_libgphoto=yes
- LIBGPHOTO_LIBS=`pkg-config --libs libgphoto2`
- LIBGPHOTO_CFLAGS=`pkg-config --cflags libgphoto2`
- AC_DEFINE(HAVE_LIBGPHOTO, 1, [Have libgphoto])
-fi
-AC_MSG_RESULT($have_libgphoto)
-AC_SUBST(LIBGPHOTO_LIBS)
-AC_SUBST(LIBGPHOTO_CFLAGS)
+
+AC_ARG_ENABLE([gphoto2],
+ [AC_HELP_STRING([--disable-gphoto2],[disable support for libgphoto2])],,
+ [enable_gphoto2=yes])
+
+if test x$enable_gphoto2 = xyes ; then
+ AC_MSG_CHECKING(GPHOTO2 Support)
+ AC_MSG_RESULT()
+
+ PKG_CHECK_MODULES(LIBGPHOTO, libgphoto2 >= $LIBGPHOTO_REQUIRED)
+
+ AC_DEFINE(HAVE_LIBGPHOTO, 1, [Define to 1 to enable libgphoto2 support])
+
+ AC_SUBST(LIBGPHOTO_LIBS)
+ AC_SUBST(LIBGPHOTO_CFLAGS)
+
+ HAVE_GPHOTO2=yes
+else
+ HAVE_GPHOTO2=no
+fi
dnl ###############################################
@@ -308,10 +339,11 @@
Source code location: ${srcdir}
Compiler: ${CC}
- Have Render: ${have_render}
- Have libexif: ${have_libexif}
- Have libjpeg: ${jpeg_ok}
- Have libtiff: ${tiff_ok}
- Have libgphoto: ${have_libgphoto}
+ Have Render: ${HAVE_RENDER}
+ Have libexif: ${HAVE_EXIF}
+ Have libpng: ${HAVE_PNG}
+ Have libjpeg: ${HAVE_JPEG}
+ Have libtiff: ${HAVE_TIFF}
+ Have libgphoto: ${HAVE_GPHOTO2}
"
|