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