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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(libgphoto2/gphoto2.h)
AM_CONFIG_HEADER(libgphoto2/config.h)
AM_INIT_AUTOMAKE(gphoto2, 2.0.1dev13)
AM_MAINTAINER_MODE
AC_LIBTOOL_DLOPEN
dnl ---------------------------------------------------------------------------
dnl Versioning (libgphoto2-(AGE.)CURRENT.REVISION):
dnl - AGE (Micro): Increment if any interfaces have been added; set to 0
dnl if any interfaces have been removed. Removal has
dnl precedence over adding, so set to 0 if both happened.
dnl - REVISION (Minor): Increment any time the source changes; set to
dnl 0 if you incremented CURRENT.
dnl - CURRENT (Major): Increment if the interface has additions, changes,
dnl removals.
dnl ---------------------------------------------------------------------------
LIBGPHOTO2_AGE=1
LIBGPHOTO2_REVISION=0
LIBGPHOTO2_CURRENT=2
AC_SUBST(LIBGPHOTO2_AGE)
AC_SUBST(LIBGPHOTO2_REVISION)
AC_SUBST(LIBGPHOTO2_CURRENT)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
dnl ---------------------------------------------------------------------------
dnl i18n support (including some hacks)
dnl ---------------------------------------------------------------------------
dnl The following is a hack to get gphoto2 to build on gettext-0.10.35
dnl systems - BUILD_INCLUDED_LIBINTL is set only in gettext-0.10.37 which is
dnl the gettext version provided with gphoto2.
BUILD_INCLUDED_LIBINTL=no
AC_SUBST(BUILD_INCLUDED_LIBINTL)
dnl USE_INCLUDED_LIBINTL=no
dnl AC_SUBST(USE_INCLUDED_LIBINTL)
ALL_LINGUAS="da de es fr it ja no ru sl sv uk zh_CN"
AM_GNU_GETTEXT
AC_CHECK_FUNC(gettext, gettext_without_libintl=true)
# same trick as with libdl:
# if gettext() doesn't require linking against libintl,
# we don't have to check for gettext in libintl. Otherwise
# we may even require libintl.
dnl AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
if test "$gettext_without_libintl" != "true" -a "$USE_NLS" = "yes"; then
AC_CHECK_LIB(intl, gettext, [INTLLIBS="$INTLLIBS -lintl"])
fi
dnl ---------------------------------------------------------------------------
dnl pthread: The gphoto2 shell (--shell) keeps up a connection to the
dnl camera. Some cameras need to be sent keep-alive-messages
dnl in order to prevent a shut-down. This is what we need
dnl pthread for.
dnl ---------------------------------------------------------------------------
pthread_msg=no
try_pthread=true
AC_ARG_WITH(pthread, [ --without-pthread Don't use pthread],
if test x$withval = xno; then
try_pthread=false
fi)
if $try_pthread; then
AC_CHECK_HEADER(pthread.h, [
AC_DEFINE(HAVE_PTHREAD,,[Define if we use pthread.h.])
pthread_msg=yes
PTHREAD_LIBS="-lpthread"
])
fi
AC_SUBST(PTHREAD_LIBS)
dnl ---------------------------------------------------------------------------
dnl Turn on debugging and all warnings when using gcc
dnl ---------------------------------------------------------------------------
if test "$ac_cv_prog_gcc" = "yes"; then
CFLAGS="$CFLAGS -g -Wall -Wmissing-declarations -Wmissing-prototypes"
LDFLAGS="$LDFLAGS -g -Wall"
fi
dnl Replace `main' with a function in -libs:
AC_CHECK_LIB(ibs, main)
dnl ---------------------------------------------------------------------------
dnl Debugging: The following will just #ifdef out the --debug option in
dnl gphoto2, the command-line frontend. It has no effect
dnl on libgphoto2. Actually, it affects only about 20 LOC in
dnl frontends/command-line/main.c, so I don't know if it's really
dnl worth the effort. But people missed it...
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(debugging,
[ --disable-debugging do not include debugging code],
[if test "$enableval" = "no"; then
AC_DEFINE(DISABLE_DEBUGGING,,[Define if we don't want to include debugging code.])
fi])
dnl ---------------------------------------------------------------------------
dnl Checks for header files.
dnl ---------------------------------------------------------------------------
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h mcheck.h)
AC_INLINE
AC_CONST
dnl ---------------------------------------------------------------------------
dnl Check for libtool: lt_dlforeachfile has been introduced in
dnl libtool-1.4. However, there are still systems out
dnl there running libtool-1.3. For those, we will need
dnl dlopen. Note that on some systems (e.g. FreeBSD)
dnl -ldl isn't needed.
dnl ---------------------------------------------------------------------------
AC_PROG_LIBTOOL
have_ltdl=false
dnl There is a show-stopper bug in libltdl. Contact
dnl <lutz@users.sourceforge.net> for infos.
ltdl_msg="no (default)"
try_ltdl=false
AC_ARG_WITH(ltdl, [ --without-ltdl Don't use ltdl],[
if test x$withval = xno; then
try_ltdl=false
fi])
if $try_ltdl; then
AC_CHECK_LIB(ltdl, lt_dlforeachfile,[
AC_CHECK_HEADER(ltdl.h,[
AC_DEFINE(HAVE_LTDL,,[whether we use libltdl])
LTDL_LIBS="-lltdl"
ltdl_msg="yes"
have_ltdl=true])])
fi
if test x$have_ltdl != "xtrue"; then
AC_CHECK_FUNC(dlopen,,[
AC_CHECK_LIB(dl, dlopen,[LTDL_LIBS="-ldl"],[AC_ERROR([
*** Could not determine how to handle
*** shared libraries!])])])
fi
AC_SUBST(LTDL_LIBS)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_CHECK_FUNCS(mkdir strdup strncpy strcpy snprintf sprintf vsnprintf)
dnl Find out how to get struct tm
AC_STRUCT_TM
dnl Check for tm_gmtoff in struct tm
AC_MSG_CHECKING([for tm_gmtoff in struct tm])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;],
AC_DEFINE(HAVE_TM_GMTOFF,,[whether struct tm has tm_gmtoff field])
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
)
dnl Create a stdint.h-like file containing size-specific integer definitions
dnl that will always be available
AC_NEED_STDINT_H(libgphoto2/_stdint.h)
dnl Create a header file containing NetBSD-style byte swapping macros
AC_NEED_BYTEORDER_H(libgphoto2/gphoto2-endian.h)
dnl Solaris hack for grep and tr
[
if test -n "`echo $host_os | grep '[sS]olaris'`"; then
TR=/usr/xpg4/bin/tr
GREP=/usr/xpg4/bin/grep
else
TR=tr
GREP=grep
fi
]
dnl ---------------------------------------------------------------------------
dnl Camera drivers
dnl ---------------------------------------------------------------------------
camlibs='agfa barbie canon casio digita dimera directory fuji jamcam jd11 kodak konica minolta mustek panasonic polaroid ptp ricoh samsung sierra sipix stv0680 sonydscf1 sonydscf55'
AC_SUBST(SUBDIRS_CAMLIBS)
for i in $camlibs; do
d=`echo $i | $TR a-z A-Z`
eval "CONFIG_DRIVER_$d=n"
done
AC_MSG_CHECKING(which drivers to compile)
AC_ARG_WITH(drivers,
[ --with-drivers=<list> compile drivers in <list>; ]
[ drivers may be separated with commas; ]
[ 'all' compiles all drivers; ]
[ possible drivers are: ]
[ agfa, barbie, canon, casio, digita, dimera,]
[ directory, fuji, jamcam, jd11, kodak,]
[ konica, mustek,]
[ minolta, panasonic, polaroid, ptp, ricoh,]
[ samsung, sierra, sonydscf1, sonydscf55,]
[ stv0680 ],
drivers="$withval", drivers="all")
if test "$drivers" = "all"; then
for i in $camlibs; do
SUBDIRS_CAMLIBS="$SUBDIRS_CAMLIBS $i"
done
AC_MSG_RESULT(all)
else
drivers=`echo $drivers | sed 's/,/ /g'`
for driver in $drivers; do
if test -n "`echo $camlibs | $GREP -E \"(^| )$driver( |\$)\"`"; then
SUBDIRS_CAMLIBS="$SUBDIRS_CAMLIBS $driver"
else
AC_ERROR(Unknown driver $driver!)
fi
done
AC_MSG_RESULT($drivers)
fi
dnl ************************************************************
dnl find out where to install documentation files
dnl ************************************************************
GP_CHECK_DOC_DIR()dnl
dnl ********
dnl build docs?
dnl ********
GP_BUILD_DOCS()dnl
dnl ************************************************************
dnl initialize packaging RPMs
dnl ************************************************************
GPKG_CHECK_RPM()dnl
dnl ---------------------------------------------------------------------------
dnl CDK: If you would like to access the camera's configuration using
dnl gphoto2, the command-line frontend, you need this. Old versions
dnl of CDK don't include fscale, therefore check for it here.
dnl ---------------------------------------------------------------------------
cdk_msg="no (http://dickey.his.com/cdk/cdk.html)"
try_cdk=true
have_cdk=false
AC_ARG_WITH(cdk, [ --without-cdk Don't use cdk],
if test x$withval = xno; then
try_cdk=false
fi
)
if test "x$prefix" = xNONE; then
cdk_prefix=$ac_default_prefix
else
cdk_prefix=$prefix
fi
AC_ARG_WITH(cdk-prefix, [ --with-cdk-prefix=PREFIX Location of cdk],
cdk_prefix="$withval")
if $try_cdk; then
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="-I$cdk_prefix/include -I$cdk_prefix/include/cdk $CPPFLAGS"
AC_CHECK_HEADER(cdk.h, [
have_cdk=true
CDK_CFLAGS="-I$cdk_prefix/include -I$cdk_prefix/include/cdk"
CDK_LIBS="-L$cdk_prefix/lib -lcdk -lncurses"
AC_DEFINE(HAVE_CDK,,[whether we have CDK])
LDFLAGS_save="$LDFLAGS"
LDFLAGS="$CDK_LIBS"
AC_CHECK_LIB(cdk, newCDKFScale, [cdk_msg="yes"], [
AC_DEFINE(HAVE_CDK_20010421,,[whether we have old CDK])
cdk_msg="yes (but without fscale)"]
)
LDFLAGS="$LDFLAGS_save"]
)
CPPFLAGS="$CPPFLAGS_save"
else
cdk_msg="no (not requested)"
fi
AM_CONDITIONAL(HAVE_CDK, $have_cdk)
AC_SUBST(CDK_CFLAGS)
AC_SUBST(CDK_LIBS)
dnl ---------------------------------------------------------------------------
dnl libjpeg: Right now, libjpeg is only used to interpret JPEG previews in
dnl order to feed them to aalib (see below).
dnl ---------------------------------------------------------------------------
jpeg_msg=no
try_jpeg=true
have_jpeg=false
AC_ARG_WITH(jpeg, [ --without-jpeg Don't use jpeg],
if test x$withval = xno; then
try_jpeg=false
fi
)
if $try_jpeg; then
AC_MSG_CHECKING([for jpeglib.h])
AC_TRY_CPP([
#include <stdio.h>
#undef PACKAGE
#undef VERSION
#undef HAVE_STDDEF_H
#undef HAVE_STDLIB_H
#include <jpeglib.h>],
jpeg_msg=yes,
jpeg_msg=no)
AC_MSG_RESULT($jpeg_msg)
if test "$jpeg_msg" = yes; then
have_jpeg=true
AC_DEFINE(HAVE_JPEG,,[whether we use libjpeg])
JPEG_LIBS="-ljpeg"
fi
else
jpeg_msg="no (not requested)"
fi
AM_CONDITIONAL(HAVE_JPEG, $have_jpeg)
AC_SUBST(JPEG_LIBS)
dnl ---------------------------------------------------------------------------
dnl pkg-config: pkg-config is a tool to simplify checks for libraries and
dnl versions. I really think this is a good thing and therefore
dnl use it here. However, if pkg-config is not installed,
dnl we offer alternative checks, too.
dnl ---------------------------------------------------------------------------
pkgconfig_msg="no (http://www.freedesktop.org/software/pkgconfig)"
try_pkgconfig=true
have_pkgconfig=false
AC_ARG_WITH(pkgconfig, [ --without-pkgconfig Don't use pkg-config],[
if test x$withval = xno; then
try_pkgconfig=false
fi])
if $try_pkgconfig; then
AC_PATH_PROG(PKG_CONFIG,pkg-config)
if test -n "${PKG_CONFIG}"; then
have_pkgconfig=true
pkgconfig_msg="yes"
fi
else
pkgconfig_msg="no (not requested)"
fi
dnl ---------------------------------------------------------------------------
dnl libexif: The CameraFilesystem can use libexif for extracting thumbnails
dnl out of EXIF data. Similarly, it can extract the mtime of
dnl a file.
dnl libexif is available from
dnl http://www.sourceforge.net/projects/libexif
dnl ---------------------------------------------------------------------------
exif_msg="no (http://www.sourceforge.net/projects/libexif)"
try_exif=true
have_exif=false
AC_ARG_WITH(exif, [ --without-exif Don't use libexif],[
if test x$withval = xno; then
try_exif=false
fi])
if test "x$prefix" = xNONE; then
exif_prefix=$ac_default_prefix
else
exif_prefix=$prefix
fi
AC_ARG_WITH(exif-prefix, [ --with-exif-prefix=PREFIX Location of libexif],[
exif_prefix="$withval"])
if $try_exif; then
if $have_pkgconfig; then
AC_MSG_CHECKING([for libexif])
if ${PKG_CONFIG} --exists libexif > /dev/null 2>&1; then
EXIF_CFLAGS=`$PKG_CONFIG --cflags libexif`
EXIF_LIBS=`$PKG_CONFIG --libs libexif`
have_exif=true
exif_msg=yes
AC_DEFINE(HAVE_EXIF,,[whether we use libexif])
fi
AC_MSG_RESULT($exif_msg)
else
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="-I$exif_prefix/include/libexif -I$exif_prefix/include $CPPFLAGS"
AC_CHECK_HEADER(exif-data.h, [
EXIF_CFLAGS="-I$exif_prefix/include -I$exif_prefix/include/libexif"
EXIF_LIBS="-L$exif_prefix/lib -lexif"
have_exif=true
exif_msg=yes
AC_DEFINE(HAVE_EXIF,,[whether we use libexif])])
fi
else
exif_msg="no (not requested)"
fi
AM_CONDITIONAL(HAVE_EXIF, $have_exif)
AC_SUBST(EXIF_CFLAGS)
AC_SUBST(EXIF_LIBS)
dnl ---------------------------------------------------------------------------
dnl aalib: gphoto2 (the frontend) has been designed as a command-line tool.
dnl However, life previews make only sense when you can actually
dnl see the preview. This is where aalib fits in - it gives you the
dnl possibility to view life-previews on any console.
dnl ---------------------------------------------------------------------------
aa_msg="no (http://www.sourceforge.net/projects/aa-project)"
try_aa=true
have_aa=false
AC_ARG_WITH(aalib, [ --without-aalib Don't use aalib],
if test x$withval = xno; then
try_aa=false
fi
)
if $try_aa; then
AC_CHECK_HEADER(aalib.h,[
have_aa=true
aa_msg=yes
AC_DEFINE(HAVE_AA,,[whether we use aalib])
AC_PATH_PROG(AALIB_CONFIG,aalib-config)
if test -n "${AALIB_CONFIG}"; then
AA_CFLAGS=`$AALIB_CONFIG --cflags`
AA_LIBS=`$AALIB_CONFIG --libs`
else
AA_LIBS="-laa"
fi])
else
aa_msg="no (not requested)"
fi
AM_CONDITIONAL(HAVE_AA, $have_aa)
AC_SUBST(AA_LIBS)
AC_SUBST(AA_CFLAGS)
dnl ---------------------------------------------------------------------------
dnl readline: Readline is pretty cool - it allows you to use <tab> to complete
dnl commands in the gphoto2 shell or to use <up> or <down> to
dnl navigate through the history.
dnl ---------------------------------------------------------------------------
rl_msg="no (cnswww.cns.cwru.edu/~chet/readline/rltop.html)"
try_readline=true
have_readline=false
AC_ARG_WITH(readline, [ --without-readline Don't use readline],
if test "x${withval}" = "xno"; then
try_readline=false
rl_msg="no (not requested)"
fi
)
if $try_readline; then
# First check for readline header.
AC_CHECK_HEADER(readline/readline.h,,[try_readline=false])
fi
if $try_readline; then
# Now check whether we can link against readline without ncurses.
AC_CHECK_LIB(readline, rl_completion_append_character, [
have_readline=true
rl_msg="yes (doesn' require explicit -lncurses)"
RL_LIBS="-lreadline"
RL_CFLAGS=""])
if $have_readline; then
AC_CHECK_LIB(readline, rl_completion_matches,,[
have_readline=false
rl_msg="no (available version too old)"
RL_LIBS=""
RL_CFLAGS=""])
else
# Check whether we can link against readline with ncurses
# we use another function to avoid the configure caching
# to kick in.
AC_CHECK_LIB(readline, rl_completion_matches, [
have_readline=true
rl_msg="yes (requires explicit -lncurses)"
RL_LIBS="-lreadline -lncurses"
RL_CFLAGS=""],[
rl_msg="no (couldn't link against it)"],[-lncurses])
fi
fi
if $have_readline; then
AC_DEFINE(HAVE_RL,,[whether we use the readline library])
fi
AM_CONDITIONAL(HAVE_RL, $have_readline)
AC_SUBST(RL_LIBS)
AC_SUBST(RL_CFLAGS)
dnl ---------------------------------------------------------------------------
dnl Configure libgphoto2-port
dnl ---------------------------------------------------------------------------
AC_CONFIG_SUBDIRS(libgphoto2_port)
AC_OUTPUT([
Makefile
camlibs/Makefile
camlibs/agfa/Makefile
camlibs/barbie/Makefile
camlibs/canon/Makefile
camlibs/canon/doc/Makefile
camlibs/casio/Makefile
camlibs/digita/Makefile
camlibs/dimera/Makefile
camlibs/directory/Makefile
camlibs/fuji/Makefile
camlibs/jamcam/Makefile
camlibs/jd11/Makefile
camlibs/kodak/Makefile
camlibs/kodak/dc120/Makefile
camlibs/kodak/dc240/Makefile
camlibs/kodak/dc3200/Makefile
camlibs/konica/Makefile
camlibs/konica/localization/Makefile
camlibs/minolta/Makefile
camlibs/minolta/dimagev/Makefile
camlibs/mustek/Makefile
camlibs/panasonic/Makefile
camlibs/panasonic/l859/Makefile
camlibs/panasonic/coolshot/Makefile
camlibs/polaroid/Makefile
camlibs/ptp/Makefile
camlibs/ricoh/Makefile
camlibs/samsung/Makefile
camlibs/sierra/Makefile
camlibs/sipix/Makefile
camlibs/sonydscf1/Makefile
camlibs/sonydscf55/Makefile
camlibs/stv0680/Makefile
frontends/Makefile
frontends/command-line/Makefile
tests/Makefile
libgphoto2/Makefile
libgphoto2/libgphoto2.pc
gphoto2-config
intl/Makefile
packaging/Makefile
packaging/linux-hotplug/Makefile
packaging/rpm/Makefile
packaging/rpm/package.spec
po/Makefile.in
doc/Makefile
doc/api/Makefile
doc/figures/Makefile
])
if test "x$CDPATH" != "x"
then
echo
echo "***********************************************************"
echo "* You have CDPATH set. You may have to run \"unset CDPATH\" *"
echo "* before running \"make dist\" or \"make rpm\". *"
echo "***********************************************************"
fi
echo "
Configuration (libgphoto2):
Source code location: ${srcdir}
Version: ${VERSION}
Compiler: ${CC}
Build API documentation: $gtkdoc_msg
Build User's Manual: $manual_msg
Config. support (gphoto2): $cdk_msg
Preview support (gphoto2): $aa_msg
JPEG support: $jpeg_msg
pkg-config: $pkgconfig_msg
EXIF support: $exif_msg
readline support: $rl_msg
pthread support: $pthread_msg
Use ltdl.h: $ltdl_msg
"
|