app: s/sprintf/g_snprintf/ in xcf_save_image()
[gimp.git] / configure.ac
blob4b9e4fa5594e6e3ebc0ce765cb5a2ecc4c7b4cdd
1 # Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.54)
5 # Making releases on the stable branch:
6 #   gimp_micro_version += 1;
7 #   gimp_interface_age += 1;
9 # For a description of libtool version variables, see:
10 # devel-docs/libtool-instructions.txt
12 m4_define([gimp_major_version], [2])
13 m4_define([gimp_minor_version], [99])
14 m4_define([gimp_micro_version], [1])
15 m4_define([gimp_real_version],
16           [gimp_major_version.gimp_minor_version.gimp_micro_version])
17 m4_define([gimp_version], [gimp_real_version])
18 m4_define([gimp_interface_age], [0])
19 m4_define([gimp_binary_age],
20           [m4_eval(100 * gimp_minor_version + gimp_micro_version)])
22 # For overriding the version string. Comment out if not needed.
23 # m4_define([gimp_version], [2.99.1])
25 # This is the X.Y used in -lgimp-X.Y
26 m4_define([gimp_api_version], [3.0])
28 # Versions used for apps, plugins, tools, pkg-config files, and data,
29 # as well as global and user prefs
30 m4_define([gimp_app_version], [2.99])
31 m4_define([gimp_plugin_version], [2.99])
32 m4_define([gimp_tool_version], [2.99])
33 m4_define([gimp_pkgconfig_version], [3.0])
34 m4_define([gimp_data_version], [2.99])
35 m4_define([gimp_sysconf_version], [2.99])
36 m4_define([gimp_user_version], [2.99])
38 m4_define([gimp_unstable],
39           m4_if(m4_eval(gimp_minor_version % 2), [1], [yes], [no]))
40 m4_define([gimp_stable],
41           m4_if(m4_eval(gimp_minor_version % 2), [0], [yes], [no]))
43 m4_define([gimp_full_name], [GNU Image Manipulation Program])
45 # required versions of other packages
46 m4_define([alsa_required_version], [1.0.0])
47 m4_define([appstream_glib_required_version], [0.7.7])
48 m4_define([atk_required_version], [2.4.0])
49 m4_define([babl_required_version], [0.1.56])
50 m4_define([cairo_required_version], [1.14.0])
51 m4_define([cairo_pdf_required_version], [1.12.2])
52 m4_define([fontconfig_required_version], [2.12.4])
53 m4_define([freetype2_required_version], [2.1.7])
54 m4_define([gdk_pixbuf_required_version], [2.30.8])
55 m4_define([gegl_major_minor_version], [0.4])
56 m4_define([gegl_micro_version], [9])
57 m4_define([gegl_required_version],
58           [gegl_major_minor_version.gegl_micro_version])
59 m4_define([gexiv2_required_version], [0.10.6])
60 m4_define([glib_required_version], [2.56.0])
61 m4_define([gtk_mac_integration_required_version], [2.0.0])
62 m4_define([gtk_required_version], [3.22.29])
63 m4_define([gtkdoc_required_version], [1.0])
64 m4_define([harfbuzz_required_version], [0.9.19])
65 m4_define([intltool_required_version], [0.40.1])
66 m4_define([lcms_required_version], [2.8])
67 m4_define([libgudev_required_version], [167])
68 m4_define([libheif_required_version], [1.1.0])
69 m4_define([liblzma_required_version], [5.0.0])
70 m4_define([libmypaint_required_version], [1.3.0])
71 m4_define([libpng_required_version], [1.6.25])
72 m4_define([openexr_required_version], [1.6.1])
73 m4_define([openjpeg_required_version], [2.1.0])
74 m4_define([pangocairo_required_version], [1.42.0])
75 m4_define([perl_required_version], [5.10.0])
76 m4_define([poppler_required_version], [0.44.0])
77 m4_define([poppler_data_required_version], [0.4.7])
78 m4_define([pycairo_required_version], [1.0.2])
79 m4_define([pygtk_required_version], [2.10.4])
80 m4_define([python2_required_version], [2.5.0])
81 m4_define([rsvg_required_version], [2.40.6])
82 m4_define([webkitgtk_required_version], [2.20.3])
83 m4_define([webp_required_version], [0.6.0])
84 m4_define([wmf_required_version], [0.2.8])
86 # Current test considers only 2 version numbers. If we update the recommended
87 # version of gettext with more version numbers, please update the tests.
88 m4_define([xgettext_required_version], [0.19])
90 AC_INIT([GIMP], [gimp_version],
91         [https://gitlab.gnome.org/GNOME/gimp/issues/new],
92         [gimp])
94 AC_CONFIG_HEADERS([config.h])
95 AC_CONFIG_SRCDIR([app/core/gimp.c])
96 AC_CONFIG_MACRO_DIR([m4macros])
98 AM_INIT_AUTOMAKE(no-define dist-bzip2 dist-xz no-dist-gzip -Wno-portability)
100 # Enable silent build rules by default, requires at least
101 # Automake-1.11. Disable by either passing --disable-silent-rules to
102 # configure or passing V=1 to make
103 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
105 GIMP_MAJOR_VERSION=gimp_major_version
106 GIMP_MINOR_VERSION=gimp_minor_version
107 GIMP_MICRO_VERSION=gimp_micro_version
108 GIMP_INTERFACE_AGE=gimp_interface_age
109 GIMP_BINARY_AGE=gimp_binary_age
110 GIMP_VERSION=gimp_version
111 GIMP_REAL_VERSION=gimp_real_version
112 GIMP_API_VERSION=gimp_api_version
113 GIMP_APP_VERSION=gimp_app_version
114 GIMP_PLUGIN_VERSION=gimp_plugin_version
115 GIMP_TOOL_VERSION=gimp_tool_version
116 GIMP_PKGCONFIG_VERSION=gimp_pkgconfig_version
117 GIMP_DATA_VERSION=gimp_data_version
118 GIMP_SYSCONF_VERSION=gimp_sysconf_version
119 GIMP_USER_VERSION=gimp_user_version
120 GIMP_UNSTABLE=gimp_unstable
121 GIMP_FULL_NAME="gimp_full_name"
122 AC_SUBST(GIMP_MAJOR_VERSION)
123 AC_SUBST(GIMP_MINOR_VERSION)
124 AC_SUBST(GIMP_MICRO_VERSION)
125 AC_SUBST(GIMP_INTERFACE_AGE)
126 AC_SUBST(GIMP_BINARY_AGE)
127 AC_SUBST(GIMP_VERSION)
128 AC_SUBST(GIMP_REAL_VERSION)
129 AC_SUBST(GIMP_API_VERSION)
130 AC_SUBST(GIMP_APP_VERSION)
131 AC_SUBST(GIMP_PLUGIN_VERSION)
132 AC_SUBST(GIMP_TOOL_VERSION)
133 AC_SUBST(GIMP_PKGCONFIG_VERSION)
134 AC_SUBST(GIMP_DATA_VERSION)
135 AC_SUBST(GIMP_SYSCONF_VERSION)
136 AC_SUBST(GIMP_USER_VERSION)
137 AC_SUBST(GIMP_UNSTABLE)
138 AC_SUBST(GIMP_FULL_NAME)
140 # Version strings used in some source, though it seems unnecessary to
141 # declare them in the public API (libgimpbase/gimpversion.h).
142 AC_DEFINE(GIMP_PKGCONFIG_VERSION, "gimp_pkgconfig_version",
143           [libgimp pkg-config version])
144 AC_DEFINE(GIMP_TOOL_VERSION, "gimp_tool_version",
145           [GIMP tools version])
147 # These are used for substitution (.pc, INSTALL, etc.).
148 APPSTREAM_GLIB_REQUIRED_VERSION=appstream_glib_required_version
149 ATK_REQUIRED_VERSION=atk_required_version
150 BABL_REQUIRED_VERSION=babl_required_version
151 CAIRO_REQUIRED_VERSION=cairo_required_version
152 CAIRO_PDF_REQUIRED_VERSION=cairo_pdf_required_version
153 FONTCONFIG_REQUIRED_VERSION=fontconfig_required_version
154 FREETYPE2_REQUIRED_VERSION=freetype2_required_version
155 GDK_PIXBUF_REQUIRED_VERSION=gdk_pixbuf_required_version
156 GEGL_MAJOR_MINOR_VERSION=gegl_major_minor_version
157 GEGL_REQUIRED_VERSION=gegl_required_version
158 GEXIV2_REQUIRED_VERSION=gexiv2_required_version
159 GLIB_REQUIRED_VERSION=glib_required_version
160 GTK_REQUIRED_VERSION=gtk_required_version
161 GTK_WIN32_RECOMMENDED_VERSION=gtk_win32_recommended_version
162 HARFBUZZ_REQUIRED_VERSION=harfbuzz_required_version
163 INTLTOOL_REQUIRED_VERSION=intltool_required_version
164 LCMS_REQUIRED_VERSION=lcms_required_version
165 LIBHEIF_REQUIRED_VERSION=libheif_required_version
166 LIBLZMA_REQUIRED_VERSION=liblzma_required_version
167 LIBMYPAINT_REQUIRED_VERSION=libmypaint_required_version
168 LIBPNG_REQUIRED_VERSION=libpng_required_version
169 OPENEXR_REQUIRED_VERSION=openexr_required_version
170 OPENJPEG_REQUIRED_VERSION=openjpeg_required_version
171 PANGOCAIRO_REQUIRED_VERSION=pangocairo_required_version
172 PERL_REQUIRED_VERSION=perl_required_version
173 POPPLER_REQUIRED_VERSION=poppler_required_version
174 POPPLER_DATA_REQUIRED_VERSION=poppler_data_required_version
175 PYTHON2_REQUIRED_VERSION=python2_required_version
176 RSVG_REQUIRED_VERSION=rsvg_required_version
177 WEBKITGTK_REQUIRED_VERSION=webkitgtk_required_version
178 WEBP_REQUIRED_VERSION=webp_required_version
179 WMF_REQUIRED_VERSION=wmf_required_version
180 XGETTEXT_REQUIRED_VERSION=xgettext_required_version
181 AC_SUBST(APPSTREAM_GLIB_REQUIRED_VERSION)
182 AC_SUBST(ATK_REQUIRED_VERSION)
183 AC_SUBST(BABL_REQUIRED_VERSION)
184 AC_SUBST(CAIRO_REQUIRED_VERSION)
185 AC_SUBST(CAIRO_PDF_REQUIRED_VERSION)
186 AC_SUBST(FONTCONFIG_REQUIRED_VERSION)
187 AC_SUBST(FREETYPE2_REQUIRED_VERSION)
188 AC_SUBST(GDK_PIXBUF_REQUIRED_VERSION)
189 AC_SUBST(GEGL_MAJOR_MINOR_VERSION)
190 AC_SUBST(GEGL_REQUIRED_VERSION)
191 AC_SUBST(GEXIV2_REQUIRED_VERSION)
192 AC_SUBST(GLIB_REQUIRED_VERSION)
193 AC_SUBST(GTK_REQUIRED_VERSION)
194 AC_SUBST(GTK_WIN32_RECOMMENDED_VERSION)
195 AC_SUBST(HARFBUZZ_REQUIRED_VERSION)
196 AC_SUBST(INTLTOOL_REQUIRED_VERSION)
197 AC_SUBST(LCMS_REQUIRED_VERSION)
198 AC_SUBST(LIBHEIF_REQUIRED_VERSION)
199 AC_SUBST(LIBLZMA_REQUIRED_VERSION)
200 AC_SUBST(LIBMYPAINT_REQUIRED_VERSION)
201 AC_SUBST(LIBPNG_REQUIRED_VERSION)
202 AC_SUBST(OPENEXR_REQUIRED_VERSION)
203 AC_SUBST(OPENJPEG_REQUIRED_VERSION)
204 AC_SUBST(PANGOCAIRO_REQUIRED_VERSION)
205 AC_SUBST(PERL_REQUIRED_VERSION)
206 AC_SUBST(POPPLER_REQUIRED_VERSION)
207 AC_SUBST(POPPLER_DATA_REQUIRED_VERSION)
208 AC_SUBST(PYTHON2_REQUIRED_VERSION)
209 AC_SUBST(RSVG_REQUIRED_VERSION)
210 AC_SUBST(WEBKITGTK_REQUIRED_VERSION)
211 AC_SUBST(WEBP_REQUIRED_VERSION)
212 AC_SUBST(WMF_REQUIRED_VERSION)
213 AC_SUBST(XGETTEXT_REQUIRED_VERSION)
215 # The symbol GIMP_UNSTABLE is defined above for substitution in
216 # Makefiles and conditionally defined here as a preprocessor symbol
217 # and automake conditional.
218 if test "x$GIMP_UNSTABLE" = "xyes"; then
219   AC_DEFINE(GIMP_UNSTABLE, 1,
220             [Define to 1 if this is an unstable version of GIMP])
222 AM_CONDITIONAL(GIMP_UNSTABLE, test "x$GIMP_UNSTABLE" = "xyes")
225 # libtool versioning
226 m4_define([lt_current], [m4_eval(100 * gimp_minor_version + gimp_micro_version - gimp_interface_age)])
227 m4_define([lt_revision], [gimp_interface_age])
228 m4_define([lt_age], [m4_eval(gimp_binary_age - gimp_interface_age)])
229 LT_VERSION_INFO="lt_current:lt_revision:lt_age"
230 LT_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
231 AC_SUBST(LT_VERSION_INFO)
232 AC_SUBST(LT_CURRENT_MINUS_AGE)
235 # gettext i18n support
236 GETTEXT_PACKAGE=gimp30
237 AC_SUBST(GETTEXT_PACKAGE)
238 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
239                    [The prefix for our gettext translation domains.])
241 # work around intltool-update issues during 'make distcheck'
242 AS_IF([test "x$0" != "x./configure"], [
243         AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
246 # Determine a C compiler to use
247 AC_PROG_CC
248 AX_PROG_CC_FOR_BUILD
249 # Works around a bug in AX_PROG_CC_FOR_BUILD for build with MinGW on
250 # Windows. See bug 780270, comment 18.
251 case "$build_os" in
252   cygwin*|mingw32*|mingw64*)    BUILD_EXEEXT=.exe ;;
253 esac
254 AM_PROG_CC_C_O
256 # Determine a C++ compiler to use
257 AC_PROG_CXX
258 AX_CXX_COMPILE_STDCXX([14], , [mandatory])
260 # Initialize libtool
261 LT_PREREQ([2.2])
262 LT_INIT([disable-static win32-dll])
264 AM_PROG_AS
266 # Initialize maintainer mode
267 AM_MAINTAINER_MODE([enable])
269 # Check for pkg-config
270 PKG_PROG_PKG_CONFIG(0.16)
273 #########################
274 # Check host architecture
275 #########################
277 AC_CANONICAL_HOST
279 AC_MSG_CHECKING([for host type])
280 AC_MSG_RESULT([$host])
282 AC_MSG_CHECKING([for host processor])
283 case "$host_cpu" in
284   i*86)
285     have_x86=yes
286     AC_DEFINE(ARCH_X86, 1, [Define to 1 if you are compiling for ix86.])
287     AC_MSG_RESULT([x86])
288     ;;
289   x86_64)
290     have_x86=yes
291     AC_DEFINE(ARCH_X86, 1, [Define to 1 if you are compiling for ix86.])
292     AC_DEFINE(ARCH_X86_64, 1, [Define to 1 if you are compiling for amd64.])
293     AC_MSG_RESULT([x86-64])
294     ;;
295   ppc | powerpc)
296     have_ppc=yes
297     AC_DEFINE(ARCH_PPC, 1, [Define to 1 if you are compiling for PowerPC.])
298     AC_MSG_RESULT([PowerPC])
299     ;;
300   ppc64 | powerpc64)
301     have_ppc=yes
302     AC_DEFINE(ARCH_PPC, 1, [Define to 1 if you are compiling for PowerPC.])
303     AC_DEFINE(ARCH_PPC64, 1, [Define to 1 if you are compiling for PowerPC64.])
304     AC_MSG_RESULT([64-bit PowerPC])
305     ;;
306   *)
307     AC_MSG_RESULT([unknown])
308     ;;
309 esac
312 #################
313 # Check for Win32
314 #################
316 AC_MSG_CHECKING([if compiling for Win32])
317 case "$host_os" in
318   mingw* | cygwin*)
319     platform_win32=yes
320     ;;
321   *)
322     platform_win32=no
323     ;;
324 esac
325 AC_MSG_RESULT([$platform_win32])
326 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
328 PATHSEP=':'
329 os_win32=no
330 if test "x$platform_win32" != xno; then
331   AC_MSG_CHECKING([if this is native Win32])
332   case "$host_os" in
333     mingw*)
334       os_win32=yes
335       case "$host_cpu" in
336         x86_64)
337         ;;
338         *)
339         WIN32_LARGE_ADDRESS_AWARE='-Wl,--large-address-aware'
340         ;;
341       esac
342       PATHSEP=';'
343       ;;
344     *)
345       ;;
346   esac
347   AC_MSG_RESULT([$os_win32])
349 AC_SUBST(WIN32_LARGE_ADDRESS_AWARE)
350 AC_SUBST(PATHSEP)
351 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
352 AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes")
354 if test "$os_win32" = "yes"; then
355   AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
356   AC_CHECK_TOOL(WINDRES, windres, :)
357 else
358   WINDRES=":"
361 AM_CONDITIONAL(MS_LIB_AVAILABLE, test "x$ms_librarian" = xyes)
362 AM_CONDITIONAL(HAVE_WINDRES, test "x$WINDRES" != "x:")
364 AC_SUBST(WINDRES)
367 ####################
368 # Check for Mac OS X
369 ####################
371 platform_osx=no
372 AC_MSG_CHECKING([if compiling for Mac OS X])
373 case "$host_os" in
374   darwin*)
375      AC_MSG_RESULT(yes)
376      AC_DEFINE(PLATFORM_OSX, 1, [define to 1 if compiling for Mac OS X])
377      platform_osx=yes
378      ;;
379   *)
380      ;;
381 esac
382 AC_MSG_RESULT($platform_osx)
383 AM_CONDITIONAL(PLATFORM_OSX, test "x$platform_osx" = xyes)
386 ###############
387 # Generic stuff
388 ###############
390 # Checks for programs.
391 AC_PROG_INSTALL
392 AC_PROG_MAKE_SET
393 AC_PROG_LN_S
395 # Large file support for the swap file
396 AC_SYS_LARGEFILE
398 AC_MSG_CHECKING([whether to turn on debugging])
399 AC_ARG_ENABLE(debug,
400               [  --enable-debug          turn on debugging (default=no)],
401               if eval "test x$enable_debug = xyes"; then
402                 DEBUGFLAG="-g"
403               fi)
405 if test -n "$DEBUGFLAG"; then
406   AC_MSG_RESULT([yes])
407   CFLAGS="$DEBUGFLAG $CFLAGS"
408 else
409   AC_MSG_RESULT([no])
412 AC_MSG_CHECKING([whether to turn on profiling])
413 AC_ARG_ENABLE(profile,
414               [  --enable-profile        turn on profiling (default=no)],
415               if eval "test x$enable_profile = xyes"; then
416                 PROFFLAG="-pg"
417               fi)
419 if test -n "$PROFFLAG"; then
420   AC_MSG_RESULT([yes])
421   CFLAGS="$PROFFLAG $CFLAGS"
422 else
423   AC_MSG_RESULT([no])
426 AC_ARG_ENABLE(ansi,
427               [  --enable-ansi           turn on strict ansi (default=no)],,
428               enable_ansi=no)
430 changequote(,)dnl
431 if eval "test x$GCC = xyes"; then
432   case " $CFLAGS " in
433   *[\ \ ]-Wall[\ \      ]*) ;;
434   *) CFLAGS="$CFLAGS -Wall" ;;
435   esac
437   if test "x$enable_ansi" = "xyes"; then
438     case " $CFLAGS " in
439     *[\ \       ]-ansi[\ \      ]*) ;;
440     *) CFLAGS="$CFLAGS -ansi" ;;
441     esac
443     case " $CFLAGS " in
444     *[\ \       ]-pedantic[\ \  ]*) ;;
445     *) CFLAGS="$CFLAGS -pedantic" ;;
446     esac
447   fi
449 changequote([,])dnl
452 # If possible, warn if C99isms are used
453 GIMP_DETECT_CFLAGS(extra_warnings, '-Wdeclaration-after-statement')
454 CFLAGS="$CFLAGS $extra_warnings"
456 GIMP_DETECT_CFLAGS(extra_warnings, '-Wmissing-prototypes')
457 CFLAGS="$CFLAGS $extra_warnings"
459 # We really don't want anyone using code with missing prototypes, which
460 # can cause random behavior. If compile breaks due to the following,
461 # come to us and we will point you to a newer version which works.
463 GIMP_DETECT_CFLAGS(extra_warnings, '-Werror=missing-prototypes')
464 CFLAGS="$CFLAGS $extra_warnings"
466 GIMP_DETECT_CFLAGS(extra_warnings, '-Wstrict-prototypes')
467 CFLAGS="$CFLAGS $extra_warnings"
469 GIMP_DETECT_CFLAGS(extra_warnings, '-Wmissing-declarations')
470 CFLAGS="$CFLAGS $extra_warnings"
472 GIMP_DETECT_CFLAGS(extra_warnings, '-Winit-self')
473 CFLAGS="$CFLAGS $extra_warnings"
475 GIMP_DETECT_CFLAGS(extra_warnings, '-Wpointer-arith')
476 CFLAGS="$CFLAGS $extra_warnings"
478 GIMP_DETECT_CFLAGS(extra_warnings, '-Wold-style-definition')
479 CFLAGS="$CFLAGS $extra_warnings"
481 GIMP_DETECT_CFLAGS(extra_warnings, '-Wmissing-format-attribute')
482 CFLAGS="$CFLAGS $extra_warnings"
484 GIMP_DETECT_CFLAGS(extra_warnings, '-Wformat-security')
485 CFLAGS="$CFLAGS $extra_warnings"
487 GIMP_DETECT_CFLAGS(extra_warnings, '-Wlogical-op')
488 CFLAGS="$CFLAGS $extra_warnings"
490 GIMP_DETECT_CFLAGS(extra_warnings, '-Wtype-limits')
491 CFLAGS="$CFLAGS $extra_warnings"
493 GIMP_DETECT_CFLAGS(extra_warnings, '-fno-common')
494 CFLAGS="$CFLAGS $extra_warnings"
496 GIMP_DETECT_CFLAGS(extra_warnings, '-fdiagnostics-show-option')
497 CFLAGS="$CFLAGS $extra_warnings"
499 GIMP_DETECT_CFLAGS(extra_warnings, '-Wreturn-type')
500 CFLAGS="$CFLAGS $extra_warnings"
502 # -Wreturn-type warns on forgotten return on non-void functions,
503 # but not of g_return_if_fail() on non-void functions.
504 # -Wsystem-headers is needed for that.
505 # Unfortunately it pulls tons of warnings on some systems.
506 # So we comment out for now.
507 # GIMP_DETECT_CFLAGS(extra_warnings, '-Wsystem-headers')
508 # CFLAGS="$CFLAGS $extra_warnings"
510 # Extra optimization flags for super performance
511 GIMP_DETECT_CFLAGS(extra_warnings, '--omg-optimized')
512 CFLAGS="$CFLAGS $extra_warnings"
514 GIMP_DETECT_CFLAGS(extra_warnings, '--disable-instructions')
515 CFLAGS="$CFLAGS $extra_warnings"
518 # Ensure MSVC-compatible struct packing convention is used when
519 # compiling for Win32 with gcc.
520 # What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
521 # gcc2 uses "-fnative-struct".
522 if test "x$os_win32" = xyes; then
523   if test "x$GCC" = xyes; then
524     msnative_struct=''
525     AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
526     if test -z "$ac_cv_prog_CC"; then
527       our_gcc="$CC"
528     else
529       our_gcc="$ac_cv_prog_CC"
530     fi
531     case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
532       2.)
533         if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
534           msnative_struct='-fnative-struct'
535         fi
536         ;;
537       *)
538         if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
539           msnative_struct='-mms-bitfields'
540         fi
541         ;;
542     esac
543     if test "x$msnative_struct" = x ; then
544       AC_MSG_RESULT([no way])
545       AC_MSG_WARN([build will be incompatible with GTK+ DLLs])
546     else
547       CFLAGS="$CFLAGS $msnative_struct"
548       AC_MSG_RESULT([${msnative_struct}])
549     fi
550   fi
553 if test "x$GCC" = xyes; then
554   gcc_version=`$CC -v 2>&1|grep 'gcc version'|sed -e 's/.*gcc version \([[0-9.]]\+\)[[^0-9.]].*/\1/'`
555   if test "x$gcc_version" = "x7.2.0" ; then
556     warning_gcc="
557 WARNING: GCC 7.2.0 has a serious bug affecting GEGL/GIMP. We advise
558          against using this version of the compiler (previous and
559          further versions are fine).
560          See https://bugzilla.gnome.org/show_bug.cgi?id=787222"
561   fi
562   # For GCC, use -v which has more information than --version.
563   CC_VERSION="\\\\t`$CC -v 2>&1 | sed -e 's/$/\\\\n\\\\t/g' | tr -d '\n'`"
564 else
565   # This is the list of common options used by autotools to check
566   # versions for various compilers.
567   CC_VERSION="\\\\t`$CC --version 2>&1 | sed -e 's/$/\\\\n\\\\t/g' | tr -d '\n'`"
568   if test $? != 0; then
569     CC_VERSION="\\\\t`$CC -v 2>&1` | sed -e 's/$/\\\\n\\\\t/g' | tr -d '\n'"
570     if test $? != 0; then
571       CC_VERSION="\\\\t`$CC -V 2>&1` | sed -e 's/$/\\\\n\\\\t/g' | tr -d '\n'"
572       if test $? != 0; then
573         CC_VERSION="\\\\t`$CC -qversion 2>&1` | sed -e 's/$/\\\\n\\\\t/g' | tr -d '\n'"
574       fi
575     fi
576   fi
578 AC_SUBST(CC_VERSION)
580 AC_HEADER_STDC
581 AC_HEADER_SYS_WAIT
582 AC_HEADER_TIME
584 AC_CHECK_HEADERS(execinfo.h fcntl.h sys/param.h sys/prctl.h sys/thr.h sys/time.h sys/times.h sys/wait.h unistd.h)
585 AC_CHECK_FUNCS(backtrace, , AC_CHECK_LIB(execinfo, backtrace))
587 AC_TYPE_PID_T
588 AC_FUNC_VPRINTF
590 AC_FUNC_ALLOCA
592 # check some more funcs
593 AC_CHECK_FUNCS(fsync)
594 AC_CHECK_FUNCS(difftime mmap)
595 AC_CHECK_FUNCS(thr_self)
598 AM_BINRELOC
601 # _NL_MEASUREMENT_MEASUREMENT is an enum and not a define
602 AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
603 AC_LINK_IFELSE(
604   [AC_LANG_PROGRAM(
605     [[#include <langinfo.h>]],
606     [[char c = *((unsigned char *)  nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));]])],
607   [nl_ok=yes],
608   [nl_ok=no])
609 AC_MSG_RESULT($nl_ok)
610 if test "$nl_ok" = "yes"; then
611   AC_DEFINE(HAVE__NL_MEASUREMENT_MEASUREMENT, 1,
612             [Define to 1 if _NL_MEASUREMENT_MEASUREMENT is available])
615 # Macro to keep track of failed dependencies.
617 required_deps=''
619 # To add a required dependency error, call: add_deps_error([dependency]).
620 # If details about the dependency are needed:
621 # add_deps_error([dependency], [first line, second line])
622 m4_define([add_deps_error], [
623   AC_MSG_NOTICE([Eeeeeeeeeeeeeeeeeeeeek! Missing dep: $1])
624   required_deps="$required_deps
625   - Error: missing dependency $1"
626   m4_foreach([more], [$2], [
627   required_deps="$required_deps
628       *** more"])])
630 ######################
631 # Internationalisation
632 ######################
634 IT_PROG_INTLTOOL(intltool_required_version)
635 AM_GLIB_GNU_GETTEXT
637 # Testing xgettext version since we had some problem with localizing script-fu. See bug 720052.
638 AC_MSG_CHECKING([for xgettext version (>= xgettext_required_version)])
639 XGETTEXT_REQUIRED_VERSION_MAJOR=`echo $XGETTEXT_REQUIRED_VERSION | awk -F. '{ print $ 1; }'`
640 XGETTEXT_REQUIRED_VERSION_MINOR_1=`echo $XGETTEXT_REQUIRED_VERSION | awk -F. '{ print $ 2; }'`
642 XGETTEXT_APPLIED_VERSION=`$XGETTEXT --version | head -1 | cut -d" " -f4`
643 XGETTEXT_APPLIED_VERSION_MAJOR=`echo $XGETTEXT_APPLIED_VERSION | awk -F. '{ print $ 1; }'`
644 XGETTEXT_APPLIED_VERSION_MINOR_1=`echo $XGETTEXT_APPLIED_VERSION | awk -F. '{ print $ 2; }'`
646 have_required_xgettext="no"
647 if test -n "$XGETTEXT_APPLIED_VERSION_MAJOR"; then
648     if test "$XGETTEXT_REQUIRED_VERSION_MAJOR" -lt "$XGETTEXT_APPLIED_VERSION_MAJOR"; then
649         have_required_xgettext="yes"
650     elif test "$XGETTEXT_REQUIRED_VERSION_MAJOR" -eq "$XGETTEXT_APPLIED_VERSION_MAJOR"; then
651         if test -n "$XGETTEXT_APPLIED_VERSION_MINOR_1"; then
652             if test "$XGETTEXT_REQUIRED_VERSION_MINOR_1" -le "$XGETTEXT_APPLIED_VERSION_MINOR_1"; then
653                 have_required_xgettext="yes"
654             fi
655         fi
656     fi
658 AC_MSG_RESULT($have_required_xgettext)
660 if test "x$have_required_xgettext" = "xno"; then
661     add_deps_error([xgettext], [xgettext >= xgettext_required_version])
664 ###########
665 # iso-codes
666 ###########
668 AC_MSG_CHECKING([for iso-codes])
669 PKG_CHECK_EXISTS(iso-codes,
670   have_iso_codes="yes"
671   AC_DEFINE(HAVE_ISO_CODES, 1,
672             [Define to 1 if the iso-codes package is available])
673   ISO_CODES_PREFIX=`$PKG_CONFIG --variable=prefix iso-codes`
674   ISO_CODES_LOCATION="$ISO_CODES_PREFIX/share/xml/iso-codes"
675   ISO_CODES_LOCALEDIR="$ISO_CODES_PREFIX/$DATADIRNAME/locale",
676   have_iso_codes="no (iso-codes package not found)")
677 AC_MSG_RESULT($have_iso_codes)
679 AC_SUBST(ISO_CODES_LOCATION)
680 AC_SUBST(ISO_CODES_LOCALEDIR)
683 ###############################
684 # Checks for required libraries
685 ###############################
687 PKG_CHECK_MODULES(BABL, [babl >= babl_required_version],,
688                   [add_deps_error([babl >= babl_required_version])])
689 PKG_CHECK_MODULES(GEGL, gegl-gegl_major_minor_version >= gegl_required_version,,
690                   [add_deps_error([gegl-gegl_major_minor_version >= gegl_required_version])])
691 PKG_CHECK_MODULES(ATK, atk >= atk_required_version,,
692                   [add_deps_error([atk >= atk_required_version])])
694 # glib 2.56.0 and 2.56.1 have a bad bug on Win32, breaking the file
695 # chooser dialogs. This has been fixed, but no release made yet. When
696 # 2.56.2 is released, the additional test for these broken versions can
697 # be removed and we can bump the requirement to glib 2.56.2.
698 AM_PATH_GLIB_2_0(glib_required_version,
699                  [if test "x$platform_win32" = "xyes"; then
700                    PKG_CHECK_MODULES(GLIB_WIN_BUG, glib-2.0 >= 2.56.0 glib-2.0 < 2.56.2,
701                                      [add_deps_error([glib >= glib_required_version except glib 2.56.0 and 2.56.1 (broken on Win32 - bug 795855)])],:)
702                  fi],
703                  [add_deps_error([glib >= glib_required_version],
704                                  [Test for GLIB failed])],
705                  gobject)
707 PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0,,
708                   [add_deps_error([gmodule-no-export-2.0])])
710 PKG_CHECK_MODULES(GIO, gio-2.0,,
711                   [add_deps_error([gio-2.0])])
713 if test "x$os_win32" = "xyes"; then
714   PKG_CHECK_MODULES(GIO_WINDOWS, gio-windows-2.0,,
715                     [add_deps_error([gio-windows-2.0])])
716 else
717   PKG_CHECK_MODULES(GIO_UNIX, gio-unix-2.0,,
718                     [add_deps_error([gio-unix-2.0])])
721 AC_MSG_CHECKING([for glib-networking (GIO TLS implementation)])
722 gimp_save_CFLAGS="$CFLAGS"
723 gimp_save_LIBS="$LIBS"
724 CFLAGS="$CFLAGS $GIO_CFLAGS"
725 LIBS="$LIBS $GIO_LIBS"
726 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <gio/gio.h>],
727                                [return !g_tls_backend_supports_tls (g_tls_backend_get_default ());])],
728               [have_glib_networking="yes"],
729               [have_glib_networking="no"],
730               [have_glib_networking="unknown (cross-compiling)"])
731 CFLAGS="$gimp_save_CFLAGS"
732 LIBS="$gimp_save_LIBS"
733 AC_MSG_RESULT($have_glib_networking)
735 if test "x$have_glib_networking" = "xno"; then
736   add_deps_error([glib-networking],
737       [Test for glib-networking failed. This is required.])
738 elif test "x$have_glib_networking" != "xyes"; then
739   warning_glib_networking="
740 WARNING: Test for glib-networking cannot be performed while cross-compiling.
741          Make sure glib-networking is installed, otherwise GIMP will not be able
742          to display the remote help pages through the help browser, nor will it
743          be able to open remote HTTPS (or other protocol using SSL/TLS) files.
744          HTTPS is becoming the expected standard and should not be considered
745          optional anymore."
748 # AM_PATH_GLIB_2_0 already fills in the variable GLIB_COMPILE_RESOURCES.
749 # Unfortunately it looks it up using $PKG_CONFIG, which search in
750 # target-installed libraries, hence it would return a tool for the
751 # target architecture in case of cross-compilation (which can't be run
752 # during build, unless there is some compatibility layer in the OS).
753 # Therefore we make our own check.
754 AC_MSG_CHECKING([for native glib-compile-resources])
755 if test -z "$HOST_GLIB_COMPILE_RESOURCES"; then
756   # Do not use $PKG_CONFIG as it will search target files.
757   HOST_GLIB_COMPILE_RESOURCES=`pkg-config --variable=glib_compile_resources gio-2.0`
758   if test -z "$HOST_GLIB_COMPILE_RESOURCES"; then
759     # As fallback, search in path.
760     AC_PATH_PROG(HOST_GLIB_COMPILE_RESOURCES, glib-compile-resources, no)
761     if test "x$HOST_GLIB_COMPILE_RESOURCES" = xno; then
762       add_deps_error([glib-compile-resources],
763                      [Could not find glib-compile-resources in your PATH.])
764     fi
765   fi
767 AC_MSG_RESULT($HOST_GLIB_COMPILE_RESOURCES)
768 AC_SUBST(HOST_GLIB_COMPILE_RESOURCES)
770 AC_PATH_PROG(GDBUS_CODEGEN, gdbus-codegen, no)
771 if test "x$GDBUS_CODEGEN" = xno; then
772   add_deps_error([gdbus-codegen], [Could not find gdbus-codegen in your PATH.])
775 AC_MSG_CHECKING([if GLib is version 2.57.0 or newer])
776 if $PKG_CONFIG --atleast-version=2.57.0 glib-2.0; then
777   have_glib_2_57=yes
778 else
779   have_glib_2_57=no
781 AC_MSG_RESULT($have_glib_2_57)
783 AC_PATH_PROG(GEGL, gegl, no)
784 if test "x$GEGL" = xno; then
785   add_deps_error([gegl], [Could not find native gegl executable in your PATH.])
789 # Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
790 gimp_save_LIBS=$LIBS
791 LIBS="$LIBS $GLIB_LIBS"
792 AC_CHECK_FUNCS(bind_textdomain_codeset,,
793   add_deps_error([bind_textdomain_codeset()],
794                  [Check for bind_textdomain_codeset() failed! This is required.]))
795 LIBS=$gimp_save_LIBS
798 AC_PATH_XTRA
800 AM_PATH_GTK_3_0(gtk_required_version, :,
801   add_deps_error([gtk+-3.0 >= gtk_required_version],
802                  [Test for GTK+ failed.]))
804 AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
805 if test "x$GTK_UPDATE_ICON_CACHE" = xno; then
806   add_deps_error([gtk-update-icon-cache],
807                  [Could not find gtk-update-icon-cache in your PATH.])
810 PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= gdk_pixbuf_required_version,,
811                   [add_deps_error([gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])])
813 AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
814 if test "x$GDK_PIXBUF_CSOURCE" = xno; then
815   add_deps_error([gdk-pixbuf-csource],
816                  [Could not find gdk-pixbuf-csource in your PATH.])
819 PKG_CHECK_MODULES(CAIRO, cairo >= cairo_required_version,,
820                   [add_deps_error([cairo >= cairo_required_version])])
822 PKG_CHECK_MODULES(PANGOCAIRO,
823                   [pangocairo >= pangocairo_required_version pangoft2], :,
824                   [add_deps_error([pangocairo >= pangocairo_required_version and pangoft2],
825                                   [We require Pango with the optional support for Cairo compiled in.])])
827 gimp_save_CFLAGS=$CFLAGS
828 CFLAGS="$PANGOCAIRO_CFLAGS $CFLAGS"
830 # Windows platform had a few bugs fixed in earlier fontconfig.
831 # The bugs are serious enough (for instance very slow startups at each
832 # GIMP start, but also slowness when closing, broken font features,
833 # etc.) that we should bump the requirement for Win32.
834 # See bugs 708110 (fontconfig 2.11.0), 703331 (2.11.1) and 782676
835 # (2.12.4).
836 PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= fontconfig_required_version,,
837                   [add_deps_error([fontconfig >= fontconfig_required_version])])
839 AC_MSG_CHECKING([if Pango is version 1.43.0 or newer])
840 if $PKG_CONFIG --atleast-version=1.43.0 pango; then
841   have_pango_1_43=yes
842 else
843   have_pango_1_43=no
845 AC_MSG_RESULT($have_pango_1_43)
847 CFLAGS="$PANGOCAIRO_CFLAGS $CFLAGS"
849 AC_MSG_CHECKING([if Pango is built with a recent fontconfig])
850 AC_COMPILE_IFELSE(
851   [AC_LANG_PROGRAM(
852     [[#include <fontconfig/fontconfig.h>]],
853     [[FcObjectSet *os; os = FcObjectSetBuild (FC_FAMILY, FC_WIDTH);]])],
854   [fontconfig_ok=yes],
855   [fontconfig_ok=no])
856 AC_MSG_RESULT($fontconfig_ok)
858 CFLAGS=$gimp_save_CFLAGS
860 if test "x$fontconfig_ok" = xno; then
861   AC_MSG_ERROR([
862 *** You have a fontconfig >= fontconfig_required_version installed on your system, but your
863 *** Pango library is using an older version. This old version is probably in
864 *** /usr/X11R6. Look at the above output, and note that the result for
865 *** FONTCONFIG_CFLAGS is not in the result for PANGOCAIRO_CFLAGS, and that
866 *** there is likely an extra -I line, other than the ones for GLIB,
867 *** Freetype, and Pango itself. That's where your old fontconfig files are.
868 *** Rebuild pango, and make sure that it uses the newer fontconfig. The
869 *** easiest way be sure of this is to simply get rid of the old fontconfig.
870 *** When you rebuild pango, make sure the result for FONTCONFIG_CFLAGS is
871 *** the same as the result here.])
875 PKG_CHECK_MODULES(FREETYPE, freetype2 >= freetype2_required_version,,
876                   [add_deps_error([freetype2_required_version >= freetype2_required_version])])
878 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz >= harfbuzz_required_version,,
879                  [add_deps_error([harfbuzz >= harfbuzz_required_version])])
881 PKG_CHECK_MODULES(GEXIV2, gexiv2 >= gexiv2_required_version,,
882                  [add_deps_error([gexiv2 >= gexiv2_required_version])])
884 #################################
885 # Check for debug console (Win32)
886 #################################
888 AC_ARG_ENABLE(win32-debug-console,
889               [  --enable-win32-debug-console
890                           open a console when starting the program
891                           (default=auto)],,
892               enable_win32_debug_console=auto)
894 AC_MSG_CHECKING([if GIMP should open a debug console at start])
895 if test "x$platform_win32" != "xyes"; then
896    enable_win32_debug_console=no
897 elif test "x$enable_win32_debug_console" != xno &&
898      test "x$enable_win32_debug_console" != xyes; then
899   # By default, we enable the debug console only for unstable builds.
900    enable_win32_debug_console=gimp_unstable
903 if test "x$enable_win32_debug_console" = "xyes"; then
904   AC_DEFINE(ENABLE_WIN32_DEBUG_CONSOLE, 1,
905             [Define to 1 if GIMP should open a debug console at start])
907 AC_MSG_RESULT([$enable_win32_debug_console])
909 ######################################
910 # Check for 32-bit DLLs (Win32 64-bit)
911 ######################################
913 AC_ARG_WITH(win32-32bit-dll-folder,
914             [  --with-win32-32bit-dll-folder[=DIR]
915                           alternative folder with 32-bit versions of DLL libraries on Windows (default: 32/bin/)],,
916             with_win32_32bit_dll_folder="32/bin")
918 AC_MSG_CHECKING([the alternative folder containing 32-bit DLLs on Windows])
919 if test "x$platform_win32" = "xyes"; then
920   case "$host_cpu" in
921     x86_64)
922     ;;
923     *)
924     with_win32_32bit_dll_folder="no"
925     ;;
926   esac
927 else
928     with_win32_32bit_dll_folder="no"
931 if test "x$with_win32_32bit_dll_folder" != "xno"; then
932   AC_DEFINE_UNQUOTED(WIN32_32BIT_DLL_FOLDER, "$with_win32_32bit_dll_folder",
933                      [Define if 32-bit versions of libraries are packaged in an alternative folder])
935 AC_MSG_RESULT([$with_win32_32bit_dll_folder])
937 #####################
938 # Check for Dr. Mingw
939 #####################
941 enable_drmingw="no"
942 if test "x$platform_win32" = "xyes"; then
943    # Check for Dr. Mingw
944    AC_CHECK_LIB(exchndl, ExcHndlSetLogFileNameA,
945                 [
946                  AC_DEFINE(HAVE_EXCHNDL, 1, [Define to 1 when Dr. MingW is available])
947                  LIBS="-lexchndl $LIBS"
948                  enable_drmingw="yes"
949                 ],
950                 [enable_drmingw="no (ExcHndl library missing)"]
951                )
953 AM_CONDITIONAL(HAVE_EXCHNDL, test "x$ac_cv_lib_exchndl_ExcHndlSetLogFileNameA" = "xyes")
955 ###########################
956 # Check for backtrace() API
957 ###########################
959 AC_CHECK_HEADERS([execinfo.h])
961 ##########################################
962 # Check for some special functions we need
963 ##########################################
965 AC_CHECK_HEADERS(math.h ieeefp.h)
967 # DU4 native cc currently needs -std1 for ANSI mode (instead of K&R)
968 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
969 gimp_save_LIBS=$LIBS
970 LIBS="$LIBS -lm"
971 AC_RUN_IFELSE(
972   [AC_LANG_SOURCE([[
973     #include <math.h>
974     int main (void) { return (log(1) != log(1.)); }]])],
975   [AC_MSG_RESULT(none needed)],
976   [gimp_save_CFLAGS=$CFLAGS
977    CFLAGS="$CFLAGS -std1"
978    AC_RUN_IFELSE(
979      [AC_LANG_SOURCE([[
980        #include <math.h>
981        int main (void) { return (log(1) != log(1.)); }]])],
982      [AC_MSG_RESULT(-std1)],
983      [AC_MSG_RESULT()
984       CFLAGS=$gimp_save_CFLAGS
985       AC_MSG_WARN([No ANSI prototypes found in library. (-std1 didn't work.)])],
986      [AC_MSG_RESULT])],
987   [AC_MSG_RESULT()])
989 # Check for finite or isfinite
990 AC_CHECK_FUNCS(finite, , [
991   AC_MSG_CHECKING(for finite in <math.h>)
992   AC_LINK_IFELSE(
993     [AC_LANG_PROGRAM(
994       [[#include <math.h>]],
995       [[double f = 0.0; finite (f)]])],
996     [AC_DEFINE(HAVE_FINITE, 1)
997      AC_MSG_RESULT(yes)],
998     [AC_MSG_RESULT(no)
999      AC_MSG_CHECKING(for isfinite in <math.h>)
1000      AC_LINK_IFELSE(
1001        [AC_LANG_PROGRAM(
1002          [[#include <math.h>]],
1003          [[float f = 0.0; isfinite(f)]])],
1004        [AC_DEFINE([HAVE_ISFINITE],[1],[Define to 1 if you have the isfinite function.])
1005         AC_MSG_RESULT(yes)],
1006        [AC_MSG_RESULT(no)])])])
1007 AC_SUBST(HAVE_FINITE)
1008 AC_SUBST(HAVE_ISFINITE)
1010 LIBS=$gimp_save_LIBS
1013 # check for rint
1014 AC_CHECK_FUNC(rint, AC_DEFINE(HAVE_RINT, 1,
1015                               [Define to 1 if you have the rint function.]), [
1016   AC_CHECK_LIB(m, rint, [
1017     AC_DEFINE(HAVE_RINT)])])
1020 # check for vfork
1021 AC_CHECK_FUNCS(vfork, ,)
1022 AC_SUBST(HAVE_VFORK)
1025 ##############################
1026 # Check for attributes we need
1027 ##############################
1029 AX_GCC_FUNC_ATTRIBUTE(destructor)
1031 #####################################################################
1032 # Check for extra libs needed for getaddrinfo, getnameinfo and socket
1033 #####################################################################
1035 gimp_save_LIBS=$LIBS
1036 LIBS=""
1038 AC_CHECK_FUNCS(getaddrinfo, , AC_CHECK_LIB(nsl, getaddrinfo))
1039 AC_CHECK_FUNCS(getnameinfo, , AC_CHECK_LIB(nsl, getnameinfo))
1040 AC_CHECK_LIB(socket, socket)
1042 SOCKET_LIBS="$LIBS"
1043 LIBS=$gimp_save_LIBS
1045 AC_SUBST(SOCKET_LIBS)
1047 ###################################
1048 # Check for Intel vector intrinsics
1049 ###################################
1050 intrinsics_save_CFLAGS="$CFLAGS"
1051 #FIXME: Check the CFLAGS separately
1052 GIMP_DETECT_CFLAGS(SSE_MATH_CFLAG, '-mfpmath=sse')
1053 GIMP_DETECT_CFLAGS(SSE2_CFLAG, '-msse2')
1054 SSE2_EXTRA_CFLAGS="$SSE_MATH_CFLAG $SSE2_CFLAG"
1055 CFLAGS="$intrinsics_save_CFLAGS $SSE2_EXTRA_CFLAGS"
1057 AC_MSG_CHECKING(whether we can compile SSE2 intrinsics)
1058 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <emmintrin.h>]],[[__m128i one = _mm_set1_epi32 (1);]])],
1059   AC_DEFINE(COMPILE_SSE2_INTRINISICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1060   AC_SUBST(SSE2_EXTRA_CFLAGS)
1061   AC_MSG_RESULT(yes)
1063   AC_MSG_RESULT(no)
1064   AC_MSG_WARN([SSE2 intrinsics not available.])
1068 GIMP_DETECT_CFLAGS(SSE4_1_CFLAG, '-msse4.1')
1069 SSE4_1_EXTRA_CFLAGS="$SSE_MATH_CFLAG $SSE4_1_CFLAG"
1070 CFLAGS="$intrinsics_save_CFLAGS $SSE4_1_EXTRA_CFLAGS"
1072 AC_MSG_CHECKING(whether we can compile SSE4.1 intrinsics)
1073 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <smmintrin.h>]],[[__v4sf a, b, c; c = _mm_blend_ps(a, b, 0x08);]])],
1074   AC_DEFINE(COMPILE_SSE4_1_INTRINISICS, 1, [Define to 1 if SSE4.1 intrinsics are available.])
1075   AC_SUBST(SSE4_1_EXTRA_CFLAGS)
1076   AC_MSG_RESULT(yes)
1078   AC_MSG_RESULT(no)
1079   AC_MSG_WARN([SSE4.1 intrinsics not available.])
1081 CFLAGS="$intrinsics_save_CFLAGS"
1084 ########################
1085 # Check for MMX assembly
1086 ########################
1088 AC_ARG_ENABLE(mmx,
1089   [  --enable-mmx            enable MMX support (default=auto)],,
1090   enable_mmx=$have_x86)
1092 AC_ARG_ENABLE(sse,
1093   [  --enable-sse            enable SSE support (default=auto)],,
1094   enable_sse=$enable_mmx)
1096 if test "x$enable_mmx" = xyes; then
1097   GIMP_DETECT_CFLAGS(MMX_EXTRA_CFLAGS, '-mmmx')
1098   SSE_EXTRA_CFLAGS=
1100   AC_MSG_CHECKING(whether we can compile MMX code)
1102   mmx_save_CFLAGS="$CFLAGS"
1103   CFLAGS="$mmx_save_CFLAGS $MMX_EXTRA_CFLAGS"
1105   AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[asm ("movq 0, %mm0");]])],
1107     AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.])
1108     AC_MSG_RESULT(yes)
1110     if test "x$enable_sse" = xyes; then
1111       GIMP_DETECT_CFLAGS(sse_flag, '-msse')
1112       SSE_EXTRA_CFLAGS="$MMX_EXTRA_CFLAGS $sse_flag"
1114       AC_MSG_CHECKING(whether we can compile SSE code)
1116       CFLAGS="$CFLAGS $sse_flag"
1118       AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[asm ("movntps %xmm0, 0");]])],
1119         AC_DEFINE(USE_SSE, 1, [Define to 1 if SSE assembly is available.])
1120         AC_MSG_RESULT(yes)
1121       ,
1122         enable_sse=no
1123         AC_MSG_RESULT(no)
1124         AC_MSG_WARN([The assembler does not support the SSE command set.])
1125       )
1127     fi
1128   ,
1129     enable_mmx=no
1130     AC_MSG_RESULT(no)
1131     AC_MSG_WARN([The assembler does not support the MMX command set.])
1132   )
1134   CFLAGS="$mmx_save_CFLAGS"
1136   AC_SUBST(MMX_EXTRA_CFLAGS)
1137   AC_SUBST(SSE_EXTRA_CFLAGS)
1141 ############################
1142 # Check for AltiVec assembly
1143 ############################
1145 AC_ARG_ENABLE(altivec,
1146   [  --enable-altivec        enable AltiVec support (default=auto)],,
1147   enable_altivec=$have_ppc)
1149 if test "x$enable_altivec" = xyes; then
1151   GIMP_DETECT_CFLAGS(altivec_flag, '-faltivec' '-maltivec -mabi=altivec')
1153   ALTIVEC_EXTRA_CFLAGS=
1154   case "$altivec_flag" in
1155     -maltivec*)
1156       altivec_save_CPPFLAGS="$CPPFLAGS"
1157       CPPFLAGS="$altivec_save_CPPFLAGS $altivec_flag"
1158       AC_CHECK_HEADERS(altivec.h, [ALTIVEC_EXTRA_CFLAGS="$altivec_flag"])
1159       CPPFLAGS="$altivec_save_CPPFLAGS"
1160       ;;
1161     *)
1162       ALTIVEC_EXTRA_CFLAGS="$altivec_flag"
1163       ;;
1164   esac
1165   AC_SUBST(ALTIVEC_EXTRA_CFLAGS)
1167   AC_MSG_CHECKING(whether we can compile AltiVec code)
1169   can_use_altivec=no
1170   if test -z "$ALTIVEC_EXTRA_CFLAGS"; then
1171     AC_MSG_RESULT(no)
1172     AC_MSG_WARN([The compiler does not support the AltiVec command set.])
1173   else
1174     case "$host_os" in
1175       darwin*)
1176         can_use_altivec=yes
1177         AC_DEFINE(HAVE_ALTIVEC_SYSCTL, 1,
1178          [Define to 1 if the altivec runtime test should use a sysctl.])
1179         ;;
1180       *)
1181         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[asm ("vand %v0, %v0, %v0");]])],
1182           can_use_altivec=yes, can_use_altivec=no)
1183         ;;
1184     esac
1185     AC_MSG_RESULT($can_use_altivec)
1187     if test "x$can_use_altivec" = "xyes"; then
1188       AC_DEFINE(USE_ALTIVEC, 1, [Define to 1 if AltiVec support is available.])
1189     else
1190       enable_altivec=no
1191       AC_MSG_WARN([The assembler does not support the AltiVec command set.])
1192     fi
1193   fi
1195   enable_altivec="$can_use_altivec"
1199 ###################################
1200 # Checks for shared memory handling
1201 ###################################
1203 # MacOS X has broken SysV shm
1204 case "$host_os" in
1205   darwin* | rhapsody* | machten*)
1206     shmdefault=posix
1207     ;;
1208   *)
1209     shmdefault=sysv
1210     ;;
1211 esac
1213 shmtype=auto
1214 AC_ARG_WITH(shm, [  --with-shm=none|sysv|posix|auto    shared memory transport type (default=auto)], shmtype=$with_shm)
1216 case $shmtype in
1217   none|sysv|posix) ;;
1218   auto) shmtype=$shmdefault ;;
1219   *) AC_MSG_ERROR([Invalid shared memory transport type: use none, sysv, posix, or auto.]);;
1220 esac
1223 if test "x$platform_win32" = "xyes"; then
1224   shmtype=win32
1225 elif test "x$shmtype" = "xsysv"; then
1226   AC_CHECK_HEADER(sys/ipc.h,
1227     [AC_DEFINE(HAVE_IPC_H, 1,
1228                [Define to 1 if you have the <sys/ipc.h> header file.])],
1229     no_sys_ipc=yes)
1230   AC_CHECK_HEADER(sys/shm.h,
1231     [AC_DEFINE(HAVE_SHM_H, 1,
1232                [Define to 1 if you have the <sys/shm.h> header file.])],
1233     no_sys_shm=yes)
1235   if test "$ac_cv_header_sys_shm_h" = "yes"; then
1236     AC_MSG_CHECKING(whether shmctl IPC_RMID allowes subsequent attaches)
1237     AC_RUN_IFELSE(
1238       [AC_LANG_SOURCE([[
1239         #include <sys/types.h>
1240         #include <sys/ipc.h>
1241         #include <sys/shm.h>
1242         int main()
1243         {
1244           int id;
1245           char *shmaddr;
1246         id = shmget (IPC_PRIVATE, 4, IPC_CREAT | 0600);
1247         if (id == -1)
1248           exit (2);
1249           shmaddr = shmat (id, 0, 0);
1250           shmctl (id, IPC_RMID, 0);
1251           if ((char*) shmat (id, 0, 0) == (char*) -1)
1252           {
1253             shmdt (shmaddr);
1254             exit (1);
1255           }
1256           shmdt (shmaddr);
1257           shmdt (shmaddr);
1258           exit (0);
1259         }
1260       ]])],
1261       [AC_DEFINE([IPC_RMID_DEFERRED_RELEASE],[1],
1262                  [Define to 1 if shared memory segments are released deferred.])
1263        AC_MSG_RESULT(yes)],
1264       [AC_MSG_RESULT(no)],
1265       [AC_MSG_RESULT(assuming no)])
1267     AC_DEFINE(USE_SYSV_SHM, 1, [Define to 1 to use SYSV shared memory])
1268   else
1269     shmtype=none
1270   fi
1271 elif test "x$shmtype" = "xposix"; then
1272   have_shm_open=no
1274   AC_CHECK_FUNC(shm_open, have_shm_open=yes)
1276   RT_LIBS=
1277   if test "$have_shm_open" != "yes"; then
1278     AC_CHECK_LIB(rt, shm_open, RT_LIBS="-lrt" have_shm_open=yes)
1279   fi
1280   AC_SUBST(RT_LIBS)
1282   AC_CHECK_HEADER(sys/mman.h,
1283     [AC_DEFINE(HAVE_MMAN_H, 1,
1284                [Define to 1 if you have the <sys/mman.h> header file.])],
1285     no_sys_mman=yes)
1287   if test "$ac_cv_func_mmap" = "yes" &&
1288      test "$ac_cv_header_sys_mman_h" = "yes" &&
1289      test "$have_shm_open" = "yes"; then
1290     AC_DEFINE(USE_POSIX_SHM, 1, [Define to 1 to use POSIX shared memory])
1291   else
1292     shmtype=none
1293   fi
1296 AC_MSG_CHECKING(for shared memory transport type)
1297 AC_MSG_RESULT($shmtype)
1300 ########################
1301 # Define a symbol prefix
1302 ########################
1304 AC_MSG_CHECKING([whether symbols are prefixed])
1306 case "$host_os" in
1307   mingw*)
1308     case "$host_cpu" in 
1309           x86_64) SYMPREFIX='' ;;
1310           *) SYMPREFIX='_' ;;
1311         esac
1312     ;;
1313   darwin* | rhapsody* | machten*)
1314     SYMPREFIX='_'
1315     ;;
1316   *)
1317     ;;
1318 esac
1320 if test -n "$SYMPREFIX"; then
1321   AC_MSG_RESULT([yes, with a $SYMPREFIX])
1322 else
1323   AC_MSG_RESULT(no)
1326 AC_SUBST(SYMPREFIX)
1329 ############################
1330 # Check for select and fdset
1331 ############################
1333 if test "x$os_win32" != xyes; then
1334   AC_MSG_CHECKING([fd_set and sys/select])
1335   AC_COMPILE_IFELSE(
1336     [AC_LANG_PROGRAM(
1337       [[#include <sys/types.h>]],
1338       [[fd_set readMask, writeMask;]])],
1339     [gimp_ok=yes],
1340     [gimp_ok=no])
1341   if test "x$gimp_ok" = xno; then
1342       AC_EGREP_HEADER(fd_mask, sys/select.h, gimp_ok=yes)
1343       if test "x$gimp_ok" = xyes; then
1344           AC_DEFINE(HAVE_SYS_SELECT_H, 1,
1345                     [Define to 1 if you have the <sys/select.h> header.])
1346       fi
1347   fi
1348   AC_MSG_RESULT($gimp_ok)
1349   if test "x$gimp_ok" = xno; then
1350       AC_DEFINE(NO_FD_SET, 1,
1351                 [Define to 1 if you don't have the fd_set typedef.])
1352   fi
1356 #############################
1357 # Threads and multi processor
1358 #############################
1360 AC_ARG_ENABLE(mp, [  --disable-mp            disable support for multiple processors])
1362 if test "x$enable_mp" != "xno"; then
1363   AC_DEFINE(ENABLE_MP, 1,
1364             [Define to 1 to enable support for multiple processors.])
1368 ################################
1369 # Some plug-ins are X11 specific
1370 ################################
1372 # Check if building for GTK+-X11
1373 GTK_CHECK_BACKEND([x11], [gtk_required_version],
1374                   [have_gtk_x11=yes], [have_gtk_x11=no])
1376 have_libxmu="no (building for `pkg-config --variable=targets gtk+-3.0`)"
1378 if test "x$have_gtk_x11" = "xyes"; then
1380    # doc-shooter is X11 specific
1381    DOC_SHOOTER=doc-shooter
1383    # screenshot plug-in needs to link to X11 explicitly
1384    SCREENSHOT_LIBS="$X_LIBS -lX11"
1386    gimp_save_CFLAGS="$CFLAGS"
1387    gimp_save_LDFLAGS="$LDFLAGS"
1388    CFLAGS="$CFLAGS $GTK_CFLAGS"
1389    LDFLAGS="$LDFLAGS $X_LIBS"
1391    # Test for Xmu
1392    if test -z "$XMU_LIBS"; then
1393       AC_CHECK_LIB(Xmu, XmuClientWindow,
1394         [AC_CHECK_HEADERS(X11/Xmu/WinUtil.h,
1395           have_libxmu=yes
1396           XMU_LIBS="$X_LIBS $X_PRE_LIBS -lX11 -lXmu -lXt"
1397           SCREENSHOT_LIBS="$XMU_LIBS",
1398           [have_libxmu="no (XMU header file not found)"],[#include <gdk/gdkx.h>])],
1399         [have_libxmu="no (XMU library not found)"], -lXt -lX11)
1400    fi
1402    # Check for shaped window extension
1403    AC_CHECK_LIB(Xext, XShapeGetRectangles,
1404      [AC_CHECK_HEADERS(X11/extensions/shape.h,
1405         SCREENSHOT_LIBS="$SCREENSHOT_LIBS -lXext",,[#include <gdk/gdkx.h>])],,
1406      -lX11 -lXext)
1408    CFLAGS="$gimp_save_CFLAGS"
1409    LDFLAGS="$gimp_save_LDFLAGS"
1411    # check for the XFixes extension
1412    PKG_CHECK_MODULES(XFIXES, xfixes,
1413       AC_DEFINE(HAVE_XFIXES, 1,
1414                 [Define to 1 to if the XFIXES X extension is available])
1415       SCREENSHOT_LIBS="$SCREENSHOT_LIBS $XFIXES_LIBS",
1416       true)
1419 AC_SUBST(XMU_LIBS)
1420 AC_SUBST(SCREENSHOT_LIBS)
1422 AC_SUBST(DOC_SHOOTER)
1425 GIMP_COMMAND='gimp-gimp_app_version'
1427 AC_SUBST(GIMP_COMMAND)
1430 ############
1431 # MIME types
1432 ############
1434 # The list of MIME types that are supported by plug-ins that are compiled
1435 # unconditionally:
1436 MIME_TYPES="image/bmp;image/g3fax;image/gif;image/x-fits;image/x-pcx;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-psd;image/x-sgi;image/x-tga;image/x-xbitmap;image/x-xwindowdump;image/x-xcf;image/x-compressed-xcf;image/x-gimp-gbr;image/x-gimp-pat;image/x-gimp-gih"
1438 #################
1439 # Bundle packages
1440 #################
1442 AC_MSG_CHECKING([whether we build a relocatable package])
1443 AC_ARG_ENABLE(relocatable-bundle,
1444               [  --enable-relocatable-bundle
1445                           build with resources considered bundled under the same prefix
1446                           (default=auto)],,
1447               enable_relocatable_bundle=auto)
1449 if test "x$enable_relocatable_bundle" != xno &&
1450    test "x$enable_relocatable_bundle" != xyes; then
1451   # By default, assume building for Windows or macOS everything to be on
1452   # the same prefix and can be relocated.
1453   # On other platforms, build-time paths are meaningful.
1454   if test "x$platform_osx" = "xyes" ||
1455      test "x$platform_win32" = "xyes"; then
1456      enable_relocatable_bundle=yes
1457   else
1458      enable_relocatable_bundle=no
1459   fi
1461 if test "x$enable_relocatable_bundle" = xyes; then
1462   AC_DEFINE(ENABLE_RELOCATABLE_RESOURCES, 1,
1463             [Define to 1 if resources are considered bundled under the same prefix])
1466 AC_MSG_RESULT([$enable_relocatable_bundle])
1468 ###################
1469 # Check for libtiff
1470 ###################
1472 libtiff_error=
1473 if test -z "$TIFF_LIBS"; then
1474   AC_CHECK_LIB(tiff, TIFFReadScanline,
1475     [AC_CHECK_HEADER(tiffio.h,
1476       FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff',
1477       [libtiff_error="TIFF header files not found"])],
1478     [AC_CHECK_LIB(tiff, TIFFWriteScanline,
1479       [AC_CHECK_HEADER(tiffio.h,
1480         FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff -ljpeg -lz',
1481         [libtiff_error="TIFF header files not found"])],
1482       [AC_CHECK_LIB(tiff34, TIFFFlushData,
1483         [AC_CHECK_HEADER(tiffio.h,
1484           FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff34 -ljpeg -lz',
1485           [libtiff_error="TIFF header files not found"])],
1486       [libtiff_error="TIFF library not found"], -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
1489 if test -z "$TIFF_LIBS"; then
1490   add_deps_error([libtiff], [Checks for TIFF library failed: $libtiff_error])
1493 MIME_TYPES="$MIME_TYPES;image/tiff"
1495 AC_SUBST(TIFF_LIBS)
1498 ###################
1499 # Check for libjpeg
1500 ###################
1502 if test -z "$JPEG_LIBS"; then
1503   AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, ,
1504     add_deps_error([libjpeg], [JPEG library not found]))
1505   AC_MSG_CHECKING([for jpeglib.h])
1506   AC_PREPROC_IFELSE(
1507     [AC_LANG_SOURCE([[
1508 #include <stdio.h>
1509 #undef HAVE_STDDEF_H
1510 #undef HAVE_STDLIB_H
1511 #undef PACKAGE
1512 #undef VERSION
1513 #include <jpeglib.h>]])],
1514     AC_MSG_RESULT([yes]),
1515     add_deps_error([libjpeg], [JPEG header file not found]))
1516   AC_CHECK_LIB(jpeg, jpeg_save_markers,
1517     JPEG_LIBS='-ljpeg',
1518     add_deps_error([libjpeg], [JPEG library is too old]))
1521 MIME_TYPES="$MIME_TYPES;image/jpeg"
1523 AC_SUBST(JPEG_LIBS)
1526 ################
1527 # Check for libz
1528 ################
1530 if test -z "$Z_LIBS"; then
1531   AC_CHECK_LIB(z, gzsetparams,
1532     [AC_CHECK_HEADER(zlib.h,
1533       Z_LIBS='-lz',
1534       add_deps_error([zlib], [ZLIB header files not found]))],
1535     add_deps_error([zlib], [ZLIB library not found]))
1538 MIME_TYPES="$MIME_TYPES;image/x-psp"
1540 AC_SUBST(Z_LIBS)
1543 ####################
1544 # Check for libbzip2
1545 ####################
1547 gimp_save_LIBS=$LIBS
1548 LIBS="$LIBS -lbz2"
1550 if test -z "$BZIP2_LIBS"; then
1551   # We used to use AC_CHECK_LIB, but bz2 uses the WINAPI calling convention on
1552   # windows, so the test needs to #include <bzlib.h> to be able to link properly
1553   AC_CHECK_HEADER(bzlib.h,
1554     [AC_MSG_CHECKING([for BZ2_bzCompress in -lbz2]);
1555     AC_LINK_IFELSE(
1556       [AC_LANG_PROGRAM(
1557         [[#include <bzlib.h>]],
1558         [[BZ2_bzCompress (NULL, 0);]])],
1559       [AC_MSG_RESULT([yes]); BZIP2_LIBS='-lbz2'],
1560       add_deps_error([libbzip2], [libbzip2 library not found]))],
1561     add_deps_error([libbzip2], [libbzip2 header files not found]))
1564 LIBS=$gimp_save_LIBS
1566 AC_SUBST(BZIP2_LIBS)
1569 ###################
1570 # Check for liblzma
1571 ###################
1573 PKG_CHECK_MODULES(LZMA, liblzma >= liblzma_required_version,,
1574                  [add_deps_error([liblzma >= liblzma_required_version])])
1577 ##########################
1578 # Check for appstream-glib
1579 ##########################
1581 PKG_CHECK_MODULES(APPSTREAM_GLIB, appstream-glib >= appstream_glib_required_version,,
1582                  [add_deps_error([appstream-glib >= appstream_glib_required_version])])
1585 ###############################
1586 # Check for Ghostscript library
1587 ###############################
1589 AC_ARG_WITH(gs,  [  --without-gs            build without Ghostscript support])
1591 have_gs=no
1592 if test "x$with_gs" != xno; then
1593   have_gs=yes
1594   AC_CHECK_LIB(gs, gsapi_new_instance,
1595     [AC_CHECK_HEADER(ghostscript/iapi.h,
1596       FILE_PS='file-ps$(EXEEXT)'; GS_LIBS='-lgs',
1597       [have_gs="no (Ghostscript header files not found)"])],
1598     [have_gs="no (Ghostscript library not found)"])
1599   if test "x$have_gs" != xyes -a "x$with_gs" = xyes; then
1600     AC_MSG_ERROR([
1601 *** Checks for Ghostscript library failed. You can build without it by passing
1602 *** --without-gs to configure but you won't be able to use PostScript files then.])
1603   fi
1606 if test "x$have_gs" = xyes; then
1607   MIME_TYPES="$MIME_TYPES;application/postscript"
1610 AC_SUBST(FILE_PS)
1611 AM_CONDITIONAL(HAVE_GS, test "x$have_gs" = xyes)
1612 AC_SUBST(GS_LIBS)
1615 ##################
1616 # Check for libpng
1617 ##################
1619 PKG_CHECK_MODULES(PNG, libpng >= libpng_required_version,,
1620                   [add_deps_error([libpng >= libpng_required_version])])
1622 MIME_TYPES="$MIME_TYPES;image/png;image/x-icon"
1623 PNG_CFLAGS="$PNG_CFLAGS -DPNG_PEDANTIC_WARNINGS"
1626 ##################
1627 # Check for libmng
1628 ##################
1630 AC_ARG_WITH(libmng,  [  --without-libmng        build without MNG support])
1632 have_libmng=no
1633 if test "x$with_libmng" != xno && test -z "$MNG_LIBS" &&
1634    test -n "$PNG_LIBS" && test -n "$JPEG_LIBS" && test -n "$Z_LIBS"; then
1635   AC_CHECK_LIB(mng, mng_create,
1636     [AC_CHECK_HEADER(libmng.h, mng_ok=yes)],
1637     [have_libmng="no (MNG library not found)"], -lz -lm)
1638   if test "$mng_ok" = yes; then
1639     have_libmng=yes
1640     FILE_MNG='file-mng$(EXEEXT)'; MNG_LIBS="-lmng $JPEG_LIBS $PNG_LIBS"; MNG_CFLAGS="$PNG_CFLAGS"
1641     if test "x$platform_win32" = "xyes"; then
1642       MNG_CFLAGS="$MNG_CFLAGS -DMNG_USE_DLL"
1643     fi
1644   else
1645     have_libmng="no (MNG header file not found)"
1646   fi
1649 AC_SUBST(FILE_MNG)
1650 AC_SUBST(MNG_LIBS)
1651 AC_SUBST(MNG_CFLAGS)
1654 #################
1655 # Check for libaa
1656 #################
1658 AC_ARG_WITH(aa,  [  --without-aa            do not build the AA plug-in])
1660 have_libaa=no
1661 if test "x$with_aa" != xno && test -z "$AA_LIBS"; then
1662   have_libaa=yes
1663   AC_CHECK_LIB(aa, aa_printf,
1664     [AC_CHECK_HEADER(aalib.h,
1665       FILE_AA='file-aa$(EXEEXT)'; AA_LIBS='-laa',
1666       [have_libaa="no (AA header file not found)"])],
1667     [have_libaa="no (AA library not found)"])
1670 AC_SUBST(FILE_AA)
1671 AC_SUBST(AA_LIBS)
1674 ##################
1675 # Check for libxpm
1676 ##################
1678 AC_ARG_WITH(libxpm,  [  --without-libxpm        build without XPM support])
1680 gimp_save_CFLAGS="$CFLAGS"
1681 CFLAGS="$CFLAGS $X_CFLAGS"
1682 gimp_save_LDFLAGS="$LDFLAGS"
1683 LDFLAGS="$LDFLAGS $X_LIBS"
1684 if test "x$have_gtk_x11" = "xyes"; then
1685   lib_X11=-lX11
1687 have_libxpm=no
1688 if test "x$with_libxpm" != xno && test -z "$XPM_LIBS"; then
1689   have_libxpm=yes
1690   AC_CHECK_LIB(Xpm, XpmReadFileToXpmImage,
1691     [AC_CHECK_HEADER(X11/xpm.h,
1692       FILE_XPM='file-xpm$(EXEEXT)'; XPM_LIBS="$X_LIBS $X_PRE_LIBS $lib_X11 -lXpm",
1693       [have_libxpm="no (XPM header file not found)"])],
1694     [have_libxpm="no (XPM library not found)"], $X_PRE_LIBS $lib_X11)
1696 CFLAGS="$gimp_save_CFLAGS"
1697 LDFLAGS="$gimp_save_LDFLAGS"
1699 if test "x$have_libxpm" = xyes; then
1700   MIME_TYPES="$MIME_TYPES;image/x-xpixmap"
1703 AC_SUBST(FILE_XPM)
1704 AC_SUBST(XPM_LIBS)
1707 ###################
1708 # Check for OpenEXR
1709 ###################
1711 AC_ARG_WITH(openexr, [  --without-openexr       build without OpenEXR support])
1713 have_openexr=no
1714 if test "x$with_openexr" != xno; then
1715   have_openexr=yes
1716   PKG_CHECK_MODULES(OPENEXR, OpenEXR >= openexr_required_version,
1717     FILE_EXR='file-exr$(EXEEXT)',
1718     [have_openexr="no (OpenEXR not found)"])
1721 if test "x$have_openexr" = xyes; then
1722   MIME_TYPES="$MIME_TYPES;image/x-exr"
1725 AC_SUBST(OPENEXR_CFLAGS)
1726 AC_SUBST(OPENEXR_LIBS)
1727 AC_SUBST(FILE_EXR)
1729 AM_CONDITIONAL(HAVE_OPENEXR, test "x$have_openexr" = xyes)
1732 ################
1733 # Check for WebP
1734 ################
1736 AC_ARG_WITH(webp, [  --without-webp       build without WebP support])
1738 have_webp=no
1739 if test "x$with_webp" != xno; then
1740   have_webp=yes
1741   PKG_CHECK_MODULES(WEBP, libwebp >= webp_required_version,
1742     [
1743       PKG_CHECK_MODULES(WEBPMUX, libwebpmux >= webp_required_version,
1744         [
1745           PKG_CHECK_MODULES(WEBPDEMUX, libwebpdemux >= webp_required_version,,
1746             [have_webp="no (WebP not built with libwebpdemux)"])
1747         ],
1748         [have_webp="no (WebP not built with libwebpmux)"])
1749     ],
1750     [have_webp="no (WebP not found)"])
1753 if test "x$have_webp" = xyes; then
1754   MIME_TYPES="$MIME_TYPES;image/x-webp"
1757 AM_CONDITIONAL(HAVE_WEBP, test "x$have_webp" = xyes)
1760 ###################
1761 # Check for libheif
1762 ###################
1764 AC_ARG_WITH(libheif, [  --without-libheif       build without libheif support])
1766 have_libheif=no
1767 if test "x$with_libheif" != xno; then
1768   have_libheif=yes
1769   PKG_CHECK_MODULES(LIBHEIF, libheif >= libheif_required_version,
1770     FILE_HEIF='file-heif$(EXEEXT)',
1771     [have_libheif="no (libheif not found)"])
1774 if test "x$have_libheif" = xyes; then
1775   MIME_TYPES="$MIME_TYPES;image/heif;image/heic"
1778 AC_SUBST(FILE_HEIF)
1779 AM_CONDITIONAL(HAVE_LIBHEIF, test "x$have_libheif" = xyes)
1782 ######################
1783 # Check for libmypaint
1784 ######################
1786 PKG_CHECK_MODULES(LIBMYPAINT, libmypaint >= libmypaint_required_version,,
1787                   [add_deps_error([libmypaint >= libmypaint_required_version])])
1789 PKG_CHECK_MODULES(MYPAINT_BRUSHES, mypaint-brushes-1.0,,
1790                   [add_deps_error([mypaint-brushes-1.0])])
1792 if test "x$enable_relocatable_bundle" != xno; then
1793   mypaint_brushes_dir='${gimp_installation_dir}/share/mypaint-data/1.0/brushes'
1794 else
1795   mypaint_brushes_dir=`$PKG_CONFIG --variable=brushesdir mypaint-brushes-1.0`
1797 AC_SUBST(mypaint_brushes_dir)
1800 ##################
1801 # Check for webkit
1802 ##################
1804 AC_ARG_WITH(webkit, [  --without-webkit        don't build the help-browser and web-page plug-ins])
1806 have_webkit=no
1807 if test "x$with_webkit" != xno; then
1808   PKG_CHECK_MODULES(WEBKIT, webkit2gtk-4.0 >= webkitgtk_required_version,
1809     WEB_PAGE='web-page$(EXEEXT)'
1810     have_webkit=yes,
1811     have_webkit="no (WebKit not found)")
1812 else
1813   have_webkit="no (WebKit support disabled)"
1816 AC_SUBST(WEB_PAGE)
1817 if test "x$have_webkit" = "xyes"; then
1818   AC_DEFINE(HAVE_WEBKIT, 1, [Define to 1 if webkit is available])
1820 AM_CONDITIONAL(HAVE_WEBKIT, test "x$have_webkit" = xyes)
1823 ###################
1824 # Check for librsvg
1825 ###################
1827 PKG_CHECK_MODULES(SVG, librsvg-2.0 >= rsvg_required_version,,
1828                   [add_deps_error([rsvg >= rsvg_required_version])])
1830 MIME_TYPES="$MIME_TYPES;image/svg+xml"
1832 AC_CHECK_PROGS(GTK_ENCODE_SYMBOLIC_SVG, gtk-encode-symbolic-svg, no)
1834 if test "x$GTK_ENCODE_SYMBOLIC_SVG" = xno; then
1835   add_deps_error([gtk-encode-symbolic-svg],
1836                  [Could not find gtk-encode-symbolic-svg in your PATH.])
1839 ####################################
1840 # Allow to disable the print plug-in
1841 ####################################
1843 AC_ARG_WITH(print,[  --without-print         build without print support])
1845 enable_print="no (disabled)"
1846 if test "x$with_print" != xno; then
1847   enable_print="yes"
1850 AM_CONDITIONAL(BUILD_PRINT, test "x$enable_print" = xyes)
1853 ######################
1854 # Check for libpoppler
1855 ######################
1857 # PDF import support is a granted feature.
1858 PKG_CHECK_MODULES(POPPLER, [poppler-glib >= poppler_required_version],,
1859                   [add_deps_error([poppler-glib >= poppler_required_version])])
1860 # All modern distributions have at least this version and CJK/Cyrillic
1861 # support should not be considered as "second-zone citizen".
1862 PKG_CHECK_MODULES(POPPLER_DATA, [poppler-data >= poppler_data_required_version],,
1863                   [add_deps_error([poppler-data >= poppler_data_required_version])])
1865 # MIME_TYPES is for the formats we can open as used for instance in the
1866 # desktop file. Even if cairo-pdf (used for PDF export) is not
1867 # installed, the mime-type list should contain application/pdf.
1868 MIME_TYPES="$MIME_TYPES;application/pdf"
1870 #####################
1871 # Check for cairo-pdf
1872 #####################
1874 AC_ARG_WITH(cairo_pdf,[  --without-cairo-pdf     build without cairo-pdf support])
1875 have_cairo_pdf=no
1876 if test "x$with_cairo_pdf" != xno; then
1877   have_cairo_pdf=yes
1878   PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf >= cairo_pdf_required_version,
1879     FILE_PDF_SAVE='file-pdf-save$(EXEEXT)',
1880     have_cairo_pdf="no (cairo-pdf not found)")
1881 else
1882    have_cairo_pdf="no (cairo-pdf support disabled)"
1885 AC_SUBST(FILE_PDF_SAVE)
1888 ###################
1889 # Check for libwmf2
1890 ###################
1892 AC_ARG_WITH(wmf, [  --without-wmf           build without WMF support])
1894 have_libwmf=no
1895 if test "x$with_wmf" != xno; then
1896   AC_PATH_PROG(WMF_CONFIG, libwmf-config, no)
1897   if test "x$WMF_CONFIG" != "xno" ; then
1898     have_libwmf=yes
1899     AC_MSG_CHECKING(for libwmf >= wmf_required_version)
1900     wmf_version=`$WMF_CONFIG --version`
1901     if expr $wmf_version \>= wmf_required_version >/dev/null; then
1902       AC_MSG_RESULT([yes (version $wmf_version)])
1903       FILE_WMF='file-wmf$(EXEEXT)'
1904       WMF_LIBS=`$WMF_CONFIG --libs`
1905       WMF_CFLAGS=`$WMF_CONFIG --cflags`
1906     else
1907       have_libwmf="no (libwmf is too old)"
1908    fi
1909   else
1910     have_libwmf="no (libwmf not found)"
1911   fi
1914 if test "x$have_libwmf" = xyes; then
1915   MIME_TYPES="$MIME_TYPES;image/x-wmf"
1918 AC_SUBST(FILE_WMF)
1919 AC_SUBST(WMF_LIBS)
1920 AC_SUBST(WMF_CFLAGS)
1923 ####################
1924 # Check for OpenJPEG
1925 ####################
1927 AC_ARG_WITH(jpeg2000, [  --without-jpeg2000      build without JPEG 2000 support])
1929 have_openjpeg=no
1930 if test "x$with_jpeg2000" != xno; then
1931   have_openjpeg=yes
1932   PKG_CHECK_MODULES(OPENJPEG, libopenjp2 >= openjpeg_required_version,
1933     FILE_JP2_LOAD='file-jp2-load$(EXEEXT)'
1934     have_openjpeg=yes,
1935     have_openjpeg="no (OpenJPEG not found)")
1938 if test "x$have_openjpeg" = xyes; then
1939   MIME_TYPES="$MIME_TYPES;image/jp2"
1942 AM_CONDITIONAL(HAVE_OPENJPEG, test "x$have_openjpeg" = xyes)
1943 AC_SUBST(FILE_JP2_LOAD)
1946 ################
1947 # Check for lcms
1948 ################
1950 PKG_CHECK_MODULES(LCMS, lcms2 >= lcms_required_version,,
1951                   [add_deps_error([lcms2 >= lcms_required_version])])
1954 ######################
1955 # Check for libXcursor
1956 ######################
1958 AC_ARG_WITH(xmc,[  --without-xmc           build without Xcursor support])
1960 have_xmc=no
1961 if test "x$with_xmc" != xno; then
1962   have_xmc=yes
1963   PKG_CHECK_MODULES(XMC, xcursor,
1964     FILE_XMC='file-xmc$(EXEEXT)',
1965     have_xmc="no (libXcursor not found)")
1966 else
1967    have_xmc="no (libXcursor support disabled)"
1970 if test "x$have_xmc" = xyes; then
1971   MIME_TYPES="$MIME_TYPES;image/x-xcursor"
1974 AC_SUBST(FILE_XMC)
1977 ################
1978 # Check for alsa
1979 ################
1981 AC_ARG_WITH(alsa, [  --without-alsa          disable alsa support in midi input controller])
1983 have_alsa="no (alsa support disabled)"
1984 if test "x$with_alsa" != xno; then
1985   have_alsa=yes
1986   AM_PATH_ALSA(alsa_required_version,
1987                AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if alsa is available]),
1988                have_alsa="no (libasound not found or unusable)")
1992 #######################
1993 # Check for Linux Input
1994 #######################
1996 AC_ARG_WITH(linux-input, [  --without-linux-input   don't build linux input event controller module])
1998 have_linux_input="no (linux input support disabled)"
1999 if test "x$with_linux_input" != "xno"; then
2000   AC_CHECK_HEADER(linux/input.h,
2001         AC_CHECK_DECL(KEY_OK,
2002                 have_linux_input=yes,
2003                 have_linux_input="no (needs Linux 2.6)",
2004                 [#include <linux/input.h>]))
2007 AM_CONDITIONAL(HAVE_LINUX_INPUT, test "x$have_linux_input" = xyes)
2010 ###############################
2011 # Check for DirectX DirectInput
2012 ###############################
2014 AC_ARG_WITH(directx-sdk, [  --with-directx-sdk=PFX  prefix where the DirectX SDK is installed(optional)])
2016 have_dx_dinput=no
2017 if test "x$os_win32" = xyes; then
2018   case "$with_directx_sdk" in
2019     *" "*) AC_MSG_WARN([The DirectX SDK should be accessible through a path without spaces. Use MSYS mounts. Ignoring your --with-directx-sdk switch.])
2020            with_directx_sdk=;;
2021     *\\*) AC_MSG_WARN([Use plain (forward) slashes only in your --with-directx-sdk switch. Ignoring your --with-directx-sdk switch.])
2022            with_directx_sdk=;;
2023   esac
2025   dinput_save_CPPFLAGS="$CPPFLAGS"
2026   dinput_save_LDFLAGS="$LDFLAGS"
2027   if test "x$with_directx_sdk" != x; then
2028     CPPFLAGS="-I $with_directx_sdk/Include $CPPFLAGS"
2029     LDFLAGS="-L$with_directx_sdk/Lib/x86 $LDFLAGS"
2030     AC_CHECK_HEADER(dinput.h,
2031                     [AC_CHECK_LIB(dxguid, GUID_XAxis, have_dx_dinput=yes)])
2032   fi
2034   if test "x$have_dx_dinput" = xyes; then
2035     AC_DEFINE(HAVE_DX_DINPUT, 1, [Define to 1 if you have DirectX DirectInput headers and libraries])
2036   else
2037     CPPFLAGS="$dinput_save_CPPFLAGS"
2038     LDFLAGS="$dinput_save_LDFLAGS"
2039   fi
2042 AM_CONDITIONAL(HAVE_DX_DINPUT, test "x$have_dx_dinput" = xyes)
2045 ####################
2046 # Check for libgudev
2047 ####################
2049 AC_ARG_WITH(gudev, [  --without-gudev         build without GUdev support])
2051 have_libgudev=no
2053 if test "x$with_gudev" = xno; then
2054   have_libgudev="no (disabled)"
2057 if test "x$have_linux_input" = xyes && test "x$with_gudev" != xno; then
2058   PKG_CHECK_MODULES(GUDEV, gudev-1.0 >= libgudev_required_version,
2059     have_libgudev=yes,
2060     have_libgudev="no (libgudev not found)")
2063 if test "x$have_libgudev" = xyes; then
2064   AC_DEFINE(HAVE_LIBGUDEV, 1, [Define to 1 if libgudev is available])
2068 ##########################
2069 # Check for Email Settings
2070 ##########################
2072 # The default behavior is that xdg-email is searched in the user PATH,
2073 # and email plugin is enabled if found.
2074 # Sendmail can be used instead of xdg-email, but must be explicitly
2075 # enabled with --with-sendmail.
2077 have_email="no (xdg-email not found)"
2079 AC_ARG_WITH(sendmail,[  --with-sendmail[=DIR]     use sendmail instead of xdg-email])
2081 have_sendmail=no
2082 # Sendmail must be explicitly enabled to replace xdg-email implementation.
2083 if test "x$with_sendmail" != "x" && test "x$with_sendmail" != "xno"; then
2084   if test "x$with_sendmail" = "xyes"; then
2085       sendmail_path=$PATH:/usr/sbin:/usr/lib
2086       AC_DEFINE_UNQUOTED(SENDMAIL, "",
2087                          [The MTA used by the mail plug-in.])
2088   else
2089       sendmail_path=$with_sendmail
2090       AC_DEFINE_UNQUOTED(SENDMAIL, "$with_sendmail",
2091                          [The MTA used by the mail plug-in.])
2092   fi
2094   AC_PATH_PROG(SENDMAIL, sendmail, , $sendmail_path)
2095   if test "x$SENDMAIL" != "x"; then
2096     have_email="yes (sendmail)"
2097   else
2098     # Not having sendmail at runtime is not a blocker.
2099     have_email="needs runtime dependency: sendmail"
2100   fi
2101   have_sendmail=yes
2104 if test "x$have_sendmail" = xno; then
2105   AC_PATH_PROG(XDG_EMAIL, xdg-email)
2106   if test "x$XDG_EMAIL" != "x"; then
2107     have_email="yes (xdg-email)"
2108   else
2109     # Not having xdg-email at runtime is not a blocker.
2110     # But let's inform the builder that for the feature to be available,
2111     # xdg-email is a runtime dependency.
2112     have_email="needs runtime dependency: xdg-email"
2113   fi
2116 ################
2117 # Check for perl
2118 ################
2120 AC_PATH_PROGS(PERL,perl5 perl,perl)
2121 AX_PROG_PERL_VERSION([perl_required_version],,
2122                      [add_deps_error([perl >= perl_required_version])])
2125 AC_ARG_WITH(pdbgen,
2126             [  --with-pdbgen           use 'pdbgen' code generation tool],,
2127   with_pdbgen=$USE_MAINTAINER_MODE)
2129 AM_CONDITIONAL(WITH_PDBGEN, test "x$with_pdbgen" = xyes)
2132 ##################
2133 # Check for python
2134 ##################
2136 # Pygimp configure stuff ...
2137 AC_ARG_ENABLE(python,
2138   AS_HELP_STRING([--disable-python],
2139                  [do not build the python extension]))
2141 m4_define([pycheck_error], [
2142   required_deps="$required_deps
2143   - $1
2144       *** Please install $2, or skip building the python scripting extension by
2145       *** passing --disable-python to configure (but then you will not be able
2146       *** to use scripts for GIMP that are written in Python)."])
2148 if test "x$enable_python" != xno; then
2149   enable_python="yes"
2150   # check for Python
2151   AM_PATH_PYTHON2(python2_required_version,,
2152                   [pycheck_error([Python 2 (python2_required_version or newer)], [it])])
2153   AM_CHECK_PYTHON_HEADERS(, [pycheck_error([Python 2 headers], [them])])
2155   # Win32 needs all symbols resolved for linking, even for DLLs
2156   # Assume the link library is in $exec_prefix/libs
2157   # This might be able to be figured out from distutils, but it's
2158   # not documented so we won't rely on internal implementation
2159   PYLINK_LIBS=
2160   if test "x$platform_win32" = "xyes"; then
2161     PYBIN_PATH="$py_exec_prefix\pythonw.exe"
2162     PYTHON_INCLUDES=`echo "$PYTHON_INCLUDES" | sed -e 's/\\\\/\\//g'`
2163     py_exec_prefix=`echo "$py_exec_prefix" | sed -e 's/\\\\/\\//g'`
2164     pylibversion=`echo $PYTHON_VERSION | sed -e 's/\\.//'`
2165     PYLINK_LIBS="-L${py_exec_prefix}/libs -lpython${pylibversion}"
2166   else
2167     PYBIN_PATH="$PYTHON"
2168   fi
2169   AC_SUBST(PYLINK_LIBS)
2170   AC_SUBST(PYBIN_PATH)
2172   # check for PyGTK
2173   PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= pygtk_required_version,,
2174                     [pycheck_error([PyGTK pygtk_required_version or newer], [it])])
2176   AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
2177   if test "x$PYGTK_CODEGEN" = xno; then
2178      pycheck_error([pygtk-codegen-2.0 script], [it])
2179   fi
2181   AC_MSG_CHECKING(for pygtk defs)
2182   PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
2183   AC_SUBST(PYGTK_DEFSDIR)
2184   AC_MSG_RESULT($PYGTK_DEFSDIR)
2186   PKG_CHECK_MODULES(PYCAIRO, pycairo >= pycairo_required_version,,
2187                     [pycheck_error([PyCairo pycairo_required_version or newer], [it])])
2189   GIMP_DETECT_CFLAGS(PYGIMP_EXTRA_CFLAGS, '-fno-strict-aliasing')
2190   AC_SUBST(PYGIMP_EXTRA_CFLAGS)
2192 AM_CONDITIONAL(BUILD_PYTHON, test "x$enable_python" != xno)
2195 ###########################################################
2196 # Some plug-ins don't build on Win32, others are Win32-only
2197 ###########################################################
2199 if test "x$os_win32" = xno; then
2200   MAIL='mail$(EXEEXT)'
2203 AC_SUBST(MAIL)
2206 ###############################
2207 # Check for GTK Mac Integration
2208 ###############################
2210 gtk_mac_integration_ok=no
2211 if test "x$platform_osx" != xno &&
2212    (echo `pkg-config --variable=targets gtk+-3.0` | grep quartz); then
2214   PKG_CHECK_MODULES(GTK_MAC_INTEGRATION, gtk-mac-integration-gtk3 >= gtk_mac_integration_required_version,
2215     gtk_mac_integration_ok=yes,
2216     gtk_mac_integration_ok=no)
2218   if test "x$gtk_mac_integration_ok" != "xyes"; then
2219     PKG_CHECK_MODULES(GTK_MAC_INTEGRATION, gtk-mac-integration >= gtk_mac_integration_required_version,
2220       gtk_mac_integration_ok=yes,
2221       gtk_mac_integration_ok=no)
2222   fi
2225 AM_CONDITIONAL(PLATFORM_OSX_QUARTZ, test "x$gtk_mac_integration_ok" = xyes)
2228 ##########################################################
2229 # Determine where to install the desktop & mime info files
2230 ##########################################################
2232 AC_ARG_WITH(desktop-dir, [  --with-desktop-dir=PATH where to install desktop files (default=PREFIX/share)])
2234 if test "x$with_desktop_dir" != x; then
2235   DESKTOP_DATADIR=$with_desktop_dir
2236 else
2237   DESKTOP_DATADIR="$datadir"
2240 AM_CONDITIONAL(DESKTOP_DATADIR, test "x$with_desktop_dir" != xno)
2241 AC_SUBST(DESKTOP_DATADIR)
2244 #####################
2245 # Check for XML tools
2246 #####################
2248 AC_PATH_PROG(XMLLINT, xmllint, no)
2249 AM_CONDITIONAL(HAVE_XMLLINT, test "x$XMLLINT" != "xno")
2251 AC_PATH_PROG(XSLTPROC, xsltproc, no)
2252 AM_CONDITIONAL(HAVE_XSLTPROC, test "x$XSLTPROC" != "xno")
2255 ########################
2256 # Check for vector icons
2257 ########################
2259 # If not cross-compiling, default build's link and compile flags to the
2260 # target's flags.
2261 if test "$cross_compiling" != "yes"; then
2262   if test "x$LDFLAGS_FOR_BUILD" = "x"; then
2263     LDFLAGS_FOR_BUILD="$LDFLAGS"
2264   fi
2265   if test "x$CFLAGS_FOR_BUILD" = "x"; then
2266     CFLAGS_FOR_BUILD="$CFLAGS"
2267   fi
2268   if test "x$CPPFLAGS_FOR_BUILD" = "x"; then
2269     CPPFLAGS_FOR_BUILD="$CPPFLAGS"
2270   fi
2273 AC_ARG_ENABLE(vector-icons, [  --disable-vector-icons  use raster icons rather than vector ones (default=auto)], ,
2274               enable_vector_icons=auto)
2276 if test "x$enable_vector_icons" != "xno"; then
2277   if test "x$have_recommended_gtk" != "x"; then
2278       enable_vector_icons="no (gtk+-2-0 < gtk_win32_recommended_version)"
2279   else
2280     have_shared_mime_info=""
2281     # shared-mime-info is needed to correctly detect SVG files (except on
2282     # Windows, apparently).
2283     PKG_CHECK_MODULES(MIME_INFO, [shared-mime-info],
2284                       have_shared_mime_info="yes", have_shared_mime_info="no")
2285     if test "x$have_shared_mime_info" = "xyes" ||
2286        test "x$platform_win32" = "xyes"; then
2287       # Check if librsvg was built with --disable-pixbuf-loader.
2288       gdk_pixbuf_moduledir=`$PKG_CONFIG --variable=gdk_pixbuf_moduledir gdk-pixbuf-2.0`
2289       # AC_CHECK_FILE macro does not work when cross-compiling and exits with:
2290       # error: cannot check for file existence when cross compiling
2291       # So let's test files the shell way.
2292       if (test "x$platform_win32" = "xyes" &&
2293           test -f "$gdk_pixbuf_moduledir/libpixbufloader-svg.dll") ||
2294          test -f "$gdk_pixbuf_moduledir/libpixbufloader-svg.so"; then
2295         # We must not use $PKG_CONFIG nor PKG_CHECK_* macros because we need
2296         # to make sure we use the native pkg-config (in case we cross-compile).
2297         if pkg-config --atleast-version=glib_required_version glib-2.0 &&
2298            pkg-config gio-2.0; then
2299           NATIVE_GLIB_LIBS=`pkg-config --libs gio-2.0 glib-2.0`
2300           NATIVE_GLIB_CFLAGS=`pkg-config --cflags gio-2.0 glib-2.0`
2301           enable_vector_icons="yes"
2303           if test "x$platform_win32" = "xyes"; then
2304             warning_vector_icons_windows="
2305 WARNING: You enabled vector icons on Win32. Make sure to run:
2306            $ gdk-pixbuf-query-loaders.exe --update-cache
2307          on the target machine (this command generates loaders.cache)
2308          so that GdkPixbuf knows where to find the SVG loader."
2309           fi
2310         else
2311           enable_vector_icons="no (missing native glib-2.0 > glib_required_version or gio-2.0)"
2312         fi
2313       else
2314         enable_vector_icons="no (librsvg GdkPixbuf loader missing)"
2315       fi
2316     else
2317       enable_vector_icons="no (missing shared-mime-info)"
2318     fi
2319   fi
2322 AC_SUBST(NATIVE_GLIB_LIBS)
2323 AC_SUBST(NATIVE_GLIB_CFLAGS)
2324 AM_CONDITIONAL(ENABLE_VECTOR_ICONS, test "x$enable_vector_icons" = "xyes")
2326 ####################
2327 # Check for xvfb-run
2328 ####################
2330 AC_ARG_WITH(xvfb-run,  [  --without-xvfb-run      do not use xvfb-run for UI-dependent automatic tests])
2332 have_xvfb_run="no (disabled)"
2333 if test "x$with_xvfb_run" != "xno"; then
2334   AC_PATH_PROG(XVFB_RUN, xvfb-run, no)
2335   if test "x$XVFB_RUN" != "xno"; then
2336     have_xvfb_run="yes"
2337     AC_DEFINE(HAVE_XVFB_RUN, 1, [Define to 1 if xvfb-run is available])
2338   else
2339     have_xvfb_run="no (not found)"
2340   fi
2342 AM_CONDITIONAL(HAVE_XVFB_RUN, test "x$have_xvfb_run" = "xyes")
2344 ##########################
2345 # Check for appstream-util
2346 ##########################
2348 AC_ARG_WITH(appdata-test,  [  --without-appdata-test  do not validate the appdata file])
2350 have_appstream_util="no (disabled)"
2351 if test "x$with_appdata_test" != "xno"; then
2352   AC_PATH_PROG(APPSTREAM_UTIL, appstream-util, no)
2353   if test "x$APPSTREAM_UTIL" != "xno"; then
2354     have_appstream_util="yes"
2355   else
2356     have_appstream_util="no (appstream-util not found)"
2357   fi
2359 AM_CONDITIONAL(HAVE_APPSTREAM_UTIL, test "x$have_appstream_util" = "xyes")
2360 if test "x$have_appstream_util" = "xyes"; then
2361   have_appstream_util="yes (this test requires network access; --without-appdata-test to disable)"
2365 #################################
2366 # Check for desktop-file-validate
2367 #################################
2369 AC_PATH_PROG(DESKTOP_FILE_VALIDATE, desktop-file-validate, no)
2370 if test "x$DESKTOP_FILE_VALIDATE" != "xno"; then
2371   have_desktop_file_validate="yes"
2372 else
2373   have_desktop_file_validate="no (desktop-file-validate not found)"
2375 AM_CONDITIONAL(HAVE_DESKTOP_FILE_VALIDATE, test "x$DESKTOP_FILE_VALIDATE" != "xno")
2377 ####################
2378 # Set bug report URL
2379 ####################
2381 # Allowing third-party packagers to set their own bugtracker URL, in
2382 # order to filter first packaging bugs from core bugs.
2384 AC_ARG_WITH(bug-report-url,
2385             [  --with-bug-report-url   URL used by the debug dialog to report bugs],,
2386             [with_bug_report_url="$PACKAGE_BUGREPORT"])
2388 if test "x$with_bug_report_url" = "x"; then
2389   with_bug_report_url="$PACKAGE_BUGREPORT"
2392 BUG_REPORT_URL="$with_bug_report_url"
2393 AC_DEFINE_UNQUOTED(BUG_REPORT_URL, "$with_bug_report_url",
2394                    [The URL to open in order to report bugs])
2395 AC_SUBST(BUG_REPORT_URL)
2397 override_bug_report_url=
2398 if test "x$with_bug_report_url" = "x$PACKAGE_BUGREPORT"; then
2399 override_bug_report_url="
2400 NOTE: if you plan on packaging GIMP for distribution, it is recommended
2401       to override the bug report URL with option:
2402         --with-bug-report-url=https://example.com/
2403       so that you can filter packaging bugs from core bugs before
2404       reporting upstream.
2408 #########################
2409 # Default ICC directory #
2410 #########################
2412 # This is necessary because some Unix systems may have a different
2413 # standard path for color profiles. And in particular, sandbox builds
2414 # might mount the host system at a different root. This is for
2415 # instance the case of flatpak which mount the host root at /run/host/.
2416 if test "x$platform_osx" = "xno" &&
2417    test "x$platform_win32" = "xno"; then
2418   AC_MSG_CHECKING([default directory for color profiles])
2419   AC_ARG_WITH(icc-directory,
2420               [  --with-icc-directory    Path to default color profiles for this system],,
2421               [with_icc_directory="/usr/share/color/icc"])
2423   if test "x$with_icc_directory" = "x"; then
2424     with_icc_directory="/usr/share/color/icc"
2425   fi
2427   AC_DEFINE_UNQUOTED(COLOR_PROFILE_DIRECTORY,
2428                      "$with_icc_directory",
2429                      [The path to default color profiles for this system])
2432 ######################################
2433 # Checks for gtk-doc and docbook-tools
2434 ######################################
2436 # Check for GTK_DOC_CHECK availability. The GTK_DOC_CHECK invocation
2437 # must be on its own line, gtkdocize relies on it
2438 m4_ifdef([GTK_DOC_CHECK], [
2439 GTK_DOC_CHECK([1.0])
2442 # NOTE: We need to use a separate automake conditional for this
2443 #       to make this work with the tarballs.
2444 AM_CONDITIONAL(ENABLE_GTK_DOC, test "x$enable_gtk_doc" = xyes)
2446 AC_ARG_ENABLE(gtk-doc-app, [  --enable-gtk-doc-app    build developer documentation for app (default=no)], , enable_gtk_doc_app=no)
2447 AM_CONDITIONAL(ENABLE_GTK_DOC_APP, test "x$enable_gtk_doc_app" = xyes)
2450 #############################
2451 # Check for Windows installer
2452 #############################
2454 AC_MSG_CHECKING([if building the Windows installer])
2455 AC_ARG_ENABLE(windows-installer,
2456               [  --enable-windows-installer
2457                           generate files needed for the Windows installer
2458                           (default=no)],,
2459               enable_windows_installer=no)
2461 if test "x$enable_windows_installer" != xno; then
2462   if test ! -e "$srcdir/build/windows/installer/lang/setup.isl.in"; then
2463     AC_MSG_RESULT([no (not building from git)])
2464     AC_MSG_ERROR([Building the Windows installer is only supported when building from git.])
2465   fi
2468 AC_MSG_RESULT([$enable_windows_installer])
2469 AM_CONDITIONAL(BUILD_WINDOWS_INSTALLER, test "x$enable_windows_installer" != xno)
2472 #########################################
2473 # Allow to configure the GIMP environment
2474 #########################################
2476 AC_ARG_ENABLE(default-binary, [  --enable-default-binary install this as the default gimp binary (default=gimp_stable)], , enable_default_binary=gimp_stable)
2478 AM_CONDITIONAL(DEFAULT_BINARY, test "x$enable_default_binary" = xyes)
2481 AC_ARG_ENABLE(gimp-console, [  --enable-gimp-console   build a console-only binary which does not link GTK+], , enable_gimp_console=yes)
2483 AM_CONDITIONAL(ENABLE_GIMP_CONSOLE, test "x$enable_gimp_console" != xno)
2486 # Possibly change default gimpdir from $XDG_CONFIG_HOME/GIMP/gimp_user_version
2487 gimpdir=GIMP
2488 AC_ARG_WITH(gimpdir, [  --with-gimpdir=DIR      change default gimpdir from $XDG_CONFIG_HOME/GIMP/gimp_user_version to $XDG_CONFIG_HOME/DIR/gimp_user_version, or to DIR if DIR is an absolute path],
2489 if eval "test x$with_gimpdir != x"; then
2490   if eval "test x$with_gimpdir != xyes"; then
2491     gimpdir=$with_gimpdir
2492   fi
2495 # Build the gimpdir to be used in manpages here, because the manpage
2496 # source is unreadable enough already
2497 case "$gimpdir" in
2498   /*)
2499     manpage_gimpdir="$gimpdir"
2500     ;;
2501   *)
2502     manpage_gimpdir="\\fB\$XDG_CONFIG_HOME\\fP/$gimpdir/gimp_user_version"
2503     ;;
2504 esac
2506 gimpdatadir="$datadir/$PACKAGE/gimp_data_version"
2507 gimpplugindir="$libdir/$PACKAGE/gimp_plugin_version"
2508 gimpsysconfdir="$sysconfdir/$PACKAGE/gimp_sysconf_version"
2510 AC_SUBST(gimpdir)
2511 AC_SUBST(manpage_gimpdir)
2512 AC_SUBST(gimpdatadir)
2513 AC_SUBST(gimpplugindir)
2514 AC_SUBST(gimpsysconfdir)
2517 # GNU format message catalogs go into $datadir/locale,
2518 # standard location is $libdir/locale. DATADIRNAME set accordingly.
2520 gimplocaledir="$datadir/locale"
2521 if test "$DATADIRNAME" = "lib"; then
2522    gimplocaledir="$libdir/locale"
2525 AC_SUBST(gimplocaledir)
2528 ############################
2529 # Some defines for the build
2530 ############################
2532 AM_CONDITIONAL(STATICLIBS, test "x$enable_static" = xyes)
2534 # a tuned version of glib-mkenums
2535 GIMP_MKENUMS="\$(PERL) \$(top_srcdir)/tools/gimp-mkenums"
2536 AC_SUBST(GIMP_MKENUMS)
2538 #Add required trailing ; to list
2539 MIME_TYPES="$MIME_TYPES;"
2541 AC_SUBST(MIME_TYPES)
2544 #########################
2545 # Disable deprecated APIs
2546 #########################
2548 CPPFLAGS="${CPPFLAGS} -DGIMP_DISABLE_DEPRECATED -DBABL_DISABLE_DEPRECATED -DGSEAL_ENABLE"
2550 # Make sure not to disable deprecated APIs for unreleased versions.
2551 # We must build without problems with future releases of libraries
2552 # and disabling deprecated API risks breaking the build
2554 if test "x$have_glib_2_57" != "xyes"; then
2555   CPPFLAGS="${CPPFLAGS} -DG_DISABLE_DEPRECATED"
2558 if test "x$have_pango_1_43" != "xyes"; then
2559   CPPFLAGS="${CPPFLAGS} -DPANGO_DISABLE_DEPRECATED"
2563 ##################
2564 # configure output
2565 ##################
2567 # easy way to skip the plug-in build
2568 GIMP_PLUGINS=plug-ins
2569 GIMP_MODULES=modules
2570 AC_SUBST(GIMP_PLUGINS)
2571 AC_SUBST(GIMP_MODULES)
2573 AC_CONFIG_COMMANDS([libgimpbase/gimpversion.h], [
2574   outfile=gimpversion.h-tmp
2575   cat > $outfile <<\_______EOF
2576 /* gimpversion.h
2578  * This is a generated file.  Please modify 'configure.ac'
2579  */
2581 #if !defined (__GIMP_BASE_H_INSIDE__) && !defined (GIMP_BASE_COMPILATION)
2582 #error "Only <libgimpbase/gimpbase.h> can be included directly."
2583 #endif
2585 #ifndef __GIMP_VERSION_H__
2586 #define __GIMP_VERSION_H__
2588 G_BEGIN_DECLS
2592  * SECTION: gimpversion
2593  * @title: gimpversion
2594  * @short_description: Macros and constants useful for determining
2595  *                     GIMP's version number and capabilities.
2597  * Macros and constants useful for determining GIMP's version number and
2598  * capabilities.
2599  **/
2601 _______EOF
2603   cat >>$outfile <<_______EOF
2605  * GIMP_MAJOR_VERSION:
2607  * The major GIMP version number.
2608  **/
2609 #define GIMP_MAJOR_VERSION                              ($gimp_major_ver)
2612  * GIMP_MINOR_VERSION:
2614  * The minor GIMP version number.
2615  **/
2616 #define GIMP_MINOR_VERSION                              ($gimp_minor_ver)
2619  * GIMP_MICRO_VERSION:
2621  * The micro GIMP version number.
2622  **/
2623 #define GIMP_MICRO_VERSION                              ($gimp_micro_ver)
2626  * GIMP_VERSION:
2628  * The GIMP version as a string.
2629  **/
2630 #define GIMP_VERSION                                    "$gimp_ver"
2633  * GIMP_API_VERSION:
2635  * Since: 2.2
2636  **/
2637 #define GIMP_API_VERSION                                "$gimp_api_ver"
2639 _______EOF
2641   cat >>$outfile <<\_______EOF
2642 #define GIMP_CHECK_VERSION(major, minor, micro) \
2643     (GIMP_MAJOR_VERSION > (major) || \
2644      (GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION > (minor)) || \
2645      (GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION == (minor) && \
2646       GIMP_MICRO_VERSION >= (micro)))
2649 G_END_DECLS
2651 #endif /* __GIMP_VERSION_H__ */
2652 _______EOF
2654   if cmp -s $outfile libgimpbase/gimpversion.h; then
2655     AC_MSG_NOTICE([libgimpbase/gimpversion.h is unchanged])
2656     rm -f $outfile
2657   else
2658     mv $outfile libgimpbase/gimpversion.h
2659   fi
2661   gimp_major_ver=gimp_major_version
2662   gimp_minor_ver=gimp_minor_version
2663   gimp_micro_ver=gimp_micro_version
2664   gimp_ver=gimp_version
2665   gimp_api_ver=gimp_api_version
2668 AC_CONFIG_FILES([
2669 INSTALL
2670 tools/Makefile
2671 pdb/Makefile
2672 libgimp/Makefile
2673 libgimpbase/Makefile
2674 libgimpconfig/Makefile
2675 libgimpcolor/Makefile
2676 libgimpmath/Makefile
2677 libgimpmodule/Makefile
2678 libgimpthumb/Makefile
2679 libgimpwidgets/Makefile
2680 app/Makefile
2681 app/actions/Makefile
2682 app/config/Makefile
2683 app/core/Makefile
2684 app/operations/Makefile
2685 app/operations/layer-modes/Makefile
2686 app/operations/layer-modes-legacy/Makefile
2687 app/operations/tests/Makefile
2688 app/gegl/Makefile
2689 app/dialogs/Makefile
2690 app/display/Makefile
2691 app/file/Makefile
2692 app/gui/Makefile
2693 app/menus/Makefile
2694 app/paint/Makefile
2695 app/pdb/Makefile
2696 app/plug-in/Makefile
2697 app/propgui/Makefile
2698 app/text/Makefile
2699 app/tools/Makefile
2700 app/vectors/Makefile
2701 app/widgets/Makefile
2702 app/xcf/Makefile
2703 app/tests/Makefile
2704 app/tests/files/Makefile
2705 app/tests/gimpdir-empty/Makefile
2706 app/tests/gimpdir-empty/brushes/Makefile
2707 app/tests/gimpdir-empty/gradients/Makefile
2708 app/tests/gimpdir-empty/patterns/Makefile
2709 app/tests/gimpdir/Makefile
2710 app/tests/gimpdir/brushes/Makefile
2711 app/tests/gimpdir/gradients/Makefile
2712 app/tests/gimpdir/patterns/Makefile
2713 app-tools/Makefile
2714 build/Makefile
2715 build/windows/Makefile
2716 build/windows/gimp.rc
2717 build/windows/gimp-plug-ins.rc
2718 build/windows/installer/Makefile
2719 build/windows/installer/lang/Makefile
2720 plug-ins/Makefile
2721 plug-ins/file-bmp/Makefile
2722 plug-ins/file-exr/Makefile
2723 plug-ins/file-faxg3/Makefile
2724 plug-ins/file-fits/Makefile
2725 plug-ins/file-fli/Makefile
2726 plug-ins/file-ico/Makefile
2727 plug-ins/file-jpeg/Makefile
2728 plug-ins/file-psd/Makefile
2729 plug-ins/file-raw/Makefile
2730 plug-ins/file-sgi/Makefile
2731 plug-ins/file-tiff/Makefile
2732 plug-ins/file-webp/Makefile
2733 plug-ins/flame/Makefile
2734 plug-ins/fractal-explorer/Makefile
2735 plug-ins/fractal-explorer/examples/Makefile
2736 plug-ins/gfig/Makefile
2737 plug-ins/gfig/gfig-examples/Makefile
2738 plug-ins/gfig/images/Makefile
2739 plug-ins/ui/Makefile
2740 plug-ins/gimpressionist/Brushes/Makefile
2741 plug-ins/gimpressionist/Makefile
2742 plug-ins/gimpressionist/Paper/Makefile
2743 plug-ins/gimpressionist/Presets/Makefile
2744 plug-ins/gradient-flare/Makefile
2745 plug-ins/gradient-flare/flares/Makefile
2746 plug-ins/help-browser/Makefile
2747 plug-ins/help/Makefile
2748 plug-ins/ifs-compose/Makefile
2749 plug-ins/imagemap/Makefile
2750 plug-ins/imagemap/images/Makefile
2751 plug-ins/lighting/Makefile
2752 plug-ins/lighting/images/Makefile
2753 plug-ins/map-object/Makefile
2754 plug-ins/metadata/Makefile
2755 plug-ins/pagecurl/Makefile
2756 plug-ins/print/Makefile
2758 dnl plug-ins/pygimp/Makefile
2759 dnl plug-ins/pygimp/plug-ins/Makefile
2761 plug-ins/screenshot/Makefile
2762 plug-ins/script-fu/Makefile
2763 plug-ins/script-fu/ftx/Makefile
2764 plug-ins/script-fu/scripts/Makefile
2765 plug-ins/script-fu/scripts/images/Makefile
2766 plug-ins/script-fu/tinyscheme/Makefile
2767 plug-ins/selection-to-path/Makefile
2768 plug-ins/twain/Makefile
2769 plug-ins/common/Makefile
2770 modules/Makefile
2772 dnl devel-docs/Makefile
2773 dnl devel-docs/app/Makefile
2774 dnl devel-docs/app/version
2775 dnl devel-docs/libgimp/Makefile
2776 dnl devel-docs/libgimp/version
2777 dnl devel-docs/libgimpbase/Makefile
2778 dnl devel-docs/libgimpbase/version
2779 dnl devel-docs/libgimpconfig/Makefile
2780 dnl devel-docs/libgimpconfig/version
2781 dnl devel-docs/libgimpcolor/Makefile
2782 dnl devel-docs/libgimpcolor/version
2783 dnl devel-docs/libgimpmath/Makefile
2784 dnl devel-docs/libgimpmath/version
2785 dnl devel-docs/libgimpmodule/Makefile
2786 dnl devel-docs/libgimpmodule/version
2787 dnl devel-docs/libgimpthumb/Makefile
2788 dnl devel-docs/libgimpthumb/version
2789 dnl devel-docs/libgimpwidgets/Makefile
2790 dnl devel-docs/libgimpwidgets/version
2791 dnl devel-docs/tools/Makefile
2793 docs/Makefile
2794 menus/Makefile
2795 cursors/Makefile
2796 icons/Makefile
2797 icons/Color/Makefile
2798 icons/Legacy/Makefile
2799 icons/Symbolic/Makefile
2800 themes/Makefile
2801 themes/System/Makefile
2802 data/Makefile
2803 data/brushes/Makefile
2804 data/brushes/Basic/Makefile
2805 data/brushes/Fun/Makefile
2806 data/brushes/Media/Makefile
2807 data/brushes/Legacy/Makefile
2808 data/brushes/Sketch/Makefile
2809 data/brushes/Splatters/Makefile
2810 data/brushes/Texture/Makefile
2811 data/dynamics/Makefile
2812 data/dynamics/Basic/Makefile
2813 data/dynamics/FX/Makefile
2814 data/environ/Makefile
2815 data/gradients/Makefile
2816 data/images/Makefile
2817 data/interpreters/Makefile
2818 data/palettes/Makefile
2819 data/patterns/Makefile
2820 data/patterns/Animal/Makefile
2821 data/patterns/Fabric/Makefile
2822 data/patterns/Food/Makefile
2823 data/patterns/Legacy/Makefile
2824 data/patterns/Paper/Makefile
2825 data/patterns/Plant/Makefile
2826 data/patterns/Sky/Makefile
2827 data/patterns/Stone/Makefile
2828 data/patterns/Water/Makefile
2829 data/patterns/Wood/Makefile
2830 data/tags/Makefile
2831 data/tips/Makefile
2832 data/tool-presets/Makefile
2833 data/tool-presets/Crop/Makefile
2834 data/tool-presets/FX/Makefile
2835 data/tool-presets/Paint/Makefile
2836 data/tool-presets/Selection/Makefile
2837 data/tool-presets/Sketch/Makefile
2838 desktop/Makefile
2839 desktop/gimp-data-extras.metainfo.xml.in
2840 desktop/gimp.desktop.in
2841 desktop/org.gimp.GIMP.appdata.xml.in
2842 etc/Makefile
2843 etc/gimprc
2844 m4macros/Makefile
2845 po/Makefile.in
2846 po-libgimp/Makefile.in
2847 po-plug-ins/Makefile.in
2849 dnl po-python/Makefile.in
2851 po-script-fu/Makefile.in
2852 po-tips/Makefile.in
2853 po-windows-installer/Makefile.in
2854 gimp-zip
2855 Makefile
2858 # Files with versions in their names
2859 AC_CONFIG_FILES(
2860 docs/gimp-gimp_app_version.1:docs/gimp.1.in
2861 docs/gimprc-gimp_app_version.5:docs/gimprc.5.in
2862 docs/gimptool-gimp_tool_version.1:docs/gimptool.1.in
2863 gimp-gimp_pkgconfig_version.pc:gimp.pc.in
2864 gimpthumb-gimp_pkgconfig_version.pc:gimpthumb.pc.in
2865 gimpui-gimp_pkgconfig_version.pc:gimpui.pc.in
2868 # By default, autoconf will create only po/Makefile.
2869 # This code is used to create the POTFILES and Makefile for all
2870 # additional gettext catalogs.
2871 m4_define([generate_po_makefile], [
2872   AC_MSG_NOTICE([Generating POTFILES and Makefile for $1])
2874   AC_CONFIG_COMMANDS([$1/stamp-it],
2875   [[
2876     if  ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ; then
2877        as_fn_error $? "$1/Makefile.in.in was not created by intltoolize." "$LINENO" 5
2878     fi
2879     rm -f "$1/stamp-it" "$1/POTFILES"
2880     sed -e '/^#/d' -e 's/^[[].*] *//' \
2881         -e '/^[         ]*$/d'        \
2882         -e "s|^|        $ac_top_srcdir/|" \
2883         "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" && \
2884     sed -e "/^# This comment gets stripped out/ {"  \
2885         -e 'r $1/POTFILES'                          \
2886         -e "d" -e "}"                               \
2887         "$1/Makefile.in" >"$1/Makefile" && \
2888     touch "$1/stamp-it"
2889   ]])
2892 generate_po_makefile([po-libgimp])
2893 #generate_po_makefile([po-python])
2894 generate_po_makefile([po-plug-ins])
2895 generate_po_makefile([po-script-fu])
2896 generate_po_makefile([po-tips])
2897 generate_po_makefile([po-windows-installer])
2899 # Print a summary of features enabled/disabled:
2900 optional_deps="
2901 Extra Binaries:
2902   gimp-console:              $enable_gimp_console
2904 Optional Features:
2905   Language selection:        $have_iso_codes
2906   Vector icons:              $enable_vector_icons
2907   Dr. Mingw (Win32):         $enable_drmingw
2908   Relocatable bundle:        $enable_relocatable_bundle
2909   Default ICC directory:     $with_icc_directory
2910   Debug console (Win32):     $enable_win32_debug_console
2911   32-bit DLL folder (Win32): $with_win32_32bit_dll_folder
2913 Optional Plug-Ins:
2914   Ascii Art:                 $have_libaa
2915   Ghostscript:               $have_gs
2916   Help Browser:              $have_webkit
2917   JPEG 2000:                 $have_openjpeg
2918   MNG:                       $have_libmng
2919   OpenEXR:                   $have_openexr
2920   WebP:                      $have_webp
2921   Heif:                      $have_libheif
2922   PDF (export):              $have_cairo_pdf
2923   Print:                     $enable_print
2924   Python 2:                  $enable_python
2925   TWAIN (Win32):             $os_win32
2926   Webpage:                   $have_webkit
2927   WMF:                       $have_libwmf
2928   X11 Mouse Cursor:          $have_xmc
2929   XPM:                       $have_libxpm
2930   Email:                     $have_email
2932 Optional Modules:
2933   ALSA (MIDI Input):         $have_alsa
2934   Linux Input:               $have_linux_input (GUdev support: $have_libgudev)
2935   DirectInput (Win32):       $have_dx_dinput
2937 Tests:
2938   Use xvfb-run               $have_xvfb_run
2939   Test appdata               $have_appstream_util
2940   Test desktop file          $have_desktop_file_validate
2942 Bug report URL: $with_bug_report_url
2943 $override_bug_report_url$have_recommended_gtk$warning_vector_icons_windows$warning_glib_networking$warning_gcc"
2945 if test "x$required_deps" = "x"; then
2946   AC_OUTPUT
2947   AC_MSG_RESULT([
2948 Building GIMP with prefix=$prefix, datarootdir=$datarootdir
2949 Desktop files install into $DESKTOP_DATADIR
2950 $optional_deps]);
2951 else
2952   AC_MSG_ERROR([
2953 $optional_deps
2955 Error: GIMP configuration failed.
2956 $required_deps
2958 See the file 'INSTALL' for more help.]);