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.2.2010.07-2])
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
71 dnl Check for GdkPixbuf, needed for dumping current frame
72 GDKPIXBUF_REQUIRED=2.12.0
73 AC_ARG_ENABLE(gdkpixbuf,
74 AS_HELP_STRING([--disable-gdkpixbuf],
75 [Disable GdkPixbuf support, required for current frame dumping]),,
76 [enable_gdkpixbuf=auto])
78 if test "x$enable_gdkpixbuf" != "xno"; then
79 PKG_CHECK_MODULES(GDKPIXBUF,
80 [gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED],
83 AC_SUBST(GDKPIXBUF_LIBS)
84 AC_SUBST(GDKPIXBUF_CFLAGS)
86 if test "x$have_gdkpixbuf" = "xyes"; then
87 AC_DEFINE(HAVE_GDKPIXBUF, [], [Define if we have GdkPixbuf])
90 have_gdkpixbuf="no (disabled)"
93 if test "x$enable_gdkpixbuf" = "xyes"; then
94 if test "x$have_gdkpixbuf" != "xyes"; then
95 AC_MSG_ERROR([Couldn't find GdkPixbuf >= $GDKPIXBUF_REQUIRED.])
99 AM_CONDITIONAL(HAVE_GDKPIXBUF, test "x$have_gdkpixbuf" = "xyes")
102 dnl Check for Conic, needed connection error handling
105 AS_HELP_STRING([--disable-conic],
106 [Disable Conic support, required to handle network errors]),,
109 if test "x$enable_conic" != "xno"; then
110 PKG_CHECK_MODULES(CONIC,
111 [conic >= $CONIC_REQUIRED],
115 AC_SUBST(CONIC_CFLAGS)
117 if test "x$have_conic" = "xyes"; then
118 AC_DEFINE(HAVE_CONIC, [], [Define if we have Conic])
121 have_conic="no (disabled)"
124 if test "x$enable_conic" = "xyes"; then
125 if test "x$have_conic" != "xyes"; then
126 AC_MSG_ERROR([Couldn't find Conic >= $CONIC_REQUIRED.])
130 AM_CONDITIONAL(HAVE_CONIC, test "x$have_conic" = "xyes")
134 plugindir=`$PKG_CONFIG --variable=plugindir mafw`
137 dnl Default compile flags. (NOTE: CFLAGS is reserved for the user!)
141 _CFLAGS="-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
142 _CFLAGS="$_CFLAGS -ggdb3"
144 dnl Configure-time options.
147 DISABLED_BY_DEFAULT([debug], [compile with debug flags and extra output])
148 if test "x$enable_debug" = xyes; then
149 AC_DEFINE([MAFW_DEBUG], [1], [Enable debugging related parts.])
150 _CFLAGS="$_CFLAGS -O0 -Werror -DGTK_DISABLE_DEPRECATED"
152 AC_DEFINE([G_DEBUG_DISABLE], [1], [Disable g_debug() calls.])
153 _CFLAGS="$_CFLAGS -O2"
155 AS_IF([test "x$enable_debug" = xyes],
156 [AC_DEFINE([MAFW_DEBUG], [1], [Enable extra debug messages])
157 CFLAGS="$CFLAGS -Werror -O0 -ggdb3 -DGTK_DISABLE_DEPRECATED"],
158 [AC_DEFINE([G_DEBUG_DISABLE], [1], [Disable g_debug calls])
159 CFLAGS="$CFLAGS -O2"])
163 DISABLED_BY_DEFAULT([tests], [disable unit tests])
164 if test "x${SBOX_DPKG_INST_ARCH}" = "xarmel"; then
165 AC_MSG_WARN([Tests are disabled for compilation in armel])
168 if test "x$enable_tests" = xyes; then
169 PKG_CHECK_MODULES(CHECKMORE, [checkmore, check >= 0.9.4])
170 if test -z "$CHECKMORE_LIBS"; then
171 AC_MSG_WARN([checkmore is needed for unit tests!])
174 AM_CONDITIONAL(ENABLE_TESTS,
175 [test "x$enable_tests" = xyes && test -n "$CHECKMORE_LIBS"])
178 if test "x${SBOX_DPKG_INST_ARCH}" = "xi386"; then
179 DISABLED_BY_DEFAULT([pulse-volume], [enable volume handling with pulse])
181 ENABLED_BY_DEFAULT([pulse-volume], [enable volume handling with pulse])
183 if test "x$enable_pulse_volume" = xno; then
184 AC_DEFINE([MAFW_GST_RENDERER_DISABLE_PULSE_VOLUME], [1], [Disables volume handling with pulse.])
186 PKG_CHECK_MODULES(VOLUME, libpulse-mainloop-glib >= 0.9.15)
191 DISABLED_BY_DEFAULT([mute], [enable mute handling])
192 if test "x$enable_mute" = xyes; then
193 AC_DEFINE([MAFW_GST_RENDERER_ENABLE_MUTE], [1], [Enable mute.])
197 DISABLED_BY_DEFAULT([tracing], [enable function instrumentation (tracing)])
198 if test "x$enable_tracing" = xyes; then
199 _CFLAGS="$_CFLAGS -finstrument-functions -rdynamic"
203 DISABLED_BY_DEFAULT([coverage], [enable coverage data generation (gcov)])
204 if test "x$enable_coverage" = xyes; then
205 AC_PATH_PROG(LCOV, [lcov], [lcov])
206 if test "x$LCOV" = x; then
207 echo You need to install lcov to get actual reports!
208 echo See http://ltp.sf.net/coverage/lcov.php
210 if test "x$SBOX_USE_CCACHE" == xyes; then
211 AC_MSG_ERROR([Please set SBOX_USE_CCACHE=no to use coverage.])
213 _CFLAGS="$_CFLAGS -fprofile-arcs -ftest-coverage"
214 _LDFLAGS="$_LDFLAGS -g -lgcov"
216 AM_CONDITIONAL(ENABLE_COVERAGE,
217 [test "x$enable_coverage" != xno && test -n "$LCOV"])
220 PKG_CHECK_MODULES([MAFW_SUBTITLES_CPA], [libosso >= 2.0
226 CPA_PLUGINDIR=`pkg-config hildon-control-panel --variable=pluginlibdir`
227 CPA_DESKTOPDIR=`pkg-config hildon-control-panel --variable=plugindesktopentrydir`
229 AC_SUBST(MAFW_SUBTITLES_CPA_CFLAGS)
230 AC_SUBST(MAFW_SUBTITLES_CPA_LIBS)
231 AC_SUBST(CPA_DESKTOPDIR)
232 AC_SUBST(CPA_PLUGINDIR)
238 mafw-gst-renderer-uninstalled.pc
239 libmafw-gst-renderer/Makefile
242 debian/mafw-gst-subtitles-renderer.install