"Fossies" - the Fresh Open Source Software Archive

Member "libgphoto2-2.5.27/configure.ac" (21 Feb 2021, 25944 Bytes) of package /linux/privat/libgphoto2-2.5.27.tar.bz2:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 2.5.26_vs_2.5.27.

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