Check nautilus-sendto dependency in configure
[cheese.git] / configure.ac
blob47f003d4b7130b43df13221115a8656e96dcf4b5
1 # Process this file with autoconf to produce a configure script.
2 AC_PREREQ([2.64])
3 AC_INIT([cheese],
4         [3.3.4],
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.13.2])
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], [4:1:1])
45 AC_SUBST([LIBCHEESE_GTK_LT_VERSION], [21:2:0])
47 #*******************************************************************************
48 # Internationalization
49 #*******************************************************************************
50 AC_SUBST([GETTEXT_PACKAGE], [$PACKAGE_TARNAME])
51 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [GETTEXT package name])
53 IT_PROG_INTLTOOL([0.40.0])
55 #*******************************************************************************
56 # Check required libraries
57 #*******************************************************************************
60 GLIB_REQUIRED="glib-2.0 >= 2.28.0"
61 GOBJECT_REQUIRED="gobject-2.0 >= 2.28.0"
62 GIO_REQUIRED="gio-2.0 >= 2.28.0"
63 GTK_REQUIRED="gtk+-3.0 >= 2.99.4"
64 GDK_REQUIRED="gdk-3.0 >= 2.99.4"
65 GDK_PIXBUF_REQUIRED="gdk-pixbuf-2.0"
66 LIBGNOMEDESKTOP_REQUIRED="gnome-desktop-3.0 >= 2.91.6"
67 GSTREAMER_VERSION=0.10.32
68 GSTREAMER_REQUIRED="gstreamer-plugins-base-0.10 >= $GSTREAMER_VERSION gstreamer-0.10 >= $GSTREAMER_VERSION"
69 CAIRO_REQUIRED="cairo >= 1.10.0"
70 PANGOCAIRO_REQUIRED="pangocairo >= 1.28.0"
71 LIBRSVG_REQUIRED="librsvg-2.0 >= 2.32.0"
72 CLUTTER_REQUIRED="clutter-1.0 >= 1.6.1"
73 CLUTTERGTK_REQUIRED="clutter-gtk-1.0 >= 0.91.8"
74 CLUTTERGST_REQUIRED="clutter-gst-1.0 >= 1.0.0"
75 GEE_REQUIRED="gee-1.0 >= 0.6.0"
76 LIBCANBERRA_REQUIRED="libcanberra-gtk3 >= 0.26"
77 MX_REQUIRED="mx-1.0"
78 X11_REQUIRED="x11"
79 GNOME_VIDEO_EFFECTS_REQUIRED="gnome-video-effects"
81 # Libtool requires this, but it is only expanded once anyway.
82 AC_CANONICAL_HOST
84 AC_MSG_CHECKING([host operating system])
85 AS_CASE([$host_os],
86   [*linux-*], [AC_MSG_RESULT([Linux])
87     UDEV_REQUIRED="gudev-1.0"],
88   [AC_MSG_RESULT([unsupported operating system])])
90 AC_MSG_CHECKING([for gudev-1.0])
91 AS_IF([test -n $UDEV_REQUIRED],
92   [PKG_CHECK_EXISTS([$UDEV_REQUIRED],
93     [AC_MSG_RESULT([found])
94      AC_DEFINE([HAVE_UDEV], [], [Enable gudev support])],
95     [AC_MSG_ERROR([$UDEV_REQUIRED not found])])],
96   [AC_MSG_RESULT([not needed])])
98 AC_CHECK_HEADERS([sys/videoio.h])
100 AC_CHECK_HEADER([X11/extensions/XTest.h],
101   [AC_CHECK_LIB([Xtst], [XTestFakeKeyEvent],
102     [AC_DEFINE([HAVE_XTEST], [1], [Defined if the XTEST X extension is present])
103      AC_SUBST([XTEST_LIBS], ["-lX11 -lXtst"])])
104   ])
105 AM_CONDITIONAL([HAVE_XTEST], test "x$HAVE_TEST" = "xyes")
107 PKG_CHECK_MODULES([CHEESE],
108   [$GLIB_REQUIRED
109   $GIO_REQUIRED
110   $X11_REQUIRED
111   $GOBJECT_REQUIRED
112   $GDK_PIXBUF_REQUIRED
113   $GSTREAMER_REQUIRED
114   $CAIRO_REQUIRED
115   $PANGOCAIRO_REQUIRED
116   $CLUTTER_REQUIRED
117   $CLUTTERGST_REQUIRED
118   $MX_REQUIRED
119   $UDEV_REQUIRED])
120 CHEESE_LIBS="$CHEESE_LIBS -lgstinterfaces-0.10"
122 PKG_CHECK_MODULES([CHEESE_GTK],
123   [$GIO_REQUIRED
124    $GTK_REQUIRED
125    $GDK_REQUIRED
126    $LIBGNOMEDESKTOP_REQUIRED
127    $LIBRSVG_REQUIRED
128    $CLUTTERGTK_REQUIRED
129    $GEE_REQUIRED
130    $LIBCANBERRA_REQUIRED
131    $UDEV_REQUIRED
132    $GNOME_VIDEO_EFFECTS_REQUIRED])
134 # Recommend some runtime GStreamer plugins.
135 AC_PATH_PROGS([GST_INSPECT], [gst-inspect-0.10 gst-inspect], [notfound])
136 AS_IF([test "x$GST_INSPECT" = "xnotfound"],
137   [AC_MSG_WARN([unable to check for runtime GStreamer plugin dependencies])],
138   [GST_RUNTIME_PLUGINS="camerabin theoraenc"
139    for gst_runtime_plugin in $GST_RUNTIME_PLUGINS
140    do
141      AC_MSG_CHECKING([for $gst_runtime_plugin GStreamer plugin])
142      AS_IF([$GST_INSPECT $gst_runtime_plugin >&AS_MESSAGE_LOG_FD],
143        [AC_MSG_RESULT([found])],
144        [AC_MSG_RESULT([not found])
145         AC_MSG_WARN([$gst_runtime_plugin was not found. It needs to be installed before Cheese is run])])
146    done])
148 # Check for nautilus-sendto runtime dependency.
149 NAUTILUS_SENDTO_DEP_MSG="This is a runtime dependency just needed for using the sharing functionality in Cheese."
150 NAUTILUS_SENDTO_REQUIRED=2.91.0
151 AC_PATH_PROGS([NAUTILUS_SENDTO], [nautilus-sendto], [notfound])
152 AS_IF([test "x$NAUTILUS_SENDTO" = "xnotfound"],
153   [AC_MSG_WARN([Unable to find nautilus-sendto >= $NAUTILUS_SENDTO_REQUIRED in the path. $NAUTILUS_SENDTO_DEP_MSG])],
154   [NAUTILUS_SENDTO_SYSTEM=`nautilus-sendto --version 2>/dev/null | $SED 's/nautilus-sendto //'`
155    AS_IF([echo $NAUTILUS_SENDTO_SYSTEM | $GREP 'version' >/dev/null],
156      [AC_MSG_WARN([Unable to check the version of nautilus-sendto, it is \
157 probably too old. At least $NAUTILUS_SENDTO_REQUIRED is required. \
158 $NAUTILUS_SENDTO_DEP_MSG])],
159       [AS_VERSION_COMPARE([$NAUTILUS_SENDTO_SYSTEM], [$NAUTILUS_SENDTO_REQUIRED],
160          [NS_VERSION_COMPARE=0], [NS_VERSION_COMPARE=1], [NS_VERSION_COMPARE=1])
161        AS_IF([test $NS_VERSION_COMPARE = 0],
162          [AC_MSG_WARN([Unable to find nautilus-sendto >= \
163 $NAUTILUS_SENDTO_REQUIRED in the path. The current installed version is \
164 $NAUTILUS_SENDTO_SYSTEM. $NAUTILUS_SENDTO_DEP_MSG])])])])
166 # Check for GLib testing utilities.
167 AC_PATH_PROG([GTESTER], [gtester], [notfound])
168 AC_PATH_PROG([GTESTER_REPORT], [gtester-report], [notfound])
169 AS_IF([test "x$GTESTER" = "xnotfound" -o "x$GTESTER_REPORT" = "xnotfound"],
170   [AC_MSG_WARN([testing disabled as the required utilities were not found])],
171   [CHEESE_ENABLE_TESTS=true
172    AC_SUBST([GTESTER])
173    AC_SUBST([GTESTER_REPORT])])
174 AM_CONDITIONAL([CHEESE_ENABLE_TESTS], [test "x$CHEESE_ENABLE_TESTS" = "xtrue"])
176 # Check for lcov.
177 AC_ARG_ENABLE([lcov],
178   [AS_HELP_STRING([--disable-lcov], [Disable lcov code coverage testing])])
180 AS_IF([test "x$enable_lcov" != "xno"],
181   [AC_PATH_PROG([LCOV], [lcov], [notfound])
182    AC_PATH_PROG([LCOV_GENHTML], [genhtml], [notfound])
183    AS_IF([test "x$LCOV" = "xnotfound" -o "x$LCOV_GENHTML" = "xnotfound"],
184      [have_lcov=no],
185      [have_lcov=yes])],
186   [have_lcov=no])
188 AS_IF([test "x$have_lcov" = "xyes"],
189   [AC_SUBST([LCOV])
190    AC_SUBST([LCOV_GENHTML])
191    CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
192    LDFLAGS="$LDFLAGS -lgcov"],
193   [AS_IF([test "x$enable_lcov" = "xyes"],
194      [AC_MSG_ERROR([lcov code coverage reporting requested but not found])])])
196 AM_CONDITIONAL([CHEESE_ENABLE_LCOV], [test "x$have_lcov" = "xyes"])
198 AC_MSG_CHECKING([for glib-mkenums script])
199 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
200 AS_IF([test "x$GLIB_MKENUMS" = "x"],
201   [AC_MSG_ERROR([glib-mkenums not listed in glib-2.0 pkg-config file])],
202   [AC_SUBST([GLIB_MKENUMS])
203    AC_MSG_RESULT([$GLIB_MKENUMS])])
205 GOBJECT_INTROSPECTION_CHECK([0.6.7])
207 # API documentation
208 GTK_DOC_CHECK([1.14], [--flavour no-tmpl])
210 # Manpage, generated with gtk-doc and xsltproc from DocBook XML.
211 AC_ARG_ENABLE([man],
212   [AS_HELP_STRING([--disable-man], [Disable building the man page])])
214 AS_IF([test "x$enable_man" != "xno"],
215   [AC_CHECK_PROG([have_xsltproc], [xsltproc], [yes], [no])
216    JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN],
217      [DocBook XML DTD V4.3], [have_docbookdtd=yes], [have_docbookdtd=no])
218    JH_CHECK_XML_CATALOG(
219      [http://docbook.sourceforge.net/release/xsl/current/html/refentry.xsl],
220      [DocBook XSL Stylesheets], [have_docbookxsl=yes], [have_docbookxsl=no])
221    AS_IF([test "x$have_xsltproc" = "xyes" -a "x$have_docbookdtd" = "xyes" \
222      -a "x$have_docbookxsl" = "xyes"],
223      [have_manutils=yes],
224      [AS_IF([test "x$enable_man" = "xyes"],
225        [AC_MSG_ERROR(
226          [manpage generation requested but required utilities were not found])])
227       have_manutils=no])],
228   [have_manutils=no])
230 AM_CONDITIONAL([ENABLE_MAN], [test "x$have_manutils" = "xyes"])
232 # Mallard help
233 YELP_HELP_INIT
235 GLIB_GSETTINGS
236 #*******************************************************************************
238 AC_CONFIG_FILES([
239 Makefile
240 docs/reference/Makefile
241 docs/reference/version.xml
242 data/cheese.pc
243 data/cheese-gtk.pc
244 data/cheese.desktop.in
245 help/Makefile
246 po/Makefile.in
248 AC_OUTPUT
250 #**************************************************************************