Chain up to finalize in UmCropArea
[cheese.git] / configure.ac
blob24239082ec83d37a303745811692292bdafdc235
1 # Process this file with autoconf to produce a configure script.
2 AC_PREREQ([2.64])
3 AC_INIT([Cheese],
4         [3.11.2],
5         [https://bugzilla.gnome.org/enter_bug.cgi?product=cheese],
6         [cheese],
7         [http://projects.gnome.org/cheese/])
9 AC_CONFIG_AUX_DIR([build-aux])
10 AC_CONFIG_HEADERS([cheese-config.h])
11 AC_CONFIG_SRCDIR([configure.ac])
12 AC_CONFIG_MACRO_DIR([m4])
14 AM_INIT_AUTOMAKE([1.11 -Wall -Wno-portability dist-xz no-define no-dist-gzip nostdinc subdir-objects])
15 AM_MAINTAINER_MODE([enable])
16 AM_SILENT_RULES([yes])
18 # Check for programs
19 AC_PROG_CC
20 AM_PROG_CC_C_O
21 AM_PROG_VALAC([0.22.0])
23 # Initialize libtool
24 LT_PREREQ([2.2])
25 LT_INIT([disable-static])
27 PKG_PROG_PKG_CONFIG([0.24])
29 AC_SUBST([CHEESE_WFLAGS], ["-Wall -DGSEAL_ENABLE"])
31 GNOME_MAINTAINER_MODE_DEFINES
32 GNOME_COMPILE_WARNINGS([maximum])
34 #*******************************************************************************
35 # Libraries
36 #*******************************************************************************
37 # Before making a release, the CHEESE_LT_VERSION string should be modified.
38 # The string is of the form C:R:A.
39 # - If interfaces have been changed or added, but binary compatibility has
40 #   been preserved, change to C+1:0:A+1
41 # - If binary compatibility has been broken (eg removed or changed interfaces)
42 #   change to C+1:0:0
43 # - If the interface is the same as the previous version, change to C:R+1:A
44 AC_SUBST([LIBCHEESE_LT_VERSION], [7:16:0])
45 AC_SUBST([LIBCHEESE_GTK_LT_VERSION], [24:0:1])
47 #*******************************************************************************
48 # Internationalization
49 #*******************************************************************************
50 AC_SUBST([GETTEXT_PACKAGE], [$PACKAGE_TARNAME])
51 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [GETTEXT package name])
52 IT_PROG_INTLTOOL([0.50.0])
54 #*******************************************************************************
55 # Check required libraries
56 #*******************************************************************************
59 GLIB_REQUIRED="glib-2.0 >= 2.38.0"
60 GTK_REQUIRED="gtk+-3.0 >= 3.10.0"
61 GDK_PIXBUF_REQUIRED="gdk-pixbuf-2.0"
62 LIBGNOMEDESKTOP_REQUIRED="gnome-desktop-3.0 >= 2.91.6"
63 GSTREAMER_VERSION=0.11.0
64 GSTREAMER_REQUIRED="gstreamer-plugins-base-1.0 >= $GSTREAMER_VERSION gstreamer-1.0 >= $GSTREAMER_VERSION gstreamer-pbutils-1.0 >= $GSTREAMER_VERSION"
65 GSTREAMER_PLUGINS_BAD_VERSION=0.11.0
66 GSTREAMER_PLUGINS_BAD_REQUIRED="gstreamer-plugins-bad-1.0 >= $GSTREAMER_PLUGINS_BAD_VERSION"
67 CAIRO_REQUIRED="cairo >= 1.10.0"
68 PANGOCAIRO_REQUIRED="pangocairo >= 1.28.0"
69 LIBRSVG_REQUIRED="librsvg-2.0 >= 2.32.0"
70 CLUTTER_REQUIRED="clutter-1.0 >= 1.13.2"
71 CLUTTERGTK_REQUIRED="clutter-gtk-1.0 >= 0.91.8"
72 CLUTTERGST_REQUIRED="clutter-gst-2.0 >= 1.9.0"
73 LIBCANBERRA_REQUIRED="libcanberra-gtk3 >= 0.26"
74 X11_REQUIRED="x11"
75 GNOME_VIDEO_EFFECTS_REQUIRED="gnome-video-effects"
77 # Libtool requires this, but it is only expanded once anyway.
78 AC_CANONICAL_HOST
80 AC_MSG_CHECKING([host operating system])
81 AS_CASE([$host_os],
82   [*linux-*], [AC_MSG_RESULT([Linux])
83     UDEV_REQUIRED="gudev-1.0"],
84   [AC_MSG_RESULT([unsupported operating system])])
86 AC_MSG_CHECKING([for gudev-1.0])
87 AS_IF([test -n "$UDEV_REQUIRED"],
88   [PKG_CHECK_EXISTS([$UDEV_REQUIRED],
89     [AC_MSG_RESULT([found])
90      AC_DEFINE([HAVE_UDEV], [], [Enable gudev support])],
91     [AC_MSG_ERROR([$UDEV_REQUIRED not found])])],
92   [AC_MSG_RESULT([not needed])])
94 AC_CHECK_HEADERS([sys/videoio.h])
96 AC_CHECK_HEADER([X11/extensions/XTest.h],
97   [AC_CHECK_LIB([Xtst], [XTestFakeKeyEvent],
98     [AC_SUBST([XTEST_LIBS], ["-lX11 -lXtst"])])])
99 AM_CONDITIONAL([HAVE_XTEST], test "x$ac_cv_lib_Xtst_XTestFakeKeyEvent" = "xyes")
101 PKG_CHECK_MODULES([CHEESE],
102   [$GLIB_REQUIRED
103   $X11_REQUIRED
104   $GDK_PIXBUF_REQUIRED
105   $GSTREAMER_REQUIRED
106   $GSTREAMER_PLUGINS_BAD_REQUIRED
107   $LIBGNOMEDESKTOP_REQUIRED
108   $CAIRO_REQUIRED
109   $PANGOCAIRO_REQUIRED
110   $CLUTTER_REQUIRED
111   $CLUTTERGST_REQUIRED
112   $UDEV_REQUIRED])
114 PKG_CHECK_MODULES([CHEESE_GTK],
115   [$GTK_REQUIRED
116    $LIBRSVG_REQUIRED
117    $CLUTTERGTK_REQUIRED
118    $LIBCANBERRA_REQUIRED
119    $UDEV_REQUIRED
120    $GNOME_VIDEO_EFFECTS_REQUIRED])
122 # Resources.
123 AC_SUBST([GLIB_COMPILE_RESOURCES], [`$PKG_CONFIG --variable glib_compile_resources gio-2.0`])
125 # Recommend some runtime GStreamer plugins.
126 AC_PATH_PROGS([GST_INSPECT], [gst-inspect-1.0], [notfound])
127 AS_IF([test "x$GST_INSPECT" = "xnotfound"],
128   [AC_MSG_WARN([unable to check for runtime GStreamer plugin dependencies])],
129   [GST_RUNTIME_PLUGINS="camerabin vp8enc webmmux"
130    for gst_runtime_plugin in $GST_RUNTIME_PLUGINS
131    do
132      AC_MSG_CHECKING([for $gst_runtime_plugin GStreamer plugin])
133      AS_IF([$GST_INSPECT $gst_runtime_plugin >&AS_MESSAGE_LOG_FD],
134        [AC_MSG_RESULT([found])],
135        [AC_MSG_RESULT([not found])
136         AC_MSG_WARN([$gst_runtime_plugin was not found. It needs to be installed before Cheese is run])])
137    done])
139 # Check for GLib testing utilities.
140 AC_PATH_PROG([GTESTER], [gtester], [notfound])
141 AC_PATH_PROG([GTESTER_REPORT], [gtester-report], [notfound])
142 AS_IF([test "x$GTESTER" = "xnotfound" -o "x$GTESTER_REPORT" = "xnotfound"],
143   [AC_MSG_WARN([testing disabled as the required utilities were not found])],
144   [CHEESE_ENABLE_TESTS=true
145    AC_SUBST([GTESTER])
146    AC_SUBST([GTESTER_REPORT])])
147 AM_CONDITIONAL([CHEESE_ENABLE_TESTS], [test "x$CHEESE_ENABLE_TESTS" = "xtrue"])
149 # Check for lcov.
150 AC_ARG_ENABLE([lcov],
151   [AS_HELP_STRING([--disable-lcov], [Disable lcov code coverage testing])])
153 AS_IF([test "x$enable_lcov" != "xno"],
154   [AC_PATH_PROG([LCOV], [lcov], [notfound])
155    AC_PATH_PROG([LCOV_GENHTML], [genhtml], [notfound])
156    AS_IF([test "x$LCOV" = "xnotfound" -o "x$LCOV_GENHTML" = "xnotfound"],
157      [have_lcov=no],
158      [have_lcov=yes])],
159   [have_lcov=no])
161 AS_IF([test "x$have_lcov" = "xyes"],
162   [AC_SUBST([LCOV])
163    AC_SUBST([LCOV_GENHTML])
164    CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
165    LDFLAGS="$LDFLAGS -lgcov"],
166   [AS_IF([test "x$enable_lcov" = "xyes"],
167      [AC_MSG_ERROR([lcov code coverage reporting requested but not found])])])
169 AM_CONDITIONAL([CHEESE_ENABLE_LCOV], [test "x$have_lcov" = "xyes"])
171 AC_MSG_CHECKING([for glib-mkenums script])
172 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
173 AS_IF([test "x$GLIB_MKENUMS" = "x"],
174   [AC_MSG_ERROR([glib-mkenums not listed in glib-2.0 pkg-config file])],
175   [AC_SUBST([GLIB_MKENUMS])
176    AC_MSG_RESULT([$GLIB_MKENUMS])])
178 GOBJECT_INTROSPECTION_CHECK([0.6.7])
180 # API documentation
181 GTK_DOC_CHECK([1.14], [--flavour no-tmpl])
183 # Manpage, generated with gtk-doc and xsltproc from DocBook XML.
184 AC_ARG_ENABLE([man],
185   [AS_HELP_STRING([--disable-man], [Disable building the man page])])
187 AS_IF([test "x$enable_man" != "xno"],
188   [AC_CHECK_PROG([have_xsltproc], [xsltproc], [yes], [no])
189    JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN],
190      [DocBook XML DTD V4.3], [have_docbookdtd=yes], [have_docbookdtd=no])
191    JH_CHECK_XML_CATALOG(
192      [http://docbook.sourceforge.net/release/xsl/current/html/refentry.xsl],
193      [DocBook XSL Stylesheets], [have_docbookxsl=yes], [have_docbookxsl=no])
194    AS_IF([test "x$have_xsltproc" = "xyes" -a "x$have_docbookdtd" = "xyes" \
195      -a "x$have_docbookxsl" = "xyes"],
196      [have_manutils=yes],
197      [AS_IF([test "x$enable_man" = "xyes"],
198        [AC_MSG_ERROR(
199          [manpage generation requested but required utilities were not found])])
200       have_manutils=no])],
201   [have_manutils=no])
203 AM_CONDITIONAL([ENABLE_MAN], [test "x$have_manutils" = "xyes"])
205 # Mallard help
206 YELP_HELP_INIT
208 # AppData
209 APPDATA_XML
211 GLIB_GSETTINGS
212 #*******************************************************************************
214 AC_CONFIG_FILES([
215 Makefile
216 docs/reference/Makefile
217 docs/reference/version.xml
218 data/cheese.pc
219 data/cheese-gtk.pc
220 data/cheese.desktop.in
221 help/Makefile
222 po/Makefile.in
224 AC_OUTPUT
226 #**************************************************************************