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-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 dnl Prevent AC_PROG_CC adding '-g -O2' to CFLAGS.
23 if test "x$GCC" = xyes; then
30 # DISABLED_BY_DEFAULT(NAME, DESCRIPTION)
31 # ---------------------------------
32 # Creates a new --enable-* option, with default value `no'.
33 AC_DEFUN([DISABLED_BY_DEFAULT], [dnl
34 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1], [$2]), [],[dnl
35 m4_bpatsubst([enable_$1], [[^0-9a-z]], [_])=no])dnl
36 ])# DISABLED_BY_DEFAULT
38 # ENABLED_BY_DEFAULT(NAME, DESCRIPTION)
39 # ---------------------------------
40 # Creates a new --disable-* option, with default value `yes'.
41 AC_DEFUN([ENABLED_BY_DEFAULT], [dnl
42 AC_ARG_ENABLE([$1], AS_HELP_STRING([--disable-$1], [$2]), [],[dnl
43 m4_bpatsubst([enable_$1], [[^0-9a-z]], [_])=yes])dnl
44 ])# ENABLED_BY_DEFAULT
48 GSTREAMER_VERSION=0.10.20
50 AM_PATH_GLIB_2_0(2.15.0, [], [], [glib])
51 PKG_CHECK_MODULES(DEPS,
53 gstreamer-0.10 >= $GSTREAMER_VERSION
54 gstreamer-plugins-base-0.10 >= $GSTREAMER_VERSION
64 dnl Check for GdkPixbuf, needed for dumping current frame
65 GDKPIXBUF_REQUIRED=2.12.0
66 AC_ARG_ENABLE(gdkpixbuf,
67 AS_HELP_STRING([--disable-gdkpixbuf],
68 [Disable GdkPixbuf support, required for current frame dumping]),,
69 [enable_gdkpixbuf=auto])
71 if test "x$enable_gdkpixbuf" != "xno"; then
72 PKG_CHECK_MODULES(GDKPIXBUF,
73 [gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED],
76 AC_SUBST(GDKPIXBUF_LIBS)
77 AC_SUBST(GDKPIXBUF_CFLAGS)
79 if test "x$have_gdkpixbuf" = "xyes"; then
80 AC_DEFINE(HAVE_GDKPIXBUF, [], [Define if we have GdkPixbuf])
83 have_gdkpixbuf="no (disabled)"
86 if test "x$enable_gdkpixbuf" = "xyes"; then
87 if test "x$have_gdkpixbuf" != "xyes"; then
88 AC_MSG_ERROR([Couldn't find GdkPixbuf >= $GDKPIXBUF_REQUIRED.])
92 AM_CONDITIONAL(HAVE_GDKPIXBUF, test "x$have_gdkpixbuf" = "xyes")
95 dnl Check for Conic, needed connection error handling
98 AS_HELP_STRING([--disable-conic],
99 [Disable Conic support, required to handle network errors]),,
102 if test "x$enable_conic" != "xno"; then
103 PKG_CHECK_MODULES(CONIC,
104 [conic >= $CONIC_REQUIRED],
108 AC_SUBST(CONIC_CFLAGS)
110 if test "x$have_conic" = "xyes"; then
111 AC_DEFINE(HAVE_CONIC, [], [Define if we have Conic])
114 have_conic="no (disabled)"
117 if test "x$enable_conic" = "xyes"; then
118 if test "x$have_conic" != "xyes"; then
119 AC_MSG_ERROR([Couldn't find Conic >= $CONIC_REQUIRED.])
123 AM_CONDITIONAL(HAVE_CONIC, test "x$have_conic" = "xyes")
127 plugindir=`$PKG_CONFIG --variable=plugindir mafw`
130 dnl Default compile flags. (NOTE: CFLAGS is reserved for the user!)
134 _CFLAGS="-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
135 _CFLAGS="$_CFLAGS -ggdb3"
137 dnl Configure-time options.
140 DISABLED_BY_DEFAULT([debug], [compile with debug flags and extra output])
141 if test "x$enable_debug" = xyes; then
142 AC_DEFINE([MAFW_DEBUG], [1], [Enable debugging related parts.])
143 _CFLAGS="$_CFLAGS -O0 -Werror -DGTK_DISABLE_DEPRECATED"
145 AC_DEFINE([G_DEBUG_DISABLE], [1], [Disable g_debug() calls.])
146 _CFLAGS="$_CFLAGS -O2"
148 AS_IF([test "x$enable_debug" = xyes],
149 [AC_DEFINE([MAFW_DEBUG], [1], [Enable extra debug messages])
150 CFLAGS="$CFLAGS -Werror -O0 -ggdb3 -DGTK_DISABLE_DEPRECATED"],
151 [AC_DEFINE([G_DEBUG_DISABLE], [1], [Disable g_debug calls])
152 CFLAGS="$CFLAGS -O2"])
156 DISABLED_BY_DEFAULT([tests], [disable unit tests])
157 if test "x${SBOX_DPKG_INST_ARCH}" = "xarmel"; then
158 AC_MSG_WARN([Tests are disabled for compilation in armel])
161 if test "x$enable_tests" = xyes; then
162 PKG_CHECK_MODULES(CHECKMORE, [checkmore, check >= 0.9.4])
163 if test -z "$CHECKMORE_LIBS"; then
164 AC_MSG_WARN([checkmore is needed for unit tests!])
167 AM_CONDITIONAL(ENABLE_TESTS,
168 [test "x$enable_tests" = xyes && test -n "$CHECKMORE_LIBS"])
171 if test "x${SBOX_DPKG_INST_ARCH}" = "xi386"; then
172 DISABLED_BY_DEFAULT([pulse-volume], [enable volume handling with pulse])
174 ENABLED_BY_DEFAULT([pulse-volume], [enable volume handling with pulse])
176 if test "x$enable_pulse_volume" = xno; then
177 AC_DEFINE([MAFW_GST_RENDERER_DISABLE_PULSE_VOLUME], [1], [Disables volume handling with pulse.])
179 PKG_CHECK_MODULES(VOLUME, libpulse-mainloop-glib >= 0.9.15)
184 DISABLED_BY_DEFAULT([mute], [enable mute handling])
185 if test "x$enable_mute" = xyes; then
186 AC_DEFINE([MAFW_GST_RENDERER_ENABLE_MUTE], [1], [Enable mute.])
190 DISABLED_BY_DEFAULT([tracing], [enable function instrumentation (tracing)])
191 if test "x$enable_tracing" = xyes; then
192 _CFLAGS="$_CFLAGS -finstrument-functions -rdynamic"
196 DISABLED_BY_DEFAULT([coverage], [enable coverage data generation (gcov)])
197 if test "x$enable_coverage" = xyes; then
198 AC_PATH_PROG(LCOV, [lcov], [lcov])
199 if test "x$LCOV" = x; then
200 echo You need to install lcov to get actual reports!
201 echo See http://ltp.sf.net/coverage/lcov.php
203 if test "x$SBOX_USE_CCACHE" == xyes; then
204 AC_MSG_ERROR([Please set SBOX_USE_CCACHE=no to use coverage.])
206 _CFLAGS="$_CFLAGS -fprofile-arcs -ftest-coverage"
207 _LDFLAGS="$_LDFLAGS -g -lgcov"
209 AM_CONDITIONAL(ENABLE_COVERAGE,
210 [test "x$enable_coverage" != xno && test -n "$LCOV"])
213 PKG_CHECK_MODULES([MAFW_SUBTITLES_CPA], [libosso >= 2.0
219 CPA_PLUGINDIR=`pkg-config hildon-control-panel --variable=pluginlibdir`
220 CPA_DESKTOPDIR=`pkg-config hildon-control-panel --variable=plugindesktopentrydir`
222 AC_SUBST(MAFW_SUBTITLES_CPA_CFLAGS)
223 AC_SUBST(MAFW_SUBTITLES_CPA_LIBS)
224 AC_SUBST(CPA_DESKTOPDIR)
225 AC_SUBST(CPA_PLUGINDIR)
231 mafw-gst-renderer-uninstalled.pc
232 libmafw-gst-renderer/Makefile
235 debian/mafw-gst-subtitles-renderer.install