Remove generated files
[framework/connectivity/libgphoto2.git] / configure.ac
1 dnl Process this file with autoreconf to produce a configure script.
2 AC_PREREQ(2.59)
3
4 dnl NOTE: Be version style _higher_ than the last release.
5 dnl       So lastversion.X.trunk for instance. Bump X if necessary.
6
7 dnl ******* THE NEXT RELEASE VERSION MUST BE 2.4.12 at least or higher!
8 AC_INIT([libgphoto2 photo camera library], [2.4.11], [gphoto-devel@lists.sourceforge.net], [libgphoto2])
9 AC_CONFIG_SRCDIR([libgphoto2/gphoto2-version.c])
10 AC_CONFIG_HEADERS([config.h])
11 AC_CONFIG_MACRO_DIR([auto-m4])
12 AC_CONFIG_AUX_DIR([auto-aux])
13 dnl Working around bug in automake <= 1.9.6:
14 dnl  - Please do not add filename-length-max=99 here.
15 dnl  - Otherwise "make distdir" will fail in gphoto-suite
16 dnl The generated Makefile rule fails to remove the absolute part at
17 dnl the beginning of the /path/to/buildroot/PACKAGE-VERSION/foo/bar
18 dnl before determining the string length. However, the only relevant
19 dnl string to determine the length of would be PACKAGE-VERSION/foo/bar
20 AM_INIT_AUTOMAKE([-Wall gnu 1.9 dist-bzip2 check-news subdir-objects])
21
22 GP_CHECK_SHELL_ENVIRONMENT
23 GP_CONFIG_MSG([Build])
24 GP_CONFIG_MSG([Source code location],[${srcdir}])
25
26
27 dnl ---------------------------------------------------------------------------
28 dnl Advanced information about versioning:
29 dnl   * "Writing shared libraries" by Mike Hearn
30 dnl         http://navi.cx/~mike/writing-shared-libraries.html
31 dnl   * libtool.info chapter "Versioning"
32 dnl   * libtool.info chapter "Updating library version information"
33 dnl ---------------------------------------------------------------------------
34 dnl Versioning:
35 dnl  - CURRENT (Major):  Increment if the interface has changes. AGE is always
36 dnl                      *changed* at the same time.
37 dnl  - AGE (Micro):      Increment if any interfaces have been added; set to 0
38 dnl                      if any interfaces have been removed. Removal has 
39 dnl                      precedence over adding, so set to 0 if both happened.
40 dnl                      It denotes upward compatibility.
41 dnl  - REVISION (Minor): Increment any time the source changes; set to 
42 dnl                      0 if you incremented CURRENT.
43 dnl
44 dnl  To summarize. Any interface *change* increment CURRENT. If that interface
45 dnl  change does not break upward compatibility (ie it is an addition), 
46 dnl  increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed, 
47 dnl  REVISION is set to 0, otherwise REVISION is incremented.
48 dnl ---------------------------------------------------------------------------
49 dnl A:R:C=1:1:3  libgphoto2-2.2
50 dnl A:R:C=2:0:4  libgphoto2-2.3 (since libgphoto2-2.2.1.5.trunk)
51 dnl A:R:C=2:1:4  libgphoto2-2.3.1 (since libgphoto2-2.3.0.1.trunk)
52 dnl A:R:C=3:0:5  libgphoto2-2.4.0 (since libgphoto2-2.3.0.3.trunk (new gp_file_new_from_fd(), gp_file_slurp(), gp_camera_get_storageinfo() functions + enums + struct)
53 dnl A:R:C=4:0:6  libgphoto2-2.4.3 (since libgphoto2-2.4.0: gp_ahd_bayer())
54 AC_SUBST([LIBGPHOTO2_AGE],      [4])
55 AC_SUBST([LIBGPHOTO2_REVISION], [0])
56 AC_SUBST([LIBGPHOTO2_CURRENT],  [6])
57 AC_SUBST([LIBGPHOTO2_CURRENT_MIN],
58          [`expr $LIBGPHOTO2_CURRENT - $LIBGPHOTO2_AGE`])
59 AC_SUBST([LIBGPHOTO2_VERSION_INFO],
60          [$LIBGPHOTO2_CURRENT:$LIBGPHOTO2_REVISION:$LIBGPHOTO2_AGE])
61
62
63 dnl Set up compiler options
64 dnl "CPPFLAGS" concerns the C preprocessor, i.e. both C and C++ source code.
65 dnl C only would be CFLAGS, C++ only CXXFLAGS
66 AM_CPPFLAGS="$CPPFLAGS"
67
68 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)"
69 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_builddir)"
70 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/libgphoto2_port"
71 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/libgphoto2"
72 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_builddir)/libgphoto2"
73
74
75 dnl ---------------------------------------------------------------------------
76 dnl Checks for programs.
77 dnl ---------------------------------------------------------------------------
78
79 AC_PROG_CC
80 AC_PROG_CPP
81 AC_PROG_CXX
82 AC_PROG_INSTALL
83 AM_PROG_CC_C_O
84
85 dnl Something with the sequences is not quite alright yet.
86 dnl SED is supposed to be set in AC_LIBTOOL_SETUP, but the
87 dnl sequence seems to get mixed up.
88 SED=${SED-sed}
89
90
91 # Make sure that the *FLAGS given at ./configure time will be active by
92 # default in AM_*FLAGS
93 AM_CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
94 AM_CFLAGS="$AM_CFLAGS $CFLAGS"
95 AM_CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
96 AM_LDFLAGS="$AM_LDFLAGS $LDFLAGS"
97
98 dnl ---------------------------------------------------------------------------
99 dnl Turn on (almost) all warnings when using gcc
100 dnl ---------------------------------------------------------------------------
101 if test "x$GCC" = "xyes"; then
102         AM_CPPFLAGS="$AM_CPPFLAGS -Wall"
103         # AM_CFLAGS="$AM_CFLAGS --std=c99 -Wall -Wextra -Werror -pedantic"
104         AM_CFLAGS="$AM_CFLAGS -Wall"
105         # AM_CFLAGS="$AM_CFLAGS -Wno-pointer-sign -Wno-unused -Wno-sign-compare"
106         AM_CFLAGS="$AM_CFLAGS -Wmissing-declarations -Wmissing-prototypes"
107         AM_LDFLAGS="$AM_LDFLAGS -Wall"
108         # FIXME: Check for --enable-debug here
109         AM_CPPFLAGS="$AM_CPPFLAGS -g"
110         AM_LDFLAGS="$AM_LDFLAGS -g"
111         AC_SUBST([NO_UNUSED_CFLAGS], [-Wno-unused])
112 fi
113 AM_CONDITIONAL([HAVE_GCC], [test "x$GCC" = "xyes"])
114
115 # Activate internal code
116 AM_CPPFLAGS="$AM_CPPFLAGS -D_GPHOTO2_INTERNAL_CODE"
117
118 # Activate Samsung patch
119 AM_CPPFLAGS="$AM_CPPFLAGS -D_GPHOTO2_SAMSUNG_PATCH_"
120
121 # CPPFLAGS: C PreProcessor flags
122 AC_SUBST([AM_CPPFLAGS])
123 # CFLAGS: C compiler flags
124 AC_SUBST([AM_CFLAGS])
125 # CXXFLAGS: C++ compiler flags
126 AC_SUBST([AM_CXXFLAGS])
127 # LDFLAGS: Linker flags
128 AC_SUBST([AM_LDFLAGS])
129
130 # Define compiler flags for later compile tests
131 # Note: Do NOT add specific libraries and stuff to the generic _FLAGS.
132 #       Put these into LIBFOO_CFLAGS and LIBFOO_LIBS instead.
133 CFLAGS="$AM_CFLAGS"
134 CPPFLAGS="$AM_CPPFLAGS"
135
136
137 try_gp2ddb=false
138 msg_gp2ddb=""
139 gp_msg_dp2ddb="no"
140
141 AC_ARG_ENABLE([gp2ddb],
142 [AS_HELP_STRING([--enable-gp2ddb],
143                 [enable EXPERIMENTAL PRE-ALPHA gphoto2 device database code])],[
144         if test "x$enableval" = "xyes"; then
145                 try_gp2ddb=true
146                 msg_dp2ddb="(--enable-gp2ddb detected)"
147         elif test "x$enableval" = "xno"; then
148                 try_gp2ddb=false
149                 msg_dp2ddb="(--disable-gp2ddb detected)"
150         fi
151 ])
152
153 AC_PATH_PROG([FLEX], [flex])
154 AC_SUBST([FLEX])
155 AC_PATH_PROG([BISON], [bison])
156 AC_SUBST([BISON])
157
158 AC_MSG_CHECKING([whether to enable GP2DDB])
159 if "$try_gp2ddb"; then
160    if test -x "$FLEX" && test -x "$BISON"; then
161       gp_msg_dp2ddb="yes $msg_dp2ddb"
162    else
163       AC_MSG_ERROR([Fatal: GP2DDB support requires flex and bison!
164
165 Aborting configuration.
166
167 Install flex and bison into your PATH or run configure with --disable-gp2ddb
168 to disable GP2DDB support.
169 ])
170    fi
171 else
172       gp_msg_dp2ddb="no $msg_dp2ddb"
173 fi
174 AC_MSG_RESULT([${gp_msg_gp2ddb}])
175
176 AM_CONDITIONAL([ENABLED_GP2DDB], ["$try_gp2ddb" && test -x "$FLEX" && test -x "$BISON"])
177
178 if "$try_gp2ddb" && test -x "$FLEX" && test -x "$BISON"; then
179         gp_msg_gp2ddb="yes $msg_gp2ddb"
180         AC_DEFINE([ENABLED_GP2DDB], [1], [Whether we have flex and bison for GP2DDB])
181 else
182         gp_msg_gp2ddb="no $msg_gp2ddb"
183 fi
184 GP_CONFIG_MSG([GP2DDB support], [${gp_msg_gp2ddb} (EXPERIMENTAL)])
185
186 GP_PKG_CONFIG
187
188
189 dnl check for/set up libtool and libltdl
190 dnl AC_DISABLE_STATIC
191 dnl AC_DISABLE_SHARED
192 dnl AC_LIBLTDL_CONVENIENCE([libltdl])
193 dnl AC_WITH_LTDL
194 dnl AC_LIB_LTDL
195 AC_DISABLE_STATIC
196 AC_LIBTOOL_WIN32_DLL
197 AC_LIBTOOL_DLOPEN
198 AC_PROG_LIBTOOL
199
200 dnl We are using our own libltdl checks instead of AC_WITH_LTDL
201 dnl because we do not want to ship our own copy of libltdl any more.
202 dnl Not shipping libltdl makes it possible to ditch our own autogen.sh
203 dnl and relying on standard autoconf's "autoreconf".
204 #GP_LIB_LTDL
205
206
207 # report on compiler/libtool setup
208 GP_CONFIG_MSG([Compiler],[${CC}])
209 #GP_CONFIG_MSG([libltdl includes],[$LTDLINCL])
210 #GP_CONFIG_MSG([libltdl library],[$LIBLTDL])
211
212 AC_DEFINE_UNQUOTED(HAVE_CC,"$CC",[The C compiler we're using])
213
214
215 dnl ---------------------------------------------------------------------------
216 dnl Reference definitions
217 dnl    required before we do the Makevars hack!
218 dnl ---------------------------------------------------------------------------
219
220 GP_REFERENCES()dnl
221
222
223 GP_CONFIG_MSG([Features])
224
225 dnl ---------------------------------------------------------------------------
226 dnl i18n support (including some hacks)
227 dnl ---------------------------------------------------------------------------
228
229 ALL_LINGUAS="da de es eu fr hu it ja nl pl ru sv uk vi zh_CN"
230 GP_GETTEXT_HACK([${PACKAGE}-${LIBGPHOTO2_CURRENT_MIN}],[The gPhoto Team],[${MAIL_GPHOTO_TRANSLATION}])
231 AM_GNU_GETTEXT_VERSION([0.14.1])
232 AM_GNU_GETTEXT([external])
233 AM_PO_SUBDIRS()
234 AM_ICONV()
235 GP_GETTEXT_FLAGS()
236
237 dnl FIXME: We have to make sure this works first
238 dnl AC_CHECK_FUNC(gettext, gettext_without_libintl=true)
239 # same trick as with libdl:
240 # if gettext() doesn't require linking against libintl,
241 # we don't have to check for gettext in libintl. Otherwise
242 # we may even require libintl.
243 dnl if test "$gettext_without_libintl" != "true" -a "$USE_NLS" = "yes"; then
244 dnl        AC_CHECK_LIB([intl], [gettext], [INTLLIBS="$INTLLIBS -lintl"])
245 dnl fi
246
247 AC_SUBST([localedir],["\$(datadir)/locale"])
248 AM_CPPFLAGS="$AM_CPPFLAGS -DLOCALEDIR=\\\"${localedir}\\\""
249
250 AC_SYS_LARGEFILE
251
252 dnl ---------------------------------------------------------------------------
253 dnl FIXME: What is this good for?
254 dnl Replace `main' with a function in -libs:
255 dnl ---------------------------------------------------------------------------
256 AC_CHECK_LIB(ibs, main)
257
258
259 dnl ---------------------------------------------------------------------------
260 dnl check for libjpeg
261 dnl ---------------------------------------------------------------------------
262 LIBJPEG=""
263 libjpeg_msg="no"
264 AC_SUBST(LIBJPEG)
265 AC_CHECK_LIB(jpeg,jpeg_start_decompress,[
266         AC_CHECK_HEADER(jpeglib.h,[
267                 AC_DEFINE(HAVE_LIBJPEG,1,[define if we found LIBJPEG and its headers])
268                 LIBJPEG="-ljpeg"
269                 libjpeg_msg="yes"
270         ])
271 ])
272 GP_CONFIG_MSG([JPEG mangling support],[${libjpeg_msg}])
273
274 dnl ---------------------------------------------------------------------------
275 dnl check for libgd
276 dnl ---------------------------------------------------------------------------
277 LIBGD=""
278 libgd_msg="no"
279 AC_SUBST(LIBGD)
280 AC_CHECK_LIB(gd,gdImageCreateTrueColor,[
281         AC_CHECK_HEADER(gd.h,[
282                 AC_DEFINE(HAVE_GD,1,[define if we have LIBGD and its headers])
283                 LIBGD="-lgd"
284                 libgd_msg="yes"
285         ])
286 ])
287 GP_CONFIG_MSG([GD conversion support],[${libgd_msg}])
288
289 dnl ---------------------------------------------------------------------------
290 dnl Checks for header files.
291 dnl ---------------------------------------------------------------------------
292 AC_HEADER_DIRENT
293 # before _HEADER_STDC
294 AC_HEADER_STDC
295 # after _HEADER_STDC
296 AC_CHECK_HEADERS([sys/param.h sys/select.h locale.h memory.h getopt.h unistd.h mcheck.h limits.h sys/time.h])
297 AC_C_INLINE([])
298 AC_C_CONST([])
299 dnl FIXME: AC_STRUCT_TIMEZONE
300
301
302 dnl ---------------------------------------------------------------------------
303 dnl more header/function/def checks
304 dnl ---------------------------------------------------------------------------
305
306 dnl Checks for typedefs, structures, and compiler characteristics.
307 AC_TYPE_SIZE_T
308
309 dnl Checks for library functions.
310 AC_CHECK_FUNCS([getopt getopt_long mkdir strdup strncpy strcpy snprintf sprintf vsnprintf gmtime_r statfs])
311
312 dnl Find out how to get struct tm
313 AC_STRUCT_TM
314
315 dnl Check for tm_gmtoff in struct tm
316 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
317 AC_COMPILE_IFELSE([dnl
318 AC_LANG_PROGRAM([[
319 #include <sys/types.h>
320 #include <$ac_cv_struct_tm>
321 ]], [[
322 struct tm tm;
323 tm.tm_gmtoff;
324 ]])dnl
325 ],[
326 AC_DEFINE(HAVE_TM_GMTOFF,1,whether struct tm has tm_gmtoff field)
327 AC_MSG_RESULT(yes)
328 ],[
329 AC_MSG_RESULT(no)
330 ])
331
332 AC_CHECK_HEADERS([sys/mount.h sys/statfs.h sys/user.h sys/vfs.h],,,[
333 #include <sys/types.h>
334 #if HAVE_SYS_PARAM_H
335 # include <sys/param.h>
336 #endif
337 ])
338
339 dnl Check for statfs members
340 AC_CHECK_MEMBERS([struct statfs.f_bfree, struct statfs.f_bavail, struct statfs.f_favail],,,[
341 #include <sys/types.h>
342 #ifdef HAVE_SYS_PARAM_H
343 # include <sys/param.h>
344 #endif
345 #ifdef HAVE_SYS_MOUNT_H
346 # include <sys/mount.h>
347 #endif
348 #ifdef HAVE_SYS_VFS_H
349 # include <sys/vfs.h>
350 #endif
351 #ifdef HAVE_SYS_STATFS_H
352 # include <sys/statfs.h>
353 #endif
354 ])
355
356 AC_CHECK_MEMBERS([struct statvfs.f_blocks],,,[
357 #ifdef HAVE_SYS_STATVFS_H
358 # include <sys/statvfs.h>
359 #endif
360 ])
361
362
363 dnl ---------------------------------------------------------------------------
364 dnl Checks for integer types.
365 dnl ---------------------------------------------------------------------------
366 dnl
367 dnl FIXME: Test AC_TYPE_UINT32_T & Co and check whether that could work for us.
368 dnl        Potential problem: The required autoconf version.
369 dnl Note: We are already using AC_TYPE_SIZE_T somewhere else in here.
370
371
372 dnl Create a stdint.h-like file containing size-specific integer definitions
373 dnl that will always be available
374 AX_NEED_STDINT_H([libgphoto2/_stdint.h])
375
376 dnl Create a header file containing NetBSD-style byte swapping macros
377 AC_NEED_BYTEORDER_H([libgphoto2/gphoto2-endian.h])
378
379
380 dnl ---------------------------------------------------------------------------
381 dnl Old libtool stuff left here for reference purposes. For now.
382 dnl dnl ---------------------------------------------------------------------------
383 dnl dnl Check for libtool: lt_dlforeachfile has been introduced in 
384 dnl dnl                libtool-1.4. However, there are still systems out
385 dnl dnl                there running libtool-1.3. For those, we will need
386 dnl dnl                dlopen. Note that on some systems (e.g. FreeBSD)
387 dnl dnl                -ldl isn't needed.
388 dnl dnl ---------------------------------------------------------------------------
389 dnl AC_PROG_LIBTOOL
390 dnl have_ltdl=false
391 dnl ltdl_msg="no"
392 dnl try_ltdl=false
393 dnl AC_ARG_WITH(ltdl, [  --with-ltdl             Use ltdl],[
394 dnl         if test x$withval = xyes; then
395 dnl             try_ltdl=true
396 dnl     fi])
397 dnl if $try_ltdl; then
398 dnl     AC_CHECK_LIB(ltdl, lt_dlforeachfile,[
399 dnl             AC_CHECK_HEADER(ltdl.h,[
400 dnl                     AC_DEFINE(HAVE_LTDL,1,[whether we use libltdl])
401 dnl                     LTDL_LIBS="-lltdl"
402 dnl                     ltdl_msg="yes"
403 dnl                     have_ltdl=true])])
404 dnl fi
405 dnl if ! $have_ltdl; then
406 dnl     AC_CHECK_FUNC(dlopen,,[
407 dnl             AC_CHECK_LIB(dl, dlopen,[LTDL_LIBS="-ldl"],[AC_ERROR([
408 dnl *** Could not determine how to handle
409 dnl *** shared libraries!])])])
410 dnl fi
411 dnl AC_SUBST(LTDL_LIBS)
412
413
414 dnl should be obsolete (we're not using grep and tr any more)
415 dnl dnl Solaris hack for grep and tr
416 dnl [
417 dnl if test -n "`echo $host_os | grep '[sS]olaris'`"; then
418 dnl   TR=/usr/xpg4/bin/tr
419 dnl   GREP=/usr/xpg4/bin/grep  
420 dnl else
421 dnl   TR=tr
422 dnl   GREP=grep
423 dnl fi
424 dnl ]
425
426
427 dnl ---------------------------------------------------------------------------
428 dnl utility installation directory
429 dnl
430 dnl If your system wants utilities installed into ${libexecdir} instead, then
431 dnl run configure with 'utilsdir=${libexecdir}/${PACKAGE_TARNAME}'.
432 dnl ---------------------------------------------------------------------------
433
434 AC_SUBST([PACKAGE_TARNAME])
435
436 if test "x${utilsdir}" = "x"; then utilsdir="\${libdir}/\${PACKAGE_TARNAME}"; fi
437 AC_ARG_VAR([utilsdir],[Directory where utilities like print-camera-list will be installed])
438 AC_SUBST([utilsdir])
439
440 GP_UDEV([true])
441
442
443 dnl ---------------------------------------------------------------------------
444 dnl camlib installation directory
445 dnl ---------------------------------------------------------------------------
446 AC_MSG_CHECKING([where to install camlibs])
447 AC_ARG_WITH([camlibdir],[AS_HELP_STRING(
448         [--with-camlibdir=<path>],
449         [install camlibs in directory <path>])dnl
450 ],[
451         camlibdir="$withval"
452 ],[
453         camlibdir="\${libdir}/${PACKAGE_TARNAME}/${PACKAGE_VERSION}"
454 ])
455 AC_MSG_RESULT([${camlibdir}])
456 AC_SUBST([camlibdir])
457 AM_CPPFLAGS="$AM_CPPFLAGS -DCAMLIBS=\\\"\$(camlibdir)\\\""
458
459 CAMLIB_LDFLAGS="-module -no-undefined -avoid-version -export-dynamic"
460 CAMLIB_LDFLAGS="$CAMLIB_LDFLAGS -export-symbols \$(top_srcdir)/camlibs/camlib.sym"
461 AC_SUBST([CAMLIB_LDFLAGS],[${CAMLIB_LDFLAGS}])
462 AC_SUBST([CAMLIB_LIBS],["\$(top_builddir)/libgphoto2/libgphoto2.la"])
463
464
465 dnl ---------------------------------------------------------------------------
466 dnl Camera drivers (camlibs)
467 dnl ---------------------------------------------------------------------------
468 dnl * See m4m/gp-camlibs.m4 for usage details, e.g. for marking camlibs as
469 dnl   obsolete.
470 dnl * Please add new camlibs in alphabetical order.
471 GP_CAMLIB([agfa_cl20])dnl
472 GP_CAMLIB([aox])dnl
473 GP_CAMLIB([ax203])dnl
474 GP_CAMLIB([barbie])dnl
475 GP_CAMLIB([canon])dnl
476 GP_CAMLIB([casio_qv])dnl
477 GP_CAMLIB([clicksmart310])dnl
478 GP_CAMLIB([digigr8])dnl
479 GP_CAMLIB([digita])dnl
480 GP_CAMLIB([dimera3500])dnl
481 GP_CAMLIB([directory])dnl
482 GP_CAMLIB([enigma13])dnl
483 GP_CAMLIB([gsmart300])dnl
484 GP_CAMLIB([hp215])dnl
485 GP_CAMLIB([iclick])dnl
486 GP_CAMLIB([jamcam])dnl
487 GP_CAMLIB([jd11])dnl
488 GP_CAMLIB([jl2005a])dnl
489 GP_CAMLIB([kodak_dc120])dnl
490 GP_CAMLIB([kodak_dc210])dnl
491 GP_CAMLIB([kodak_dc240])dnl
492 GP_CAMLIB([kodak_ez200])dnl
493 GP_CAMLIB([largan])dnl
494 GP_CAMLIB([lg_gsm])dnl
495 GP_CAMLIB([mars])dnl
496 GP_CAMLIB([panasonic_coolshot])dnl
497 GP_CAMLIB([panasonic_l859])dnl
498 GP_CAMLIB([panasonic_dc1000])dnl
499 GP_CAMLIB([panasonic_dc1580])dnl
500 GP_CAMLIB([pccam300])dnl
501 GP_CAMLIB([pccam600])dnl
502 GP_CAMLIB([polaroid_pdc320])dnl
503 GP_CAMLIB([polaroid_pdc640])dnl
504 GP_CAMLIB([polaroid_pdc700])dnl
505 GP_CAMLIB([ptp2])dnl
506 GP_CAMLIB([ricoh])dnl
507 GP_CAMLIB([ricoh_g3])dnl
508 GP_CAMLIB([samsung])dnl
509 GP_CAMLIB([sierra])dnl
510 GP_CAMLIB([sipix_blink], [obsolete])dnl
511 GP_CAMLIB([sipix_blink2])dnl
512 GP_CAMLIB([sipix_web2])dnl
513 GP_CAMLIB([smal])dnl
514 GP_CAMLIB([sonix])dnl
515 GP_CAMLIB([sony_dscf1])dnl
516 GP_CAMLIB([sony_dscf55])dnl
517 GP_CAMLIB([soundvision])dnl
518 GP_CAMLIB([spca50x])dnl
519 GP_CAMLIB([sq905])dnl
520 GP_CAMLIB([st2205])dnl
521 GP_CAMLIB([stv0674])dnl
522 GP_CAMLIB([sx330z])dnl
523 GP_CAMLIB([template], [obsolete])dnl
524 GP_CAMLIB([toshiba_pdrm11])dnl
525 dnl
526 GP_CAMLIBS_DEFINE()dnl
527
528 dnl --------------------------------------------------------------------
529 dnl documentation
530 dnl --------------------------------------------------------------------
531 GP_CHECK_DOC_DIR()dnl
532 GP_CHECK_DOXYGEN()dnl
533 GP_BUILD_GTK_DOCS()dnl
534 AC_SUBST([camlibdocdir], ['${docdir}/camlibs'])
535
536
537 dnl --------------------------------------------------------------------
538 dnl initialize convenience packaging
539 dnl --------------------------------------------------------------------
540 GPKG_CHECK_RPM()dnl Check wether to package for a system using RPM
541 GPKG_CHECK_LINUX()dnl Check wether to package for a linux system
542
543
544 dnl --------------------------------------------------------------------
545 dnl guess directory to install *.pc into
546 dnl --------------------------------------------------------------------
547 pkgconfigdir='${libdir}/pkgconfig'
548 AC_SUBST([pkgconfigdir])
549
550
551 dnl ---------------------------------------------------------------------------
552 dnl libexif: The CameraFilesystem can use libexif for extracting thumbnails
553 dnl          out of EXIF data. Similarly, it can extract the mtime of
554 dnl          a file. 
555 dnl          libexif is available from
556 dnl          http://www.sourceforge.net/projects/libexif
557 dnl ---------------------------------------------------------------------------
558 GP_CHECK_LIBRARY([LIBEXIF],[libexif],[>= 0.6.13],
559                  [libexif/exif-data.h],[exif_data_new],[
560 AC_MSG_CHECKING([whether we use a version of libexif with ExifData.ifd[[]]])
561 # Check for libexif version
562 dnl FIXME: Use AC_CHECK_MEMBER?
563 CPPFLAGS_save="$CPPFLAGS"
564 CPPFLAGS="$LIBEXIF_CFLAGS"
565 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
566 /* CC=$CC */
567 /* CPPFLAGS=${CPPFLAGS} */
568 /* LDFLAGS=${LDFLAGS} */
569 #include <libexif/exif-data.h>
570 #include <libexif/exif-content.h>
571 ]],[[
572         ExifData ed;
573         ExifContent *ec0, *ec1;
574         ec0 = &ed.ifd[0];
575         ec1 = &ed.ifd[1];
576 ]])], [
577    AC_DEFINE([HAVE_LIBEXIF_IFD],1,
578              [whether we use a version of libexif with ExifData.ifd[[]]])
579    AC_MSG_RESULT([yes])
580 ], [
581    AC_MSG_RESULT([no])
582 ])
583 CPPFLAGS="$CPPFLAGS_save"
584 ],[],[default-on],[http://www.sourceforge.net/projects/libexif])dnl
585
586
587 dnl ---------------------------------------------------------------------------
588 dnl Check libusb
589 dnl FIXME: What for? Shouldn't this belong into libgphoto2_port?
590 dnl ---------------------------------------------------------------------------
591 AC_PATH_PROG(LIBUSB_CONFIG,libusb-config)
592 AM_CONDITIONAL(HAVE_LIBUSB,test -n "${LIBUSB_CONFIG}")
593
594
595 dnl FIXME: Is this accurate?
596 AM_CONDITIONAL([HAVE_CXX], [test -n "$CXX" && test "X$CXX" != "Xno"])
597
598 dnl ... temporary off again
599 dnl GP_CHECK_LIBRARY([LIBXML2],[libxml-2.0],[>= 2.0],,,,,[default-on])
600
601 dnl ---------------------------------------------------------------------------
602 dnl Configure subprojects
603 dnl ---------------------------------------------------------------------------
604 if test -d "$srcdir/libgphoto2_port"; then
605         AC_CONFIG_SUBDIRS([libgphoto2_port])
606 else
607         AC_MSG_ERROR([
608 *** Hey, where have you hidden my libgphoto2_port?
609 *** I needed that!
610 ])
611 fi
612
613
614 # ---------------------------------------------------------------------------
615 # Create output files
616 # ---------------------------------------------------------------------------
617 AC_CONFIG_FILES([
618 README
619 Makefile
620 gphoto2-config
621 camlibs/Makefile
622 libgphoto2/Makefile
623 libgphoto2.pc
624 libgphoto2-uninstalled.pc
625 examples/Makefile
626 tests/Makefile
627 tests/check-camera-list.sh
628 tests/ddb/Makefile
629 tests/ddb/check-ddb.sh
630 packaging/Makefile
631 packaging/linux-hotplug/Makefile
632 packaging/generic/Makefile
633 packaging/rpm/Makefile
634 packaging/rpm/package.spec
635 po/Makefile.in
636 doc/Makefile
637 doc/Doxyfile
638 doc/api/Makefile
639 ],[
640 dnl This relies on this code being called for each of the above files
641 dnl with ac_file set to the filename.
642         if echo "$ac_file" | grep '.sh$' > /dev/null; then
643                 if test -f "$ac_file"; then
644                         chmod +x "$ac_file"
645                 fi
646         fi
647 ])
648 AC_OUTPUT
649
650 if test "x$CDPATH" != "x"
651 then
652         echo
653         echo "***********************************************************"
654         echo "* You have CDPATH set. You may have to run \"unset CDPATH\" *"
655         echo "* before running \"make dist\" or \"make rpm\".               *"
656         echo "***********************************************************"
657 fi
658
659 GP_CONFIG_OUTPUT
660
661 dnl Catch the Gentoo folks that think just enabling "canon" makes their
662 dnl Canon camera work.
663 if test "$BUILD_THESE_CAMLIBS" = " canon.la" ; then
664         echo 
665         echo "*** Note: Newer Canon Cameras are supported by the ptp2 camera driver."
666         echo "***       'canon' is used for older models."
667         echo "***       If you are unsure, please enable both the canon and ptp2 driver."
668         echo 
669 fi
670
671 echo "
672 Please check whether the configuration I detected matches what you
673 would like to have. E.g. make sure that USB support is there if you
674 intend to use USB cameras with $PACKAGE_NAME.
675
676 Please also check that PKG_CONFIG_PATH contains
677     ${pkgconfigdir} 
678 before compiling any libgphoto2 frontend.
679 "