Preparing release
[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 - 2020 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], 1.6, [https://github.com/BestImageViewer/geeqie/issues], [], [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 #  libffmpegthumbnailer support
372 # ----------------------------------------------------------------------
373
374 AC_ARG_ENABLE([ffmpegthumbnailer],
375   AC_HELP_STRING([--disable-ffmpegthumbnailer], [disable ffmpegthumbnailer support for generating thumbnails of video files]),
376     [ffmpegthumbnailer=$enableval], [ffmpegthumbnailer=auto])
377
378 if test "x${ffmpegthumbnailer}" != "xno"; then
379   PKG_CHECK_MODULES(FFMPEGTHUMBNAILER, [libffmpegthumbnailer >= 2.1.0],
380     [
381       HAVE_FFMPEGTHUMBNAILER=yes
382       AC_DEFINE(HAVE_FFMPEGTHUMBNAILER, 1, [define to enable ffmpegthumbnailer support])
383       AC_CHECK_MEMBER([video_thumbnailer.prefer_embedded_metadata], [AC_DEFINE(HAVE_FFMPEGTHUMBNAILER_METADATA, 1, [define if ffmpegthumbnailer supports embedded metadata])], [], [[#include <libffmpegthumbnailer/videothumbnailerc.h>]])
384       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>]])
385       AC_CHECK_LIB([ffmpegthumbnailer], [video_thumbnailer_set_size], [AC_DEFINE(HAVE_FFMPEGTHUMBNAILER_WH, 1, [define if ffmpegthumbnailer supports specifying size by width/height])])
386     ],
387     [
388       HAVE_FFMPEGTHUMBNAILER=no
389     ])
390 else
391   HAVE_FFMPEGTHUMBNAILER=disabled
392 fi
393
394 AM_CONDITIONAL(HAVE_FFMPEGTHUMBNAILER, [test "x$HAVE_FFMPEGTHUMBNAILER" = xyes])
395 AC_SUBST(FFMPEGTHUMBNAILER_CFLAGS)
396 AC_SUBST(FFMPEGTHUMBNAILER_LIBS)
397
398 #  Exiv2 support
399 # ----------------------------------------------------------------------
400
401 AC_ARG_ENABLE([exiv2],
402   AC_HELP_STRING([--disable-exiv2], [disable exiv2 support]),
403     [libexiv2=$enableval], [libexiv2=auto])
404
405 if test "x${libexiv2}" != "xno"; then
406   PKG_CHECK_MODULES(EXIV2, [exiv2 >= 0.11],
407     [
408       HAVE_EXIV2=yes
409       AC_DEFINE(HAVE_EXIV2, 1, [define to enable exiv2 support])
410     ],
411     [
412       HAVE_EXIV2=no
413       AC_MSG_WARN([$EXIV2_PKG_ERRORS])
414     ])
415 else
416   HAVE_EXIV2=disabled
417 fi
418
419 AM_CONDITIONAL(HAVE_EXIV2, [test "x$HAVE_EXIV2" = xyes])
420 AC_SUBST(EXIV2_CFLAGS)
421 AC_SUBST(EXIV2_LIBS)
422
423
424 #  Gettext support
425 # ----------------------------------------------------------------------
426
427 dnl Set of available languages
428 ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
429 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
430
431 GETTEXT_PACKAGE=$PACKAGE
432 AC_SUBST(GETTEXT_PACKAGE)
433 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["${GETTEXT_PACKAGE}"],[Name of gettext file])
434 AM_GLIB_GNU_GETTEXT
435 AM_GLIB_DEFINE_LOCALEDIR(GQ_LOCALEDIR)
436
437 AC_SUBST(CFLAGS)
438 AC_SUBST(CXXFLAGS)
439 AC_SUBST(CPPFLAGS)
440 AC_SUBST(LDFLAGS)
441
442
443 #  clutter and champlain support
444 # ----------------------------------------------------------------------
445
446 AC_ARG_ENABLE([map],
447   AC_HELP_STRING([--disable-map], [disable map support]),
448     [libgps=$enableval], [libgps=auto])
449
450 AC_ARG_ENABLE([gpu-accel],
451   AC_HELP_STRING([--disable-gpu-accel], [disable GPU acceleration support - experimental]),
452     [libclutter=$enableval], [libclutter=auto])
453
454 if test "x${libclutter}" != "xno" -a "x${gtk3}" != "xno"; then
455   PKG_CHECK_MODULES(CLUTTER, [clutter-1.0 >= 1.0],
456     [
457       PKG_CHECK_MODULES(CLUTTER_GTK, [clutter-gtk-1.0 >= 1.0],
458         [
459           HAVE_CLUTTER=yes
460           AC_DEFINE(HAVE_CLUTTER, 1, [define to enable use of clutter library])
461         ],
462         [
463           HAVE_CLUTTER=no
464           AC_MSG_WARN([$CLUTTER_GTK_PKG_ERRORS])
465         ])
466     ],
467     [
468       HAVE_CLUTTER=no
469       AC_MSG_WARN([$CLUTTER_PKG_ERRORS])
470     ])
471 else
472   HAVE_CLUTTER=disabled
473 fi
474
475 AC_SUBST(CLUTTER_CFLAGS)
476 AC_SUBST(CLUTTER_LIBS)
477 AC_SUBST(CLUTTER_GTK_CFLAGS)
478 AC_SUBST(CLUTTER_GTK_LIBS)
479
480
481 #  Libchamplain support - used for map facility
482 # ----------------------------------------------------------------------
483
484 if test "x${libgps}" != "xno" -a "x${HAVE_CLUTTER}" = "xyes"; then
485     if test "x${gtk3}" != "xno"; then
486       PKG_CHECK_MODULES(LIBCHAMPLAIN, [champlain-0.12 >= 0.12],
487         [
488           HAVE_LIBCHAMPLAIN=yes
489           AC_DEFINE(HAVE_LIBCHAMPLAIN, 1, [define to enable use of maps])
490         ],
491         [
492           HAVE_LIBCHAMPLAIN=no
493           AC_MSG_WARN([$LIBCHAMPLAIN_PKG_ERRORS])
494         ])
495     else
496       HAVE_LIBCHAMPLAIN=disabled
497     fi
498 else
499   HAVE_LIBCHAMPLAIN=disabled
500 fi
501
502 if test "x${libgps}" != "xno" -a "x${HAVE_LIBCHAMPLAIN}" = "xyes" ; then
503   PKG_CHECK_MODULES(LIBCHAMPLAIN_GTK, [champlain-gtk-0.12 >= 0.12],
504     [
505       HAVE_LIBCHAMPLAIN_GTK=yes
506       AC_DEFINE(HAVE_LIBCHAMPLAIN_GTK, 1, [define to enable use of maps])
507     ],
508     [
509       HAVE_LIBCHAMPLAIN_GTK=no
510       AC_MSG_WARN([$LIBCHAMPLAIN_GTK_PKG_ERRORS])
511     ])
512 else
513   HAVE_LIBCHAMPLAIN_GTK=disabled
514 fi
515
516 AM_CONDITIONAL(HAVE_LIBCHAMPLAIN_GTK, [test "x$HAVE_LIBCHAMPLAIN_GTK" = xyes])
517 AC_SUBST(LIBCHAMPLAIN_GTK_CFLAGS)
518 AC_SUBST(LIBCHAMPLAIN_GTK_LIBS)
519
520 #  Lua support
521 # ----------------------------------------------------------------------
522
523 AC_ARG_ENABLE([lua],
524   AC_HELP_STRING([--disable-lua], [disable lua support]),
525     [liblua=$enableval], [liblua=auto])
526
527 if test "x${liblua}" != "xno"; then
528   PKG_CHECK_MODULES(LUA, lua5.3 >= 5.3,
529     [
530       HAVE_LUA=yes
531       AC_DEFINE(HAVE_LUA, 1, [define to enable lua support])
532     ],
533     [
534      PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1,
535        [
536          HAVE_LUA=yes
537          AC_DEFINE(HAVE_LUA, 1, [define to enable lua support])
538        ],
539        [
540          PKG_CHECK_MODULES(LUA, lua >= 5.1,
541             [
542               HAVE_LUA=yes
543               AC_DEFINE(HAVE_LUA, 1, [define to enable lua support])
544             ],
545             [
546                HAVE_LUA=no
547                AC_MSG_WARN([$LUA_PKG_ERRORS])
548             ])
549        ])
550      ])
551 else
552   HAVE_LUA=disabled
553 fi
554
555 AM_CONDITIONAL(HAVE_LUA, [test "x$HAVE_LUA" = xyes])
556 AC_SUBST(LUA_CFLAGS)
557 AC_SUBST(LUA_LIBS)
558
559 #  Pdf support
560 # ----------------------------------------------------------------------
561
562 if test "x${gtk3}" != "xno"; then
563     AC_ARG_ENABLE([pdf],
564       AC_HELP_STRING([--disable-pdf], [disable pdf support]),
565         [libpdf=$enableval], [libpdf=auto])
566
567     if test "x${libpdf}" != "xno"; then
568       PKG_CHECK_MODULES(PDF, poppler-glib >= 0.62,
569         [
570           HAVE_PDF=yes
571           AC_DEFINE(HAVE_PDF, 1, [define to enable pdf support])
572         ],
573         [
574           HAVE_PDF=no
575           AC_MSG_WARN([$PDF_PKG_ERRORS])
576         ])
577     else
578         HAVE_PDF=disabled
579     fi
580 else
581     HAVE_PDF=disabled
582 fi
583
584 AM_CONDITIONAL(HAVE_PDF, [test "x$HAVE_PDF" = xyes])
585 AC_SUBST(PDF_CFLAGS)
586 AC_SUBST(PDF_LIBS)
587
588 #  Heif support
589 # ----------------------------------------------------------------------
590
591 AC_ARG_ENABLE([heif],
592   AC_HELP_STRING([--disable-heif], [disable heif support]),
593     [libheif=$enableval], [libheif=auto])
594
595 if test "x${libheif}" != "xno"; then
596   PKG_CHECK_MODULES(HEIF, libheif >= 1.3.2,
597     [
598       HAVE_HEIF=yes
599       AC_DEFINE(HAVE_HEIF, 1, [define to enable heif support])
600     ],
601     [
602       HAVE_HEIF=no
603       AC_MSG_WARN([$HEIF_PKG_ERRORS])
604     ])
605 else
606     HAVE_HEIF=disabled
607 fi
608
609 AM_CONDITIONAL(HAVE_HEIF, [test "x$HAVE_HEIF" = xyes])
610 AC_SUBST(HEIF_CFLAGS)
611 AC_SUBST(HEIF_LIBS)
612
613 #  WebP support
614 # ----------------------------------------------------------------------
615
616 AC_ARG_ENABLE([webp],
617   AC_HELP_STRING([--disable-webp], [disable webp support]),
618     [libwebp=$enableval], [libwebp=auto])
619
620 if test "x${libwebp}" != "xno"; then
621   PKG_CHECK_MODULES(WEBP, libwebp >= 0.6.1,
622     [
623       HAVE_WEBP=yes
624       AC_DEFINE(HAVE_WEBP, 1, [define to enable webp support])
625     ],
626     [
627       HAVE_WEBP=no
628       AC_MSG_WARN([$WEBP_PKG_ERRORS])
629     ])
630 else
631     HAVE_WEBP=disabled
632 fi
633
634 AM_CONDITIONAL(HAVE_WEBP, [test "x$HAVE_WEBP" = xyes])
635 AC_SUBST(WEBP_CFLAGS)
636 AC_SUBST(WEBP_LIBS)
637
638 #  J2K support
639 # ----------------------------------------------------------------------
640
641 AC_ARG_ENABLE([j2k],
642   AC_HELP_STRING([--disable-j2k], [disable j2k support]),
643     [libopenjp2=$enableval], [libopenjp2=auto])
644
645 if test "x${libopenjp2}" != "xno"; then
646   PKG_CHECK_MODULES(J2K, libopenjp2 >= 2.3.0,
647     [
648       HAVE_J2K=yes
649       AC_DEFINE(HAVE_J2K, 1, [define to enable j2k support])
650     ],
651     [
652       HAVE_J2K=no
653       AC_MSG_WARN([$J2K_PKG_ERRORS])
654     ])
655 else
656     HAVE_J2K=disabled
657 fi
658
659 AM_CONDITIONAL(HAVE_J2K, [test "x$HAVE_J2K" = xyes])
660 AC_SUBST(J2K_CFLAGS)
661 AC_SUBST(J2K_LIBS)
662
663 #  DjVu support
664 # ----------------------------------------------------------------------
665
666 AC_ARG_ENABLE([djvu],
667   AC_HELP_STRING([--disable-djvu], [disable djvu support]),
668     [libdjvulibre=$enableval], [libdjvulibre=auto])
669
670 if test "x${libdjvulibre}" != "xno"; then
671   PKG_CHECK_MODULES(DJVU, ddjvuapi >= 3.5.27,
672     [
673       HAVE_DJVU=yes
674       AC_DEFINE(HAVE_DJVU, 1, [define to enable DjVu support])
675     ],
676     [
677       HAVE_DJVU=no
678       AC_MSG_WARN([$DJVU_PKG_ERRORS])
679     ])
680 else
681     HAVE_DJVU=disabled
682 fi
683
684 AM_CONDITIONAL(HAVE_DJVU, [test "x$HAVE_DJVU" = xyes])
685 AC_SUBST(DJVU_CFLAGS)
686 AC_SUBST(DJVU_LIBS)
687
688 #  Markdown support
689 # ----------------------------------------------------------------------
690
691 AM_CONDITIONAL(HAVE_MARKDOWN, [ "$(command -v markdown)" ])
692
693 # _NL_TIME_FIRST_WEEKDAY support
694 # note that it is an enum and not a define
695 # ----------------------------------------------------------------------
696
697 AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY])
698 AC_TRY_LINK([#include <langinfo.h>], [
699 char c;
700 c = *((unsigned char *)  nl_langinfo(_NL_TIME_FIRST_WEEKDAY));
701 ], nl_ok=yes, nl_ok=no)
702 AC_MSG_RESULT($nl_ok)
703 if test "$nl_ok" = "yes"; then
704   AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1],
705       [Define if _NL_TIME_FIRST_WEEKDAY is available])
706 fi
707
708 # ----------------------------------------------------------------------
709
710 AH_TOP([
711 /** \file
712  * \short autogenerated definition by autoheader.
713  * \author Bruclik
714  */
715
716 /*
717  *  This file is a part of Geeqie project (http://www.geeqie.org/).
718  *  Copyright (C) 2008 - 2016 The Geeqie Team
719  *
720  *  This program is free software; you can redistribute it and/or modify
721  *  it under the terms of the GNU General Public License as published by
722  *  the Free Software Foundation; either version 2 of the License, or
723  *  (at your option) any later version.
724  *
725  *  This program is distributed in the hope that it will be useful,
726  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
727  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
728  *  GNU General Public License for more details.
729  */
730
731 #ifndef _INCLUDE_CONFIG_H
732 #define _INCLUDE_CONFIG_H
733 ])
734
735 AH_BOTTOM([#endif])
736
737 dnl Write the output
738 dnl
739
740 AC_CONFIG_FILES([
741     Makefile
742     src/Makefile
743     src/icons/Makefile
744     src/icons/svg/Makefile
745     po/Makefile.in
746     doc/Makefile
747     plugins/Makefile
748     plugins/symlink/Makefile
749     plugins/rotate/Makefile
750     plugins/ufraw/Makefile
751     plugins/geocode-parameters/Makefile
752     plugins/export-jpeg/Makefile
753     plugins/tethered-photography/Makefile
754     plugins/camera-import/Makefile
755     plugins/image-crop/Makefile
756     plugins/random-image/Makefile
757     plugins/lens/Makefile
758     geeqie.spec
759 ])
760
761 AC_OUTPUT
762 dnl Print the results
763 dnl
764
765 cat > config.report << END
766
767      Config results:
768     -=-=-=-=-=-=-=-=-
769
770 Package:
771   Name:          $PACKAGE_NAME
772   Version:       $PACKAGE_VERSION
773
774 Architecture:
775   UNIX:          $os_unix
776   Win32:         $platform_win32 (native: $os_win32)
777
778 Flags:
779   Geeqie:        $GQ_CFLAGS
780   DEFS:          $DEFS
781   CPPFLAGS:      $__CPPFLAGS
782   CFLAGS:        $CFLAGS
783   CXXFLAGS:      $CXXFLAGS
784   Gtk:           $GTK_CFLAGS
785   Glib:          $GLIB_CFLAGS
786   Thread:        $GTHREAD_LIBS
787   Others:        $JPEG_LIBS $TIFF_LIBS $LCMS_LIBS $EXIV2_LIBS $CLUTTER_LIBS $CLUTTER_GTK_LIBS $LIBCHAMPLAIN_LIBS $LIBCHAMPLAIN_GTK_LIBS $LUA_LIBS
788
789 Localization:
790   NLS support:   $USE_NLS
791   LINGUAS:       $LINGUAS
792
793 Settings:
794   Developer:     $__IS_DEVELOPER
795   Debug flags:   $__IS_DEBUG_FLAGS
796   Debug log:     $__IS_DEBUG_LOG
797   Deprecated:    $__IS_DEPRECATED
798
799 Support:
800   LCMS:          $HAVE_LCMS
801   Exiv2:         $HAVE_EXIV2
802   Lirc:          $HAVE_LIRC
803   Clutter:       $HAVE_CLUTTER
804   Libchamplain:         $HAVE_LIBCHAMPLAIN
805   Libchamplain-gtk:     $HAVE_LIBCHAMPLAIN_GTK
806   Lua:           $HAVE_LUA
807   FFmpegthumbnailer:    $HAVE_FFMPEGTHUMBNAILER
808   Pdf:           $HAVE_PDF
809   HEIF:          $HAVE_HEIF
810   WebP:          $HAVE_WEBP
811   DjVu:          $HAVE_DJVU
812   J2K:           $HAVE_J2K
813
814 Documentation:
815   Doxygen:       $DX_DOXYGEN
816   doc-tool:      $GNOME_DOC_TOOL
817
818 END
819
820 cat config.report
821 cat <<EOF
822
823   Now you can type "make" to build Geeqie
824   (or you take blue pill and the story ends :)
825
826 EOF