Updated Portuguese translation
[cheese.git] / configure.ac
blobb0d332c654aa00a62bcac9e22a8901bc9649ad79
1 # Process this file with autoconf to produce a configure script.
2 AC_PREREQ([2.64])
3 AC_INIT([Cheese],
4         [3.19.90],
5         [https://bugzilla.gnome.org/enter_bug.cgi?product=cheese],
6         [cheese],
7         [https://wiki.gnome.org/Apps/Cheese])
9 AC_CONFIG_AUX_DIR([build-aux])
10 AC_CONFIG_HEADERS([config.h])
11 AC_CONFIG_SRCDIR([configure.ac])
12 AC_CONFIG_MACRO_DIR([m4])
14 AM_INIT_AUTOMAKE([1.12 -Wall -Wno-portability dist-xz no-define no-dist-gzip nostdinc subdir-objects])
15 AM_MAINTAINER_MODE([enable])
16 AM_SILENT_RULES([yes])
18 dnl https://github.com/cgwalters/build-api
19 dnl We don't support separate builddir when building from git
20 echo \#buildapi-variable-no-builddir >/dev/null
22 # Check for programs
23 AC_PROG_CC
24 AM_PROG_CC_C_O
25 AC_PROG_SED
26 AM_PROG_VALAC([0.25.2])
28 # Initialize libtool
29 LT_PREREQ([2.2])
30 LT_INIT([disable-static])
32 # Find an appropriate libm, for fmod()
33 LT_LIB_M
35 PKG_PROG_PKG_CONFIG([0.24])
37 AC_SUBST([CHEESE_WFLAGS], ["-Wall"])
39 GNOME_COMPILE_WARNINGS([maximum])
41 #*******************************************************************************
42 # Libraries
43 #*******************************************************************************
44 # Before making a release, the CHEESE_LT_VERSION string should be modified.
45 # The string is of the form C:R:A.
46 # - If interfaces have been changed or added, but binary compatibility has
47 #   been preserved, change to C+1:0:A+1
48 # - If binary compatibility has been broken (eg removed or changed interfaces)
49 #   change to C+1:0:0
50 # - If the interface is the same as the previous version, change to C:R+1:A
51 AC_SUBST([LIBCHEESE_LT_VERSION], [8:3:0])
52 AC_SUBST([LIBCHEESE_GTK_LT_VERSION], [25:3:0])
54 #*******************************************************************************
55 # Internationalization
56 #*******************************************************************************
57 AC_SUBST([GETTEXT_PACKAGE], [$PACKAGE_TARNAME])
58 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [GETTEXT package name])
59 AX_REQUIRE_DEFINED([IT_PROG_INTLTOOL])
60 IT_PROG_INTLTOOL([0.50.0])
62 #*******************************************************************************
63 # Check required libraries
64 #*******************************************************************************
67 GLIB_REQUIRED="glib-2.0 >= 2.39.90"
68 GTK_REQUIRED="gtk+-3.0 >= 3.13.4"
69 GDK_PIXBUF_REQUIRED="gdk-pixbuf-2.0"
70 GSTREAMER_REQUIRED="gstreamer-pbutils-1.0 gstreamer-plugins-bad-1.0 >= 1.4"
71 LIBGNOMEDESKTOP_REQUIRED="gnome-desktop-3.0"
72 CLUTTER_REQUIRED="clutter-1.0 >= 1.13.2"
73 CLUTTERGTK_REQUIRED="clutter-gtk-1.0"
74 CLUTTERGST_REQUIRED="clutter-gst-3.0 >= 3.0.0"
75 LIBCANBERRA_REQUIRED="libcanberra-gtk3 >= 0.26"
76 X11_REQUIRED="x11"
77 GNOME_VIDEO_EFFECTS_REQUIRED="gnome-video-effects"
79 AC_CHECK_HEADER([X11/extensions/XTest.h],
80   [AC_CHECK_LIB([Xtst], [XTestFakeKeyEvent],
81     [AC_SUBST([XTEST_LIBS], ["-lX11 -lXtst"])])])
82 AM_CONDITIONAL([HAVE_XTEST], test "x$ac_cv_lib_Xtst_XTestFakeKeyEvent" = "xyes")
84 PKG_CHECK_MODULES([CHEESE],
85   [$GLIB_REQUIRED
86   $X11_REQUIRED
87   $GDK_PIXBUF_REQUIRED
88   $GSTREAMER_REQUIRED
89   $LIBGNOMEDESKTOP_REQUIRED
90   $CLUTTER_REQUIRED
91   $CLUTTERGST_REQUIRED])
93 PKG_CHECK_MODULES([CHEESE_GTK],
94   [$GTK_REQUIRED
95    $CLUTTERGTK_REQUIRED
96    $LIBCANBERRA_REQUIRED])
98 PKG_CHECK_EXISTS([$GNOME_VIDEO_EFFECTS_REQUIRED],
99                  [],
100                  [AC_MSG_WARN([The $GNOME_VIDEO_EFFECTS_REQUIRED package is required at runtime for effects])])
102 # GLib programs.
103 AC_SUBST([GLIB_COMPILE_RESOURCES], [`$PKG_CONFIG --variable glib_compile_resources gio-2.0`])
104 AC_SUBST([GDBUS_CODEGEN], [`$PKG_CONFIG --variable gdbus_codegen gio-2.0`])
106 # Recommend some runtime GStreamer plugins.
107 AC_PATH_PROGS([GST_INSPECT], [gst-inspect-1.0], [notfound])
108 AS_IF([test "x$GST_INSPECT" = "xnotfound"],
109   [AC_MSG_WARN([unable to check for runtime GStreamer plugin dependencies])],
110   [GST_RUNTIME_PLUGINS="camerabin vp8enc webmmux"
111    for gst_runtime_plugin in $GST_RUNTIME_PLUGINS
112    do
113      AC_MSG_CHECKING([for $gst_runtime_plugin GStreamer plugin])
114      AS_IF([$GST_INSPECT $gst_runtime_plugin >&AS_MESSAGE_LOG_FD],
115        [AC_MSG_RESULT([found])],
116        [AC_MSG_RESULT([not found])
117         AC_MSG_WARN([$gst_runtime_plugin was not found. It needs to be installed before Cheese is run])])
118    done])
120 # Check for GLib testing utilities.
121 AC_PATH_PROG([GTESTER], [gtester], [notfound])
122 AC_PATH_PROG([GTESTER_REPORT], [gtester-report], [notfound])
123 AS_IF([test "x$GTESTER" = "xnotfound" -o "x$GTESTER_REPORT" = "xnotfound"],
124   [AC_MSG_WARN([testing disabled as the required utilities were not found])],
125   [CHEESE_ENABLE_TESTS=true
126    AC_SUBST([GTESTER])
127    AC_SUBST([GTESTER_REPORT])])
128 AM_CONDITIONAL([CHEESE_ENABLE_TESTS], [test "x$CHEESE_ENABLE_TESTS" = "xtrue"])
130 # Check for lcov.
131 AC_ARG_ENABLE([lcov],
132   [AS_HELP_STRING([--disable-lcov], [Disable lcov code coverage testing])])
134 AS_IF([test "x$enable_lcov" != "xno"],
135   [AC_PATH_PROG([LCOV], [lcov], [notfound])
136    AC_PATH_PROG([LCOV_GENHTML], [genhtml], [notfound])
137    AS_IF([test "x$LCOV" = "xnotfound" -o "x$LCOV_GENHTML" = "xnotfound"],
138      [have_lcov=no],
139      [have_lcov=yes])],
140   [have_lcov=no])
142 AS_IF([test "x$have_lcov" = "xyes"],
143   [AC_SUBST([LCOV])
144    AC_SUBST([LCOV_GENHTML])
145    CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
146    LDFLAGS="$LDFLAGS -lgcov"],
147   [AS_IF([test "x$enable_lcov" = "xyes"],
148      [AC_MSG_ERROR([lcov code coverage reporting requested but not found])])])
150 AM_CONDITIONAL([CHEESE_ENABLE_LCOV], [test "x$have_lcov" = "xyes"])
152 AC_MSG_CHECKING([for glib-mkenums script])
153 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
154 AS_IF([test "x$GLIB_MKENUMS" = "x"],
155   [AC_MSG_ERROR([glib-mkenums not listed in glib-2.0 pkg-config file])],
156   [AC_SUBST([GLIB_MKENUMS])
157    AC_MSG_RESULT([$GLIB_MKENUMS])])
159 AX_REQUIRE_DEFINED([GOBJECT_INTROSPECTION_CHECK])
160 GOBJECT_INTROSPECTION_CHECK([0.6.7])
162 # API documentation
163 AX_REQUIRE_DEFINED([GTK_DOC_CHECK])
164 GTK_DOC_CHECK([1.14], [--flavour no-tmpl])
166 # Manpage, generated with gtk-doc and xsltproc from DocBook XML.
167 AC_ARG_ENABLE([man],
168   [AS_HELP_STRING([--disable-man], [Disable building the man page])])
170 AS_IF([test "x$enable_man" != "xno"],
171   [AC_CHECK_PROG([have_xsltproc], [xsltproc], [yes], [no])
172    JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN],
173      [DocBook XML DTD V4.3], [have_docbookdtd=yes], [have_docbookdtd=no])
174    JH_CHECK_XML_CATALOG(
175      [http://docbook.sourceforge.net/release/xsl/current/html/refentry.xsl],
176      [DocBook XSL Stylesheets], [have_docbookxsl=yes], [have_docbookxsl=no])
177    AS_IF([test "x$have_xsltproc" = "xyes" -a "x$have_docbookdtd" = "xyes" \
178      -a "x$have_docbookxsl" = "xyes"],
179      [have_manutils=yes],
180      [AS_IF([test "x$enable_man" = "xyes"],
181        [AC_MSG_ERROR(
182          [manpage generation requested but required utilities were not found])])
183       have_manutils=no])],
184   [have_manutils=no])
186 AM_CONDITIONAL([ENABLE_MAN], [test "x$have_manutils" = "xyes"])
188 # Mallard help
189 AX_REQUIRE_DEFINED([YELP_HELP_INIT])
190 YELP_HELP_INIT
192 # AppData
193 AX_REQUIRE_DEFINED([APPSTREAM_XML])
194 APPSTREAM_XML
196 GLIB_GSETTINGS
197 #*******************************************************************************
199 AC_CONFIG_FILES([
200 Makefile
201 docs/reference/Makefile
202 docs/reference/version.xml
203 data/cheese.pc
204 data/cheese-gtk.pc
205 data/org.gnome.Cheese.desktop.in
206 help/Makefile
207 po/Makefile.in
209 AC_OUTPUT
211 #**************************************************************************