Adds API documentation to functions in pixbuf-util.h
[geeqie.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.  -*- Autoconf
2  -*-
3
4 dnl This file is a part of Geeqie project (http://www.geeqie.org/).
5 dnl Copyright (C) 2008 - 2018 The Geeqie Team
6 dnl
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
11 dnl
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 dnl GNU General Public License for more details.
16
17 AC_PREREQ(2.57)
18 AC_INIT([geeqie], m4_translit(m4_esyscmd([if [ $(git tag --list 'v[1-9]*' --points-at HEAD | wc -c) -gt 0 ]; then git tag --list v[1-9]* --points-at HEAD | tail -n 1 | tr -d 'v' ; else git tag --list v[1-9]* | tail -n 1 | tr -d 'v' && echo "+git" && git log --max-count=1 --date=format:"%Y%m%d" --format="%ad" && echo "-" && git rev-parse --quiet --verify --short HEAD; fi ]), m4_newline), [geeqie@freelists.org], [], [http://www.geeqie.org/])
19
20 # Add -Werror to the default CFLAGS
21 CFLAGS+=" -Werror -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=return-type"
22
23 # Check for rightly dirs
24 AC_CONFIG_SRCDIR([src/main.c])
25
26 AC_CONFIG_AUX_DIR(auxdir)
27 # Require Automake 1.14 for %reldir% support
28 AM_INIT_AUTOMAKE([1.14.1 subdir-objects foreign dist-xz no-dist-gzip tar-ustar])
29
30 AC_CONFIG_HEADER([config.h])
31
32 # Only for developers
33 AM_MAINTAINER_MODE
34
35 # Silent build for automake >= 1.11
36 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
37
38 AC_ARG_ENABLE(developer, [
39 Development options:
40 AC_HELP_STRING([--enable-developer], [turn on developers mode [default=no]])],
41 [
42   __IS_DEVELOPER=yes
43 ],
44 [
45 if test "x${enable_developer}" != "xyes"
46 then
47   __IS_DEVELOPER=no
48 else
49   __IS_DEVELOPER=yes
50 fi
51 ])
52
53 DX_HTML_FEATURE(ON)
54 DX_CHM_FEATURE(OFF)
55 DX_CHI_FEATURE(OFF)
56 DX_MAN_FEATURE(OFF)
57 DX_RTF_FEATURE(OFF)
58 DX_XML_FEATURE(OFF)
59 DX_PDF_FEATURE(OFF)
60 DX_PS_FEATURE(OFF)
61
62 DX_INIT_DOXYGEN($PACKAGE_NAME, doxygen.conf, doc/doxygen)
63
64 #  Debug support
65 # ----------------------------------------------------------------------
66
67 dnl Debugging option
68 dnl FIXME: official release convert default to 'no'
69 dnl
70
71 AC_ARG_ENABLE([debug-flags], [
72 Development options:
73 AC_HELP_STRING([--enable-debug-flags], [use compiler flags for debugging [default=no]])], [],
74 [
75 if test "x${enable_developer}" != "xyes"
76 then
77   enable_debug_flags="no"
78 else
79   enable_debug_flags="yes"
80 fi
81 ])
82
83 AC_ARG_ENABLE([debug-log], [
84 Development options:
85 AC_HELP_STRING([--enable-debug-log], [enable debugging messages [default=yes]])], [], [enable_debug_log="yes"])
86
87 if test "x${enable_debug_flags}" != "xno"
88 then
89   if test "x${enable_developer}" = "xyes"
90   then
91     CXXFLAGS="${CXXFLAGS} -Wall"
92     CFLAGS="${CFLAGS} -Wstrict-prototypes -Wall"
93   fi
94   __COMMONFLAGS="-g -O0 -Wextra -Wunused-value -Wunused-variable -Wunused-function -Wunused-label -Wcomment -Wmissing-braces -Wparentheses -Wreturn-type -Wswitch -Wstrict-aliasing -Wno-unused-parameter -Wformat -Wformat-security -DGQ_DEBUG_PATH_UTF8=1"
95   CXXFLAGS="${CXXFLAGS} ${__COMMONFLAGS}"
96   CFLAGS="${CFLAGS} ${__COMMONFLAGS} -Wimplicit-int -Werror-implicit-function-declaration"
97   __IS_DEBUG_FLAGS=yes
98 else
99   __IS_DEBUG_FLAGS=no
100 fi
101
102 if test "x${enable_debug_log}" != "xno"
103 then
104   AC_DEFINE(DEBUG,1,[Defined if Geeqie is compiled with debugging messages support])
105   __IS_DEBUG_LOG=yes
106 else
107   __IS_DEBUG_LOG=no
108 fi
109
110 AM_CONDITIONAL(DEBUG, test x$enable_debug_flags = xyes)
111
112 AC_ARG_ENABLE(deprecated, [
113 AC_HELP_STRING([--enable-deprecated], [turn off checking of deprecated functions [default=yes]])], [],
114 [
115 if test "x${enable_developer}" != "xyes"
116 then
117   enable_deprecated="no"
118 else
119   enable_deprecated="yes"
120 fi
121 ])
122
123 if test "x${enable_deprecated}" != "xno"
124 then
125   CXXFLAGS="${CXXFLAGS} -DGTK_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -DGDK_PIXBUF_DISABLE_DEPRECATED=1 -DG_DISABLE_DEPRECATED=1"
126   CFLAGS="${CFLAGS} -DGTK_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -DGDK_PIXBUF_DISABLE_DEPRECATED=1 -DG_DISABLE_DEPRECATED=1"
127   __IS_DEPRECATED=yes
128 else
129   __IS_DEPRECATED=no
130 fi
131
132
133 AC_ISC_POSIX
134 AC_PROG_CC
135 AC_PROG_CC_C99
136 AC_PROG_CXX
137 AC_STDC_HEADERS
138 AC_ARG_PROGRAM
139 AC_SYS_LARGEFILE
140 IT_PROG_INTLTOOL([0.35.0])
141
142
143 dnl checks for functions
144 AC_CHECK_FUNCS(strverscmp access fsync fflush)
145
146
147 # Check target architecture
148
149 # Check for Win32
150 AC_MSG_CHECKING([for some Win32 platform])
151 case "$target_os" in
152   mingw* | cygwin*)
153     platform_win32=yes
154     AC_DEFINE(PLATFORM_WIN32, 1, [Build on win32 OS])
155     ;;
156   *)
157     platform_win32=no
158     ;;
159 esac
160 AC_MSG_RESULT([$platform_win32])
161 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
162
163 AC_MSG_CHECKING([for native Win32])
164 case "$target_os" in
165   mingw*)
166     os_win32=yes
167     AC_DEFINE(OS_WIN32, 1, [Build on native win32 OS])
168     os_unix=no
169     PATHSEP=';'
170     ;;
171   *)
172     os_win32=no
173     os_unix=yes
174     PATHSEP=':'
175     ;;
176 esac
177 AC_MSG_RESULT([$os_win32])
178 AC_SUBST(PATHSEP)
179 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
180 AM_CONDITIONAL(OS_UNIX, test "$os_unix" = "yes")
181
182 if test "$os_win32" = "yes"; then
183   AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
184   AC_CHECK_TOOL(WINDRES, windres, :)
185 else
186   WINDRES=":"
187 fi
188
189 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
190 AM_CONDITIONAL(HAVE_WINDRES, test "x$WINDRES" != "x:")
191 AC_SUBST(WINDRES)
192
193 AM_CONDITIONAL([EXTERNAL_PREFIX], [test "x$prefix" != "xNONE"])
194
195 dnl reasonable guesses for where stuff is installed
196 if test "x$prefix" = "xNONE"; then
197   prefix="/usr/local"
198 else
199   prefix=$prefix
200 fi
201
202 AM_PATH_GLIB_2_0(2.52.0,,AC_MSG_ERROR(GLIB >= 2.52.0 not installed.))
203 AC_ARG_ENABLE([gtk3], AC_HELP_STRING([--disable-gtk3], [use gtk2 instead of gtk3]),[gtk3="${enableval}"], [gtk3=m4_ifdef([AM_PATH_GTK_3_0], [auto], [no])])
204
205 if test x$gtk3 = xyes; then
206     AC_MSG_WARN("Gtk3 enabled")
207     m4_ifdef([AM_PATH_GTK_3_0], [AM_PATH_GTK_3_0(3.0.0,,AC_MSG_ERROR(GTK+ >= 3.0.0 not installed.))])
208 else
209     if test x$gtk3 != xno; then
210        AC_MSG_WARN("Gtk3 is preferred...")
211        m4_ifdef([AM_PATH_GTK_3_0], [AM_PATH_GTK_3_0(3.0.0,,[gtk3=no])])
212     fi
213 fi
214
215 if test x$gtk3 = xno; then
216     m4_ifdef([AM_PATH_GTK_2_0], [AM_PATH_GTK_2_0(2.20.0,,AC_MSG_ERROR(GTK+ >= 2.20.0 not installed.))])
217     true
218 fi
219
220 threads="auto"
221 AC_ARG_ENABLE([threads],
222   AC_HELP_STRING([--disable-threads], [disable thread support]), [threads="${enableval}"])
223
224 have_gthread="no"
225 if test "x${threads}" != "xno" ; then
226   PKG_CHECK_MODULES(GTHREAD, [gthread-2.0], have_gthread="yes", [AC_MSG_WARN("No thread support in glib")])
227 fi
228
229 if test "x$have_gthread" != "xno"; then
230         AC_DEFINE(HAVE_GTHREAD, 1, Define if you have gthread library)
231         GLIB_CFLAGS="$GTHREAD_CFLAGS"
232         GLIB_LIBS="$GTHREAD_LIBS"
233 fi
234
235
236 AC_PATH_PROGS(GDK_PIXBUF_CSOURCE, "gdk-pixbuf-csource")
237 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
238
239 AC_ARG_WITH(readmedir, [  --with-readmedir=DIR    install path for readme files],
240             readmedir=$withval, readmedir="$prefix/share/doc/geeqie-$VERSION")
241 AC_ARG_WITH(htmldir, [  --with-htmldir=DIR      install path for html files],
242             htmldir=$withval, htmldir="$readmedir/html")
243
244 AC_DEFINE_UNQUOTED(GQ_HELPDIR, "$readmedir", [Location of documentation files])
245 AC_DEFINE_UNQUOTED(GQ_HTMLDIR, "$htmldir", [Location of html documentation])
246
247 AC_PATH_PROG(GNOME_DOC_TOOL, yelp-build)
248
249 AC_SUBST(readmedir)
250 AC_SUBST(htmldir)
251
252 eval "eval appdir=${datadir}/${PACKAGE}"
253 AC_DEFINE_UNQUOTED([GQ_APP_DIR], "$appdir", [Location of application data])
254 AC_SUBST(appdir)
255
256 eval "eval gq_bindir=${prefix}/lib/${PACKAGE}"
257 AC_DEFINE_UNQUOTED([GQ_BIN_DIR], "$gq_bindir", [Location of helper scripts and executables])
258 AC_SUBST(gq_bindir)
259
260 #  LIRC support
261 # ----------------------------------------------------------------------
262
263 dnl Check for LIRC client support
264 AC_MSG_CHECKING(if LIRC support is enabled)
265 lirc=no
266 AC_ARG_ENABLE([lirc],
267   AC_HELP_STRING([--disable-lirc], [disable lirc support (auto)]),
268 [
269 if test "x${enableval}" = "xyes" -a "x$GCC" = "xyes"; then
270   AC_MSG_RESULT(yes)
271   lirc=yes
272 else
273   AC_MSG_RESULT(no)
274   lirc=no
275 fi], AC_MSG_RESULT(no))
276
277
278 AC_ARG_WITH(lirc-prefix,
279 [  --with-lirc-prefix=PATH Prefix where LIRC is installed],
280 [
281 for dir in `echo "$withval" | tr : ' '`; do
282   if test -d $dir/lib; then CXXFLAGS="$CXXFLAGS -L$dir/lib"; fi
283   if test -d $dir/include; then CXXFLAGS="$CXXFLAGS -I$dir/include"; fi
284   done
285 ])
286
287 HAVE_LIRC=no
288 if test "x${lirc}" != "xno" ; then
289   AC_CHECK_HEADER(lirc/lirc_client.h,
290     [AC_CHECK_LIB(lirc_client,lirc_init,[HAVE_LIRC=yes;LIBS=-llirc_client $LIBS;AC_DEFINE([HAVE_LIRC],[],[Define to 1 if LIRC must be used])],,)],)
291 fi
292 AM_CONDITIONAL(HAVE_LIRC, [test "x$HAVE_LIRC" = xyes])
293
294
295 #  LCMS support
296 # ----------------------------------------------------------------------
297
298 AC_ARG_ENABLE([lcms],
299   AC_HELP_STRING([--disable-lcms], [disable lcms support]),
300     [liblcms=$enableval], [liblcms=auto])
301
302 if test "x${liblcms}" != "xno"; then
303   PKG_CHECK_MODULES(LCMS, [lcms2 >= 2.0],
304     [
305       HAVE_LCMS=yes
306       AC_DEFINE(HAVE_LCMS, 1, [define to enable use of color profiles with lcms])
307       AC_DEFINE(HAVE_LCMS2, 1, [lcms2 is used])
308     ],
309     [
310     PKG_CHECK_MODULES(LCMS, [lcms >= 1.14],
311       [
312         HAVE_LCMS=yes
313         AC_DEFINE(HAVE_LCMS, 1, [define to enable use of color profiles with lcms])
314       ],
315       [
316         HAVE_LCMS=no
317         AC_MSG_WARN([$LCMS_PKG_ERRORS])
318       ])
319     ])
320 else
321   HAVE_LCMS=disabled
322 fi
323
324 AM_CONDITIONAL(HAVE_LCMS, [test "x$HAVE_LCMS" = xyes])
325 AC_SUBST(LCMS_CFLAGS)
326 AC_SUBST(LCMS_LIBS)
327
328 #  libjpeg support
329 # ----------------------------------------------------------------------
330
331 AC_ARG_ENABLE([jpeg],
332   AC_HELP_STRING([--disable-jpeg], [disable direct jpeg support]),
333     [libjpeg=$enableval], [libjpeg=auto])
334
335 if test "x${libjpeg}" != "xno"; then
336   AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
337       HAVE_JPEG=yes
338       JPEG_LIBS=-ljpeg
339       AC_DEFINE(HAVE_JPEG, 1, [define to enable use of custom jpeg loader]),
340       HAVE_JPEG=no)
341 else
342   HAVE_JPEG=disabled
343 fi
344
345 AM_CONDITIONAL(HAVE_JPEG, [test "x$HAVE_JPEG" = xyes])
346 AC_SUBST(JPEG_CFLAGS)
347 AC_SUBST(JPEG_LIBS)
348
349
350 #  libtiff support
351 # ----------------------------------------------------------------------
352
353 AC_ARG_ENABLE([tiff],
354   AC_HELP_STRING([--disable-tiff], [disable direct tiff support]),
355     [libtiff=$enableval], [libtiff=auto])
356
357 if test "x${libtiff}" != "xno"; then
358   AC_CHECK_LIB(tiff, TIFFClientOpen,
359       HAVE_TIFF=yes
360       TIFF_LIBS=-ltiff
361       AC_DEFINE(HAVE_TIFF, 1, [define to enable use of custom tiff loader]),
362       HAVE_TIFF=no)
363 else
364   HAVE_TIFF=disabled
365 fi
366
367 AM_CONDITIONAL(HAVE_TIFF, [test "x$HAVE_TIFF" = xyes])
368 AC_SUBST(TIFF_CFLAGS)
369 AC_SUBST(TIFF_LIBS)
370
371 #  libraw support
372 # ----------------------------------------------------------------------
373
374 AC_ARG_ENABLE([raw],
375   AC_HELP_STRING([--disable-raw], [disable LibRaw support]),
376     [libraw=$enableval], [libraw=auto])
377
378 if test "x${libraw}" != "xno"; then
379   PKG_CHECK_MODULES(RAW, [libraw >= 0.20],
380     [
381       HAVE_RAW=yes
382       AC_DEFINE(HAVE_RAW, 1, [define to enable libraw support])
383     ],
384     [
385       HAVE_RAW=no
386       AC_MSG_WARN([$RAW_PKG_ERRORS])
387     ])
388 else
389   HAVE_RAW=disabled
390 fi
391
392 AM_CONDITIONAL(HAVE_RAW, [test "x$HAVE_RAW" = xyes])
393 AC_SUBST(RAW_CFLAGS)
394 AC_SUBST(RAW_LIBS)
395
396 #  libffmpegthumbnailer support
397 # ----------------------------------------------------------------------
398
399 AC_ARG_ENABLE([ffmpegthumbnailer],
400   AC_HELP_STRING([--disable-ffmpegthumbnailer], [disable ffmpegthumbnailer support for generating thumbnails of video files]),
401     [ffmpegthumbnailer=$enableval], [ffmpegthumbnailer=auto])
402
403 if test "x${ffmpegthumbnailer}" != "xno"; then
404   PKG_CHECK_MODULES(FFMPEGTHUMBNAILER, [libffmpegthumbnailer >= 2.1.0],
405     [
406       HAVE_FFMPEGTHUMBNAILER=yes
407       AC_DEFINE(HAVE_FFMPEGTHUMBNAILER, 1, [define to enable ffmpegthumbnailer support])
408       AC_CHECK_MEMBER([video_thumbnailer.prefer_embedded_metadata], [AC_DEFINE(HAVE_FFMPEGTHUMBNAILER_METADATA, 1, [define if ffmpegthumbnailer supports embedded metadata])], [], [[#include <libffmpegthumbnailer/videothumbnailerc.h>]])
409       AC_CHECK_MEMBER([image_data.image_data_width], [AC_DEFINE(HAVE_FFMPEGTHUMBNAILER_RGB, 1, [define if ffmpegthumbnailer supports raw RGB output])], [], [[#include <libffmpegthumbnailer/videothumbnailerc.h>]])
410       AC_CHECK_LIB([ffmpegthumbnailer], [video_thumbnailer_set_size], [AC_DEFINE(HAVE_FFMPEGTHUMBNAILER_WH, 1, [define if ffmpegthumbnailer supports specifying size by width/height])])
411     ],
412     [
413       HAVE_FFMPEGTHUMBNAILER=no
414     ])
415 else
416   HAVE_FFMPEGTHUMBNAILER=disabled
417 fi
418
419 AM_CONDITIONAL(HAVE_FFMPEGTHUMBNAILER, [test "x$HAVE_FFMPEGTHUMBNAILER" = xyes])
420 AC_SUBST(FFMPEGTHUMBNAILER_CFLAGS)
421 AC_SUBST(FFMPEGTHUMBNAILER_LIBS)
422
423 #  Exiv2 support
424 # ----------------------------------------------------------------------
425
426 AC_ARG_ENABLE([exiv2],
427   AC_HELP_STRING([--disable-exiv2], [disable exiv2 support]),
428     [libexiv2=$enableval], [libexiv2=auto])
429
430 if test "x${libexiv2}" != "xno"; then
431   PKG_CHECK_MODULES(EXIV2, [exiv2 >= 0.11],
432     [
433       HAVE_EXIV2=yes
434       AC_DEFINE(HAVE_EXIV2, 1, [define to enable exiv2 support])
435     ],
436     [
437       HAVE_EXIV2=no
438       AC_MSG_WARN([$EXIV2_PKG_ERRORS])
439     ])
440 else
441   HAVE_EXIV2=disabled
442 fi
443
444 AM_CONDITIONAL(HAVE_EXIV2, [test "x$HAVE_EXIV2" = xyes])
445 AC_SUBST(EXIV2_CFLAGS)
446 AC_SUBST(EXIV2_LIBS)
447
448
449 #  Gettext support
450 # ----------------------------------------------------------------------
451
452 dnl Set of available languages
453 ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
454 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
455
456 GETTEXT_PACKAGE=$PACKAGE
457 AC_SUBST(GETTEXT_PACKAGE)
458 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["${GETTEXT_PACKAGE}"],[Name of gettext file])
459 AM_GLIB_GNU_GETTEXT
460 AM_GLIB_DEFINE_LOCALEDIR(GQ_LOCALEDIR)
461
462 AC_SUBST(CFLAGS)
463 AC_SUBST(CXXFLAGS)
464 AC_SUBST(CPPFLAGS)
465 AC_SUBST(LDFLAGS)
466
467
468 #  clutter and champlain support
469 # ----------------------------------------------------------------------
470
471 AC_ARG_ENABLE([map],
472   AC_HELP_STRING([--disable-map], [disable map support]),
473     [libgps=$enableval], [libgps=auto])
474
475 AC_ARG_ENABLE([gpu-accel],
476   AC_HELP_STRING([--disable-gpu-accel], [disable GPU acceleration support - experimental]),
477     [libclutter=$enableval], [libclutter=auto])
478
479 if test "x${libclutter}" != "xno" -a "x${gtk3}" != "xno"; then
480   PKG_CHECK_MODULES(CLUTTER, [clutter-1.0 >= 1.0],
481     [
482       PKG_CHECK_MODULES(CLUTTER_GTK, [clutter-gtk-1.0 >= 1.0],
483         [
484           HAVE_CLUTTER=yes
485           AC_DEFINE(HAVE_CLUTTER, 1, [define to enable use of clutter library])
486         ],
487         [
488           HAVE_CLUTTER=no
489           AC_MSG_WARN([$CLUTTER_GTK_PKG_ERRORS])
490         ])
491     ],
492     [
493       HAVE_CLUTTER=no
494       AC_MSG_WARN([$CLUTTER_PKG_ERRORS])
495     ])
496 else
497   HAVE_CLUTTER=disabled
498 fi
499
500 AC_SUBST(CLUTTER_CFLAGS)
501 AC_SUBST(CLUTTER_LIBS)
502 AC_SUBST(CLUTTER_GTK_CFLAGS)
503 AC_SUBST(CLUTTER_GTK_LIBS)
504
505
506 #  Libchamplain support - used for map facility
507 # ----------------------------------------------------------------------
508
509 if test "x${libgps}" != "xno" -a "x${HAVE_CLUTTER}" = "xyes"; then
510     if test "x${gtk3}" != "xno"; then
511       PKG_CHECK_MODULES(LIBCHAMPLAIN, [champlain-0.12 >= 0.12],
512         [
513           HAVE_LIBCHAMPLAIN=yes
514           AC_DEFINE(HAVE_LIBCHAMPLAIN, 1, [define to enable use of maps])
515         ],
516         [
517           HAVE_LIBCHAMPLAIN=no
518           AC_MSG_WARN([$LIBCHAMPLAIN_PKG_ERRORS])
519         ])
520     else
521       HAVE_LIBCHAMPLAIN=disabled
522     fi
523 else
524   HAVE_LIBCHAMPLAIN=disabled
525 fi
526
527 if test "x${libgps}" != "xno" -a "x${HAVE_LIBCHAMPLAIN}" = "xyes" ; then
528   PKG_CHECK_MODULES(LIBCHAMPLAIN_GTK, [champlain-gtk-0.12 >= 0.12],
529     [
530       HAVE_LIBCHAMPLAIN_GTK=yes
531       AC_DEFINE(HAVE_LIBCHAMPLAIN_GTK, 1, [define to enable use of maps])
532     ],
533     [
534       HAVE_LIBCHAMPLAIN_GTK=no
535       AC_MSG_WARN([$LIBCHAMPLAIN_GTK_PKG_ERRORS])
536     ])
537 else
538   HAVE_LIBCHAMPLAIN_GTK=disabled
539 fi
540
541 AM_CONDITIONAL(HAVE_LIBCHAMPLAIN_GTK, [test "x$HAVE_LIBCHAMPLAIN_GTK" = xyes])
542 AC_SUBST(LIBCHAMPLAIN_GTK_CFLAGS)
543 AC_SUBST(LIBCHAMPLAIN_GTK_LIBS)
544
545 #  Lua support
546 # ----------------------------------------------------------------------
547
548 AC_ARG_ENABLE([lua],
549   AC_HELP_STRING([--disable-lua], [disable lua support]),
550     [liblua=$enableval], [liblua=auto])
551
552 if test "x${liblua}" != "xno"; then
553   PKG_CHECK_MODULES(LUA, lua5.3 >= 5.3,
554     [
555       HAVE_LUA=yes
556       AC_DEFINE(HAVE_LUA, 1, [define to enable lua support])
557     ],
558     [
559      PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1,
560        [
561          HAVE_LUA=yes
562          AC_DEFINE(HAVE_LUA, 1, [define to enable lua support])
563        ],
564        [
565          PKG_CHECK_MODULES(LUA, lua >= 5.1,
566             [
567               HAVE_LUA=yes
568               AC_DEFINE(HAVE_LUA, 1, [define to enable lua support])
569             ],
570             [
571                HAVE_LUA=no
572                AC_MSG_WARN([$LUA_PKG_ERRORS])
573             ])
574        ])
575      ])
576 else
577   HAVE_LUA=disabled
578 fi
579
580 AM_CONDITIONAL(HAVE_LUA, [test "x$HAVE_LUA" = xyes])
581 AC_SUBST(LUA_CFLAGS)
582 AC_SUBST(LUA_LIBS)
583
584 #  Pdf support
585 # ----------------------------------------------------------------------
586
587 if test "x${gtk3}" != "xno"; then
588     AC_ARG_ENABLE([pdf],
589       AC_HELP_STRING([--disable-pdf], [disable pdf support]),
590         [libpdf=$enableval], [libpdf=auto])
591
592     if test "x${libpdf}" != "xno"; then
593       PKG_CHECK_MODULES(PDF, poppler-glib >= 0.62,
594         [
595           HAVE_PDF=yes
596           AC_DEFINE(HAVE_PDF, 1, [define to enable pdf support])
597         ],
598         [
599           HAVE_PDF=no
600           AC_MSG_WARN([$PDF_PKG_ERRORS])
601         ])
602     else
603         HAVE_PDF=disabled
604     fi
605 else
606     HAVE_PDF=disabled
607 fi
608
609 AM_CONDITIONAL(HAVE_PDF, [test "x$HAVE_PDF" = xyes])
610 AC_SUBST(PDF_CFLAGS)
611 AC_SUBST(PDF_LIBS)
612
613 #  Heif support
614 # ----------------------------------------------------------------------
615
616 AC_ARG_ENABLE([heif],
617   AC_HELP_STRING([--disable-heif], [disable heif support]),
618     [libheif=$enableval], [libheif=auto])
619
620 if test "x${libheif}" != "xno"; then
621   PKG_CHECK_MODULES(HEIF, libheif >= 1.3.2,
622     [
623       HAVE_HEIF=yes
624       AC_DEFINE(HAVE_HEIF, 1, [define to enable heif support])
625     ],
626     [
627       HAVE_HEIF=no
628       AC_MSG_WARN([$HEIF_PKG_ERRORS])
629     ])
630 else
631     HAVE_HEIF=disabled
632 fi
633
634 AM_CONDITIONAL(HAVE_HEIF, [test "x$HAVE_HEIF" = xyes])
635 AC_SUBST(HEIF_CFLAGS)
636 AC_SUBST(HEIF_LIBS)
637
638 #  WebP support
639 # ----------------------------------------------------------------------
640
641 AC_ARG_ENABLE([webp],
642   AC_HELP_STRING([--disable-webp], [disable webp support]),
643     [libwebp=$enableval], [libwebp=auto])
644
645 if test "x${libwebp}" != "xno"; then
646   PKG_CHECK_MODULES(WEBP, libwebp >= 0.6.1,
647     [
648       HAVE_WEBP=yes
649       AC_DEFINE(HAVE_WEBP, 1, [define to enable webp support])
650     ],
651     [
652       HAVE_WEBP=no
653       AC_MSG_WARN([$WEBP_PKG_ERRORS])
654     ])
655 else
656     HAVE_WEBP=disabled
657 fi
658
659 AM_CONDITIONAL(HAVE_WEBP, [test "x$HAVE_WEBP" = xyes])
660 AC_SUBST(WEBP_CFLAGS)
661 AC_SUBST(WEBP_LIBS)
662
663 #  Libarchive support
664 # ----------------------------------------------------------------------
665
666 AC_ARG_ENABLE([archive],
667   AC_HELP_STRING([--disable-archive], [disable archive support]),
668     [libarchive=$enableval], [libarchive=auto])
669
670 if test "x${libarchive}" != "xno"; then
671   PKG_CHECK_MODULES(ARCHIVE, libarchive >= 3.4.0,
672     [
673       HAVE_ARCHIVE=yes
674       AC_DEFINE(HAVE_ARCHIVE, 1, [define to enable archive support])
675     ],
676     [
677       HAVE_ARCHIVE=no
678       AC_MSG_WARN([$ARCHIVE_PKG_ERRORS])
679     ])
680 else
681     HAVE_ARCHIVE=disabled
682 fi
683
684 AM_CONDITIONAL(HAVE_ARCHIVE, [test "x$HAVE_ARCHIVE" = xyes])
685 AC_SUBST(ARCHIVE_CFLAGS)
686 AC_SUBST(ARCHIVE_LIBS)
687
688 #  J2K support
689 # ----------------------------------------------------------------------
690
691 AC_ARG_ENABLE([j2k],
692   AC_HELP_STRING([--disable-j2k], [disable j2k support]),
693     [libopenjp2=$enableval], [libopenjp2=auto])
694
695 if test "x${libopenjp2}" != "xno"; then
696   PKG_CHECK_MODULES(J2K, libopenjp2 >= 2.3.0,
697     [
698       HAVE_J2K=yes
699       AC_DEFINE(HAVE_J2K, 1, [define to enable j2k support])
700     ],
701     [
702       HAVE_J2K=no
703       AC_MSG_WARN([$J2K_PKG_ERRORS])
704     ])
705 else
706     HAVE_J2K=disabled
707 fi
708
709 AM_CONDITIONAL(HAVE_J2K, [test "x$HAVE_J2K" = xyes])
710 AC_SUBST(J2K_CFLAGS)
711 AC_SUBST(J2K_LIBS)
712
713 #  DjVu support
714 # ----------------------------------------------------------------------
715
716 AC_ARG_ENABLE([djvu],
717   AC_HELP_STRING([--disable-djvu], [disable djvu support]),
718     [libdjvulibre=$enableval], [libdjvulibre=auto])
719
720 if test "x${libdjvulibre}" != "xno"; then
721   PKG_CHECK_MODULES(DJVU, ddjvuapi >= 3.5.27,
722     [
723       HAVE_DJVU=yes
724       AC_DEFINE(HAVE_DJVU, 1, [define to enable DjVu support])
725     ],
726     [
727       HAVE_DJVU=no
728       AC_MSG_WARN([$DJVU_PKG_ERRORS])
729     ])
730 else
731     HAVE_DJVU=disabled
732 fi
733
734 AM_CONDITIONAL(HAVE_DJVU, [test "x$HAVE_DJVU" = xyes])
735 AC_SUBST(DJVU_CFLAGS)
736 AC_SUBST(DJVU_LIBS)
737
738 #  JPEG XL support
739 # ----------------------------------------------------------------------
740
741 AC_ARG_ENABLE([jpegxl],
742   AC_HELP_STRING([--disable-jpegxl], [disable jpeg xl support]),
743     [libjxl=$enableval], [libjxl=auto])
744
745 if test "x${libjxl}" != "xno"; then
746   PKG_CHECK_MODULES(JPEGXL, libjxl >= 0.3.7,
747     [
748       HAVE_JPEGXL=yes
749       AC_DEFINE(HAVE_JPEGXL, 1, [define to enable JPEG XL support])
750     ],
751     [
752       HAVE_JPEGXL=no
753       AC_MSG_WARN([$JPEGXL_PKG_ERRORS])
754     ])
755 else
756     HAVE_JPEGXL=disabled
757 fi
758
759 AM_CONDITIONAL(HAVE_JPEGXL, [test "x$HAVE_JPEGXL" = xyes])
760 AC_SUBST(JPEGXL_CFLAGS)
761 AC_SUBST(JPEGXL_LIBS)
762
763 #  Markdown support
764 # ----------------------------------------------------------------------
765
766 AM_CONDITIONAL(HAVE_MARKDOWN, [ "$(command -v markdown)" ])
767
768 # _NL_TIME_FIRST_WEEKDAY support
769 # note that it is an enum and not a define
770 # ----------------------------------------------------------------------
771
772 AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY])
773 AC_TRY_LINK([#include <langinfo.h>], [
774 char c;
775 c = *((unsigned char *)  nl_langinfo(_NL_TIME_FIRST_WEEKDAY));
776 ], nl_ok=yes, nl_ok=no)
777 AC_MSG_RESULT($nl_ok)
778 if test "$nl_ok" = "yes"; then
779   AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1],
780       [Define if _NL_TIME_FIRST_WEEKDAY is available])
781 fi
782
783 # ----------------------------------------------------------------------
784
785 AH_TOP([
786 /** \file
787  * \short autogenerated definition by autoheader.
788  * \author Bruclik
789  */
790
791 /*
792  *  This file is a part of Geeqie project (http://www.geeqie.org/).
793  *  Copyright (C) 2008 - 2016 The Geeqie Team
794  *
795  *  This program is free software; you can redistribute it and/or modify
796  *  it under the terms of the GNU General Public License as published by
797  *  the Free Software Foundation; either version 2 of the License, or
798  *  (at your option) any later version.
799  *
800  *  This program is distributed in the hope that it will be useful,
801  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
802  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
803  *  GNU General Public License for more details.
804  */
805
806 #ifndef _INCLUDE_CONFIG_H
807 #define _INCLUDE_CONFIG_H
808 ])
809
810 AH_BOTTOM([#endif])
811
812 dnl Write the output
813 dnl
814
815 AC_CONFIG_FILES([
816     Makefile
817     src/Makefile
818     src/icons/Makefile
819     src/icons/svg/Makefile
820     po/Makefile.in
821     doc/Makefile
822     plugins/Makefile
823     plugins/symlink/Makefile
824     plugins/rotate/Makefile
825     plugins/ufraw/Makefile
826     plugins/geocode-parameters/Makefile
827     plugins/export-jpeg/Makefile
828     plugins/tethered-photography/Makefile
829     plugins/camera-import/Makefile
830     plugins/image-crop/Makefile
831     plugins/random-image/Makefile
832     plugins/lens/Makefile
833     geeqie.spec
834 ])
835
836 AC_OUTPUT
837 dnl Print the results
838 dnl
839
840 cat > config.report << END
841
842      Config results:
843     -=-=-=-=-=-=-=-=-
844
845 Package:
846   Name:          $PACKAGE_NAME
847   Version:       $PACKAGE_VERSION
848
849 Architecture:
850   UNIX:          $os_unix
851   Win32:         $platform_win32 (native: $os_win32)
852
853 Flags:
854   Geeqie:        $GQ_CFLAGS
855   DEFS:          $DEFS
856   CPPFLAGS:      $__CPPFLAGS
857   CFLAGS:        $CFLAGS
858   CXXFLAGS:      $CXXFLAGS
859   Gtk:           $GTK_CFLAGS
860   Glib:          $GLIB_CFLAGS
861   Thread:        $GTHREAD_LIBS
862   Others:        $JPEG_LIBS $TIFF_LIBS $LCMS_LIBS $EXIV2_LIBS $CLUTTER_LIBS $CLUTTER_GTK_LIBS $LIBCHAMPLAIN_LIBS $LIBCHAMPLAIN_GTK_LIBS $LUA_LIBS $RAW_LIBS $JPEGXL_LIBS
863
864 Localization:
865   NLS support:   $USE_NLS
866   LINGUAS:       $LINGUAS
867
868 Settings:
869   Developer:     $__IS_DEVELOPER
870   Debug flags:   $__IS_DEBUG_FLAGS
871   Debug log:     $__IS_DEBUG_LOG
872   Deprecated:    $__IS_DEPRECATED
873
874 Support:
875   LCMS:          $HAVE_LCMS
876   Exiv2:         $HAVE_EXIV2
877   Lirc:          $HAVE_LIRC
878   Clutter:       $HAVE_CLUTTER
879   Libchamplain:         $HAVE_LIBCHAMPLAIN
880   Libchamplain-gtk:     $HAVE_LIBCHAMPLAIN_GTK
881   Lua:           $HAVE_LUA
882   FFmpegthumbnailer:    $HAVE_FFMPEGTHUMBNAILER
883   Pdf:           $HAVE_PDF
884   HEIF:          $HAVE_HEIF
885   WebP:          $HAVE_WEBP
886   DjVu:          $HAVE_DJVU
887   J2K:           $HAVE_J2K
888   LibRaw:        $HAVE_RAW
889   Libjxl:        $HAVE_JPEGXL
890   Libarchive:    $HAVE_ARCHIVE
891
892 Documentation:
893   Doxygen:       $DX_DOXYGEN
894   doc-tool:      $GNOME_DOC_TOOL
895
896 END
897
898 cat config.report
899 cat <<EOF
900
901   Now you can type "make" to build Geeqie
902   (or you take blue pill and the story ends :)
903
904 EOF