Updated Slovenian translation
[gegl.git] / configure.ac
blobae31682a15183d2a34f3e939f642f682935efb67
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.54)
5 dnl Making releases on the stable branch:
6 dnl   GEGL_MICRO_VERSION += 1;
7 dnl   GEGL_INTERFACE_AGE += 1;
8 dnl   GEGL_BINARY_AGE += 1;
9 dnl if any functions have been added,
10 dnl    set GEGL_INTERFACE_AGE to 0.
11 dnl if backwards compatibility has been broken,
12 dnl    set GEGL_BINARY_AGE _and_ GEGL_INTERFACE_AGE to 0.
15 m4_define([gegl_major_version], [0])
16 m4_define([gegl_minor_version], [3])
17 m4_define([gegl_micro_version], [1])
18 m4_define([gegl_real_version],
19           [gegl_major_version.gegl_minor_version.gegl_micro_version])
20 m4_define([gegl_version], [gegl_real_version])
22 dnl Number of releases since we've added interfaces
23 m4_define([gegl_interface_age], [0])
24 m4_define([gegl_binary_age],
25           [m4_eval(100 * gegl_minor_version + gegl_micro_version)])
27 m4_define([gegl_api_version], [gegl_major_version.gegl_minor_version])
29 m4_define([stability_version_number],
30           m4_if(m4_eval(gegl_major_version || gegl_minor_version), [0], 
31                         [gegl_micro_version], [gegl_minor_version]))
32 m4_define([gegl_unstable],
33           m4_if(m4_eval(stability_version_number % 2), [1], [yes], [no]))
34 m4_define([gegl_stable],
35           m4_if(m4_eval(stability_version_number % 2), [0], [yes], [no]))
37 m4_define([gimp_full_name], [Generic Graphical Library])
39 # required versions of external libraries
40 m4_define([babl_required_version], [0.1.12])
41 m4_define([cairo_required_version], [0.0.0])
42 m4_define([gdk_pixbuf_required_version], [2.18.0])
43 m4_define([introspection_required_version], [1.32.0])
44 m4_define([glib_required_version], [2.36.0])
45 m4_define([graphviz_required_version], [0.0.0])
46 m4_define([jasper_required_version], [1.900.1])
47 m4_define([lcms_required_version], [2.2])
48 m4_define([lensfun_required_version], [0.2.5])
49 m4_define([librsvg_required_version], [2.14.0])
50 m4_define([libv4l2_required_version], [1.0.1])
51 m4_define([lua_required_version], [5.1.0])
52 m4_define([openexr_required_version], [0.0.0])
53 m4_define([libraw_required_version], [0.15.4])
54 m4_define([pango_required_version], [0.0.0])
55 m4_define([pangocairo_required_version], [0.0.0])
56 m4_define([png_required_version], [0.0.0])
57 m4_define([sdl_required_version], [0.0.0])
58 m4_define([webp_required_version], [0.0.0])
59 m4_define([poly2tri-c_required_version], [0.0.0])
61 AC_INIT(gegl, gegl_major_version.gegl_minor_version.gegl_micro_version)
63 AC_CONFIG_HEADERS([config.h])
64 AC_CONFIG_SRCDIR([gegl/gegl.h])
65 AC_CONFIG_MACRO_DIR([m4])
67 # Enable silent build rules by default, requires at least
68 # Automake-1.11. Disable by either passing --disable-silent-rules to
69 # configure or passing V=1 to make
70 m4_ifdef([AM_SILENT_RULES],
71          [AM_SILENT_RULES([yes])],
72          [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
74 dnl ==========================================================================
75 dnl                              Versioning              
76 dnl ==========================================================================
78 dnl The triplet 
79 GEGL_MAJOR_VERSION=gegl_major_version
80 GEGL_MINOR_VERSION=gegl_minor_version
81 GEGL_MICRO_VERSION=gegl_micro_version
82 GEGL_INTERFACE_AGE=gegl_interface_age
83 GEGL_BINARY_AGE=gegl_binary_age
84 GEGL_VERSION=gegl_version
85 GEGL_REAL_VERSION=gegl_real_version
86 GEGL_VERSION=gegl_version
87 GEGL_API_VERSION=gegl_api_version
88 AC_SUBST(GEGL_MAJOR_VERSION)
89 AC_SUBST(GEGL_MINOR_VERSION)
90 AC_SUBST(GEGL_MICRO_VERSION)
91 AC_SUBST(GEGL_INTERFACE_AGE)
92 AC_SUBST(GEGL_BINARY_AGE)
93 AC_SUBST(GEGL_VERSION)
94 AC_SUBST(GEGL_REAL_VERSION)
95 AC_SUBST(GEGL_API_VERSION)
97 GEGL_RELEASE=gegl_api_version
98 AC_SUBST(GEGL_RELEASE)
101 AC_DEFINE_UNQUOTED(GEGL_LIBRARY, "$PACKAGE_NAME-$GEGL_API_VERSION",
102                    [The name of the GEGL library])
105 dnl The symbol GEGL_UNSTABLE is defined above for substitution in
106 dnl Makefiles and conditionally defined here as a preprocessor symbol
107 dnl and automake conditional.
108 GEGL_UNSTABLE=gegl_unstable
109 if test "x$GEGL_UNSTABLE" = "xyes"; then
110   AC_DEFINE(GEGL_UNSTABLE, 1,
111             [Define to 1 if this is an unstable version of GEGL])
113 AM_CONDITIONAL(GEGL_UNSTABLE, test "x$GEGL_UNSTABLE" = "xyes")
116 dnl libtool versioning
117 m4_define([lt_current], [m4_eval(100 * gegl_minor_version + gegl_micro_version - gegl_interface_age)])
118 m4_define([lt_revision], [gegl_interface_age])
119 m4_define([lt_age], [m4_eval(gegl_binary_age - gegl_interface_age)])
120 GEGL_LIBRARY_VERSION="lt_current:lt_revision:lt_age"
121 GEGL_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
122 AC_SUBST(GEGL_LIBRARY_VERSION)
123 AC_SUBST(GEGL_CURRENT_MINUS_AGE)
125 gegltargetlib=libgegl-$GEGL_API_VERSION.la
126 AC_SUBST(gegltargetlib)
128 GLIB_REQUIRED_VERSION=glib_required_version
129 AC_SUBST(GLIB_REQUIRED_VERSION)
131 LUA_REQUIRED_VERSION=lua_required_version
132 AC_SUBST(LUA_REQUIRED_VERSION)
134 dnl ==========================================================================
136 AC_CANONICAL_SYSTEM
137 AM_INIT_AUTOMAKE([1.11 no-define dist-bzip2 no-dist-gzip -Wno-portability])
138 dnl Initialize maintainer mode
139 AM_MAINTAINER_MODE([enable])
141 ###############
142 # Generic stuff
143 ###############
145 dnl Prefer clang on OSX, because GCC isn't updated
147 case "$build_os" in
148   darwin10.* | darwin9.* | darwin8.*)
149     ;;
150   darwin*)
151     prefered_cc="clang"
152     prefered_cxx="clang++"
153     ;;
154   *)
155     ;;
156 esac
158 if test -z "$CC" && test -n "$prefered_cc"; then
159   AC_MSG_NOTICE([setting CC to $prefered_cc for $build_os])
160   CC=$prefered_cc
163 if test -z "$CXX" && test -n "$prefered_cc"; then
164   AC_MSG_NOTICE([setting CXX to $prefered_cxx for $build_os])
165   CXX=$prefered_cxx
168 if test -n "$CFLAGS"; then
169   user_set_cflags=yes
172 if test -n "$CXXFLAGS"; then
173   user_set_cxxflags=yes
176 dnl Checks for programs.
178 AC_PROG_CC
179 AC_PROG_CC_C99
180 AC_PROG_CXX
181 AC_PROG_INSTALL
182 AC_PROG_MAKE_SET
184 case "$CC" in
185   clang* | gcc*)
186     if test -z $user_set_cflags; then
187       CFLAGS="-g -O3"
188     fi
189     ;;
190   *)
191     ;;
192 esac
194 case "$CXX" in
195   clang* | g++*)
196     if test -z $user_set_cxxflags; then
197       CXXFLAGS="-g -O3"
198     fi
199     ;;
200   *)
201     ;;
202 esac
204 dnl Large file support.
205 AC_SYS_LARGEFILE
207 dnl Initialize libtool
208 LT_PREREQ([2.2])
209 LT_INIT([disable-static win32-dll dlopen])
211 GEGL_VARIADIC_MACROS
213 AC_MSG_CHECKING([whether to turn on debugging])
214 AC_ARG_ENABLE(debug,
215               [  --enable-debug          turn on  debugging (default=no)],
216               if eval "test x$enable_debug = xyes"; then
217                 DEBUGFLAG="-g -DGEGL_ENABLE_DEBUG"
218               fi)
220 if test -n "$DEBUGFLAG"; then
221   AC_MSG_RESULT([yes])
222   CFLAGS="$DEBUGFLAG $CFLAGS"
223 else
224   AC_MSG_RESULT([no])
227 AC_MSG_CHECKING([whether to turn on profiling])
228 AC_ARG_ENABLE(profile,
229               [  --enable-profile        turn on profiling (default=no)],
230               if eval "test x$enable_profile = xyes"; then
231                 PROFFLAG="-pg"
232               fi)
234 if test -n "$PROFFLAG"; then
235   AC_MSG_RESULT([yes])
236   CFLAGS="$PROFFLAG $CFLAGS"
237 else
238   AC_MSG_RESULT([no])
241 AC_C_RESTRICT
243 dnl disable docs generation.
244 AC_ARG_ENABLE([docs],
245               [  --disable-docs          disable docs generation (default=no)],,
246               enable_docs="yes")
248 # While cross-compiling, doc generation will fail.
249 if test "$cross_compiling" = "yes" && test "x$enable_docs" = "xyes"; then
250     AC_MSG_WARN([
251 *** Our build system does not support doc generation in a cross-compiled environment yet.
252 Disabling doc generation.])
253     enable_docs="no (cross-compilation environment)"
256 AM_CONDITIONAL(ENABLE_DOCS, test "x$enable_docs" = "xyes")
259 dnl Cache $ACLOCAL_FLAGS
260 AC_CACHE_CHECK([for aclocal flags], ac_cv_gegl_aclocal_flags,[
261    ac_cv_gegl_aclocal_flags="$ACLOCAL_FLAGS"
263 ACLOCAL="$ACLOCAL $ac_cv_gegl_aclocal_flags"
266 ###########################
267 # Check target architecture
268 ###########################
270 AC_MSG_CHECKING([for target architecture])
271 case x"$target" in
272   xNONE | x)
273     target_or_host="$host" ;;
274   *)
275     target_or_host="$target" ;;
276 esac
277 AC_MSG_RESULT([$target_or_host])
279 case "$target_or_host" in
280   i*86-*-*)
281     have_x86=yes
282     AC_DEFINE(ARCH_X86, 1, [Define to 1 if you are compiling for ix86.])
283     ;;
284   x86_64-*-*)
285     have_x86=yes
286     AC_DEFINE(ARCH_X86, 1, [Define to 1 if you are compiling for ix86.])
287     AC_DEFINE(ARCH_X86_64, 1, [Define to 1 if you are compiling for amd64.])
288     ;;
289   ppc-*-* | powerpc-*)
290     have_ppc=yes
291     AC_DEFINE(ARCH_PPC, 1, [Define to 1 if you are compiling for PowerPC.])
292     ;;
293   ppc64-*-* | powerpc64-*)
294     have_ppc=yes
295     AC_DEFINE(ARCH_PPC, 1, [Define to 1 if you are compiling for PowerPC.])
296     AC_DEFINE(ARCH_PPC64, 1, [Define to 1 if you are compiling for PowerPC64.])
297     ;;
298   *)
299     ;;
300 esac
303 ####################################################
304 # Check how to generate plug-ins (with gcc at least)
305 ####################################################
307 AC_MSG_CHECKING([for dynamic library filename suffix])
308 case "$target_or_host" in 
309   *-*-darwin*)                 # darwin
310     shrext=.dylib
311     ;;
312   hppa*-hpux*)                 # HP/UX
313     shrext=.sl
314     ;;
315   *-*-mingw* | *-*-cygwin*)    # windows
316     shrext=.dll
317     ;;
318   *)                           # linux (and BSD?)
319     shrext=.so
320     ;;
321 esac
323 AC_MSG_RESULT([${shrext}])
325 SHREXT=$shrext
326 AC_SUBST(SHREXT)
327 AC_DEFINE_UNQUOTED(SHREXT,     "$shrext",     [File extension for shared libraries])
329 dnl ===========================================================================
331 #######################
332 # Check for Darwin/OSX
333 #######################
335 AC_MSG_CHECKING([for some Darwin platform])
336 case "${host}" in
337   *-apple-darwin*)
338     platform_darwin=yes
339     ;;
340   *)
341     platform_darwin=no
342     ;;
343 esac
344 AC_MSG_RESULT([$platform_darwin])
345 AM_CONDITIONAL(PLATFORM_DARWIN, test "$platform_darwin" = "yes")
348 #################
349 # Check for Win32
350 #################
352 AC_MSG_CHECKING([for some Win32 platform])
353 case "$target_or_host" in 
354   *-*-mingw* | *-*-cygwin*)
355     platform_win32=yes
356     ;;
357   *)
358     platform_win32=no
359     ;;
360 esac
361 AC_MSG_RESULT([$platform_win32])
362 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
364 MATH_LIB=-lm
365 AC_MSG_CHECKING([for native Win32])
366 case "$target_or_host" in
367   *-*-mingw*)
368     os_win32=yes
369     PATHSEP=';'
370     MATH_LIB=
371     ;;
372   *)
373     os_win32=no
374     PATHSEP=':'
375     ;;
376 esac
377 AC_MSG_RESULT([$os_win32])
378 AC_SUBST(PATH_SEP)
379 AC_SUBST(MATH_LIB)
381 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
382 AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes")
384 dnl Checks for programs.
385 #AC_PROG_YACC
386 #AM_PROG_LEX
389 ########################
390 # Check for MMX assembly
391 ########################
393 AC_ARG_ENABLE(mmx,
394                 [  --enable-mmx            enable MMX support (default=auto)],,
395                   enable_mmx=$have_x86)
397 AC_ARG_ENABLE(sse,
398   [  --enable-sse            enable SSE support (default=auto)],,
399   enable_sse=$enable_mmx)
401 if test "x$enable_mmx" = "xyes"; then
402   AS_COMPILER_FLAG([-mmmx], [MMX_EXTRA_CFLAGS="-mmmx"])
403   SSE_EXTRA_CFLAGS=
405   AC_MSG_CHECKING(whether we can compile MMX code)
407   mmx_save_CFLAGS="$CFLAGS"
408   CFLAGS="$mmx_save_CFLAGS $MMX_EXTRA_CFLAGS"
410   AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[asm ("movq 0, %mm0");])],
412     AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.])
413     AC_MSG_RESULT(yes)
415     if test "x$enable_sse" = "xyes"; then
416       AS_COMPILER_FLAG([-msse], [SSE_EXTRA_CFLAGS="-msse"])
417       if test "x$CC" != "xclang"; then
418         AS_COMPILER_FLAG([-ftree-vectorize], [SSE_EXTRA_CFLAGS="$SSE_EXTRA_CFLAGS -ftree-vectorize"])
419       fi
420       AS_COMPILER_FLAG([-ffast-math], [SSE_EXTRA_CFLAGS="$SSE_EXTRA_CFLAGS -ffast-math"])
422       AC_MSG_CHECKING(whether we can compile SSE code)
424       sse_save_CFLAGS="$CFLAGS"
425       CFLAGS="$sse_save_CFLAGS $SSE_EXTRA_CFLAGS"
427       AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[asm ("movntps %xmm0, 0");])],
428         AC_DEFINE(USE_SSE, 1, [Define to 1 if SSE assembly is available.])
429         AC_MSG_RESULT(yes)
430       ,
431         enable_sse=no
432         AC_MSG_RESULT(no)
433         AC_MSG_WARN([The assembler does not support the SSE command set.])
434       )
436       CFLAGS="$sse_save_CFLAGS"
437     fi
438   ,
439     enable_mmx=no
440     AC_MSG_RESULT(no)
441     AC_MSG_WARN([The assembler does not support the MMX command set.])
442   )
444   CFLAGS="$mmx_save_CFLAGS"
446   AC_SUBST(MMX_EXTRA_CFLAGS)
447   AC_SUBST(SSE_EXTRA_CFLAGS)
450 CFLAGS="$CFLAGS $MMX_EXTRA_CFLAGS $SSE_EXTRA_CFLAGS"
452 ################
453 # Check for perl
454 ################
456 AC_PATH_PROGS(PERL,perl5 perl perl5.005 perl5.004,perl)
458 ########################
459 # Check GObject Introspection
460 ########################
461 GOBJECT_INTROSPECTION_CHECK(introspection_required_version)
463 ########################
464 # Check PyGObject
465 ########################
466 have_pygobject="no"
467 PKG_CHECK_EXISTS(pygobject-2.0 >= 2.26, have_pygobject="yes")
468 PKG_CHECK_EXISTS(pygobject-3.0 >= 3.2, have_pygobject="yes")
469 AM_CONDITIONAL(HAVE_PYGOBJECT, test "$have_pygobject" = "yes")
471 ########################
472 # Check Vala
473 ########################
475 AC_ARG_WITH(vala, [  --without-vala          build without Vala support])
477 have_vapigen="no"
478 if test "x$with_vala" != "xno"; then
479   PKG_CHECK_EXISTS(vapigen >= 0.20.0,
480     have_vapigen="yes",
481     have_vapigen="no  (vapigen not found)")
484 if test "x$have_vapigen" = "xyes"; then
485   AC_PATH_PROG(VAPIGEN, vapigen, no)
486   if test "$VAPIGEN" = "no"; then
487     have_vapigen="no  (vapigen executable not found)"
488   fi
491 have_vala=$have_vapigen
492 AM_CONDITIONAL(HAVE_VALA, test "$have_vala" = "yes")
494 ########################
495 # Check for fsync
496 ########################
497 AC_CHECK_FUNCS(fsync)
499 ###############################
500 # Checks for required libraries
501 ###############################
503 PKG_CHECK_MODULES(BABL, babl >= babl_required_version)
505 GLIB_PACKAGES="gobject-2.0 gmodule-2.0 gio-2.0 json-glib-1.0"
506 # select platform-specific GIO
507 case "$os_win32" in
508   yes)
509     GLIB_PACKAGES="$GLIB_PACKAGES gio-windows-2.0"
510     ;;
511   *)
512     GLIB_PACKAGES="$GLIB_PACKAGES gio-unix-2.0"
513     ;;
514 esac
516 AC_SUBST(GLIB_PACKAGES)
518 dnl This PATH_GLIB is somewhat redundant, but does a sanity compile and 
519 dnl importantly defines the GLIB_GENMARSHAL variable for subst into the
520 dnl Makefile
521 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
522   AC_MSG_ERROR([
523 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of 
524 *** GLIB is always available from ftp://ftp.gtk.org/.]),
525   gobject gmodule)
527 PKG_CHECK_MODULES(DEP,
528                   glib-2.0 >= $GLIB_REQUIRED_VERSION $GLIB_PACKAGES, ,
529                   AC_MSG_ERROR([
530         *** GLib not found. You can find it on ftp://ftp.gtk.org
531         *** Errors follow:
532             $DEP_PKG_ERRORS]))
534 # Rerun PKG_CONFIG to add gthread-2.0 cflags and libs
535 DEP_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES gthread-2.0`
536 DEP_LIBS=`$PKG_CONFIG --libs $GLIB_PACKAGES gthread-2.0`
538 ######################
539 # gettext i18n support
540 ######################
542 GETTEXT_PACKAGE=gegl-$GEGL_API_VERSION
543 AC_SUBST(GETTEXT_PACKAGE)
544 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
545                    [Our gettext translation domain.])
547 # GNU format message catalogs go into $datadir/locale,
548 # standard location is $libdir/locale. DATADIRNAME set accordingly.
550 GEGL_LOCALEDIR="$datadir/locale"
551 if test "$DATADIRNAME" = "lib"; then
552    GEGL_LOCALEDIR="$libdir/locale"
554 AC_SUBST(GEGL_LOCALEDIR)
556 # Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
557 gegl_save_LIBS=$LIBS
558 LIBS="$LIBS $GLIB_LIBS"
559 AC_CHECK_FUNCS(bind_textdomain_codeset,,
560   AC_MSG_ERROR([
561 *** Check for bind_textdomain_codeset() failed!  This is required.
563 LIBS=$gegl_save_LIBS
565 IT_PROG_INTLTOOL(0.40.1)
567 AM_GLIB_GNU_GETTEXT
570 ######################################
571 # Checks for gtk-doc and docbook-tools
572 ######################################
574 GTK_DOC_CHECK([1.0])
576 dnl NOTE: We need to use a separate automake conditional for this
577 dnl       to make this work with the tarballs.
578 AM_CONDITIONAL(ENABLE_GTK_DOC, test "x$enable_gtk_doc" = "xyes")
580 AC_CHECK_PROGS(PERL, perl5 perl)
583 #######################################
584 # Checks for Ruby used to make API docs
585 #######################################
587 AC_CHECK_PROG(RUBY, ruby, yes, no)
588 if test "$RUBY" = "no"; then
589   AC_MSG_WARN([
590 *** Could not find Ruby interpreter. The HTML API reference
591 will not be updated.
593   have_ruby="no"
594 else
595   RUBY_BIN="$RUBY"
596   have_ruby="yes"
598 AM_CONDITIONAL(HAVE_RUBY, test "x$have_ruby" = "xyes")
600 AC_SUBST(RUBY_BIN)
603 ####################
604 # Check for enscript
605 ####################
607 AC_PATH_PROG(ENSCRIPT, enscript, no)
608 if test "$ENSCRIPT" = "no"; then
609   have_enscript="no  (enscript not found)"
610 else
611   have_enscript="yes"
613 AM_CONDITIONAL(HAVE_ENSCRIPT, test "x$have_enscript" = "xyes")
616 ####################
617 # Check for asciidoc
618 ####################
620 AC_PATH_PROG(ASCIIDOC, asciidoc, no)
621 if test "$ASCIIDOC" = "no"; then
622   have_asciidoc="no  (asciidoc not found)"
623   AC_MSG_RESULT([*** Check for asciidoc failed.])
624 else
625   have_asciidoc="yes"
627 AM_CONDITIONAL(HAVE_ASCIIDOC, test "x$have_asciidoc" = "xyes")
630 ###############
631 # Check for dot
632 ###############
634 AC_PATH_PROG(DOT, dot, no)
635 if test "$DOT" = "no"; then
636   have_dot="no  (dot not found)"
637   AC_MSG_RESULT([*** Check for dot command failed.])
638 else
639   have_dot="yes"
641 AM_CONDITIONAL(HAVE_DOT, test "x$have_dot" = "xyes")
643 #################
644 # Check for Python (optional, used for introspection unittests)
645 #################
646 AM_PATH_PYTHON([2.5.0],, [:])
647 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
649 #################
650 # Check for Cairo
651 #################
653 AC_ARG_WITH(cairo, [  --without-cairo         build without Cairo support])
655 have_cairo="no"
656 if test "x$with_cairo" != "xno"; then
657   PKG_CHECK_MODULES(CAIRO, cairo,
658     have_cairo="yes",
659     have_cairo="no  (Cairo not found)")
662 AM_CONDITIONAL(HAVE_CAIRO, test "$have_cairo" = "yes")
664 AC_SUBST(CAIRO_CFLAGS) 
665 AC_SUBST(CAIRO_LIBS) 
668 ########################
669 # Checks for Pango stuff
670 ########################
672 AC_ARG_WITH(pango, [  --without-pango         build without Pango support])
673 AC_ARG_WITH(pangocairo, [  --without-pangocairo    build without pangocairo support])
675 have_pango="no"
676 if test "x$with_pango" != "xno"; then
677   PKG_CHECK_MODULES(PANGO, pango,
678     have_pango="yes",
679     have_pango="no  (Pango not found)")
682 have_pangocairo="no"
683 if test "x$with_pangocairo" != "xno"; then
684   PKG_CHECK_MODULES(PANGOCAIRO, pangocairo,
685     have_pangocairo="yes",
686     have_pangocairo="no  (pangocairo not found)")
689 AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
690 AM_CONDITIONAL(HAVE_PANGOCAIRO, test "x$have_pangocairo" = "xyes")
692 AC_SUBST(PANGO_CFLAGS) 
693 AC_SUBST(PANGO_LIBS) 
694 AC_SUBST(PANGOCAIRO_CFLAGS) 
695 AC_SUBST(PANGOCAIRO_LIBS) 
698 ######################
699 # Check for gdk-pixbuf
700 ######################
702 AC_ARG_WITH(gdk_pixbuf, [  --without-gdk-pixbuf    build without gdk-pixbuf support])
704 have_gdk_pixbuf="no"
705 if test "x$with_gdk_pixbuf" != "xno"; then
706   PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= gdk_pixbuf_required_version,
707     have_gdk_pixbuf="yes",
708     have_gdk_pixbuf="no  (gdk-pixbuf not found)")
711 AM_CONDITIONAL(HAVE_GDK_PIXBUF, test "$have_gdk_pixbuf" = "yes")
714 ###################
715 # Check for lensfun
716 ###################
718 AC_ARG_WITH(lensfun, [  --without-lensfun       build without lensfun support])
720 have_lensfun="no"
721 if test "x$with_lensfun" != "xno"; then
722   PKG_CHECK_MODULES(LENSFUN, lensfun,
723     have_lensfun="yes",
724     have_lensfun="no  (lensfun not found)")
727 AM_CONDITIONAL(HAVE_LENSFUN, test "$have_lensfun" = "yes")
729 AC_SUBST(LENSFUN_CFLAGS)
730 AC_SUBST(LENSFUN_LIBS)
733 ###################
734 # Check for libjpeg
735 ###################
737 AC_ARG_WITH(libjpeg, [  --without-libjpeg       build without JPEG support])
739 jpeg_ok="no"
740 if test "x$with_libjpeg" != "xno" && test -z "$LIBJPEG"; then
741   AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
742     jpeg_ok="yes",
743     jpeg_ok="no  (usable JPEG library not found)")
744   if test "$jpeg_ok" = "yes"; then
745     AC_MSG_CHECKING([for jpeglib.h])
746     AC_PREPROC_IFELSE(
747       [AC_LANG_SOURCE([[
748 #include <stdio.h>
749 #undef HAVE_STDDEF_H
750 #undef HAVE_STDLIB_H
751 #undef PACKAGE
752 #undef VERSION
753 #include <jpeglib.h>]])],
754       [jpeg_ok="yes"],
755       [jpeg_ok="no  (Can't include jpeglib.h)"])
756     AC_MSG_RESULT($jpeg_ok)
757     if test "$jpeg_ok" = "yes"; then
758       AC_CHECK_LIB(jpeg, jpeg_save_markers,
759         LIBJPEG='-ljpeg',
760         [jpeg_ok="no  (JPEG library is too old)"])
761     else
762       jpeg_ok="no  (JPEG header file not found)"
763     fi
764   fi
767 AM_CONDITIONAL(HAVE_JPEG, test "$jpeg_ok" = "yes")
769 AC_SUBST(LIBJPEG)
772 ##################
773 # Check for libpng
774 ##################
776 AC_ARG_WITH(libpng, [  --without-libpng        build without PNG support])
778 have_libpng="no"
779 if test "x$with_libpng" != "xno"; then
780   PKG_CHECK_MODULES(PNG, libpng,
781     have_libpng="yes",
782     have_libpng="no  (libpng not found)")
785 AM_CONDITIONAL(HAVE_PNG, test "$have_libpng" = "yes")
787 AC_SUBST(PNG_CFLAGS) 
788 AC_SUBST(PNG_LIBS) 
791 ###################
792 # Check for librsvg
793 ###################
795 AC_ARG_WITH(librsvg, [  --without-librsvg       build without SVG support])
797 have_librsvg="no"
798 if test "x$with_librsvg" != "xno"; then
799   PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= librsvg_required_version,
800     have_librsvg="yes",
801     have_librsvg="no  (usable librsvg not found)")
804 AM_CONDITIONAL(HAVE_RSVG, test "$have_librsvg" = "yes")
806 AC_SUBST(RSVG_CFLAGS) 
807 AC_SUBST(RSVG_LIBS) 
810 ###################
811 # Check for libv4l2
812 ###################
814 AC_ARG_WITH(libv4l2, [  --without-libv4l2      build without v4l2 support])
816 have_libv4l2="no"
817 if test "x$with_libv4l" != "xno"; then
818   PKG_CHECK_MODULES(V4L2, libv4l2 >= libv4l2_required_version,
819     have_libv4l2="yes",
820     have_libv4l2="no  (usable libv4l2 not found)")
823 AM_CONDITIONAL(HAVE_V4L2, test "$have_libv4l2" = "yes")
825 AC_SUBST(V4L2_CFLAGS) 
826 AC_SUBST(V4L2_LIBS) 
829 ###################
830 # Check for OpenEXR
831 ###################
833 AC_ARG_WITH(openexr, [  --without-openexr       build without OpenEXR support])
835 have_openexr="no"
836 if test "x$with_openexr" != "xno"; then
837   PKG_CHECK_MODULES(OPENEXR, OpenEXR,
838     have_openexr="yes",
839     have_openexr="no  (OpenEXR library not found)")
842 AM_CONDITIONAL(HAVE_OPENEXR, test "$have_openexr" = "yes")
844 AC_SUBST(OPENEXR_CFLAGS) 
845 AC_SUBST(OPENEXR_LIBS) 
848 ###############
849 # Check for SDL
850 ###############
852 AC_ARG_WITH(sdl, [  --without-sdl           build without SDL support])
854 have_sdl="no"
855 if test "x$with_sdl" != "xno"; then
856   AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
857   if test "$SDL_CONFIG" = "no"; then
858     have_sdl="no  (SDL library not found)"
859     AC_MSG_RESULT([*** Check for SDL library failed.])
860   else
861     have_sdl="yes"
862     SDL_CFLAGS=`$SDL_CONFIG --cflags`
863     SDL_LIBS=`$SDL_CONFIG --libs`
864   fi
867 AM_CONDITIONAL(HAVE_SDL, test "$have_sdl" = "yes")
869 AC_SUBST(SDL_CFLAGS)
870 AC_SUBST(SDL_LIBS)
873 AC_SUBST(OPENRAW_CFLAGS) 
874 AC_SUBST(OPENRAW_LIBS) 
877 ##################
878 # Check for libraw
879 ##################
881 AC_ARG_WITH(libraw, [  --without-libraw          build without libraw support])
883 have_libraw="no"
884 if test "x$with_libraw" != "xno"; then
885   PKG_CHECK_MODULES(LIBRAW, libraw >= libraw_required_version,
886     have_libraw="yes",
887     have_libraw="no  (libraw library not found)")
890 AM_CONDITIONAL(HAVE_LIBRAW, test "$have_libraw" = "yes")
892 AC_SUBST(LIBRAW_CFLAGS) 
893 AC_SUBST(LIBRAW_LIBS) 
896 ##################
897 # Check for Jasper
898 ##################
900 AC_ARG_WITH(jasper, [  --without-jasper        build without Jasper support])
902 have_jasper="no"
903 if test "x$with_jasper" != "xno"; then
904   ## Some systems have pkg-config patches in their packages (Eg, Fedora but
905   ## not Gentoo). Try this first though.
906   PKG_CHECK_MODULES(JASPER, jasper >= jasper_required_version,
907     have_jasper="yes", [
908       ## For systems without pkg-config data, check for the existence of a
909       ## function introduced into the latest version (1.900.1).
910       AC_CHECK_LIB([jasper], [jas_stream_freopen], [
911           have_jasper="yes"
912           JASPER_LIBS="-ljasper"
913           JASPER_CFLAGS=""
914       ], [
915         have_jasper="no  (jasper library not found)"
916       ])
917     ]
918   )
921 AM_CONDITIONAL(HAVE_JASPER, test "$have_jasper" = "yes")
923 AC_SUBST(JASPER_CFLAGS)
924 AC_SUBST(JASPER_LIBS)
927 ####################
928 # Check for graphviz
929 ####################
931 AC_ARG_WITH(graphviz, [  --without-graphviz      build without graphviz support])
933 have_graphviz="no"
934 if test "x$with_graphviz" != "xno"; then
935   AC_PATH_PROG(GRAPHVIZ, dot, no)
937   if test "$GRAPHVIZ" = "no"; then
938     have_graphviz="no  (graphviz not found)"
939     AC_MSG_RESULT([*** Check for dot command from graphviz failed.])
940   else
941     have_graphviz="yes"
942   fi
945 AM_CONDITIONAL(HAVE_GRAPHVIZ, test "$have_graphviz" = "yes")
948 ###############
949 # Check for Lua
950 ###############
952 AC_ARG_WITH(lua, [  --without-lua           build without Lua support])
954 have_lua="no"
955 if test "x$with_lua" != "xno"; then
956 PKG_CHECK_MODULES(LUA, lua >= $LUA_REQUIRED_VERSION,
957   have_lua="yes",
958   [PKG_CHECK_MODULES(LUA, lua5.1 >= $LUA_REQUIRED_VERSION,
959      have_lua="yes",
960      have_lua="no  (usable lua not found)")])
963 AM_CONDITIONAL(HAVE_LUA, test "$have_lua" = "yes")
965 AC_SUBST(LUA_CFLAGS) 
966 AC_SUBST(LUA_LIBS) 
969 ####################################
970 # Check for libavformat / libavcodec
971 ####################################
973 AC_ARG_WITH(libavformat,  [  --without-libavformat   build without libavformat support])
975 if test "x$with_libavformat" != xno; then
976   PKG_CHECK_MODULES(AVFORMAT, libavformat >= 53.0.0 libavcodec >= 53.0.0,
977     have_libavformat="yes",
978     have_libavformat="no  (libavformat not found)")
979   # verify the presence of the avformat.h header
980   if test "x$have_libavformat" = "xyes"; then
981     gegl_save_CPPFLAGS=$CPPFLAGS
982     CPPFLAGS="$AVFORMAT_CFLAGS $CPPFLAGS"
983     AC_CHECK_HEADER([libavformat/avformat.h],
984       AC_DEFINE(HAVE_LIBAVFORMAT_AVFORMAT_H, 1,
985                 [define to 1 if avformat.h is found in libavformat]),
986       [have_libavformat="no  (avformat.h not found where expected)"])
987     # on some systems the header needs to be included differently
988     if test "x$have_libavformat" != "xyes"; then
989       AC_CHECK_HEADER([avformat.h], [have_libavformat="yes"])
990     fi
991     CPPFLAGS=$gegl_save_CPPFLAGS
992   fi
993 else
994   have_libavformat="no  (disabled)"
996 AM_CONDITIONAL(HAVE_AVFORMAT, test "x$have_libavformat" = "xyes")
999 ###############
1000 # Check for V4L
1001 ###############
1003 AC_ARG_WITH(libv4l, [  --without-libv4l        build without V4L support])
1005 have_v4l="no"
1006 if test "x$with_libv4l" != "xno"; then
1007   AC_CHECK_HEADER(linux/videodev.h, have_v4l="yes")
1010 AM_CONDITIONAL(HAVE_V4L, test "$have_v4l" = "yes")
1012 ################
1013 # Check for lcms
1014 ################
1016 AC_ARG_WITH(lcms, [  --without-lcms          build without lcms support])
1018 have_lcms="no (lcms support disabled)"
1019 if test "x$with_lcms" != xno; then
1020   have_lcms=yes
1021   PKG_CHECK_MODULES(LCMS, lcms2 >= lcms_required_version,
1022     AC_DEFINE(HAVE_LCMS, 1, [Define to 1 if lcms is available])
1023     LCMS='lcms$(EXEEXT)',
1024     have_lcms="no (lcms not found or unusable)")
1027 AC_SUBST(LCMS)
1028 AM_CONDITIONAL(HAVE_LCMS, test "x$have_lcms" = xyes)
1030 ####################
1031 # Check for libspiro
1032 ####################
1034 AC_ARG_WITH(libspiro, [  --without-libspiro      build without SPIRO support])
1036 spiro_ok="no"
1037 if test "x$with_libspiro" != "xno" && test -z "$LIBSPIRO"; then
1038   AC_CHECK_LIB(spiro, run_spiro,
1039     spiro_ok="yes",
1040     spiro_ok="no  (usable SPIRO library not found)")
1041   if test "$spiro_ok" = "yes"; then
1042     AC_CHECK_HEADER([spiro.h],
1043       spiro_ok="yes"
1044       AC_DEFINE(HAVE_SPIRO, 1,
1045                 [Define to 1 if the spiro library is available])
1046       LIBSPIRO='-lspiro',
1047       spiro_ok="no  (Can't include spiro.h)",
1048       [#include <bezctx_intf.h>])
1049   fi
1052 AM_CONDITIONAL(HAVE_SPIRO, test "$spiro_ok" = "yes")
1054 AC_SUBST(LIBSPIRO)
1056 ###################
1057 # Check for exiv2
1058 ###################
1060 AC_ARG_WITH(exiv2, [  --without-exiv2         build without libexiv2 support])
1062 have_libexiv2="no"
1063 if test "x$with_libexiv2" != "xno"; then
1064   PKG_CHECK_MODULES(EXIV2, exiv2,
1065     have_exiv2="yes",
1066     have_exiv2="no  (exiv2 library not found)")
1069 AM_CONDITIONAL(HAVE_EXIV2, test "$have_exiv2" = "yes")
1071 AC_SUBST(EXIV2_CFLAGS)
1072 AC_SUBST(EXIV2_CXXFLAGS)
1073 AC_SUBST(EXIV2_LIBS)
1075 ###################
1076 # Check for UMFPACK
1077 ###################
1079 AC_ARG_WITH(umfpack, [  --without-umfpack       build without UMFPACK support])
1081 # AC_CHECK_HEADERS checks the expected locations for the umfpack header. We
1082 # would really like to set UMFPACK_CFLAGS appropriately, however there's no
1083 # readily apparent way of reliably obtaining the appropriate header directory
1084 # to add to the include list. So we rely on the automatic HAVE_<PATH> defines
1085 # and do it within the code.
1086 have_umfpack="no"
1087 if test "x$with_umfpack" != "xno"; then
1088   AC_CHECK_LIB(umfpack, umfpack_dl_solve, [
1089     AC_CHECK_HEADERS([umfpack.h suitesparse/umfpack.h] , [
1090       have_umfpack="yes"
1091       UMFPACK_LIBS="-lumfpack"
1092       break
1093     ])
1094   ])
1096   if test "x$have_umfpack" != "xyes"; then
1097     have_umfpack="no  (usable umfpack library not found)"
1098   fi
1101 AM_CONDITIONAL(HAVE_UMFPACK, test "x$have_umfpack" = "xyes")
1102 AC_SUBST(UMFPACK_CFLAGS)
1103 AC_SUBST(UMFPACK_LIBS)
1105 ################
1106 # Check for webp
1107 ################
1109 AC_ARG_WITH(webp, [  --without-webp          build without webp support])
1111 have_webp="no"
1112 if test "x$with_webp" != "xno"; then
1113   PKG_CHECK_MODULES(WEBP, libwebp >= webp_required_version,
1114     have_webp="yes",
1115     have_webp="no  (webp library not found)")
1118 AM_CONDITIONAL(HAVE_WEBP, test "$have_webp" = "yes")
1120 AC_SUBST(WEBP_CFLAGS) 
1121 AC_SUBST(WEBP_LIBS) 
1123 ######################
1124 # Check for poly2tri-c
1125 ######################
1127 have_p2tc="no"
1128 PKG_CHECK_MODULES(P2TC, poly2tri-c >= poly2tri-c_required_version,
1129   have_p2tc="yes",
1130   have_p2tc="yes (internal)")
1132 AM_CONDITIONAL(HAVE_P2TC, test "$have_p2tc" = "yes")
1134 AC_SUBST(P2TC_CFLAGS)
1135 AC_SUBST(P2TC_LIBS)
1136 AC_SUBST(P2TC_PACKAGES, "poly2tri-c")
1138 # If no poly2tri-c version is installed, we should use the local version
1139 # we have cached in the libs directory
1140 if test "x$have_p2tc" != "xyes"; then
1141   AC_SUBST(P2TC_CFLAGS, "-I\$(top_srcdir)/libs/poly2tri-c")
1142   AC_SUBST(P2TC_LIBS, "-L\$(top_builddir)/libs/poly2tri-c/poly2tri-c -lpoly2tri-c")
1143   AC_SUBST(P2TC_PACKAGES, "")
1146 ##################
1147 # Check for libnpd
1148 ##################
1149 have_libnpd="yes (internal)"
1151 AC_SUBST(NPD_CFLAGS, "-I\$(top_srcdir)/libs")
1152 AC_SUBST(NPD_LIBS, "-L\$(top_builddir)/libs/npd -lgegl-npd-\$(GEGL_API_VERSION)")
1154 #######################
1155 # Check for other items
1156 #######################
1158 # For backtrace()
1159 AC_CHECK_HEADERS([execinfo.h])
1161 # w3m is used to autogenerate README
1162 AC_PATH_PROG(W3M, w3m, no)
1163 AM_CONDITIONAL(HAVE_W3M, test "x$W3M" != "xno")
1165 dnl disable build of workshop operations.
1166 AC_ARG_ENABLE([workshop],
1167               [  --enable-workshop       enable build of workshop operations (default=no)],,
1168               enable_workshop="no")
1170 AM_CONDITIONAL(ENABLE_WORKSHOP, test "x$enable_workshop" = "xyes")
1172 # check for rint
1173 AC_CHECK_FUNC(rint, AC_DEFINE(HAVE_RINT, 1,
1174                               [Define to 1 if you have the rint function.]), [ 
1175                   AC_CHECK_LIB(m, rint, [AC_DEFINE(HAVE_RINT)])])
1178 #######################
1179 # Enable extra warnings
1180 #######################
1183 DESIRED_CFLAGS="-Wall -Wdeclaration-after-statement -Wmissing-prototypes -Wmissing-declarations -Winit-self -Wpointer-arith -Wold-style-definition"
1185 # muks would like:
1186 #   DESIRED_CFLAGS+="-fdiagnostics-show-option -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wundef -Wformat=2 -Wlogical-op -Wmissing-include-dirs -Wformat-nonliteral -Wnested-externs -Wpacked -Wno-long-long -Wno-overlength-strings -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wwrite-strings -Wp,-D_FORTIFY_SOURCE=2 -fno-common"
1188 # Also desirable:
1189 #   DESIRED_CFLAGS+="-Wfloat-equal -Waggregate-return -Wredundant-decls $DESIRED_CFLAGS"
1191 #if test -z "${MAINTAINER_MODE_TRUE}"; then
1192 #   DESIRED_CFLAGS="-Werror $DESIRED_CFLAGS"
1195 for flag in $DESIRED_CFLAGS; do
1196    AS_COMPILER_FLAG([$flag], [CFLAGS="$CFLAGS $flag"])
1197 done
1199 # We should support this at some point if possible
1200 #LDFLAGS="-Wl,-z,defs"
1202 CFLAGS="$CFLAGS -DG_LOG_DOMAIN=\\\"GEGL-\\\"__FILE__"
1204 dnl bin/node-editors/Makefile
1205 AC_CONFIG_FILES([
1206 Makefile
1207 bin/Makefile
1208 gegl/Makefile
1209 gegl/gegl-version.h
1210 gegl/buffer/Makefile
1211 gegl/graph/Makefile
1212 gegl/module/Makefile
1213 gegl/operation/Makefile
1214 gegl/process/Makefile
1215 gegl/property-types/Makefile
1216 gegl/opencl/Makefile
1217 libs/Makefile
1218 libs/rgbe/Makefile
1219 libs/npd/Makefile
1220 libs/poly2tri-c/Makefile
1221 libs/poly2tri-c/poly2tri-c/Makefile
1222 libs/poly2tri-c/poly2tri-c/render/Makefile
1223 libs/poly2tri-c/poly2tri-c/p2t/sweep/Makefile
1224 libs/poly2tri-c/poly2tri-c/p2t/common/Makefile
1225 libs/poly2tri-c/poly2tri-c/p2t/Makefile
1226 libs/poly2tri-c/poly2tri-c/refine/Makefile
1227 seamless-clone/Makefile
1228 operations/Makefile
1229 operations/core/Makefile
1230 operations/json/Makefile
1231 operations/common/Makefile
1232 operations/common/perlin/Makefile
1233 operations/seamless-clone/Makefile
1234 operations/external/Makefile
1235 operations/generated/Makefile
1236 operations/transform/Makefile
1237 operations/workshop/Makefile
1238 operations/workshop/external/Makefile
1239 operations/workshop/generated/Makefile
1240 tools/Makefile
1241 docs/Makefile
1242 docs/index.txt
1243 docs/hello-world.txt
1244 docs/copyright.txt
1245 examples/Makefile
1246 examples/data/Makefile
1247 tests/Makefile
1248 tests/buffer/Makefile
1249 tests/buffer/reference/Makefile
1250 tests/buffer/tests/Makefile
1251 tests/compositions/Makefile
1252 tests/compositions/data/Makefile
1253 tests/python/Makefile
1254 tests/simple/Makefile
1255 tests/xml/Makefile
1256 tests/xml/data/Makefile
1257 perf/Makefile
1258 po/Makefile.in
1259 gegl-uninstalled.pc
1260 opencl/Makefile
1263 # Files with versions in their names
1264 AC_CONFIG_FILES(
1265 gegl-gegl_api_version.pc:gegl.pc.in
1266 gegl/gegl-gegl_api_version.deps:gegl/gegl.deps.in
1267 gegl/Gegl-gegl_api_version.metadata:gegl/Gegl.metadata.in
1268 seamless-clone/gegl-sc-gegl_api_version.pc:seamless-clone/gegl-sc.pc.in
1271 AC_OUTPUT
1273 dnl Print a summary of features enabled/disabled:
1274 AC_MSG_RESULT([
1275 Building GEGL with prefix=$prefix
1277 Optional features:
1278   GEGL docs:       $enable_docs
1279   Build workshop:  $enable_workshop
1280   Build website:   $have_asciidoc
1281   SIMD:            sse:$enable_sse mmx:$enable_mmx
1282   Vala support:    $have_vala
1284 Optional dependencies:
1285   asciidoc:        $have_asciidoc
1286   enscript:        $have_enscript
1287   Ruby:            $have_ruby
1288   Lua:             $have_lua
1289   Cairo:           $have_cairo
1290   Pango:           $have_pango
1291   pangocairo:      $have_pangocairo
1292   GDKPixbuf:       $have_gdk_pixbuf
1293   JPEG:            $jpeg_ok
1294   PNG:             $have_libpng
1295   OpenEXR:         $have_openexr
1296   rsvg:            $have_librsvg
1297   SDL:             $have_sdl
1298   libraw:          $have_libraw
1299   Jasper:          $have_jasper
1300   graphviz:        $have_graphviz
1301   avformat:        $have_libavformat
1302   V4L:             $have_v4l
1303   V4L2:            $have_libv4l2
1304   spiro:           $spiro_ok
1305   EXIV:            $have_exiv2
1306   umfpack:         $have_umfpack
1307   webp:            $have_webp
1308   poly2tri-c:      $have_p2tc