2 # configure.ac for MAFW gstreamer renderer library
4 # Author: Visa Smolander <visa.smolander@nokia.com>
6 # Copyright (C) 2007, 2008, 2009 Nokia. All rights reserved.
9 AC_INIT([mafw-gst-subtitles-renderer], [0.1.2009.47-1])
11 AC_CONFIG_SRCDIR([libmafw-gst-renderer/mafw-gst-renderer.h])
12 AC_CONFIG_HEADERS([config.h])
13 AC_CONFIG_AUX_DIR([build-aux])
15 AM_INIT_AUTOMAKE([foreign tar-ustar])
20 IT_PROG_INTLTOOL([0.35])
21 AC_SUBST([GETTEXT_PACKAGE], [mafw-gst-subtitles-renderer])
22 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [The domain to use with gettext.])
25 dnl Prevent AC_PROG_CC adding '-g -O2' to CFLAGS.
28 if test "x$GCC" = xyes; then
35 # DISABLED_BY_DEFAULT(NAME, DESCRIPTION)
36 # ---------------------------------
37 # Creates a new --enable-* option, with default value `no'.
38 AC_DEFUN([DISABLED_BY_DEFAULT], [dnl
39 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1], [$2]), [],[dnl
40 m4_bpatsubst([enable_$1], [[^0-9a-z]], [_])=no])dnl
41 ])# DISABLED_BY_DEFAULT
43 # ENABLED_BY_DEFAULT(NAME, DESCRIPTION)
44 # ---------------------------------
45 # Creates a new --disable-* option, with default value `yes'.
46 AC_DEFUN([ENABLED_BY_DEFAULT], [dnl
47 AC_ARG_ENABLE([$1], AS_HELP_STRING([--disable-$1], [$2]), [],[dnl
48 m4_bpatsubst([enable_$1], [[^0-9a-z]], [_])=yes])dnl
49 ])# ENABLED_BY_DEFAULT
53 GSTREAMER_VERSION=0.10.20
55 AM_PATH_GLIB_2_0(2.15.0, [], [], [glib])
56 PKG_CHECK_MODULES(DEPS,
58 gstreamer-0.10 >= $GSTREAMER_VERSION
59 gstreamer-plugins-base-0.10 >= $GSTREAMER_VERSION
69 dnl Check for GdkPixbuf, needed for dumping current frame
70 GDKPIXBUF_REQUIRED=2.12.0
71 AC_ARG_ENABLE(gdkpixbuf,
72 AS_HELP_STRING([--disable-gdkpixbuf],
73 [Disable GdkPixbuf support, required for current frame dumping]),,
74 [enable_gdkpixbuf=auto])
76 if test "x$enable_gdkpixbuf" != "xno"; then
77 PKG_CHECK_MODULES(GDKPIXBUF,
78 [gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED],
81 AC_SUBST(GDKPIXBUF_LIBS)
82 AC_SUBST(GDKPIXBUF_CFLAGS)
84 if test "x$have_gdkpixbuf" = "xyes"; then
85 AC_DEFINE(HAVE_GDKPIXBUF, [], [Define if we have GdkPixbuf])
88 have_gdkpixbuf="no (disabled)"
91 if test "x$enable_gdkpixbuf" = "xyes"; then
92 if test "x$have_gdkpixbuf" != "xyes"; then
93 AC_MSG_ERROR([Couldn't find GdkPixbuf >= $GDKPIXBUF_REQUIRED.])
97 AM_CONDITIONAL(HAVE_GDKPIXBUF, test "x$have_gdkpixbuf" = "xyes")
100 dnl Check for Conic, needed connection error handling
103 AS_HELP_STRING([--disable-conic],
104 [Disable Conic support, required to handle network errors]),,
107 if test "x$enable_conic" != "xno"; then
108 PKG_CHECK_MODULES(CONIC,
109 [conic >= $CONIC_REQUIRED],
113 AC_SUBST(CONIC_CFLAGS)
115 if test "x$have_conic" = "xyes"; then
116 AC_DEFINE(HAVE_CONIC, [], [Define if we have Conic])
119 have_conic="no (disabled)"
122 if test "x$enable_conic" = "xyes"; then
123 if test "x$have_conic" != "xyes"; then
124 AC_MSG_ERROR([Couldn't find Conic >= $CONIC_REQUIRED.])
128 AM_CONDITIONAL(HAVE_CONIC, test "x$have_conic" = "xyes")
132 plugindir=`$PKG_CONFIG --variable=plugindir mafw`
135 dnl Default compile flags. (NOTE: CFLAGS is reserved for the user!)
139 _CFLAGS="-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
140 _CFLAGS="$_CFLAGS -ggdb3"
142 dnl Configure-time options.
145 DISABLED_BY_DEFAULT([debug], [compile with debug flags and extra output])
146 if test "x$enable_debug" = xyes; then
147 AC_DEFINE([MAFW_DEBUG], [1], [Enable debugging related parts.])
148 _CFLAGS="$_CFLAGS -O0 -Werror -DGTK_DISABLE_DEPRECATED"
150 AC_DEFINE([G_DEBUG_DISABLE], [1], [Disable g_debug() calls.])
151 _CFLAGS="$_CFLAGS -O2"
153 AS_IF([test "x$enable_debug" = xyes],
154 [AC_DEFINE([MAFW_DEBUG], [1], [Enable extra debug messages])
155 CFLAGS="$CFLAGS -Werror -O0 -ggdb3 -DGTK_DISABLE_DEPRECATED"],
156 [AC_DEFINE([G_DEBUG_DISABLE], [1], [Disable g_debug calls])
157 CFLAGS="$CFLAGS -O2"])
161 DISABLED_BY_DEFAULT([tests], [disable unit tests])
162 if test "x${SBOX_DPKG_INST_ARCH}" = "xarmel"; then
163 AC_MSG_WARN([Tests are disabled for compilation in armel])
166 if test "x$enable_tests" = xyes; then
167 PKG_CHECK_MODULES(CHECKMORE, [checkmore, check >= 0.9.4])
168 if test -z "$CHECKMORE_LIBS"; then
169 AC_MSG_WARN([checkmore is needed for unit tests!])
172 AM_CONDITIONAL(ENABLE_TESTS,
173 [test "x$enable_tests" = xyes && test -n "$CHECKMORE_LIBS"])
176 if test "x${SBOX_DPKG_INST_ARCH}" = "xi386"; then
177 DISABLED_BY_DEFAULT([pulse-volume], [enable volume handling with pulse])
179 ENABLED_BY_DEFAULT([pulse-volume], [enable volume handling with pulse])
181 if test "x$enable_pulse_volume" = xno; then
182 AC_DEFINE([MAFW_GST_RENDERER_DISABLE_PULSE_VOLUME], [1], [Disables volume handling with pulse.])
184 PKG_CHECK_MODULES(VOLUME, libpulse-mainloop-glib >= 0.9.15)
189 DISABLED_BY_DEFAULT([mute], [enable mute handling])
190 if test "x$enable_mute" = xyes; then
191 AC_DEFINE([MAFW_GST_RENDERER_ENABLE_MUTE], [1], [Enable mute.])
195 DISABLED_BY_DEFAULT([tracing], [enable function instrumentation (tracing)])
196 if test "x$enable_tracing" = xyes; then
197 _CFLAGS="$_CFLAGS -finstrument-functions -rdynamic"
201 DISABLED_BY_DEFAULT([coverage], [enable coverage data generation (gcov)])
202 if test "x$enable_coverage" = xyes; then
203 AC_PATH_PROG(LCOV, [lcov], [lcov])
204 if test "x$LCOV" = x; then
205 echo You need to install lcov to get actual reports!
206 echo See http://ltp.sf.net/coverage/lcov.php
208 if test "x$SBOX_USE_CCACHE" == xyes; then
209 AC_MSG_ERROR([Please set SBOX_USE_CCACHE=no to use coverage.])
211 _CFLAGS="$_CFLAGS -fprofile-arcs -ftest-coverage"
212 _LDFLAGS="$_LDFLAGS -g -lgcov"
214 AM_CONDITIONAL(ENABLE_COVERAGE,
215 [test "x$enable_coverage" != xno && test -n "$LCOV"])
218 PKG_CHECK_MODULES([MAFW_SUBTITLES_CPA], [libosso >= 2.0
224 CPA_PLUGINDIR=`pkg-config hildon-control-panel --variable=pluginlibdir`
225 CPA_DESKTOPDIR=`pkg-config hildon-control-panel --variable=plugindesktopentrydir`
227 AC_SUBST(MAFW_SUBTITLES_CPA_CFLAGS)
228 AC_SUBST(MAFW_SUBTITLES_CPA_LIBS)
229 AC_SUBST(CPA_DESKTOPDIR)
230 AC_SUBST(CPA_PLUGINDIR)
236 mafw-gst-renderer-uninstalled.pc
237 libmafw-gst-renderer/Makefile
240 debian/mafw-gst-subtitles-renderer.install